summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-28 02:36:40 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-28 02:36:40 +0000
commit7599c0b3a5551e3249bec4cfca2a97eefbcd917f (patch)
tree0c48fd6ef767d9b9c00c0f282b92f5aae97fe602 /Configure
parent4c5865a1cc3952714b19dfc688d3299ae1fed964 (diff)
downloadperl-7599c0b3a5551e3249bec4cfca2a97eefbcd917f.tar.gz
be defensive about setting {host,group,pass}cat (from Andy Dougherty)
p4raw-id: //depot/perl@4714
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure7
1 files changed, 4 insertions, 3 deletions
diff --git a/Configure b/Configure
index 411982b627..f20ba17cdb 100755
--- a/Configure
+++ b/Configure
@@ -6378,13 +6378,13 @@ if $test -d /usr/etc/yp || $test -d /etc/yp; then
esac
fi
case "$hostcat" in
-'') hostcat='cat /etc/hosts';;
+'') test -f /etc/hosts && hostcat='cat /etc/hosts';;
esac
case "$groupcat" in
-'') groupcat='cat /etc/group';;
+'') test -f /etc/group && groupcat='cat /etc/group';;
esac
case "$passcat" in
-'') passcat='cat /etc/passwd';;
+'') test -f /etc/passwd && passcat='cat /etc/passwd';;
esac
: now get the host name
@@ -6486,6 +6486,7 @@ case "$myhostname" in
$sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
$test -s hosts
} || {
+ test "X$hostcat" != "X" &&
$hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
/[ ]$myhostname[ . ]/p" > hosts
}