summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-14 13:06:19 +0100
committerVolker Lendecke <vl@samba.org>2008-12-14 14:00:43 +0100
commitdaeb3a190d16a5bc05be63b2b136ebe65d6f6cf7 (patch)
tree80ed13d20c756a84b645257d7fcc63e905a75b57 /source3/libsmb
parent31f157a04b2f26537c9da4aa39bdcdde7b41e64b (diff)
downloadsamba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.tar.gz
samba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.tar.bz2
samba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.zip
Remove the global "cmdline_auth_info" from source3/lib/util.c
This involves changing all our clients, that's why it's so large.
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidfs.c13
-rw-r--r--source3/libsmb/libsmb_context.c18
2 files changed, 19 insertions, 12 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 35922b13e9..f0ac39fed0 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -471,18 +471,19 @@ static void cm_set_password(const char *newpass)
/****************************************************************************
****************************************************************************/
-void cli_cm_set_credentials(void)
+void cli_cm_set_credentials(struct user_auth_info *auth_info)
{
SAFE_FREE(cm_creds.username);
- cm_creds.username = SMB_STRDUP(get_cmdline_auth_info_username());
+ cm_creds.username = SMB_STRDUP(get_cmdline_auth_info_username(
+ auth_info));
- if (get_cmdline_auth_info_got_pass()) {
- cm_set_password(get_cmdline_auth_info_password());
+ if (get_cmdline_auth_info_got_pass(auth_info)) {
+ cm_set_password(get_cmdline_auth_info_password(auth_info));
}
- cm_creds.use_kerberos = get_cmdline_auth_info_use_kerberos();
+ cm_creds.use_kerberos = get_cmdline_auth_info_use_kerberos(auth_info);
cm_creds.fallback_after_kerberos = false;
- cm_creds.signing_state = get_cmdline_auth_info_signing_state();
+ cm_creds.signing_state = get_cmdline_auth_info_signing_state(auth_info);
}
/****************************************************************************
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index 19843383de..becee17f65 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -633,13 +633,19 @@ smbc_set_credentials(char *workgroup,
smbc_bool use_kerberos,
char *signing_state)
{
-
- set_cmdline_auth_info_username(user);
- set_cmdline_auth_info_password(password);
- set_cmdline_auth_info_use_kerberos(use_kerberos);
- if (! set_cmdline_auth_info_signing_state(signing_state)) {
+ struct user_auth_info *auth_info;
+
+ auth_info = user_auth_info_init(talloc_tos());
+ if (auth_info == NULL) {
+ return;
+ }
+ set_cmdline_auth_info_username(auth_info, user);
+ set_cmdline_auth_info_password(auth_info, password);
+ set_cmdline_auth_info_use_kerberos(auth_info, use_kerberos);
+ if (! set_cmdline_auth_info_signing_state(auth_info, signing_state)) {
DEBUG(0, ("Invalid signing state: %s", signing_state));
}
set_global_myworkgroup(workgroup);
- cli_cm_set_credentials();
+ cli_cm_set_credentials(auth_info);
+ TALLOC_FREE(auth_info);
}