From 4fe23d02f0c729decfb9e897a3fb3c6747cf7a86 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Mon, 9 Jun 2008 22:46:42 +0000 Subject: [PATCH] Ensure that hostname.* files are also re-chowned to root.wheel at each boot as discussed with claudio while eating tasty donairs. ok todd --- src/etc/netstart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/etc/netstart b/src/etc/netstart index 4f98acc3..ea1bcd92 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.119 2008/04/17 19:03:25 deraadt Exp $ +# $OpenBSD: netstart,v 1.120 2008/06/09 22:46:42 deraadt Exp $ # Strip comments (and leading/trailing whitespace if IFS is set) # from a file and spew to stdout @@ -36,9 +36,10 @@ ifstart() { fi file=/etc/hostname.$if - if [ "$(stat -f "%SLp" $file)" != "---" ]; then + if [ "$(stat -f "%SLp %u %g" $file)" != "--- 0 0" ]; then echo "WARNING: $file is insecure, fixing permissions" chmod o-rwx $file + chown root.wheel $file fi ifconfig $if > /dev/null 2>&1 if [ "$?" != "0" ]; then