summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2005-03-19 05:45:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:07 -0500
commit2b71ed0cda9fcb2ee3399956745075aa27472246 (patch)
treef347a550fc6650588c2a84a049c970c278899419 /source3/client
parent9ac8568547763a2386a552e054b030c72f79af3e (diff)
downloadsamba-2b71ed0cda9fcb2ee3399956745075aa27472246.tar.gz
samba-2b71ed0cda9fcb2ee3399956745075aa27472246.tar.bz2
samba-2b71ed0cda9fcb2ee3399956745075aa27472246.zip
r5897: Fix domain name parsing for cifs mount util
(This used to be commit 72eda746c2cc0a362aef6e08f7cd89e65cc7e86d)
Diffstat (limited to 'source3/client')
-rwxr-xr-xsource3/client/mount.cifs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 0ebb52a96b..b984aaaee8 100755
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -61,7 +61,7 @@ static int got_gid = 0;
static int free_share_name = 0;
static char * user_name = NULL;
static char * mountpassword = NULL;
-static char * domain_name = NULL;
+char * domain_name = NULL;
/* BB finish BB
@@ -632,7 +632,6 @@ static char * check_for_domain(char **ppuser)
/* move_string(*ppuser, usernm+1) */
len = strlen(usernm+1);
- printf("\nlen %d original_len %d\n",len, original_len);
if(len >= original_len) {
/* should not happen */
@@ -776,7 +775,6 @@ int main(int argc, char ** argv)
int flags = MS_MANDLOCK; /* no need to set legacy MS_MGC_VAL */
char * orgoptions = NULL;
char * share_name = NULL;
- char * domain_name = NULL;
char * ipaddr = NULL;
char * uuid = NULL;
char * mountpoint;
@@ -927,14 +925,12 @@ int main(int argc, char ** argv)
if (orgoptions && parse_options(orgoptions, &flags))
return -1;
-
ipaddr = parse_server(&share_name);
if((ipaddr == NULL) && (got_ip == 0)) {
printf("No ip address specified and hostname not found\n");
return -1;
}
-
/* BB save off path and pop after mount returns? */
resolved_path = malloc(PATH_MAX+1);
if(resolved_path) {
@@ -1022,13 +1018,14 @@ mount_retry:
domain_name = check_for_domain(&user_name);
strncat(options,",user=",6);
strcat(options,user_name);
- }
- if(retry == 0)
+ }
+ if(retry == 0) {
if(domain_name) {
/* extra length accounted for in option string above */
strncat(options,",domain=",8);
strcat(options,domain_name);
}
+ }
if(mountpassword) {
/* Commas have to be doubled, or else they will
look like the parameter separator */