mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: fix NIS detection damage
NIS detection wasn't tested on machines without NIS enabled, so many tests are failing on non-NIS machines. the _yp_active function has no specific return value so always evaluates as 0 (active) and the "_cat_passwd" function is called from within an awk script which is not valid as the shell may run with a sanitised environment. Hence the functions do not need specific export calls, either, as unsanitised subshells will automatically inherit the parent's environment. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Dave Chinner
parent
2294e28218
commit
3a3dfc5a67
@@ -800,13 +800,14 @@ _yp_active()
|
||||
local dn
|
||||
dn=$(domainname 2>/dev/null)
|
||||
test -n "${dn}" -a "${dn}" != "(none)"
|
||||
echo $?
|
||||
}
|
||||
|
||||
# cat the password file
|
||||
#
|
||||
_cat_passwd()
|
||||
{
|
||||
[ _yp_active ] && ypcat passwd
|
||||
[ $(_yp_active) -eq 0 ] && ypcat passwd
|
||||
cat /etc/passwd
|
||||
}
|
||||
|
||||
@@ -814,10 +815,9 @@ _cat_passwd()
|
||||
#
|
||||
_cat_group()
|
||||
{
|
||||
[ _yp_active ] && ypcat group
|
||||
[ $(_yp_active) -eq 0 ] && ypcat group
|
||||
cat /etc/group
|
||||
}
|
||||
export -f _yp_active _cat_passwd _cat_group
|
||||
|
||||
# check for the fsgqa user on the machine
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user