[Pkg-shadow-devel] Bug#484596: Bug#484596: closed by Nicolas François <nicolas.francois at centraliens.net> (Re: Bug#484596: passwd: usermod fussy about options in an undocumented manner)

Nicolas François nicolas.francois at centraliens.net
Thu Jun 5 10:27:36 UTC 2008


On Thu, Jun 05, 2008 at 09:35:30PM +1200, nwp at nz.lemon-computing.com wrote:
> Debian Bug Tracking System wrote:
> > I did not change the documentation. I find the description of -o quite
> > clear.
> >        -o, --non-unique
> >                  When used with the -u option, this option allows to
> >                  change the user ID to a non-unique value.
> >
> > In 1:4.1.0-1, usermod does not depend on the order of options anymore.
> >   
> 
> 
> That's clear about what happens when you use it along with the -u 
> option, not what happens if you provide it when -u is not present. I'd 
> suggest it should be ignored, as the logic of the -o is maintained that 
> way, and it's not as annoying - I would argue that it is perfectly valid 
> to want to allow duplicate UIDs even when you are not adjusting a UID.
> 
> This makes me wonder - what does usermod do when the UID is duplicated 
> and it is being asked to e.g. change the GECOS field?

I'm not sure I understood the question.

I assume that "when the UID is duplicated" means that you want to change
the UID of an user (specified with her login name), and to change this UID
to an UID already used by another user. And you want at the same time to
change the GECOS field of the specified user (specified by her login
name).

If you do not specify -o, then the command will fail, so I assume you want
to do:
usermod -u <used_UID> -o -c "new GECOS" user_foo

This should do what is specified:
 * change UID of user_foo to <used_UID>
 * change gecos field of user_foo to "new GECOS"

If the question is what happen if two users have the same UID, and you
want to change the UID of one of these users, then there will be no
problems, and only the specified user should be modified.

-- 
Nekral





More information about the Pkg-shadow-devel mailing list