[Bug 269193] manpage for pw seems unclear for usermod and the use of -n name

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 28 Jan 2023 01:32:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269193

            Bug ID: 269193
           Summary: manpage for pw seems unclear for usermod and the use
                    of -n name
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: dclarke@blastwave.org

The manpage for pw states in a section for "USER OPTIONS" : 

USER OPTIONS
     The following options apply to the useradd and usermod commands:

     [-n] name     Required unless -u uid is given.  Specify the user/account
                   name.  In the case of usermod can be a uid.

     -u uid        Required if name is not given.  Specify the user/account
                   numeric id.  In the case of usermod if paired with name,
                   changes the numeric id of the named user/account.

                   Usually, only one of these options is required, as the
                   account name will imply the uid, or vice versa.  However,
                   there are times when both are needed.  For example, when
                   changing the uid of an existing user with usermod, or
                   overriding the default uid when creating a new account with
                   useradd.  To automatically allocate the uid to a new user
                   with useradd, then do not use the -u option.  Either the
                   account or userid can also be provided immediately after
                   the useradd, userdel, usermod, or usershow keywords on the
                   command line without using the -n or -u options.


Therefore I would think that "pw usermod -n 16411 -s /bin/sh" would be
accepted since "In the case of usermod can be a uid."  However : 

styx# pw usermod -n 16411 -s /bin/sh
pw: no such user `16411'
styx# 

I certainly do not want to change the uid of the user.

The manpage states "-u uid" results in "In the case of usermod if
paired with name, changes the numeric id of the named user/account.
Well I do not want to change the userid number. 

However it seems I need to state the username and not the uid :

styx# pw usermod -n dclarke -s /bin/sh
styx#

Seems unclear to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.