two fixes for NT clients -> share level Samba server
authorAndrew Tridgell <tridge@samba.org>
Mon, 20 Aug 2001 21:11:55 +0000 (21:11 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 20 Aug 2001 21:11:55 +0000 (21:11 +0000)
(This used to be commit a25911d58c752350b62b205cfb0d6fc5b1c90cef)

source3/auth/auth.c
source3/smbd/auth.c
source3/smbd/reply.c

index bbcf34e8ca9ff6c389a25547a5a86821789e143c..cb0d54bf9b66b24a52f4ffa9c0fdbef124febe05 100644 (file)
@@ -157,7 +157,8 @@ uint32 pass_check_smb_with_chal(char *user, char *domain, uchar chal[8],
 
        memcpy(user_info.chal, chal, 8);
 
-       if (lm_pwd_len >= 24 || (lp_encrypted_passwords() && (lm_pwd_len == 0) && lp_null_passwords())) {
+       if ((lm_pwd_len >= 24 || nt_pwd_len >= 24) || 
+           (lp_encrypted_passwords() && (lm_pwd_len == 0) && lp_null_passwords())) {
                /* if 24 bytes long assume it is an encrypted password */
          
                user_info.lm_resp.buffer = (uint8 *)lm_pwd;
index bbcf34e8ca9ff6c389a25547a5a86821789e143c..cb0d54bf9b66b24a52f4ffa9c0fdbef124febe05 100644 (file)
@@ -157,7 +157,8 @@ uint32 pass_check_smb_with_chal(char *user, char *domain, uchar chal[8],
 
        memcpy(user_info.chal, chal, 8);
 
-       if (lm_pwd_len >= 24 || (lp_encrypted_passwords() && (lm_pwd_len == 0) && lp_null_passwords())) {
+       if ((lm_pwd_len >= 24 || nt_pwd_len >= 24) || 
+           (lp_encrypted_passwords() && (lm_pwd_len == 0) && lp_null_passwords())) {
                /* if 24 bytes long assume it is an encrypted password */
          
                user_info.lm_resp.buffer = (uint8 *)lm_pwd;
index ee7185468761c1d50798df0824e29ca399117537..eb97382750b75bb9eecb88e7200d274e2817e95f 100644 (file)
@@ -632,7 +632,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
     passlen1 = MIN(passlen1, MAX_PASS_LEN);
     passlen2 = MIN(passlen2, MAX_PASS_LEN);
 
-    if(!doencrypt) {
+    if (!doencrypt) {
        /* both Win95 and WinNT stuff up the password lengths for
           non-encrypting systems. Uggh. 
       
@@ -716,6 +716,14 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
          return bad_password_error(inbuf, outbuf);
   }
 
+  if (lp_security() == SEC_SHARE) {
+         /* in share level we should ignore any passwords */
+         smb_ntpasslen = 0;
+         smb_apasslen = 0;
+         guest = True;
+  }
+
+
   DEBUG(3,("sesssetupX:name=[%s]\n",user));
 
   /* If name ends in $ then I think it's asking about whether a */