Browse Source

warn once not 3 times in case of a non existent file, discussed with deraadt

originally pointed out by Johan Torin
OPENBSD_4_4
todd 16 years ago
parent
commit
038173408e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/etc/netstart

+ 5
- 1
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: netstart,v 1.120 2008/06/09 22:46:42 deraadt Exp $
# $OpenBSD: netstart,v 1.121 2008/06/09 22:56:42 todd Exp $
# Strip comments (and leading/trailing whitespace if IFS is set) # Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout # from a file and spew to stdout
@ -36,6 +36,10 @@ ifstart() {
fi fi
file=/etc/hostname.$if file=/etc/hostname.$if
if ! [ -f $file ]; then
echo "netstart: $file: No such file or directory"
return
fi
if [ "$(stat -f "%SLp %u %g" $file)" != "--- 0 0" ]; then if [ "$(stat -f "%SLp %u %g" $file)" != "--- 0 0" ]; then
echo "WARNING: $file is insecure, fixing permissions" echo "WARNING: $file is insecure, fixing permissions"
chmod o-rwx $file chmod o-rwx $file


Loading…
Cancel
Save