aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1999-12-29 15:13:33 +0800
committersteve <steve@FreeBSD.org>1999-12-29 15:13:33 +0800
commita75043ad10b0c25a57671a35b062b2ee47e33a71 (patch)
treeca7ba1dc607d65a377d34f655636c54013d6490d /misc
parent74bcd58262749d12fea17ba329266490e0ba7ac6 (diff)
downloadfreebsd-ports-gnome-a75043ad10b0c25a57671a35b062b2ee47e33a71.tar.gz
freebsd-ports-gnome-a75043ad10b0c25a57671a35b062b2ee47e33a71.tar.zst
freebsd-ports-gnome-a75043ad10b0c25a57671a35b062b2ee47e33a71.zip
Fix a potential root exploit in runtar that would allow any user to run
tar as root. PR: 15577 Submitted by: AnarCat <beaupran@iro.umontreal.ca>
Diffstat (limited to 'misc')
-rw-r--r--misc/amanda/Makefile1
-rw-r--r--misc/amanda/pkg-install38
2 files changed, 39 insertions, 0 deletions
diff --git a/misc/amanda/Makefile b/misc/amanda/Makefile
index df0471af745d..c4dcc3ce2239 100644
--- a/misc/amanda/Makefile
+++ b/misc/amanda/Makefile
@@ -45,5 +45,6 @@ post-install:
.endfor
@${MKDIR} ${PREFIX}/share/examples/amanda
${INSTALL_DATA} ${WRKSRC}/example/* ${PREFIX}/share/examples/amanda
+ @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>
diff --git a/misc/amanda/pkg-install b/misc/amanda/pkg-install
new file mode 100644
index 000000000000..707f96fa597c
--- /dev/null
+++ b/misc/amanda/pkg-install
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+if [ "X$2" != "XPOST-INSTALL" ]; then
+ exit 0
+fi
+
+echo -n "Adding necessary groups and modifying permissions on "
+echo "${PKG_PREFIX}/libexec/amanda dir"
+
+group=amanda
+
+if pw groupshow "${group}" 2>/dev/null; then
+ echo "You already have a group \"${group}\", so I will use it."
+else
+ echo "You need a group \"${group}\"."
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ read -p "Would you like me to create it? [Y] " ans
+ fi
+ if [ x$ans = x ]; then
+ ans=y
+ fi
+ case "$ans" in
+ [Yy]*)
+ pw groupadd ${group} -h - || exit
+ echo "Done."
+ ;;
+ *)
+ echo "Please create it, and try again."
+ exit 1
+ ;;
+ esac
+fi
+
+echo "Modifying permissions on ${PKG_PREFIX}/libexec/amanda"
+/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda
+/bin/chmod 510 ${PKG_PREFIX}/libexec/amanda
+/sbin/chown root:amanda ${PKG_PREFIX}/libexec/amanda/*
+/bin/chmod 4550 ${PKG_PREFIX}/libexec/amanda/*