mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/rc: fix check for yp
Only testing if a domainname is set and ypcat is installed is not a sufficient criteria to check if NIS is actually active. Check for a running ypbind in rpcinfo as well. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
60d700e885
commit
45d1dd7375
@@ -1991,7 +1991,9 @@ _yp_active()
|
||||
local dn
|
||||
dn=$(domainname 2>/dev/null)
|
||||
local ypcat=$(type -P ypcat)
|
||||
test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}"
|
||||
local rpcinfo=$(type -P rpcinfo)
|
||||
test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}" -a -n "${rpcinfo}" && \
|
||||
"${rpcinfo}" -p localhost 2>/dev/null | grep -q ypbind
|
||||
echo $?
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user