summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2008-08-29 08:17:28 +0000
committerajacoutot <ajacoutot@openbsd.org>2008-08-29 08:17:28 +0000
commit7825657f10ed93c6b2eeac5340d75a099224813a (patch)
treef7f8ed82c8e4e2fa880aa103ed47c90c503acfd6
parentMSIZE and MCLBYTES are now defined in sys/param.h; from Jordan Gordeev (diff)
downloadwireguard-openbsd-7825657f10ed93c6b2eeac5340d75a099224813a.tar.xz
wireguard-openbsd-7825657f10ed93c6b2eeac5340d75a099224813a.zip
- prevent sysmerge from installing a virgin master.passwd and group
files (only allow delete or merge+install); requested by nick@ no objections from laurent@ krw@ oga@ ok sthen@ nick@
-rw-r--r--usr.sbin/sysmerge/sysmerge.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh
index b04bd339cb6..99058b2181c 100644
--- a/usr.sbin/sysmerge/sysmerge.sh
+++ b/usr.sbin/sysmerge/sysmerge.sh
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: sysmerge.sh,v 1.19 2008/07/21 08:28:55 ajacoutot Exp $
+# $OpenBSD: sysmerge.sh,v 1.20 2008/08/29 08:17:28 ajacoutot Exp $
#
# This script is based on the FreeBSD mergemaster script, written by
# Douglas Barton <DougB@FreeBSD.org>
@@ -255,7 +255,9 @@ diff_loop() {
if [ -z "${BATCHMODE}" ]; then
echo " Use 'd' to delete the temporary ${COMPFILE}"
- echo " Use 'i' to install the temporary ${COMPFILE}"
+ if [ "${COMPFILE}" != "./etc/master.passwd" -a "${COMPFILE}" != "./etc/group" ]; then
+ echo " Use 'i' to install the temporary ${COMPFILE}"
+ fi
if [ -z "${NO_INSTALLED}" -a -z "${IS_BINFILE}" ]; then
echo " Use 'm' to merge the temporary and installed versions"
echo " Use 'v' to view the diff results again"
@@ -275,12 +277,18 @@ diff_loop() {
echo "\n===> Deleting ${COMPFILE}"
;;
[iI])
- echo ""
- if mm_install "${COMPFILE}"; then
- echo "===> ${COMPFILE} installed successfully"
+ if [ "${COMPFILE}" != "./etc/master.passwd" -a "${COMPFILE}" != "./etc/group" ]; then
+ echo ""
+ if mm_install "${COMPFILE}"; then
+ echo "===> ${COMPFILE} installed successfully"
+ else
+ echo " *** WARNING: Problem installing ${COMPFILE}, it will remain to merge by hand"
+ fi
else
- echo " *** WARNING: Problem installing ${COMPFILE}, it will remain to merge by hand"
+ echo "invalid choice: ${HANDLE_COMPFILE}\n"
+ HANDLE_COMPFILE="todo"
fi
+
;;
[mM])
if [ -z "${NO_INSTALLED}" -a -z "${IS_BINFILE}" ]; then