Unable to browse DFS when using kerberos
authorBo Yang <boyang@samba.org>
Fri, 7 Aug 2009 05:42:51 +0000 (13:42 +0800)
committerBo Yang <boyang@samba.org>
Fri, 7 Aug 2009 05:47:14 +0000 (13:47 +0800)
Signed-off-by: Bo Yang <boyang@samba.org>
source3/libsmb/libsmb_context.c

index 8b22ee5023c121b0f8d81e6253b773439639cb8d..78c9a551a688727764cadc9c31c2f230f7d91e21 100644 (file)
@@ -692,22 +692,28 @@ void smbc_set_credentials_with_fallback(SMBCCTX *context,
 {
        smbc_bool use_kerberos = false;
        const char *signing_state = "off";
-       struct user_auth_info *auth_info = user_auth_info_init(NULL);
+       struct user_auth_info *auth_info = NULL;
 
-       if (auth_info) {
+       if (! context) {
+
+               return;
+       }
+
+       if (! workgroup || ! *workgroup) {
+               workgroup = smbc_getWorkgroup(context);
        }
 
-       if (! context ||
-           ! workgroup || ! *workgroup ||
-           ! user || ! *user ||
-           ! password || ! *password) {
+       if (! user) {
+               user = smbc_getUser(context);
+       }
 
-               return;
+       if (! password) {
+               password = "";
        }
 
        auth_info = user_auth_info_init(NULL);
 
-       if (auth_info) {
+       if (auth_info) {
                DEBUG(0, ("smbc_set_credentials_with_fallback: allocation fail\n"));
                return;
        }