vfs_lookup: Allow PATH_MAX-1 symlinks
Previously, symlinks in FreeBSD were artificially limited to PATH_MAX-2. Add a short test case to verify the change. Submitted by: Gaurav Gangalwar <ggangalwar AT isilon.com> Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12589
This commit is contained in:
parent
d7ff64a9b1
commit
38d84d683e
@ -499,7 +499,7 @@ namei(struct nameidata *ndp)
|
||||
error = ENOENT;
|
||||
break;
|
||||
}
|
||||
if (linklen + ndp->ni_pathlen >= MAXPATHLEN) {
|
||||
if (linklen + ndp->ni_pathlen > MAXPATHLEN) {
|
||||
if (ndp->ni_pathlen > 1)
|
||||
uma_zfree(namei_zone, cp);
|
||||
error = ENAMETOOLONG;
|
||||
|
@ -7,6 +7,8 @@ TESTSDIR= ${TESTSBASE}/sys/vfs
|
||||
ATF_TESTS_C+= lookup_cap_dotdot
|
||||
CFLAGS.lookup_cap_dotdot.c+= -I${SRCTOP}/tests
|
||||
|
||||
#ATF_TESTS_SH+= lookup_test
|
||||
|
||||
TAP_TESTS_SH+= trailing_slash
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
17
tests/sys/vfs/lookup_test.sh
Normal file
17
tests/sys/vfs/lookup_test.sh
Normal file
@ -0,0 +1,17 @@
|
||||
# $FreeBSD$
|
||||
|
||||
long_symlink_head()
|
||||
{
|
||||
atf_set "descr" "Test for 1023 (PATH_MAX-1) symlink support"
|
||||
}
|
||||
long_symlink_body()
|
||||
{
|
||||
atf_check -s exit:0 ln -s aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sym_long
|
||||
# was: "stat: sym_long: stat: File name too long"; exit 1
|
||||
atf_check -s exit:0 -o ignore stat -L sym_long
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
{
|
||||
atf_add_test_case long_symlink
|
||||
}
|
Loading…
Reference in New Issue
Block a user