Browse Source

generate diffs for files listed in /etc/changelist as they are created

and deleted. previously this script only generated diffs for existing
files.
ok lots of people including millert@ msf@ mcbride@ todd@ and probably more.
OPENBSD_4_1
dlg 18 years ago
parent
commit
55c0aad4e0
1 changed files with 20 additions and 1 deletions
  1. +20
    -1
      src/etc/security

+ 20
- 1
src/etc/security View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: security,v 1.76 2006/10/13 20:12:16 otto Exp $
# $OpenBSD: security,v 1.77 2006/10/31 01:38:22 dlg Exp $
# from: @(#)security 8.1 (Berkeley) 6/9/93 # from: @(#)security 8.1 (Berkeley) 6/9/93
# #
@ -659,10 +659,19 @@ if [ -s /etc/changelist ] ; then
chown root:wheel $CUR $BACK chown root:wheel $CUR $BACK
fi fi
else else
echo "\n======\n${file} diffs (-OLD +NEW)\n======"
diff -u /dev/null $file
cp -p $file $CUR cp -p $file $CUR
chown root:wheel $CUR chown root:wheel $CUR
fi fi
fi fi
if [ ! -s $file -a -s $CUR ]; then
echo "\n======\n${file} diffs (-OLD +NEW)\n======"
diff -u $CUR /dev/null
cp -p $CUR $BACK
rm -f $CUR
chown root:wheel $BACK
fi
done done
for file in `egrep "^\+" /etc/changelist`; do for file in `egrep "^\+" /etc/changelist`; do
file="${file#+}" file="${file#+}"
@ -682,11 +691,21 @@ if [ -s /etc/changelist ] ; then
chmod 600 $CUR chmod 600 $CUR
fi fi
else else
echo "\n======\n${file} new MD5 checksum\n======"
echo "NEW: $MD5_NEW"
echo $MD5_NEW > $CUR echo $MD5_NEW > $CUR
chown root:wheel $CUR chown root:wheel $CUR
chmod 600 $CUR chmod 600 $CUR
fi fi
fi fi
if [ ! -s $file -a -s $CUR ]; then
MD5_OLD="`cat $CUR`"
echo "\n======\n${file} removed MD5 checksum\n======"
echo "OLD: $MD5_OLD"
cp -p $CUR $BACK
rm $CUR
chown root:wheel $BACK
fi
done done
fi fi


Loading…
Cancel
Save