aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2018-03-29 11:27:25 -0400
committerEryu Guan <guaneryu@gmail.com>2018-04-08 15:47:22 +0800
commit43374a62325ee6256b0e2c81489807c136e71a51 (patch)
tree8bf78885d19b2d163952b018e257872e46b5f292
parent03d77eb7539be1466b1dd954c86e0b67bfd37a79 (diff)
downloadxfstests-43374a62325ee6256b0e2c81489807c136e71a51.tar.gz
common/rc: improve checks for YP/NIS
At the 2018 spring NFS BAT, we have a number of systems that return a valid string from `domainaname`, but don't have the ypcat binary. If we don't have the yp-tools package installed, we're not going to be able to use ypcat, so check for it and bail out. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r--common/rc3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/rc b/common/rc
index 6a91850c53..5dbb8fe5ef 100644
--- a/common/rc
+++ b/common/rc
@@ -2023,7 +2023,8 @@ _yp_active()
{
local dn
dn=$(domainname 2>/dev/null)
- test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain"
+ local ypcat=$(type -P ypcat)
+ test -n "${dn}" -a "${dn}" != "(none)" -a "${dn}" != "localdomain" -a -n "${ypcat}"
echo $?
}