diff options
author | Günther Deschner <gd@samba.org> | 2008-04-10 21:21:27 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-04-10 21:21:27 +0200 |
commit | 1db69e9180d28c1abcc85e017561c36007a3ab5b (patch) | |
tree | bad6d0d6fbc155b4718f5507367fc47d9a8e610b /source3/libsmb | |
parent | 0f50f207b764b68fece8d67a7ca8d049e4184af4 (diff) | |
download | samba-1db69e9180d28c1abcc85e017561c36007a3ab5b.tar.gz samba-1db69e9180d28c1abcc85e017561c36007a3ab5b.tar.bz2 samba-1db69e9180d28c1abcc85e017561c36007a3ab5b.zip |
Add some more cli_cm_set_X functions.
Guenther
(This used to be commit 882475f5566592b3a675d3609c3af8cf7d4e256d)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clidfs.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 971cde1252..0b55d930aa 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -46,6 +46,7 @@ static struct cm_cred_struct { char *password; bool got_pass; bool use_kerberos; + bool fallback_after_kerberos; int signing_state; } cm_creds; @@ -172,6 +173,7 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, c->protocol = max_protocol; c->use_kerberos = cm_creds.use_kerberos; + c->fallback_after_kerberos = cm_creds.fallback_after_kerberos; cli_setup_signing_state(c, cm_creds.signing_state); if (!cli_session_request(c, &calling, &called)) { @@ -199,7 +201,7 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, return NULL; } - if (!cm_creds.got_pass) { + if (!cm_creds.got_pass && !cm_creds.use_kerberos) { char *pass = getpass("Password: "); if (pass) { cm_set_password(pass); @@ -461,6 +463,9 @@ static void cm_set_password(const char *newpass) } } +/**************************************************************************** +****************************************************************************/ + void cli_cm_set_credentials(void) { SAFE_FREE(cm_creds.username); @@ -471,6 +476,7 @@ void cli_cm_set_credentials(void) } cm_creds.use_kerberos = get_cmdline_auth_info_use_kerberos(); + cm_creds.fallback_after_kerberos = false; cm_creds.signing_state = get_cmdline_auth_info_signing_state(); } @@ -493,6 +499,51 @@ void cli_cm_set_dest_name_type(int type) /**************************************************************************** ****************************************************************************/ +void cli_cm_set_signing_state(int state) +{ + cm_creds.signing_state = state; +} + +/**************************************************************************** +****************************************************************************/ + +void cli_cm_set_username(const char *username) +{ + SAFE_FREE(cm_creds.username); + cm_creds.username = SMB_STRDUP(username); +} + +/**************************************************************************** +****************************************************************************/ + +void cli_cm_set_password(const char *newpass) +{ + SAFE_FREE(cm_creds.password); + cm_creds.password = SMB_STRDUP(newpass); + if (cm_creds.password) { + cm_creds.got_pass = true; + } +} + +/**************************************************************************** +****************************************************************************/ + +void cli_cm_set_use_kerberos(void) +{ + cm_creds.use_kerberos = true; +} + +/**************************************************************************** +****************************************************************************/ + +void cli_cm_set_fallback_after_kerberos(void) +{ + cm_creds.fallback_after_kerberos = true; +} + +/**************************************************************************** +****************************************************************************/ + void cli_cm_set_dest_ss(struct sockaddr_storage *pss) { dest_ss = *pss; |