summaryrefslogtreecommitdiff
path: root/etc/netstart
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2008-08-14 00:59:51 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2008-08-14 00:59:51 +0000
commit7008c9282ca45ba416cc03be1db06b025526f016 (patch)
treeee9fa9ee7547ca143f68a87a94651c7e916047f6 /etc/netstart
parent3a75e7300829acf43b1e257ab36cff8534f2687c (diff)
Tools from /usr may not be used in netstart since it may be NFS-mounted
and not available at that time. Rewrite the hostname.if permission check to use only /bin/ls and the shell. Requested by deraadt. ok todd, "Twisted." deraadt
Diffstat (limited to 'etc/netstart')
-rw-r--r--etc/netstart6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/netstart b/etc/netstart
index 4ac1ec04b1b..f780259a65c 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.122 2008/07/23 16:05:47 sthen Exp $
+# $OpenBSD: netstart,v 1.123 2008/08/14 00:59:50 sthen Exp $
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
@@ -40,7 +40,9 @@ ifstart() {
echo "netstart: $file: No such file or directory"
return
fi
- if [ "$(stat -Lf "%SLp %u %g" $file)" != "--- 0 0" ]; then
+ # Not using stat(1), we can't rely on having /usr yet
+ set -A stat -- `ls -nL $file`
+ if [ "${stat[0]#???????} ${stat[2]} ${stat[3]}" != "--- 0 0" ]; then
echo "WARNING: $file is insecure, fixing permissions"
chmod -LR o-rwx $file
chown -LR root.wheel $file