[PATCH]: mount.cifs: Allows passwords of length upto 127 bytes

Suresh Jayaraman sjayaraman at suse.de
Wed Feb 27 17:44:41 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), support 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.

The above patch was already discussed in linux-cifs-client mailing
list. But, Steve was little unsure about the associated kernel patch
which adds a kernel warning if the length exceeds. Re-posting the 
mount.cifs patch alone (Ccing samba-technical as well).

 source/client/mount.cifs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index e73d908..07c8e64 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -462,7 +462,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 					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;

-- 
Suresh Jayaraman


More information about the samba-technical mailing list