pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

munge: Use UNPRIVILEGED_USER for daemons if necessary



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Sat Nov 30 17:32:16 2024 -0600
Changeset:	80f9cec539d866828fb5c43365724a46adc5df7c

Modified Files:
	munge/Makefile
Added Files:
	munge/COMMIT_MSG
Removed Files:
	munge/PLIST.SunOS

Log Message:
munge: Use UNPRIVILEGED_USER for daemons if necessary

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=80f9cec539d866828fb5c43365724a46adc5df7c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 munge/COMMIT_MSG  | 13 +++++++++++++
 munge/Makefile    | 13 ++++++++++---
 munge/PLIST.SunOS |  2 --
 3 files changed, 23 insertions(+), 5 deletions(-)

diffs:
diff --git a/munge/COMMIT_MSG b/munge/COMMIT_MSG
new file mode 100644
index 0000000000..b64217b778
--- /dev/null
+++ b/munge/COMMIT_MSG
@@ -0,0 +1,13 @@
+security/munge: Update to 0.5.16
+
+Packaged in wip by J Bacon
+
+The next paragraph describes the pkgsrc-specific packaging changes,
+if any.
+
+The next paragraph summarizes the upstream changes on a high level.
+In packages following the GNU Coding Standards, these changes are in
+the NEWS file, see
+https://www.gnu.org/prep/standards/html_node/NEWS-File.html.
+
+See https://www.pkgsrc.org/wip/users/#COMMIT_MSG.
diff --git a/munge/Makefile b/munge/Makefile
index 975a771c0b..3f14afeb1c 100644
--- a/munge/Makefile
+++ b/munge/Makefile
@@ -23,8 +23,16 @@ MUNGE_DIR?=		${PREFIX}/var/lib/munge
 MUNGE_LOG_DIR?=		${PREFIX}/var/log/munge
 MUNGE_RUN_DIR?=		${PREFIX}/var/run/munge
 MUNGE_ETC_DIR?=		${PREFIX}/etc/munge
-MUNGE_USER=		munge
-MUNGE_GROUP=		${MUNGE_USER}
+
+# Daemons should not run as root if they don't need to
+# Allow override, e.g. env MUNGE_USER=joe MUNGE_GROUP=staff bmake install
+.if defined(UNPRIVILEGED_USER) && ${UNPRIVILEGED_USER} == "root"	# Building as root
+MUNGE_USER?=		munge
+MUNGE_GROUP?=		${MUNGE_USER}
+.else
+MUNGE_USER?=		${UNPRIVILEGED_USER}
+MUNGE_GROUP?=		${UNPRIVILEGED_GROUP}
+.endif
 
 PKG_GROUPS+=		${MUNGE_GROUP}
 PKG_USERS+=		${MUNGE_USER}:${MUNGE_GROUP}
@@ -60,7 +68,6 @@ post-install:
 # Should not be necessary with AUTO_MKDIRS enabled, but it is
 INSTALLATION_DIRS+=	share/munge/Launchd
 post-install:
-	# ${MKDIR} ${DESTDIR}${PREFIX}/share/munge/Launchd
 	${INSTALL_DATA} ${FILESDIR}/*.plist \
 		${DESTDIR}${PREFIX}/share/munge/Launchd
 .endif
diff --git a/munge/PLIST.SunOS b/munge/PLIST.SunOS
deleted file mode 100644
index 660fd932a3..0000000000
--- a/munge/PLIST.SunOS
+++ /dev/null
@@ -1,2 +0,0 @@
-etc/init.d/munge
-etc/sysconfig/munge


Home | Main Index | Thread Index | Old Index