On Mon, Jan 07, 2008 at 11:42:43PM +0000, Stephen Gran wrote:
> 
> clamav-base.  It does a fairly standard:
>   if [ -z "$2" ]; then
>     if [ -z "`getent passwd clamav`" ]; then
>       adduser --system --no-create-home \
>         --disabled-password --disabled-login \
>         --shell /bin/false --group --home /var/lib/clamav clamav
>     fi
>     chown clamav:clamav $DATABASEDIR
>     chown clamav:clamav $RUNDIR
>     chown clamav:clamav $LOGDIR
> 
> This can go wrong if you've removed the package but not purged it and
> then delgroup'ed the group (if you purge the package, it removes both
> user and group), or if even on a fresh install there is a user but no
> group present.  Both of those are so strange I didn't (and don't)
> consider them hugely interesting cases to code around.
> 
> I just don't know how you've gotten that error.  The only thing I can
> think of is that you may have scripts for copying in accounts into the
> chroot that fails to also copy in the groups?

I can't be sure of this, but what I _might_ have done is copying /etc/passwd
and/or /etc/group from outside the chroot (to propagate UIDs/GIDs).

Perhaps I only copied /etc/passwd (which presumably would include 'clamav')
and not /etc/group ?  That would explain it.

In that case, I'd suggest making it more robust.  Something like:

     if [ -z "`getent group clamav`" ]; then
      addgroup clamav
     fi
     if [ -z "`getent passwd clamav`" ]; then
      adduser --system --no-create-home \
        --disabled-password --disabled-login \
        --shell /bin/false --home /var/lib/clamav clamav \
        --ingroup clamav
     fi

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)



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

Reply via email to