get user name / password from url

This commit is contained in:
Kelvin Sherlock 2014-09-08 14:36:05 -04:00
parent ca27e1e924
commit bf6354c448
1 changed files with 13 additions and 1 deletions

14
smb.c
View File

@ -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)