mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-03 01:23:49 +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:
parent
871a680720
commit
ef0ecb1c36
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=174983
@ -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/ \
|
||||
|
@ -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}
|
Loading…
Reference in New Issue
Block a user