r3100: support 'bin/smbclient //w2k3-101/c$ -U \\administrator@w2k3.vmnet1.vm.base'
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Oct 2004 00:26:43 +0000 (00:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:02:21 +0000 (13:02 -0500)
we need to send an empty string as userdomain in this case.
fix bug #1317 in the client side

metze
(This used to be commit 958aa8de630b2a88f29ccdf80ac0fc44a8205401)

source4/lib/cmdline/popt_common.c
source4/lib/cmdline/popt_common.h

index 554b46a9401965594946491013083c6484be401c..0cf57bb2e03f0f59e6c1b14ee6bd53aaf562a3a0 100644 (file)
@@ -304,6 +304,7 @@ static void popt_common_credentials_callback(poptContext con,
                        if ((p = strchr_m(tmp,'\\'))) {
                                *p = 0;
                                pstrcpy(cmdline_auth_info.domain,tmp);
+                               cmdline_auth_info.got_domain = True;
                                pstrcpy(cmdline_auth_info.username,p+1);
                        }
 
@@ -317,6 +318,7 @@ static void popt_common_credentials_callback(poptContext con,
 
                if (getenv("DOMAIN")) {
                        pstrcpy(cmdline_auth_info.domain,getenv("DOMAIN"));
+                       cmdline_auth_info.got_domain = True;
                }
 
                if (getenv("PASSWD")) {
@@ -344,6 +346,7 @@ static void popt_common_credentials_callback(poptContext con,
                        if ((p = strchr_m(tmp,'\\'))) {
                                *p = 0;
                                pstrcpy(cmdline_auth_info.domain,tmp);
+                               cmdline_auth_info.got_domain = True;
                                pstrcpy(cmdline_auth_info.username,p+1);
                        }
 
@@ -431,12 +434,13 @@ const char *cmdline_get_username(void)
 
 void cmdline_set_userdomain(const char *domain)
 {
+       cmdline_auth_info.got_domain = True;
        pstrcpy(cmdline_auth_info.domain, domain);
 }
 
 const char *cmdline_get_userdomain(void)
 {
-       if (cmdline_auth_info.domain[0]) {
+       if (cmdline_auth_info.got_domain) {
                return cmdline_auth_info.domain;
        }
 
index bedf8f7f5dfe2d6bf8eac7992447aa623e235b78..06560d2be58b951bd86c9789b9eb61bfbb90f914 100644 (file)
@@ -40,8 +40,9 @@ extern struct poptOption popt_common_credentials[];
 
 struct cmdline_auth_info {
        pstring username;
-       pstring password;
        pstring domain;
+       BOOL got_domain;
+       pstring password;
        BOOL got_pass;
        BOOL use_kerberos;
 };