Date: Sat, 16 Oct 1999 12:20:11 -0600 (MDT) From: Marc Slemko <marcs@znep.com> To: hackers@freebsd.org Subject: MAXPATHLEN not enforced Message-ID: <Pine.BSF.4.10.9910161156420.13637-100000@alive.znep.com>
next in thread | raw e-mail | index | archive | help
Why does FreeBSD let you create paths longer than MAXPATHLEN? =20 I often have various trees that are as deep as possible for testing various programs for holes, and I finally figured out why locate wasn't updating it= s database properly; it was choking as soon as it saw a path length=20 >MAXPATHLEN long. The question, however, is why can it see a path length longer than MAXPATHLEN? I would also wonder if there aren't some security issues resulting from this. From what gdb shows, locate seems to trash its stack before spitting out the error about the path being too long... marcs@alive:/tmp$ mkdir erm... marcs@alive:/tmp$ cd erm... marcs@alive:/tmp/erm...$ while mkdir xxxxx; do cd xxxxx; done cd: could not get current directory: getcwd: cannot access parent directori= es: Result too large cd: could not get current directory: getcwd: cannot access parent directori= es: Result too large ^Cjob-working-directory: could not get current directory: getcwd: cannot ac= cess parent directories: Result too large cd_links: could not get current directory: getcwd: cannot access parent dir= ectories: Result too large ^C^C^C^C^Ccd: could not get current directory: getcwd: cannot access parent= directories: Result too large ^C^C^C^C^Ccd: could not get current directory: getcwd: cannot access parent= directories: Result too large ^C^C^C^C^C^C^C^C^C^C^C^C^C ^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C marcs@alive:.$ cd / cd_links: could not get current directory: getcwd: cannot access parent dir= ectories: Result too large marcs@alive:/$ find /tmp/erm.../ | perl -ne 'if (length($_) > 1024) { print= length($_), ": $_\n" }' (...a few other results...) 1038: /tmp/erm.../xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/= xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxx= xx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9910161156420.13637-100000>