[Pkg-shadow-devel] Bug#364909: useradd: confusion in man page; suggested fix

Nicolas François nicolas.francois at centraliens.net
Wed Apr 26 18:36:51 UTC 2006


Hello,

On Wed, Apr 26, 2006 at 04:10:36PM +0100, Reuben Thomas wrote:
> 
> The man page for useradd says:
> 
>        On Debian, the constraints on the username are lowered:
>        Usernames must neither start by a dash ('-') nor contain a
>        colon (':') or an end of line ('\n'). However, it is
>        usually recommended to only use usernames that begin with a
>        lower case letter or an underscore, and are only followed by
>        lower case letters, underscores, dashes, and dollar signs. In
>        regular expression terms: [a-z_][a-z0-9_-]*[$]
> 
> Problems:
> 
> 1. It's not clear what "lowered" means. Are the restrictions less or
>    greater on Debian? I suggest "loosened" or "tightened"
>    appropriately.
> 
> 2. The regex includes decimal digits, but you don't mention those in
>    the text. The regex also suggests that the user name MUST end with
>    a dollar character. What are you trying to say? That a dollar may
>    appear, but only once and at the end? I suggest i) that you change
>    "followed by lower case letters" to "followed by lower case
>    letters, digits", and ii) that you sort out the regex (I can't
>    since I don't know what you mean!).

Thanks for pointing this.

The [a-z_][a-z0-9_-]*[$] regular expression is what is usually permitted.
On Debian, the restrictions are loosened, and the regular expression of the
valid usernames is [^-:\n][^:\n]*

Maybe This paragraph will be clearer when turned the other way:

        It is usually recommended to only use usernames that begin with
        a lower case letter or an underscore, and are only followed by
        lower case letters, underscores, dashes, and dollar signs. In
        regular expression terms: '[a-z_][a-z0-9_-]*[$]'.
        On Debian, the constraints on the username are loosened: Usernames
        must neither start by a dash ('-') nor contain a colon (':') or an
        end of line ('\n').

Does it look better to you?

Thanks in advance,
-- 
Nekral




More information about the Pkg-shadow-devel mailing list