Added fix that means if connecting user sends guest account
authorJeremy Allison <jra@samba.org>
Fri, 12 Sep 1997 16:29:36 +0000 (16:29 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 12 Sep 1997 16:29:36 +0000 (16:29 +0000)
with no password they are seen as guest. Previous patch
broke this.

Jeremy (jallison@whistle.com)
(This used to be commit 9a55c49626f65627b26417795891260bb2afcc27)

source3/smbd/reply.c

index 773063131afea8fb25a2c270dfdb10ed6ff2c5de..228d8ad6692f4b4edc3de2eff1467745d0bb4dde 100644 (file)
@@ -268,7 +268,7 @@ int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize)
   }
   else
   {
-    char *fsname = "NTFS";
+    char *fsname = "SAMBA";
     char *p;
 
     set_message(outbuf,3,3,True);
@@ -459,6 +459,13 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
 
   add_session_user(user);
 
+  /* Check if the given username was the guest user with no password.
+     We need to do this check after add_session_user() as that
+     call can potentially change the username (via map_user).
+   */
+
+  if(!guest && strequal(user,lp_guestaccount(-1)) && (*smb_apasswd == 0))
+    guest = True;
 
   if (!guest && !(lp_security() == SEC_SERVER && server_validate(inbuf)) &&
       !check_hosts_equiv(user))