1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Fix the problem with unattended deinstallation by not even attempting

to remove the stunnel user and group at all - just kill the package
deinstall script.

PR:		104028
Reported by:	jan grant <jan.grant@bristol.ac.uk>,
		Stephen Hurd <shurd@sasktel.net> (in private mail a while ago),
		and, I think, many others
This commit is contained in:
Peter Pentchev 2006-10-08 18:06:54 +00:00
parent 871a680720
commit ef0ecb1c36
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=174983
2 changed files with 1 additions and 63 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= stunnel
PORTVERSION= 4.18
PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \
ftp://stunnel.mirt.net/stunnel/ \

View File

@ -1,63 +0,0 @@
#! /bin/sh
#
# $FreeBSD$
# taken from net/cvsup-mirror
PATH=/bin:/usr/sbin
STUNNEL_USER=${STUNNEL_USER:-stunnel}
STUNNEL_GROUP=${STUNNEL_GROUP:-stunnel}
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
read -p "${question} [${default}]? " answer
fi
if [ x${answer} = x ]; then
answer=${default}
fi
echo ${answer}
}
yesno() {
local dflt question answer
question=$1
dflt=$2
while :; do
answer=$(ask "${question}" "${dflt}")
case "${answer}" in
[Yy]*) return 0;;
[Nn]*) return 1;;
esac
echo "Please answer yes or no."
done
}
delete_account() {
local u g home
u=$1
g=$2
if yesno "Do you want me to remove group \"${g}\"" y; then
pw groupdel -n ${g}
echo "Done."
fi
if yesno "Do you want me to remove user \"${u}\"" y; then
eval home=~${u}
pw userdel -n ${u}
echo "Done."
if [ -d "${home}" ]; then
echo "Please remember to remove the home directory \"${home}\""
fi
fi
}
if [ x$2 != xDEINSTALL ]; then
exit
fi
delete_account ${STUNNEL_USER} ${STUNNEL_GROUP}