diff options
author | Bo Yang <boyang@novell.com> | 2009-02-20 12:00:46 +0800 |
---|---|---|
committer | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2009-02-20 09:46:46 -0500 |
commit | e256d72f0cd66c374f14a122623668de888aa5e7 (patch) | |
tree | ac0dfb0c38db1d9bb0ae353ef4013b5fd11f36ce /source3/libsmb/libsmb_context.c | |
parent | 27307be0f726c899c0e8a0edfdf200650037bb61 (diff) | |
download | samba-e256d72f0cd66c374f14a122623668de888aa5e7.tar.gz samba-e256d72f0cd66c374f14a122623668de888aa5e7.tar.xz samba-e256d72f0cd66c374f14a122623668de888aa5e7.zip |
Make libsmbclient work with DFS
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
Diffstat (limited to 'source3/libsmb/libsmb_context.c')
-rw-r--r-- | source3/libsmb/libsmb_context.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index c1af48507c8..0683f97ddd7 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -652,3 +652,40 @@ smbc_set_credentials(char *workgroup, cli_cm_set_credentials(auth_info); TALLOC_FREE(auth_info); } + +void smbc_set_credentials_with_fallback(SMBCCTX *context, + char *workgroup, + char *user, + char *password) +{ + smbc_bool use_kerberos = false; + const char *signing_state = "off"; + + if (!context || !workgroup || !*workgroup + || !user || !*user || !password + || !*password) { + return; + } + + if (smbc_getOptionUseKerberos(context)) { + use_kerberos = True; + } + + if (lp_client_signing()) { + signing_state = "on"; + } + + if (lp_client_signing() == Required) { + signing_state = "force"; + } + + smbc_set_credentials(workgroup, + user, + password, + use_kerberos, + (char *)signing_state); + + if (smbc_getOptionFallbackAfterKerberos(context)) { + cli_cm_set_fallback_after_kerberos(); + } +} |