Boundary tests for filename/pathname

Loulwa Salem loulwas at us.ibm.com
Wed Jun 8 14:22:27 UTC 2005


Steve Grubb wrote:

  > The authoritative place, as far as I know, is 
/usr/include/linux/limits.h.
> 
> #define PATH_MAX        4096    /* # chars in a path name including nul */

What about the NAME_MAX variable?
#define NAME_MAX	255	/* # chars in file name */
We are also checking the strlen()for that (len > NAME_MAX).

I will supply exactly :
255 chars  -> Expecting No error
254 chars  -> Expecting No error
256 chars  -> Expecting Error
Not accounting for null in all of the above ... makes sense or should 
null be also considered here?

- Loulwa





More information about the Linux-audit mailing list