adduser/useradd can be called without a -g or --gid option,
and this results in an automatically created group (done by
useradd.real) with the same groupname as username and as well
the same gid as user id.
This patch also add a check to verified that if such a call happens
then the provided ids.tables must have gid == uid for that user. If
not the useradd fails with a KeyError and with an explanation message.
adduser/useradd can be called without a -g or --gid option, and this results in an automatically created group (done by useradd.real) with the same groupname as username and as well the same gid as user id.
This patch also add a check to verified that if such a call happens then the provided ids.tables must have gid == uid for that user. If not the useradd fails with a KeyError and with an explanation message.