Browse Source

print a clear error message when not ran as root instead of just falling

through and try whatever it can do with the invoking user's perms
feedback/ok aja@ rpe@
OPENBSD_6_1
jasper 8 years ago
parent
commit
ce3e7d7285
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/etc/netstart

+ 7
- 1
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: netstart,v 1.169 2016/07/19 08:03:01 mpi Exp $
# $OpenBSD: netstart,v 1.170 2016/09/09 19:48:16 jasper Exp $
# Turn off Strict Bourne shell mode. # Turn off Strict Bourne shell mode.
set +o sh set +o sh
@ -167,6 +167,12 @@ ifv6autoconf() {
done done
} }
# Make sure the invoking user has the right privileges.
if (($(id -u) != 0)); then
echo "${0##*/}: need root privileges"
exit 1
fi
# Get network related vars from rc.conf using the parsing routine from rc.subr. # Get network related vars from rc.conf using the parsing routine from rc.subr.
FUNCS_ONLY=1 . /etc/rc.d/rc.subr FUNCS_ONLY=1 . /etc/rc.d/rc.subr
_rc_parse_conf _rc_parse_conf


Loading…
Cancel
Save