Package: adduser
Version: 3.118
Severity: minor
File: /usr/sbin/deluser

Hi,

to my surprise, I found out that deluser --force does not what I think¹
but it allows to delete the root user. It's documented that way, but
it's misnamed in my opinion. In fact,
https://codesearch.debian.net/search?q=deluser.*force&literal=0 clearly
shows that all pacakge maintainers who use deluser --force are using it
wrong.

The safeguard against removing root should be relaxed with an option
like --no-preserve-root (see, man 1 rm), so that --force can be used for
the analogon to rm --force as to not returning an error when a user to
be deleted didnt expect in the first place. This can then be used if the
author of a script just cares about the result (e.g. user gone) after
the deluser call without caring for whether the user existed before the
call or not.

Greetings
Marc

¹ I expected it to make deleting a user that does not exist not an error

Reply via email to