[linux-cifs-client] [RFC/PATCH 1/2]: mount.cifs: Allows passwords of length upto 127 bytes

Suresh Jayaraman sjayaraman at suse.de
Wed Jan 23 14:42:15 GMT 2008


The current mount.cifs code restricts the maximum password length to 16
bytes. This limit seems to have been introduced due to LanMan and NTLM 
hashing.

However, the Windows versions above Windows 98 (Windows 2000, XP and
above including Samba), supports passwords up to 127 characters. NTLM
passwords are limited only in GUI, because the dialog box limits it to
14 characters. So it makes sense for mount.cifs to allow passwords up to
127 characters. In case of sec=lanman, if the password is greater than
16 bytes, we let the user know that the password is too long by a kernel
message(PATCH 2/2) which gets logged in to /var/log/messages.

The following patch allows passwords of length greater than 16 bytes.

Signed-off-by: Suresh Jayaraman <sjayaraman at suse.de>
---

Index: cifs-utils/mount.cifs.c
===================================================================
--- cifs-utils.orig/mount.cifs.c
+++ cifs-utils/mount.cifs.c
@@ -338,7 +338,7 @@ static int parse_options(char * options,
 					printf("\npassword specified twice, ignoring second\n");
 				} else
 					got_password = 1;
-			} else if (strnlen(value, 17) < 17) {
+			} else if (strnlen(value, 128) < 128) {
 				if(got_password)
 					printf("\nmount.cifs warning - password specified twice\n");
 				got_password = 1;



More information about the linux-cifs-client mailing list