On Wed, Mar 05, 2025 at 09:46:53AM +0100, Marc Haber wrote:
> >1. For a system account, there would still be an issue if the account↲
> >has a password (if possible). If EXISTING_ID_MISMATCH is set, this↲
> >would also yield an issue; I think that this is possible if the --uid↲
> >adduser option is used, with an id different from the current one for↲
> >this account. You should add a test for this case.↲

#1099734 to be able to report an account having a password on adduser
--system --disabled-password.

I am open for additional tests.

> >2. For a non-system account, the problematic test would always be↲
> >false, while it is actually meant to be true (the error message↲
> >contains "but is not a system user"). So you should add a test↲
> >↲
> >  adduser --system username↲
> >↲
> >where the username account already exists and is not a system account↲

We now have that, in both directions.

> >One would expect a non-zero exit status because --system is↲
> >used while username exists and is not a system account.↲

adduser --system foo
adduser --system foo
is silently successful twice in a row

adduser foo
adduser foo
errors out with "user already exists" the second way around

adduser foo
adduser --system foo
errors out with "user already exists an is not a system account"

adduser --system foo
adduser foo
errors out with "already exists"

We have testcases for all four cases now.

Greetings
Marc

Reply via email to