[pkg-fetchmail-maint] Bug in postinst

Héctor García hector at debian.org
Mon Nov 14 17:23:12 UTC 2005


Hi Loïc,

After checking the bug it made reference to, your first patch, my patch
and your fix. 
I believe that your later fix is wrong (as my patch), your first patch
was a lot better but missing a few things.

What you people thing of leaving it like this?

# Create fetchmail user and its homedir if we may need it
if ! getent passwd fetchmail >/dev/null; then
    adduser --quiet --system --no-create-home --ingroup nogroup \
      --home /var/run/fetchmail --shell /bin/sh \
      --disabled-password fetchmail
fi

# work around possible adduser bug, see #119366
if ! [ -d /var/run/fetchmail ]; then
    mkdir -p /var/run/fetchmail
    chmod 700 /var/run/fetchmail
    chown -h -R fetchmail:nogroup /var/run/fetchmail
fi

Doing it this way (your original patch plus 2 flags to adduser, needed
in my opinion), fetchmail gets created if it didn't exists
and /var/run/fetchmail only gets to change permisions and owner if it
didn't exits (just thing of people with old conf that use another user
to run fetchmail, but uses same dir).

Regards,

P.S: there is also the same code again on the init script, which should
be deleted it has no sense on running  every time fetchmail starts or
stops.
Also the default VARs should be taken to /etc/defaults/fetchmail
If you people thing alike, I'll send the patch to do all the things.

Héctor




More information about the pkg-fetchmail-maint mailing list