#39 libuser does not protect against duplicate IDs
Closed a year ago by thalman. Opened 5 years ago by jhrozek.

lgroupadd -g 123 foo
lgroupadd -g 123 bar

Creates two groups, foo and bar, both with gid 123. Some users consider this a bug, especially on the grounds that shadow-utils does not permit duplicate IDs. Duplicate names are already checked.

I guess this should be configurable on some level, e.g. useradd from shadow-utils has a --non-unique flag.


I vaguely remember that two group lines with the same GID were(?) used to work around the limit on maximum line length — readers would combine the two lines.

OTOH that conflicts with shadow-utils not allowing such syntax, and either way libuser does not actually handle duplicate lines consistently with that idea.

I was thinking about a files module option that would permit the duplicates for anyone who would like to have them.

btw this upstream issue is based on RHEL bug where you said you'd like to have the default changed for RHEL-8 :-)

Anyway, there is also a PR now since we're already discussing the issue: https://pagure.io/libuser/pull-request/40

The patch with the option is WIP, but is most probably trivial to finish.

Fixed in 0.64 release

Metadata Update from @thalman:
- Issue status updated to: Closed (was: Open)

a year ago

Login to comment on this ticket.

Metadata