Bug#431853: depends on non-essential package adduser in postrm

2007-08-11 Thread Gregory Colpart
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.0 +0200
+++ amavisd-new.postrm  2007-08-11 15:59:10.0 +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


Bug#431853: depends on non-essential package adduser in postrm

2007-08-05 Thread Kurt Roeckx
On Sun, Aug 05, 2007 at 03:38:07PM -0300, Henrique de Moraes Holschuh wrote:
> On Sun, 05 Aug 2007, Kurt Roeckx wrote:
> > useradd isn't essential either (anymore).  I think it's best to just
> > leave the user around.
> 
> FWIW, I never ever liked the idea of leaving *system* users around at purge.
> If someone is misusing system users, it is his problem.  OTOH, leaving
> around cruft in the system is not nice.
> 
> IMO, not removing the user when adduser is not around is not a problem,
> though, and a easy fix for the bug.

I don't know about amavis, but the user it created might be owning
files that aren't even removed after purge.  Like log files or something
like that.  So they'll suddenly end up with a uid that doesn't exist
anymore and which later might be reused.


Kurt



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#431853: depends on non-essential package adduser in postrm

2007-08-05 Thread Henrique de Moraes Holschuh
On Sun, 05 Aug 2007, Kurt Roeckx wrote:
> On Mon, Jul 30, 2007 at 07:23:10PM +0200, Luk Claes wrote:
> > peter green wrote:
> > > found 431853  2.4.2-6.1
> > > 
> > > thanks
> > > 
> > > firstly this is also present in the version in lenny.
> > > 
> > > secondly is there a correct way of managing system users using only
> > > essential packages? If not then imo there should be!
> > 
> > You can use useradd instead of adduser. It might also be better to leave the
> > user alone if you are not sure there are still files on unmounted media 
> > owned
> > by the user...
> 
> useradd isn't essential either (anymore).  I think it's best to just
> leave the user around.

FWIW, I never ever liked the idea of leaving *system* users around at purge.
If someone is misusing system users, it is his problem.  OTOH, leaving
around cruft in the system is not nice.

IMO, not removing the user when adduser is not around is not a problem,
though, and a easy fix for the bug.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#431853: depends on non-essential package adduser in postrm

2007-08-04 Thread Kurt Roeckx
On Mon, Jul 30, 2007 at 07:23:10PM +0200, Luk Claes wrote:
> peter green wrote:
> > found 431853  2.4.2-6.1
> > 
> > thanks
> > 
> > firstly this is also present in the version in lenny.
> > 
> > secondly is there a correct way of managing system users using only
> > essential packages? If not then imo there should be!
> 
> You can use useradd instead of adduser. It might also be better to leave the
> user alone if you are not sure there are still files on unmounted media owned
> by the user...

useradd isn't essential either (anymore).  I think it's best to just
leave the user around.


Kurt



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#431853: depends on non-essential package adduser in postrm

2007-07-30 Thread Luk Claes
peter green wrote:
> found 431853  2.4.2-6.1
> 
> thanks
> 
> firstly this is also present in the version in lenny.
> 
> secondly is there a correct way of managing system users using only
> essential packages? If not then imo there should be!

You can use useradd instead of adduser. It might also be better to leave the
user alone if you are not sure there are still files on unmounted media owned
by the user...

Cheers

Luk


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#431853: depends on non-essential package adduser in postrm

2007-07-30 Thread peter green

found 431853  2.4.2-6.1

thanks

firstly this is also present in the version in lenny.

secondly is there a correct way of managing system users using only 
essential packages? If not then imo there should be!




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]