summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/cmdline/popt_common.c6
-rw-r--r--source4/lib/cmdline/popt_common.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 554b46a940..0cf57bb2e0 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -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;
}
diff --git a/source4/lib/cmdline/popt_common.h b/source4/lib/cmdline/popt_common.h
index bedf8f7f5d..06560d2be5 100644
--- a/source4/lib/cmdline/popt_common.h
+++ b/source4/lib/cmdline/popt_common.h
@@ -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;
};