From b6ebc1f68df1db54f239096e6fe8bd05c47edd05 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Thu, 17 Sep 2009 14:29:17 +0200 Subject: [PATCH] postinst-setup: restore user/password handling --- postinst-setup | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/postinst-setup b/postinst-setup index 72278f8..8ee619a 100755 --- a/postinst-setup +++ b/postinst-setup @@ -20,8 +20,7 @@ fi # completely cd /etc if [ ! -d /etc/.bzr ]; then - #for i in passwd group shadow fstab; do - for i in fstab; do + for i in passwd group shadow fstab; do [ -e $i.originst ] || cp $i $i.originst done [ -e /backup-etc ] || bzr get bzr+ssh://martin@piware.de/home/martin/backup/`hostname`-etc /backup-etc @@ -29,8 +28,8 @@ if [ ! -d /etc/.bzr ]; then cp -av /backup-etc/.bzr/ /etc/ rm -rf /backup-etc chmod 600 /etc/ssh/ssh_*_key - #chmod 640 /etc/shadow - #chown root:shadow /etc/shadow + chmod 640 /etc/shadow + chown root:shadow /etc/shadow chmod 700 /etc/ssl/private chmod 640 /etc/ssl/private/ssl-cert-* chown root:ssl-cert /etc/ssl/private/ssl-cert* @@ -40,16 +39,16 @@ if [ ! -d /etc/.bzr ]; then mv fstab.originst fstab # only restore the human users from passwd/group - #for i in passwd group; do - # perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst - # mv $i.originst $i - #done + for i in passwd group; do + perl -naF: -e 'print if $F[2] > 1000 && $F[2] < 60000' $i >> $i.originst + mv $i.originst $i + done # only restore some passwords from shadow - #egrep 'martin|netti|joe' shadow >> shadow.originst - #mv shadow.originst shadow - #chown root:shadow shadow - #chmod 640 shadow + egrep 'martin|netti|joe' shadow >> shadow.originst + mv shadow.originst shadow + chown root:shadow shadow + chmod 640 shadow fi # update postfix for new configuration -- 2.39.5