summaryrefslogtreecommitdiffstats
path: root/net/quagga
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-04-08 22:14:05 +0000
committerbms <bms@FreeBSD.org>2004-04-08 22:14:05 +0000
commit10f7b51f52607d3f5c47c7915490cd77c74ca87b (patch)
tree68655cbb9d2358558cf1750074869b7c21a77dfa /net/quagga
parentb1491bf482da1db3fc505d9a9d0927f39bd2b21e (diff)
downloadFreeBSD-ports-10f7b51f52607d3f5c47c7915490cd77c74ca87b.zip
FreeBSD-ports-10f7b51f52607d3f5c47c7915490cd77c74ca87b.tar.gz
Update the user-id used by the quagga user installed by the pkg-install
script to one which does not conflict with the Firebird package. Submitted by: Boris Kovalenko
Diffstat (limited to 'net/quagga')
-rw-r--r--net/quagga/Makefile51
-rw-r--r--net/quagga/pkg-install2
2 files changed, 51 insertions, 2 deletions
diff --git a/net/quagga/Makefile b/net/quagga/Makefile
index 921b877..b2eed0f 100644
--- a/net/quagga/Makefile
+++ b/net/quagga/Makefile
@@ -7,7 +7,7 @@
PORTNAME= quagga
PORTVERSION= 0.96.4
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net ipv6
MASTER_SITES= http://quagga.net/download/
@@ -144,6 +144,13 @@ post-install:
@${ECHO} "quagga_enable=\"YES\""
@${ECHO} "Also You may want to set router_enable=\"NO\""
@${ECHO} ""
+ @${ECHO} "Note!!! Since 0.96_5 port uses new id for quagga user and group."
+ @${ECHO} " So, You need to manually chown files:"
+ @${ECHO} " in ${SYSCONF_DIR}"
+ @${ECHO} " and ${LOCALSTATE_DIR}"
+ @${ECHO} " if You had never do this before. Or run"
+ @${ECHO} " make changeuser"
+ @${ECHO} ""
@${INSTALL_SCRIPT} ${WRKDIR}/quagga.sh ${RC_DIR}/quagga${RC_SUFX}
.if !defined(BATCH)
@@ -151,4 +158,46 @@ post-clean:
@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
.endif
+changeuser:
+# Recover from the problem that earlier versions of this port created the
+# quagga pseudo-user with an id of 90 which is used by FireBird database
+# engine. The port now uses id 101:101.
+# NOTE:
+# This target assumes that ENABLE_GROUP is the primary group of ENABLE_USER. If you
+# have a different setup, do not run this target!
+ @if [ `${ID} -u` -ne 0 ]; \
+ then ${ECHO_CMD} "Sorry, you must be root to use this target."; exit 1; fi; \
+ current_uid=`id -u ${ENABLE_USER}`; \
+ current_gid=`pw groupshow ${ENABLE_GROUP}|cut -f 3 -d :`; \
+ ${ECHO_CMD} "I will remove this user:"; \
+ ${ID} -P $${current_uid}; \
+ ${ECHO_CMD} "and this group:"; \
+ pw groupshow ${ENABLE_GROUP}; \
+ ${ECHO_CMD} "I will then re-create them with a user and group id of 101."; \
+ ${ECHO_CMD} "Then all files and directories under ${PREFIX} and /var that"; \
+ ${ECHO_CMD} "are owned by uid $${current_uid} will be chown(1)'ed."; \
+ ${ECHO_CMD} "After that, all files and directories that were accessible"; \
+ ${ECHO_CMD} "by group $${current_gid} will chgrp(1)'ed respectively."; \
+ ${ECHO_CMD} "Note that this assumes group '${ENABLE_GROUP}' to be the primary"; \
+ ${ECHO_CMD} "group of user '${ENABLE_USER}'. If you have a different setup"; \
+ ${ECHO_CMD} "please abort this target now. Also don't forget to write your"; \
+ ${ECHO_CMD} "Quagga configs right now!"; \
+ read -p "Press RETURN to continue or CTRL-C to abort:" dummy ; \
+ ${ECHO_CMD} "OK, here we go:"; \
+ ${ECHO_CMD} "deleting user $${current_uid} and his primary group..."; \
+ pw userdel -u $${current_uid}; \
+ ${ECHO_CMD} "adding user ${ENABLE_USER} with id 101..."; \
+ pw groupadd -n ${ENABLE_USER} -g 101; \
+ pw useradd -n ${ENABLE_GROUP} -u 101 -c "quagga route daemon pseudo-user" \
+ -d ${SYSCONF_DIR} -s /sbin/nologin -h - ; \
+ ${ECHO_CMD} "chown(1)'ing everything under ${PREFIX} from $${current_uid} to 101..."; \
+ ${FIND} -H ${PREFIX} -user $${current_uid} -exec ${CHOWN} 101 {} \; ; \
+ ${ECHO_CMD} "chgrp(1)'ing everything under ${PREFIX} from $${current_gid} to 100..."; \
+ ${FIND} -H ${PREFIX} -group $${current_gid} -exec ${CHOWN} :101 {} \; ; \
+ ${ECHO_CMD} "chown(1)'ing everything under /var from $${current_uid} to 101..."; \
+ ${FIND} -H /var -user $${current_uid} -exec ${CHOWN} 101 {} \; ; \
+ ${ECHO_CMD} "chgrp(1)'ing everything under /var from $${current_gid} to 101..."; \
+ ${FIND} -H /var -group $${current_gid} -exec ${CHOWN} :101 {} \; ; \
+ ${ECHO_CMD} "Finished. You must stop and then start Quagga now."
+
.include <bsd.port.post.mk>
diff --git a/net/quagga/pkg-install b/net/quagga/pkg-install
index 3860dc0..89e5e2f 100644
--- a/net/quagga/pkg-install
+++ b/net/quagga/pkg-install
@@ -20,7 +20,7 @@ fi
case $2 in
POST-INSTALL)
- UID=90
+ UID=101
GID=${UID}
if pw group show "${ENABLE_GROUP}" 2>/dev/null; then
echo "You already have a group \"${ENABLE_GROUP}\", so I will use it."
OpenPOWER on IntegriCloud