diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-09-16 09:38:09 -0700 |
---|---|---|
committer | Nadezhda Ivanova <nivanova@symas.com> | 2013-09-16 14:44:28 -0700 |
commit | 3f464ca1f5672491edf5daf15389cf7f2dc68e2b (patch) | |
tree | f9dd6d6390632ac5968e084ef7c5cae7f5c12ec3 /auth/credentials/credentials.c | |
parent | 68f7cd1724480a9bae36692d19b94e10fb1b9e73 (diff) | |
download | samba-3f464ca1f5672491edf5daf15389cf7f2dc68e2b.tar.gz samba-3f464ca1f5672491edf5daf15389cf7f2dc68e2b.tar.xz samba-3f464ca1f5672491edf5daf15389cf7f2dc68e2b.zip |
auth/credentials: Add cli_credentials_{set,get}_forced_sasl_mech()
This will allow us to force the use of only DIGEST-MD5, for example, which is useful
to avoid hitting GSSAPI, SPNEGO or NTLM when talking to OpenLDAP and Cyrus-SASL.
Andrew Bartlett
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
Diffstat (limited to 'auth/credentials/credentials.c')
-rw-r--r-- | auth/credentials/credentials.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c index 57a7c0b80d..e98dfbdae4 100644 --- a/auth/credentials/credentials.c +++ b/auth/credentials/credentials.c @@ -112,6 +112,8 @@ _PUBLIC_ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx) cli_credentials_set_gensec_features(cred, 0); cli_credentials_set_krb_forwardable(cred, CRED_AUTO_KRB_FORWARDABLE); + cred->forced_sasl_mech = NULL; + return cred; } @@ -161,6 +163,13 @@ _PUBLIC_ void cli_credentials_set_kerberos_state(struct cli_credentials *creds, creds->use_kerberos = use_kerberos; } +_PUBLIC_ void cli_credentials_set_forced_sasl_mech(struct cli_credentials *creds, + const char *sasl_mech) +{ + TALLOC_FREE(creds->forced_sasl_mech); + creds->forced_sasl_mech = talloc_strdup(creds, sasl_mech); +} + _PUBLIC_ void cli_credentials_set_krb_forwardable(struct cli_credentials *creds, enum credentials_krb_forwardable krb_forwardable) { @@ -172,6 +181,11 @@ _PUBLIC_ enum credentials_use_kerberos cli_credentials_get_kerberos_state(struct return creds->use_kerberos; } +_PUBLIC_ const char *cli_credentials_get_forced_sasl_mech(struct cli_credentials *creds) +{ + return creds->forced_sasl_mech; +} + _PUBLIC_ enum credentials_krb_forwardable cli_credentials_get_krb_forwardable(struct cli_credentials *creds) { return creds->krb_forwardable; |