Browse Source

Change test from [] to [[]] and simplify pattern.

OK tb@, krw@ (for [[]])
Feedback and OK halex@
OPENBSD_6_2
rpe 7 years ago
parent
commit
473642c0eb
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/etc/netstart

+ 2
- 2
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: netstart,v 1.182 2017/05/07 07:55:17 rpe Exp $
# $OpenBSD: netstart,v 1.183 2017/05/07 09:40:15 rpe Exp $
# Turn off Strict Bourne shell mode. # Turn off Strict Bourne shell mode.
set +o sh set +o sh
@ -96,7 +96,7 @@ ifstart() {
# Not using stat(1), we can't rely on having /usr yet. # Not using stat(1), we can't rely on having /usr yet.
set -A _stat -- $(ls -nL $_file) set -A _stat -- $(ls -nL $_file)
if [ "${_stat[0]#???????} ${_stat[2]} ${_stat[3]}" != "--- 0 0" ]; then
if [[ "${_stat[0]}${_stat[2]}${_stat[3]}" != *---00 ]]; then
echo "WARNING: $_file is insecure, fixing permissions" echo "WARNING: $_file is insecure, fixing permissions"
chmod -LR o-rwx $_file chmod -LR o-rwx $_file
chown -LR root.wheel $_file chown -LR root.wheel $_file


Loading…
Cancel
Save