[Adduser-devel] Bug#408148: adduser: Wrong failure message on invalid group name.

Joerg Hoh joerg at joerghoh.de
Wed Jun 27 21:24:16 UTC 2007


On Dienstag 23 Januar 2007, you wrote:
> Package: adduser
> Version: 3.63
> Severity: normal
>
> I can not explain how the following can happen:
>
> root at ampere:/var/lib/cvs# addgroup 'a:a'
> addgroup: To avoid problems, the username should consist of
> letters, digits, underscores, periods and dashes. For compatibility with
> Samba machine accounts $ is also supported at the end of the username
> root at ampere:/var/lib/cvs# addgroup 'a_a'
> addgroup: Please enter a username matching the regular expression
> configured
> via the name_regex configuration variable.  Use the `--force-badname'
> option to relax this check or reconfigure name_regex.
> root at ampere:/var/lib/cvs#
>
> The first message tells me that the second call of addgroup should work,
> but it does not. The more strange is that it the error message the
> second time is different. And it also mention name_regex that is nowhere
> to be found (I did not digged at the source code to find out...). Also,
> I could not find any documentation on valid group names. Only at
> adduser.conf(5) I found USER_REGEX that configures user names (not group
> names).

This is rather simple:

addgroup 'a:a' is rejected by a hardcoded regex in adduser; this regular 
expression enforces the conformity to IEEE Std 1003.1-2001; this regular 
expression rejects the ":".

addgroup 'a_a' is accepted the above mentioned regular expression but rejected 
by the expression "name_regex" (because of the "_" character) which can be 
customized in /etc/adduser.conf (NAME_REGEX, see man 5 adduser.conf).

I documented in adduser.conf (5) that NAME_REGEX also applies to group names 
and added the commented out default value to adduser.conf.  Also added a 
paragraph to the manpage describing what a valid name is.

Jörg

-- 
What did you do to the cat? It looks half-dead. -Schroedinger's wife
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20070627/1d908b19/attachment.pgp 


More information about the Adduser-devel mailing list