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

Christopher R. Hertel crh at ubiqx.mn.org
Wed Jan 23 16:00:40 GMT 2008


Suresh,

I think you're correct to allow longer passwords for use with the NTLM,
LMv2, and NTLMv2 hash algorithms.  Note, however, that the 14-byte limit
reflects the limits of the LanMan hash algorithm.

  http://ubiqx.org/cifs/SMB.html#SMB.8.3.3

So instead of 16 bytes, if sec=lanman is set then the patch should warn the
user if the password is longer than 14 bytes (excluding terminating nul byte).

Chris -)-----

Suresh Jayaraman wrote:
> 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;
> 
> _______________________________________________
> linux-cifs-client mailing list
> linux-cifs-client at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux-cifs-client

-- 
"Implementing CIFS - the Common Internet FileSystem"    ISBN: 013047116X
Samba Team -- http://www.samba.org/    -)-----     Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/  -)-----  ubiqx development, uninq
ubiqx Team -- http://www.ubiqx.org/    -)-----          crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/   -)-----             crh at ubiqx.org


More information about the linux-cifs-client mailing list