1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-01 08:27:59 +00:00

Don't assume NAME_MAX is 255

Query the filesystem limit via getconf(3) instead

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-04-04 21:36:13 +00:00
parent d2d2a79c1a
commit ba8c8a0ca2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316505

View File

@ -70,10 +70,15 @@ long_name_head() {
}
long_name_body() {
check_fs
if ! NAME_MAX=$(getconf NAME_MAX .); then
atf_skip "Filesystem not reporting NAME_MAX; skipping testcase"
fi
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965
atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names"
ATTRNAME=`jot -b X -s "" 255 0`
ATTRNAME=`jot -b X -s "" $NAME_MAX 0`
touch foo
atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo
atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo