summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-08-28 05:42:08 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-08-28 05:42:08 +0000
commit725d54f304e9915ae6f7ce7a481640c896d309d6 (patch)
tree2109a0158451162c70ece11dc44244e37e8fa8bf
parent32f23fc1b858563651a26205fd7de2365091dda9 (diff)
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@
-rw-r--r--usr.sbin/sysmerge/sysmerge.88
-rw-r--r--usr.sbin/sysmerge/sysmerge.sh8
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 <ajacoutot@openbsd.org>
.\"
@@ -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 <ajacoutot@openbsd.org>
# Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org>
@@ -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