From: joey <> Date: Sun, 23 Jan 2005 15:26:41 +0000 (+0000) Subject: Inspired by Andreas Barth: Only fiddle with the shadow file if it does X-Git-Tag: debian_userdir-ldap_0-3-8~5 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=566b90f55eb6ebbede83ae9ac8ed6d466bc19ec3 Inspired by Andreas Barth: Only fiddle with the shadow file if it does exist and has content. Probably not needed on .debian.org hosts. --- diff --git a/ud-replicate b/ud-replicate index 0b936d5..fc81a45 100755 --- a/ud-replicate +++ b/ud-replicate @@ -46,11 +46,15 @@ esac rsync ${verbose} -e ssh -rp "${udhost}/var/cache/userdir-ldap/hosts/$HOST" . makedb "$HOST/passwd.tdb" -o passwd.db.t -(umask 027 && makedb "$HOST/shadow.tdb" -o shadow.db.t) -chown root.shadow shadow.db.t; chmod 0640 shadow.db.t +if [ -s "$HOST/shadow.tdb" ] +then + (umask 027 && makedb "$HOST/shadow.tdb" -o shadow.db.t) + chown root.shadow shadow.db.t + chmod 0640 shadow.db.t + mv -f shadow.db.t shadow.db +fi makedb "$HOST/group.tdb" -o group.db.t mv -f passwd.db.t passwd.db -mv -f shadow.db.t shadow.db mv -f group.db.t group.db ln -sf "$HOST/ssh-rsa-shadow" . ln -sf "$HOST/ssh_known_hosts" .