Package: ftpd
Version: 0.17-27
Severity: important
Tags: patch

Hi,

Due to a change in update-inetd, linux-ftpd's postrm no longer removes
the inetd.conf entry. The attached patch fixes this.

Fixing this reveals other problems, which the patch also fixes:

* postrm removes the inetd.conf entry when called during remove as
  well as purge, losing any local configuration.

* With this (and downstream ftpd-ssl) fixed, if you replace
  linux-ftpd-ssl with linux-ftpd, and you had ssl-specific arguments
  (which until recently were added by default), they will be left in
  the inetd entry, causing linux-ftpd to fail to start. The patch
  handles this by removing the inetd entry at the start of postinst if
  it has any ftpd-ssl options in it (fortunately they all start with -z)

* Calling:
    apt-get install ftpd-ssl
    apt-get install ftpd
    dpkg -P ftpd-ssl
  removes the inetd.conf entry for ftp. The patch fixes this by only
  removing the entry if it is commented out (which will have happened
  in the prerm). The problem also happens the other way round (ie
  install ftpd, install ftpd-ssl, purge ftpd)

I've also fixed these issues in linux-ftpd-ssl, which my AM will
hopefully upload soon (I've only recently adopted linux-ftpd-ssl, so I
don't have the DM-Upload-Allowed flag yet)

Hope this all makes sense,

Ian.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ftpd depends on:
ii  libc6                       2.7-11       GNU C Library: Shared libraries
ii  libpam-modules              0.99.7.1-6   Pluggable Authentication Modules f
ii  libpam0g                    0.99.7.1-6   Pluggable Authentication Modules l
ii  openbsd-inetd [inet-superse 0.20080125-1 The OpenBSD Internet Superserver

ftpd recommends no packages.
diff --git a/debian/postinst b/debian/postinst
index 27a3c9d..4b51b27 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,6 +1,10 @@
 #!/bin/sh -e
 # $Id: postinst,v 1.7 2003/06/21 02:31:44 herbert Exp $
 
+if grep -q '[[:blank:]]/usr/sbin/in\.ftpd.*-z' /etc/inetd.conf; then
+       update-inetd --pattern '/usr/sbin/in\.ftpd' --remove ".*ftp"
+fi
+
 if grep -q '[[:blank:]]/usr/sbin/in\.ftpd\>' /etc/inetd.conf; then
        if ! grep -q '^ftp\>' /etc/inetd.conf; then
                update-inetd --pattern '/usr/sbin/in\.ftpd' --enable ftp
diff --git a/debian/postrm b/debian/postrm
index 2469e8a..5ebd1e5 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,9 +1,9 @@
 #!/bin/sh -e
 # $Id: postrm,v 1.1 1999/04/16 07:00:28 herbert Exp $
 
-if [ "$1" = remove -o "$1" = purge ]; then
+if [ "$1" = purge ]; then
        if command -v update-inetd >/dev/null 2>&1; then
-               update-inetd --remove "ftp              stream  tcp     nowait  
root    /usr/sbin/tcpd  /usr/sbin/in.ftpd"
+               update-inetd --pattern '/usr/sbin/in\.ftpd' --remove "#<off># 
ftp"
        fi
 fi
 

Reply via email to