Fix for [homes] problem with security=share. We were still relying
authorJeremy Allison <jra@samba.org>
Fri, 10 Apr 1998 01:19:18 +0000 (01:19 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 10 Apr 1998 01:19:18 +0000 (01:19 +0000)
on a valid vuid to get the connecting username - this is *never* true
(anymore) with security=share.
Jeremy.
(This used to be commit 5d6f63a7e665ee19bd4508b2b40d497e9851b248)

source3/smbd/server.c

index 01f9006a42a37dd1044d96f7c25cf370260eba78..1d3c2e144c3050da1d95cc51a19787c7dcd990ae 100644 (file)
@@ -3353,11 +3353,25 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de
       if (*user && Get_Pwnam(user,True))
        return(make_connection(user,user,password,pwlen,dev,vuid));
 
-      if (validated_username(vuid))
-       {
-         strcpy(user,validated_username(vuid));
-         return(make_connection(user,user,password,pwlen,dev,vuid));
-       }
+      if(lp_security() != SEC_SHARE)
+      {
+        if (validated_username(vuid))
+        {
+          strcpy(user,validated_username(vuid));
+          return(make_connection(user,user,password,pwlen,dev,vuid));
+        }
+      }
+      else
+      {
+        /*
+         * Security = share. Try with sesssetup_user as the username.
+         */
+        if(*sesssetup_user)
+        {
+          strcpy(user,sesssetup_user);
+          return(make_connection(user,user,password,pwlen,dev,vuid));
+        }
+      }
     }
 
   if (!lp_snum_ok(snum) || !check_access(snum)) {