summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/popt_common.h2
-rw-r--r--source3/lib/popt_common.c18
2 files changed, 4 insertions, 16 deletions
diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h
index 86faa144f3..f77f69dfa4 100644
--- a/source3/include/popt_common.h
+++ b/source3/include/popt_common.h
@@ -49,6 +49,4 @@ struct user_auth_info {
int signing_state;
};
-extern struct user_auth_info cmdline_auth_info;
-
#endif /* _POPT_COMMON_H */
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index e29929aac6..d454a798ac 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -399,7 +399,7 @@ static void get_password_file(void)
}
}
-static void get_credentials_file(const char *file, struct user_auth_info *info)
+static void get_credentials_file(const char *file)
{
XFILE *auth;
fstring buf;
@@ -442,18 +442,9 @@ static void get_credentials_file(const char *file, struct user_auth_info *info)
val++;
if (strwicmp("password", param) == 0) {
- SAFE_FREE(info->password);
- info->password = SMB_STRDUP(val);
- if (!info->password) {
- exit(ENOMEM);
- }
- info->got_pass = True;
+ set_cmdline_auth_info_password(val);
} else if (strwicmp("username", param) == 0) {
- SAFE_FREE(info->username);
- info->username = SMB_STRDUP(val);
- if (!info->username) {
- exit(ENOMEM);
- }
+ set_cmdline_auth_info_username(val);
} else if (strwicmp("domain", param) == 0) {
set_global_myworkgroup(val);
}
@@ -509,8 +500,7 @@ static void popt_common_credentials_callback(poptContext con,
}
if (getenv("PASSWD_FD") || getenv("PASSWD_FILE")) {
- get_password_file(&cmdline_auth_info);
- cmdline_auth_info.got_pass = True;
+ get_password_file();
}
return;