[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Need advice wrt #295306 (Was: debian/uw-imapd-ssl.postinst clobbers existing imaps line params)



> possibly as a result of DEBIAN/postinst:

  I was misleaded by this line

  in fact, the bug is triggered by the postrm that does not check if the
package is actually beeing upgraded or not.

  here are two correct postrm (you only need to put them in place of the
previous ones), that will correct the bug for upgrades *FROM THE NEW
VERSION* to future one only.

  so it does not fix the bug, it only prevent it to happen *in the
future*

  here is the full explanation : http://www.madism.org/~madcoder/295306.txt


  I send this mail to debian-mentors@ to have some advices on how to
deal with a *real* fix that implies some dpkg files
(/var/lib/dpkg/info/....postrm) from the new postinst.

-- 
·O·  Pierre Habouzit
··O
OOO                                                http://www.madism.org
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

##
## Remove imapd from inetd.conf
##
clean_inetd () {
    db_get uw-imapd/protocol
    for i in `echo "$RET" | sed 's/,/ /g'`; do
            if [ "$i" = "imap2" ]; then
                    update-inetd --remove imap2;
            elif [ "$i" = "imap3" ]; then
                    update-inetd --remove imap3;
            elif [ "$i" = "imaps" ]; then
                    update-inetd --remove imaps;
            fi
    done
}

case "$1" in
    remove)
        clean_inetd
    ;;
        
    purge)
        clean_inetd
        if [ -a -f /etc/ssl/certs/imapd.pem ]; then
            echo "SSL certificate /etc/ssl/certs/imapd.pem is NOT removed."
            echo "Please remove manually if required."
            #cd /etc/ssl/certs
            #PATH=$PATH:/usr/bin/ssl
            #rm -f `openssl x509 -noout -hash < imapd.pem`.0 || true
            #if [ -f imapd.pem ]; then rm -f imapd.pem; fi
        fi
    ;;

    *)
    ;;
esac

#DEBHELPER#

exit 0
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

##
## Remove POP daemons from inetd.conf
##
clean_inetd () {
    db_get ipopd/protocol
    for i in `echo "$RET" | sed 's/,/ /g'`; do
            if [ "$i" = "pop2" ]; then
                    update-inetd --remove pop2;
            elif [ "$i" = "pop3" ]; then
                    update-inetd --remove pop3;
            elif [ "$i" = "pop3s" ]; then
                    update-inetd --remove pop3s;
            fi
    done
}

case "$1" in
    remove)
        clean_inetd
    ;;

    purge)
        clean_inetd
        if [ -a -f /etc/ssl/certs/ipop3d.pem ]; then
            echo "SSL certificate /etc/ssl/certs/ipop3d.pem is NOT removed."
            echo "Please remove the file manually."
            #cd /etc/ssl/certs
            #PATH=$PATH:/usr/bin/ssl
            #rm -f `openssl x509 -noout -hash < ipop3d.pem`.0 || true
            #if [ -f ipop3d.pem ]; then rm -f ipop3d.pem; fi
        fi
    ;;

    *)
    ;;
esac

#DEBHELPER#

exit 0

Reply to: