Why does FreeBSD let you create paths longer than MAXPATHLEN?
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 its
database properly; it was choking as soon as it saw a path length
>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 directories: Result
too large
cd: could not get current directory: getcwd: cannot access parent directories: Result
too large
^Cjob-working-directory: could not get current directory: getcwd: cannot access parent
directories: Result too large
cd_links: 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^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 directories:
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/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/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