--- samba-3.0.30/source/libsmb/libsmbclient.old.c 2008-07-02 15:28:14.063431000 -0700 +++ samba-3.0.30/source/libsmb/libsmbclient.c 2008-07-02 15:21:36.633486000 -0700 @@ -6665,6 +6665,18 @@ return context; } +/* Set the credentials so DFS will work when following referrals.*/ +void +smbc_set_credentials(char *workgroup, char *user, char *password) +{ + struct user_auth_info auth_info; + + pstrcpy(auth_info.username, user); + pstrcpy(auth_info.password, password); + auth_info.got_pass = True; + cli_cm_set_credentials(&auth_info); + set_global_myworkgroup(workgroup); +} /* Return the verion of samba, and thus libsmbclient */ const char * --- samba-3.0.30/source/include/libsmbclient.old.h 2008-07-02 15:27:57.054330000 -0700 +++ samba-3.0.30/source/include/libsmbclient.h 2008-07-02 15:23:03.823855000 -0700 @@ -733,6 +733,20 @@ SMBCCTX * smbc_set_context(SMBCCTX * new_context); +/**@ingroup misc + * Set the users credentials globally so they can be used for DFS + * referrals. Probably best to use this function in the smbc_get_auth_data_fn + * callback. + * + * @param workgroup Workgroup of the user. + * + * @param user Username of user. + * + * @param password Password of user. + */ + +void smbc_set_credentials(char *workgroup, char *user, char *password); + /**@ingroup file * Open a file on an SMB server. *