Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2013 11:02:20 -0700
From:      Kirk McKusick <mckusick@mckusick.com>
To:        sbruno@freebsd.org, Sean Bruno <sean_bruno@yahoo.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: kern/vfs_mount.c vfs_donmount() checks of MFSNAMELEN 
Message-ID:  <201309231802.r8NI2KmF083133@chez.mckusick.com>
In-Reply-To: <1379951941.1612.3.camel@localhost> 

next in thread | previous in thread | raw e-mail | index | archive | help
> From: Sean Bruno <sean_bruno@yahoo.com>
> Subject: kern/vfs_mount.c vfs_donmount() checks of MFSNAMELEN
> To: freebsd-fs <freebsd-fs@freebsd.org>
> Date: Mon, 23 Sep 2013 08:59:01 -0700
> 
> So, I'm confused by this check:
> 
>         if (fstypelen >= MFSNAMELEN - 1 || fspathlen >= MNAMELEN - 1) {
>                 error = ENAMETOOLONG;
>                 goto bail;
>         }
> 
> MFSNAMELEN is 16, why do we check against >= MFSNAMELEN - 1?  Why dont
> we check against (> MFSNAMELEN - 1) or (>= MFSNAMELEN)?  Is a 14
> character fstypelen with a "\0" at the end considered too long?
> 
> Sean
> 
> p.s. e.g. mount -t fuse.glusterfs ...

I agree with you. It should either be (> MFSNAMELEN - 1) or (>= MFSNAMELEN).

	Kirk McKusick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309231802.r8NI2KmF083133>