diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-10-31 01:38:23 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-10-31 01:38:23 +0000 |
commit | d7060a3435bcb71013c75ac7435f7f78d275b7c2 (patch) | |
tree | 3b7a42e1324f855d67ac08eab8f946fc4d615c3a /etc/security | |
parent | 70a40bba706640420be5672eec1118fca7f39c7e (diff) |
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.
Diffstat (limited to 'etc/security')
-rw-r--r-- | etc/security | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/etc/security b/etc/security index bf7b7eff88f..4e54f5b25ec 100644 --- a/etc/security +++ b/etc/security @@ -1,6 +1,6 @@ #!/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 # @@ -659,10 +659,19 @@ if [ -s /etc/changelist ] ; then chown root:wheel $CUR $BACK fi else + echo "\n======\n${file} diffs (-OLD +NEW)\n======" + diff -u /dev/null $file cp -p $file $CUR chown root:wheel $CUR 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 for file in `egrep "^\+" /etc/changelist`; do file="${file#+}" @@ -682,11 +691,21 @@ if [ -s /etc/changelist ] ; then chmod 600 $CUR fi else + echo "\n======\n${file} new MD5 checksum\n======" + echo "NEW: $MD5_NEW" echo $MD5_NEW > $CUR chown root:wheel $CUR chmod 600 $CUR 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 fi |