summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-06 17:22:57 -0800
committerJeremy Allison <jra@samba.org>2007-12-06 17:22:57 -0800
commitc6f03521555e9634f120e1b21ad8cdeb36354d41 (patch)
treee1557369a385a2c4d6c21c90bc2ee5defdf2f5fb /source3
parent364b00295fca9dbf9c2be854b198b5e2bdc88ae1 (diff)
downloadsamba-c6f03521555e9634f120e1b21ad8cdeb36354d41.tar.gz
samba-c6f03521555e9634f120e1b21ad8cdeb36354d41.tar.bz2
samba-c6f03521555e9634f120e1b21ad8cdeb36354d41.zip
Make cmdline_auth_info private to lib/popt_common.c. Provide
accessor functions. Jeremy. (This used to be commit 420195dd3e8b1b6771ab8be8bc974edaafc0cf8f)
Diffstat (limited to 'source3')
-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;