1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-15 23:50:44 +00:00
freebsd-ports/net/cvsup-mirror/pkg-deinstall
John Polstra 3176ec22e7 This is a fairly substantial upgrade of the cvsup-mirror port. In
honor of the occasion I have bumped the version number to 1.1.

The port now depends upon the cvsup-bin and cvsupd-bin ports rather
than on the more trouble-prone cvsup port.

The CVSup server is run with "-C 100" (max. 100 clients at a time)
and the true limit is set in the "/usr/local/etc/cvsup/cvsupd.access"
file.  This is nice because you can change the limit by editing
the file; you don't have to restart the server.  The cvsupd.access
file also contains a rule to limit each individual host to one
connection at a time.

The CVSup client is now run under its own unprivileged user ID
instead of root.  This is a security enhancement.  It makes it
impossible for a compromised master site to install files into
places outside the mirror area of the filesystem.  The permissions
of various other files such as /usr/local/etc/cvsup have also been
strengthened to enhance security.

Both client and server now cd to /var/tmp to run, so that if they
decide to croak they'll be able to write the core file. :-)

The /usr/local/etc/rc.d/cvsupd.sh script now honors the "start"
and "stop" arguments.

The configure script no longer attempts to tell you the sizes of
the various collections.  That's impossible to maintain.  When I
have time I plan to make a web page where one can obtain that
information from an automatically-updated source.  Then I will
reference the URL in the configure script.

It is possible to upgrade an existing cvsup-mirror-1.0 installation
to this new version, but it is tricky because of the change in
ownership of the mirrored files.  I will post instructions to the
freebsd-hubs mailing list after I make sure I have the procedure
just right.
2000-01-28 06:42:37 +00:00

100 lines
2.0 KiB
Bash

#! /bin/sh
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" ]; 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
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
pw userdel -n ${u}
echo "Done."
fi
}
if [ x$2 != xDEINSTALL ]; then
exit
fi
export PATH=/bin:/usr/bin:/usr/sbin
base=${PKG_PREFIX}/etc/cvsup
. ${base}/config.sh || exit
if ps -axc | grep -q cvsupd; then
echo "Please kill your running cvsupd processes first" >&2
exit 1
fi
tmp="/etc/#cvsma$$"
trap "rm -f ${tmp}" 0 1 2 3 15
rm -rf ${base}/prefixes
rm -f ${base}/.start_server
if yesno "Do you want me to remove scheduled updates from \"/etc/crontab\"" y
then
sed "/\/etc\/cvsup\/update\.sh/d" /etc/crontab >${tmp} || exit
chmod 644 ${tmp}
mv ${tmp} /etc/crontab || exit
echo "Done."
fi
if yesno \
"Do you want me to remove the cvsupd logging from \"/etc/syslog.conf\"" y
then
sed "/^!cvsupd/,/cvsupd\.log\$/d" /etc/syslog.conf >${tmp} || exit
chmod 644 ${tmp}
mv ${tmp} /etc/syslog.conf || exit
if [ -f /var/run/syslog.pid ]; then
echo "Giving syslogd a kick in the pants."
kill -HUP $(cat /var/run/syslog.pid)
fi
echo "Done."
fi
if yesno "Do you want me to remove the cvsupd log entry from \
\"/etc/newsyslog.conf\"" y; then
sed "/cvsupd\.log/d" /etc/newsyslog.conf >${tmp} || exit
chmod 644 ${tmp}
mv ${tmp} /etc/newsyslog.conf || exit
echo "Done."
fi
delete_account ${user} ${group}
delete_account ${cuser} ${cgroup}