Tags 531282 +patch
thanks

Hi,

I spent a few minutes to look into that bug:

The directory is created in postinst, based on what
the user enters and is not deleted in postrm.
The problem with this is, that we cannot rely on debconf to be
available during postrm. So we need to conditionally check if we can get
the configured directory from the debconf database and delete it if it
exists. The attached patch does this and defaults to deleting the
default path, if it exists (and is not overruled by the debconf value).
Still it has some problems:

- Users might have configured another path and might not have debconf
  available during configuration: Will lead into the same situation as
  now.
- I'm not exactly confident, if this usage of debconf is okay, because I
  remember (IIRC) that it was considered bad practice to abuse the
  debconf database as a registry, which is basically what this one does.

However, feel free to use that patch as a base for whatever you decide
to do.

Best Regards
Patrick
Binärdateien atftp-0.7.dfsg/debian/.atftpd.postinst.swp and atftp-0.7.dfsg.patched/debian/.atftpd.postinst.swp sind verschieden.
diff -u -Nur atftp-0.7.dfsg/debian/atftpd.postrm atftp-0.7.dfsg.patched/debian/atftpd.postrm
--- atftp-0.7.dfsg/debian/atftpd.postrm	2009-07-09 15:44:27.000000000 +0200
+++ atftp-0.7.dfsg.patched/debian/atftpd.postrm	2009-07-09 15:44:04.000000000 +0200
@@ -1,11 +1,25 @@
 #!/bin/sh -e
 
+
 if [ "$1" = "purge" ]; then
     # If netbase is not installed, then we don't need to do the remove.
     if command -v update-inetd >/dev/null 2>&1;
     then
 	    update-inetd --group BOOT --remove "tftp.*/usr/sbin/in.tftpd.*"
     fi
+    
+    BASEDIR="/var/lib/tftpd"
+    if [ -f /usr/share/debconf/confmodule ]; then
+        . /usr/share/debconf/confmodule
+        db_get atftpd/basedir
+        if [ "$RET" ]; then
+            BASEDIR="$RET"
+        fi
+    fi
+
+    if [ -d $BASEDIR ]; then
+        rm -f $BASEDIR
+    fi
 
     # logrotate 
     rm -f /etc/logorotate.d/atftpd

Reply via email to