From 31262a59bcf1cb04631c2efca169e417ef597bec Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Tue, 8 Jul 2008 20:44:39 -0400 Subject: [BUG 5580] Allow access to DFS shares via libsmbclient Brian Sheehan provided a nice patch intended for the 3.0 code base. This commit applies a similar patch for the 3.3 code base. It adds a new public function to libsmbclient -- smbc_set_credentials() -- that may be called from the authentication callback when DFS referrals are in use. Derrell (This used to be commit 888f922bd0d1c84a687d404e95ae314a9dd0aee1) --- source3/libsmb/libsmb_context.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c index dd78bcee35..51948d1648 100644 --- a/source3/libsmb/libsmb_context.c +++ b/source3/libsmb/libsmb_context.c @@ -610,3 +610,23 @@ smbc_version(void) } +/* + * Set the credentials so DFS will work when following referrals. + */ +void +smbc_set_credentials(char *workgroup, + char *user, + char *password, + 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)) { + DEBUG(0, ("Invalid signing state: %s", signing_state)); + } + set_global_myworkgroup(workgroup); + cli_cm_set_credentials(); +} -- cgit