Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Dec 2002 13:23:22 -0500 (EST)
From:      Garrett Wollman <wollman@lcs.mit.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   standards/46035: pathchk doesn't understand the new meaning of {PATH_MAX}
Message-ID:  <200212061823.gB6INMg5062746@khavrinen.lcs.mit.edu>

next in thread | raw e-mail | index | archive | help

>Number:         46035
>Category:       standards
>Synopsis:       pathchk doesn't understand the new meaning of {PATH_MAX}
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 06 10:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Wollman
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
FreeBSD Project
>Environment:
System: FreeBSD khavrinen.lcs.mit.edu 5.0-CURRENT FreeBSD 5.0-CURRENT #609: Mon Nov 25 16:08:14 EST 2002 root@:/usr/src/sys/i386/compile/KHAVRINEN i386

$FreeBSD: src/usr.bin/pathchk/pathchk.c,v 1.2 2002/06/10 10:03:46 tjr Exp $

>Description:

	pathchk was never updated for the change in {PATH_MAX}
	semantics made by 1003.1-2001.  {PATH_MAX} (and thus,
	{_POSIX_PATH_MAX}) now include the trailing null character.
	Thus, pathchk is off by one.
	
>How-To-Repeat:

wollman@khavrinen$ pathchk -p `perl -e 'print "/a" x 128'`
wollman@khavrinen$ 

	This should have given an error, because {_POSIX_PATH_MAX} is
	256, and the path we constructed is (128 * 2 + 1 =) 257 bytes
	long.

>Fix:

	Subtract 1 in the right places in pathchk.c.



>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




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