tags 431853 + patch
thanks

Hello,

Interesting summary for handling system accounts is here:
http://wiki.debian.org/AccountHandlingInMaintainerScripts

Files commonly owned by amavis (user|group) are:
- quarantine files (by default in /var/lib/amavis/virusmails/)
- temporary files (by default in /var/lib/amavis/tmp/)
- cache files (by default in /var/lib/amavis/db/)
- spam cache files (Bayes, AWL) ((by default in
  /var/lib/amavis/.spamassassin/)
- log files but by default there is no log file owned by amavis
  (default to syslog usage)

/var/lib/amavis/ directory is removed in postrm then *by default*
there is no files owned by amavis (user|group) after purging.
Then I think we should delete amavis (user|group) because
advanced amavis users who changes default locations or complex
configuration should take care of system users.

I propose that a patch like in attachment closes this bug.

Regards,
-- 
Gregory Colpart <[EMAIL PROTECTED]>  GnuPG:1024D/C1027A0E
Evolix - Informatique et Logiciels Libres http://www.evolix.fr/
--- amavisd-new.postrm.orig     2007-08-11 16:02:00.000000000 +0200
+++ amavisd-new.postrm  2007-08-11 15:59:10.000000000 +0200
@@ -18,6 +18,36 @@
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
+# $1 "user" | "group"
+del()
+{
+if [ -x "$(command -v deluser)" ]; then
+       case $1 in
+        "user")
+               deluser --quiet --system amavis > /dev/null || true
+               ;;
+        "group")
+                delgroup --quiet --system amavis > /dev/null || true
+                ;;
+        *)
+                false
+                ;;
+       esac
+else
+       case $1 in
+        "user")
+               echo >&2 "not removing amavis system account because deluser 
command was not found"
+               ;;
+               
+        "group")
+                echo >&2 "not removing amavis system group because delgroup 
command was not found"
+                ;;
+        *)
+                false
+                ;;
+       esac
+fi
+}
 
 case "$1" in
        purge)
@@ -46,8 +76,8 @@
        do
                dpkg-statoverride --remove $i || true
        done
-       getent passwd amavis >/dev/null && deluser amavis
-       getent group amavis >/dev/null && delgroup amavis
+       getent passwd amavis >/dev/null && del user
+       getent group amavis >/dev/null && del group
 
        echo "Removing amavis files and directories..."
        [ -d /var/lib/amavis ] && rm -fr /var/lib/amavis

Reply via email to