diff options
-rwxr-xr-x | debian/bitlbee.init | 8 | ||||
-rw-r--r-- | debian/changelog | 11 | ||||
-rwxr-xr-x | debian/config | 23 | ||||
-rw-r--r-- | debian/patches/bitlbee.conf.diff | 19 | ||||
-rwxr-xr-x | debian/postinst | 9 |
5 files changed, 38 insertions, 32 deletions
diff --git a/debian/bitlbee.init b/debian/bitlbee.init index a22c53a7..4c224ffc 100755 --- a/debian/bitlbee.init +++ b/debian/bitlbee.init @@ -40,14 +40,6 @@ d_start() { touch /var/run/bitlbee.pid chown bitlbee: /var/run/bitlbee.pid - # Clean up after the bug between 1.2-5 and 1.2.1-2 where BitlBee ran - # as root. (#494656 and #495877) Fixing this in the postinst script - # is not enough since the user will restart his BitlBee after up- - # grading the package, and the BitlBee running as root will then - # save its settings, re-setting ownership of the file to root. - # TODO: Remove this after a few revisions. - find /var/lib/bitlbee -uid 0 -name '*.xml' -exec chown bitlbee: {} \; - start-stop-daemon --start --quiet --pidfile $PIDFILE \ --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS } diff --git a/debian/changelog b/debian/changelog index 6c7ea4f4..0bb5af32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,15 @@ bitlbee (1.2.3-2) unstable; urgency=low (Closes: #531219) * Fixed free port detection code in debian/config which was a bit limited and also buggy. - - -- Wilmer van der Gaast <wilmer@gaast.net> Sun, 07 Jun 2009 20:40:00 +0100 + * Removing code that edits bitlbee.conf from postinst (and chown code in + the init script), it's not really necessary anymore; bitlbee may only + still run as root if the admin doesn't read conffile diffs. + (Closes: #514572) + * No longer overwriting port number info in /etc/default/bitlbee with + what's in debconf. (Closes: #514148) + * Added notes about the above two changes to bitlbee.conf. + + -- Wilmer van der Gaast <wilmer@gaast.net> Sun, 07 Jun 2009 21:17:39 +0100 bitlbee (1.2.3-1) unstable; urgency=critical diff --git a/debian/config b/debian/config index 2bd9b879..9bb78237 100755 --- a/debian/config +++ b/debian/config @@ -1,18 +1,23 @@ #!/bin/sh -e . /usr/share/debconf/confmodule +[ -f /etc/default/bitlbee ] && . /etc/default/bitlbee db_title BitlBee -db_get bitlbee/serveport -if [ "$RET" = "stillhavetoask" ]; then - listens=$(netstat -ltn | awk '{print $4}') - for port in 6667 6666 6668 6669; do - if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then - break - fi - done - db_set bitlbee/serveport $port; +if [ -n "$BITLBEE_PORT" ]; then + db_set bitlbee/serveport "$BITLBEE_PORT" +else + db_get bitlbee/serveport + if [ "$RET" = "stillhavetoask" ]; then + listens=$(netstat -ltn | awk '{print $4}') + for port in 6667 6666 6668 6669; do + if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then + break + fi + done + db_set bitlbee/serveport $port; + fi fi if db_input medium bitlbee/serveport; then diff --git a/debian/patches/bitlbee.conf.diff b/debian/patches/bitlbee.conf.diff index b80bcb4c..e42611bb 100644 --- a/debian/patches/bitlbee.conf.diff +++ b/debian/patches/bitlbee.conf.diff @@ -1,13 +1,22 @@ -=== modified file 'bitlbee.conf' ---- debian/bitlbee/etc/bitlbee/bitlbee.conf 2008-08-26 22:33:54 +0000 -+++ debian/bitlbee/etc/bitlbee/bitlbee.conf 2008-08-27 23:18:13 +0000 -@@ -23,7 +23,7 @@ +--- bitlbee.conf 2009-06-01 00:20:24.000000000 +0100 ++++ /tmp/bitlbee.conf 2009-06-07 21:16:19.000000000 +0100 +@@ -23,13 +23,18 @@ ## If BitlBee is started by root as a daemon, it can drop root privileges, ## and change to the specified user. ## -# User = bitlbee ++## DEBIAN NOTE: Without this, BitlBee will run as root! ++## +User = bitlbee ## DaemonPort/DaemonInterface: ## - + ## For daemon mode, you can specify on what interface and port the daemon + ## should be listening for connections. + ## ++## DEBIAN NOTE: The init script passes the -p flag to use the port number ++## set using debconf, this overrides the DaemonPort setting here. ++## + # DaemonInterface = 0.0.0.0 + # DaemonPort = 6667 + diff --git a/debian/postinst b/debian/postinst index db324b65..db541f6c 100755 --- a/debian/postinst +++ b/debian/postinst @@ -32,7 +32,7 @@ fi cat<<EOF>/etc/default/bitlbee ## /etc/default/bitlbee: Auto-generated/updated script. ## -## Don't edit this line, use dpkg-reconfigure bitlbee +## If running in (fork)daemon mode, listen on this TCP port. BITLBEE_PORT="$PORT" ## Use single-process or forking daemon mode? Can't be changed from debconf, @@ -63,13 +63,6 @@ if [ -e /usr/share/bitlbee/help.upgrading ]; then fi fi -if ! grep -qi '^User *= *' /etc/bitlbee/bitlbee.conf; then - echo 'Updating configuration file, enabling User-setting...' - if ! sed -i -e 's/# *User *= *.*/User = bitlbee/i' /etc/bitlbee/bitlbee.conf; then - echo 'Failed! BitlBee may run as root now, please check your configs.' - fi -fi - if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then if which invoke-rc.d >/dev/null 2>&1; then invoke-rc.d bitlbee restart |