aboutsummaryrefslogtreecommitdiffstats
path: root/debian/postinst
diff options
context:
space:
mode:
authorSven Moritz Hallberg <pesco@khjk.org>2008-07-17 01:22:52 +0200
committerSven Moritz Hallberg <pesco@khjk.org>2008-07-17 01:22:52 +0200
commit6738a676c7a3895988de4bd9eacfe8fa0ef73cc3 (patch)
treed95d913484cf79ff4a3c6d920a4d9b92ecd66de9 /debian/postinst
parent9730d7250bb9e938ca00b72efdd8e8b3c03b2753 (diff)
parent6a78c0eed44820a2fefe1e96516e335eddc9c70b (diff)
merge in latest trunk
Diffstat (limited to 'debian/postinst')
-rwxr-xr-xdebian/postinst31
1 files changed, 24 insertions, 7 deletions
diff --git a/debian/postinst b/debian/postinst
index 37608e47..80249bfe 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -13,11 +13,20 @@ update-rc.d bitlbee defaults > /dev/null 2>&1
BITLBEE_OPTS=-F
BITLBEE_DISABLED=0
BITLBEE_UPGRADE_DONT_RESTART=0
-[ -r /etc/default/bitlbee ] && source /etc/default/bitlbee
+[ -r /etc/default/bitlbee ] && . /etc/default/bitlbee
-if [ "$BITLBEE_DISABLED" = "0" ]; then
- ## In case it's still there (if we're upgrading right now)
+if [ "$BITLBEE_DISABLED" = "0" ] && type update-inetd > /dev/null 2> /dev/null &&
+ ( expr "$2" : '0\..*' > /dev/null || expr "$2" : '1\.0\..*' > /dev/null ); then
+ ## Make sure the inetd entry is gone (can still be there from a
+ ## previous version.
update-inetd --remove '.*/usr/sbin/bitlbee'
+ if grep -q /usr/sbin/bitlbee /etc/inetd.conf 2> /dev/null; then
+ # Thanks for breaking update-inetd! (bugs.debian.org/311111)
+ # I hope that it works at least with xinetd, because this
+ # emergency hack doesn't:
+ perl -pi -e 's:^[^#].*/usr/sbin/bitlbee$:## Now using daemon mode\: # $&:' /etc/inetd.conf
+ killall -HUP inetd || true
+ fi
fi
cat<<EOF>/etc/default/bitlbee
@@ -64,13 +73,21 @@ if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then
exit 0
fi
-adduser --system --home /var/lib/bitlbee/ --disabled-login --disabled-password bitlbee
+adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
chmod 700 /var/lib/bitlbee/
## Can't do this in packaging phase: Don't know the UID yet. Access to
-## the file should be limited, now that it stores passwords.
-chmod 600 /etc/bitlbee/bitlbee.conf
-chown bitlbee /etc/bitlbee/bitlbee.conf
+## the file should be limited, now that it stores passwords. Added
+## --group later for a little more security, but have to see if I can
+## apply this change to existing installations on upgrades. Will think
+## about that later.
+if getent group bitlbee > /dev/null; then
+ chmod 640 /etc/bitlbee/bitlbee.conf
+ chown root:bitlbee /etc/bitlbee/bitlbee.conf
+else
+ chmod 600 /etc/bitlbee/bitlbee.conf
+ chown bitlbee /etc/bitlbee/bitlbee.conf
+fi
if [ -z "$2" ]; then
/etc/init.d/bitlbee start