get user name / password from url
This commit is contained in:
parent
ca27e1e924
commit
bf6354c448
14
smb.c
14
smb.c
|
@ -1177,6 +1177,9 @@ int do_smb(char *url, URLComponents *components)
|
|||
LongWord qtick;
|
||||
|
||||
char *host;
|
||||
char *user;
|
||||
char *password;
|
||||
|
||||
uint16_t *path;
|
||||
uint16_t *tmp;
|
||||
|
||||
|
@ -1193,6 +1196,7 @@ int do_smb(char *url, URLComponents *components)
|
|||
|
||||
host = URLComponentGetCMalloc(url, components, URLComponentHost);
|
||||
|
||||
|
||||
if (!host)
|
||||
{
|
||||
fprintf(stderr, "URL `%s': no host.", url);
|
||||
|
@ -1215,13 +1219,21 @@ int do_smb(char *url, URLComponents *components)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// given server [:port] / share / path
|
||||
// get the unicode server and share.
|
||||
user = URLComponentGetCMalloc(url, components, URLComponentUser);
|
||||
password = URLComponentGetCMalloc(url, components, URLComponentPassword);
|
||||
|
||||
|
||||
|
||||
tmp = host_tree(url, components);
|
||||
|
||||
// todo -- move tree connect to separate function.
|
||||
ok = negotiate(connection.ipid, tmp);
|
||||
|
||||
free(tmp);
|
||||
free(user);
|
||||
free(password);
|
||||
|
||||
tmp = NULL;
|
||||
|
||||
if (ok == 0)
|
||||
|
|
Loading…
Reference in New Issue