1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-14 23:46:10 +00:00
freebsd-ports/misc/amanda/pkg-install
Steve Price 28ca7dd503 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>
1999-12-29 07:13:33 +00:00

39 lines
955 B
Bash

#! /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/*