[PATCH 2/2] cifs: Correct comment about domainname length
scott.lovenberg at gmail.com
Fri Jul 26 12:12:48 MDT 2013
On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen at asianux.com> wrote:
> On 07/26/2013 02:34 AM, scott.lovenberg at gmail.com wrote:
>> From: Scott Lovenberg <scott.lovenberg at gmail.com>
>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
>> Signed-off-by: Scott Lovenberg <scott.lovenberg at gmail.com>
>> include/uapi/linux/cifs/cifs_mount.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
>> index a58fc6e..d2408ec 100644
>> --- a/include/uapi/linux/cifs/cifs_mount.h
>> +++ b/include/uapi/linux/cifs/cifs_mount.h
>> @@ -17,7 +17,7 @@
>> #define _CIFS_MOUNT_H
>> /* Max string lengths for cifs mounting options. */
>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>> #define CIFS_MAX_USERNAME_LEN 256 /* reasonable max for current servers */
>> #define CIFS_MAX_PASSWORD_LEN 512 /* Windows max seems to be 256 wide chars */
>> #define CIFS_MAX_SHARE_LEN 256 /* reasonable max share name length */
> For our kernel implementation:
> for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
> for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
> "The maximum length of ... the fully qualified domain name (FQDN) is
> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
> bytes for the FQDN and one byte for the ending dot."
> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
> Do we also need consider about it in our definition comments ?
> Chen Gang
Sorry, I misunderstood; I figured that it had to be the domain name
without the host since we were allowing a host name that's 1024
characters long. That documentation should probably be added to the
cifs_mount.h as well then.
Still, how can we have a FQDN that's 256 characters long when the host
name length can be 1024 characters long?
Peace and Blessings,
More information about the samba-technical