Date: Tue, 4 May 1999 13:10:03 -0700 (PDT) From: "Przemyslaw Frasunek" <venglin@lagoon.freebsd.org.pl> To: freebsd-bugs@FreeBSD.org Subject: Re: i386/11454: mkdir() and chdir() doesn't check argument lengt Message-ID: <199905042010.NAA16903@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/11454; it has been noted by GNATS. From: "Przemyslaw Frasunek" <venglin@lagoon.freebsd.org.pl> To: bde@zeta.org.au Cc: freebsd-gnats-submit@freebsd.org Subject: Re: i386/11454: mkdir() and chdir() doesn't check argument lengt Date: Tue, 4 May 1999 20:01:44 CEST > >>Description: > > Chdir() and mkdir() doesn't check argument length, so it's possible > >to create an extremly deep directory structure, on which most system > >commands won't work. > chdir() and mkdir() work correctly. They can't reasonably check the > length of the path to the current directory, and POSIX.1 doesn't > permit them to fail because the current directory is deep. Ok, but mkdir() and chdir() manual tells: ERRORS Mkdir() (chdir()) will fail and no directory will be created if: [...] [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an en- tire path name exceeded 1023 characters. But it doesn't fail. > The bugs are in the system commands. In particular, POSIX.2 specifies > that `find' and `rm -r' shall work for arbitarily deep directories > (provided directory names longer than PATH_MAX aren't specified on the > command line), and that `ls -R' should handle arbitrarily deep directories > (it shouldn't fail unless it runs out of memory for keeping track of > untraversed directories). So theoretically I can create directory, on which _all_ system commands will fail, because they doesn't have enough of memory? > `find' seems to traverse deep directories correctly. However, the > following don't work: > 1) passing long names found by `find' to other utilities. Overflow occurs, when find tries to print out a long pathname by invoking puts(). So, I think (but I'm not sure) that it could be dangerous and should be fixed... -- * Fido: 2:480/124 ** WWW: lagoon.freebsd.org.pl/~venglin ** GSM:48-601-383657 * * Inet: venglin@lagoon.freebsd.org.pl ** PGP:D48684904685DF43EA93AFA13BE170BF * To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905042010.NAA16903>