From 725d54f304e9915ae6f7ce7a481640c896d309d6 Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Tue, 28 Aug 2012 05:42:08 +0000 Subject: Always compare master.passwd(5) and group(5) regardless of their sums: this is a sanity check to ensure no system user(s)/group(s) are missing. ok sthen@ --- usr.sbin/sysmerge/sysmerge.8 | 8 +++++--- usr.sbin/sysmerge/sysmerge.sh | 8 ++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.sbin/sysmerge/sysmerge.8 b/usr.sbin/sysmerge/sysmerge.8 index f3cdcbe8251..57a9487dd7c 100644 --- a/usr.sbin/sysmerge/sysmerge.8 +++ b/usr.sbin/sysmerge/sysmerge.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysmerge.8,v 1.37 2012/08/15 19:25:41 jmc Exp $ +.\" $OpenBSD: sysmerge.8,v 1.38 2012/08/28 05:42:07 ajacoutot Exp $ .\" .\" Copyright (c) 2008 Antoine Jacoutot .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 15 2012 $ +.Dd $Mdocdate: August 28 2012 $ .Dt SYSMERGE 8 .Os .Sh NAME @@ -107,7 +107,9 @@ present in the new .Xr master.passwd 5 and .Xr group 5 -files will be automatically created. +files will +.Sy always +be automatically (re)created. .Pp .Nm will finish by running diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index c41616052e5..aa89dcce0d8 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.88 2012/08/20 14:10:30 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.89 2012/08/28 05:42:07 ajacoutot Exp $ # # Copyright (c) 2008, 2009, 2010, 2011, 2012 Antoine Jacoutot # Copyright (c) 1998-2003 Douglas Barton @@ -127,7 +127,11 @@ do_populate() { cksum -c ${DESTDIR}/${DBDIR}/${i} 2>/dev/null | grep OK | awk '{ print $2 }' | sed 's/[:]//') for _r in ${_R}; do if [ -f ${DESTDIR}/${_r} -a -f ${TEMPROOT}/${_r} ]; then - rm -f ${TEMPROOT}/${_r} + # sanity check: _always_ compare master.passwd(5) and group(5) + # we don't want to have missing system user(s) and/or group(s) + if [ ${_r} != ./etc/master.passwd -a ${_r} != ./etc/group ]; then + rm -f ${TEMPROOT}/${_r} + fi fi done fi -- cgit v1.2.3