pkgsrc-WIP-changes archive

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

gnunet: special_perms.



Module Name:	pkgsrc-wip
Committed By:	ng0 <ng0%n0.is@localhost>
Pushed By:	ng0
Date:		Thu Feb 28 19:17:56 2019 +0000
Changeset:	b16035813817e4c371e3b461db4e1351f94b8d27

Modified Files:
	gnunet/Makefile
	gnunet/files/gnunet.in

Log Message:
gnunet: special_perms.

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

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

diffstat:
 gnunet/Makefile        | 36 +++++++++++++++++++++++-------------
 gnunet/files/gnunet.in | 17 +++++++++++++++--
 2 files changed, 38 insertions(+), 15 deletions(-)

diffs:
diff --git a/gnunet/Makefile b/gnunet/Makefile
index 90ff049fb8..8c049098f9 100644
--- a/gnunet/Makefile
+++ b/gnunet/Makefile
@@ -26,17 +26,7 @@ INFO_FILES=		yes
 CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--with-extractor=${BUILDLINK_PREFIX.libextractor}
-
-# All helpers have to be suid. fs helper must not be suid.
-# Not all of these files may be available.
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-testbed ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-exit ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-dns ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-nat-client ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-nat-server ${SETUID_ROOT_PERMS}
-# SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-transport-bluetooth ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-transport-wlan ${SETUID_ROOT_PERMS}
-SPECIAL_PERMS+=		lib/gnunet/libexec/gnunet-helper-vpn ${SETUID_ROOT_PERMS}
+CONFIGURE_ARGS+=	--with-gnunetdns=${GNUNETDNS_GROUP}
 
 GNUNET_USER=			gnunet
 GNUNET_GROUP=			gnunet
@@ -65,6 +55,7 @@ CONF_FILES+=			${FILESDIR}/gnunet.conf \
 
 FILES_SUBST+=			PKG_HOME=${PKG_HOME.${GNUNET_USER}}
 FILES_SUBST+=			GNUNET_USER=${GNUNET_USER} GNUNET_GROUP=${GNUNET_GROUP}
+FILES_SUBST+=			GNUNETDNS_GROUP=${GNUNETDNS_GROUP}
 
 SUBST_CLASSES+=			sysconfdir
 SUBST_STAGE.sysconfdir=		post-build
@@ -72,11 +63,30 @@ SUBST_MESSAGE.sysconfdir=	Fixing sysconfdir in gnunet.conf
 SUBST_FILES.sysconfdir=		${FILESDIR}/gnunet.conf
 SUBST_SED.sysconfdir=		-e 's,^DEFAULTCONFIG.*,DEFAULTCONFIG = ${PKG_SYSCONFDIR}/gnunet.conf,g'
 
-#post-patch:
-#	cd ${WRKSRC} && ${SH} bootstrap
+# All helpers have to be suid. fs helper must not be suid.
+# Not all of these files may be available.
+# This is only necessary when the installation was not run
+# as root. Run it to ensure that no manual intervention is
+# necessary.
+# ${CHMOD} root:${GNUNETDNS_GROUP ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-dns
+# ${CHMOD} ${GNUNET_USER}:${GNUNETDNS_GROUP ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-service-dns
+SPECIAL_PERMS+=	${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-dns ${REAL_ROOT_USER} ${GNUNET_DNS_GROUP} 4750
+SPECIAL_PERMS+=	${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-service-dns ${GNUNET_USER} ${GNUNETDNS_GROUP} 2750
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-testbed ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-exit ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-nat-client ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-nat-server ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-transport-bluetooth ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-transport-wlan ${SETUID_ROOT_PERMS}
+SPECIAL_PERMS+= ${DESTDIR}${PREFIX}/lib/gnunet/libexec/gnunet-helper-vpn ${SETUID_ROOT_PERMS}
 
 post-install:
 	cd ${WRKSRC} && ${INSTALL_SCRIPT} ${WRKSRC}/src/util/gnunet-qr.py ${DESTDIR}${PREFIX}/bin
+	# XXX: Will be fixed in 0.11.1 or rewritten in C.
+	# Technically this is no executable script anymore, as we call
+	# call it with the shell script. The warning thrown is harmless.
+	# https://gnunet.org/en/#gsoc2019
+	${CHMOD} -x ${DESTDIR}${PREFIX}/bin/gnunet-qr.py
 
 .include "../../audio/libopus/buildlink3.mk"
 .include "../../databases/sqlite3/buildlink3.mk"
diff --git a/gnunet/files/gnunet.in b/gnunet/files/gnunet.in
index ec9717476a..44523acd83 100755
--- a/gnunet/files/gnunet.in
+++ b/gnunet/files/gnunet.in
@@ -23,6 +23,14 @@ pidfile="@PKG_HOME@/${name}.pid"
 restart_cmd="gnunet_stop ; gnunet_start"
 extra_commands="reload"
 
+: ${gnunet_user:=@GNUNET_USER@}
+: ${gnunet_group:=@GNUNET_GROUP@}
+: ${gnunet_home:=@PKG_HOME@}
+: ${gnunetdns_group:=@GNUNETDNS_GROUP@}
+
+gnunet_chdir="${gnunet_home}"
+gnunet_env="HOME=${gnunet_home}"
+
 checkconfig()
 {
 	if [ -n "$(find @PKG_HOME@/.local/share/gnunet -maxdepth 1 -name gnunet.conf -perm +0044)" ]; then
@@ -36,12 +44,17 @@ checkconfig()
 
 gnunet_start ()
 {
-	checkconfig || return 1
-	${command} -s -c @PKG_SYSCONFDIR@/gnunet.conf
+	@ECHO@ "Starting ${name}."
+	doit="@SU@ -m ${gnunet_user} -c '${command} ${command_args}'"
+	eval $doit
+	# checkconfig || return 1
+	# ${command} -s -c @PKG_SYSCONFDIR@/gnunet.conf
 }
 
 gnunet_stop()
 {
+	@ECHO@ "Stopping ${name}."
+	doit="@SU@ -m ${gnunet_user} -c '${command}
 	${command} -e -c @PKG_SYSCONFDIR@/gnunet.conf
 	kill `cat ${pidfile}` 2>/dev/null
 	sleep 1


Home | Main Index | Thread Index | Old Index