r3101: some minor fixes
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Oct 2004 00:47:05 +0000 (00:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:02:21 +0000 (13:02 -0500)
metze
(This used to be commit 61de2229e27c55041cb4e1aac32bc1d8ed68a05c)

source4/lib/cmdline/popt_common.c

index 0cf57bb2e03f0f59e6c1b14ee6bd53aaf562a3a0..266c99ae9ed0f1d646d9d0fe268dd2735892c3dd 100644 (file)
@@ -257,15 +257,15 @@ static void get_credentials_file(const char *file, struct cmdline_auth_info *inf
                while ((*val!='\0') && ((*val==' ') || (*val=='\t')))
                        val++;
 
-               if (strwicmp("password", param) == 0)
-               {
+               if (strwicmp("password", param) == 0) {
                        pstrcpy(info->password, val);
                        info->got_pass = True;
-               }
-               else if (strwicmp("username", param) == 0)
+               } else if (strwicmp("username", param) == 0) {
                        pstrcpy(info->username, val);
-               else if (strwicmp("domain", param) == 0)
+               } else if (strwicmp("domain", param) == 0) {
                        pstrcpy(info->domain,val);
+                       info->got_domain = True;
+               }
                memset(buf, 0, sizeof(buf));
        }
        x_fclose(auth);
@@ -398,12 +398,13 @@ static void popt_common_credentials_callback(poptContext con,
                                 "%s$", lp_netbios_name());
                        pstrcpy(cmdline_auth_info.password,opt_password);
                        SAFE_FREE(opt_password);
+                       cmdline_auth_info.got_pass = True;
 
-                       pstrcpy(cmdline_auth_info.password, lp_workgroup());
-
+                       pstrcpy(cmdline_auth_info.domain, lp_workgroup());
+                       cmdline_auth_info.domain = True;
+                       
                        /* machine accounts only work with kerberos */
                        cmdline_auth_info.use_kerberos = True;
-                       cmdline_auth_info.got_pass = True;
                }
                break;
        }