Bug#1001959: deluser --remove-home exists

Marc Haber mh+debian-packages at zugschlus.de
Mon Jun 27 11:00:09 BST 2022


On Sun, Jun 26, 2022 at 04:08:15PM +0200, Pierre Gruet wrote:
> On Sun, 19 Dec 2021 15:45:46 +0100 Marc Haber
> <mh+debian-packages at zugschlus.de> wrote:
> > Package: zookeeper
> > Severity: minor
> >
> > Hi,
> >
> > when browsing through codesearch.debian.net, I stumbled upon the
> > following wording in zookeeper.postrm:
> >
> > # --remove-all-files takes ages, so delete manually
> > deluser --system $USER || true
> > delgroup --system --only-if-empty $GROUP || true
> >
> > deluser --remove-all-files searches through all mounted file systems.
> > Did you want to use deluser --remove-home instead, which just removes
> > the home directory of the user as given in /etc/passwd before the
> > deletion?
> 
> Thanks for the bug submission; the few lines above the ones you quoted are
> 
> rm -rf /var/lib/$NAME
> rm -rf /var/log/$NAME
> rm -rf /var/run/$NAME
> 
> (and in face, $NAME is the same as $USER).

and everything is hardcoded set to "zookeeper". I still find the choice
of variable USER problematic as this is set to the logged in name by the
shell. NAME is fine though.

> So I guess the one who wrote these lines really meant to erase files outside
> the home dir and I think --remove-home whould thus not be enough. But I
> never manipulated such things... what is your opinion?

The home directory is set to /var/lib/zookeeper, so strictly speaking
the rm -rf /var/lib/$NAME is redundant if --remove-home is used. In my
opinion, the code is just fine. I'd remove the comment about
--remove-all-files though and add an extra --remove-home to make sure
what is intended.

I was using codesearch.debian.net to find out which packages use
--remove-all-files since we as the adduser team are contemplating to
deprecate and eventually remove --remove-all-files from adduser, and
this brougt my attention to zookeeper. It would be nice and comfortable
for us if zookeeper wouldn't show up any more in such searches ;-)

Hence, the minor severity of the bug report.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



More information about the pkg-java-maintainers mailing list