On Tuesday 14 August 2012 19:27:33 Dmitry Golubovsky wrote:
> Hi,
> 
> There is currently in loginutils/login.c, line 37
> 
> enum {
>         TIMEOUT = 60,
>         EMPTY_USERNAME_COUNT = 10,
>         USERNAME_SIZE = 32,
>         TTYNAME_SIZE = 32,
> };
> 
> May I suggest increase USERNAME_SIZE to 256 at least? I may send a
> patch, or due to trivial nature of the change someone of the
> maintainers could just do it.
> 
> My rationale is: if I want to use busybox login together with PAM
> involving authentication against some remote host or domain 32
> characters may be just insufficient to hold something like
> [email protected] (already 36 characters).
> 
> Where did the 32 char limit come from?
> 
> Thanks.
> 
> 

Hi,

The Single UNIX ® Specification, Version 2
#include <limits.h>
LOGIN_NAME_MAX
    Maximum length of a login name. Minimum Acceptable Value: 
_POSIX_LOGIN_NAME_MAX 
_POSIX_LOGIN_NAME_MAX
    The size of the storage required for a login name, in bytes, including the 
terminating null. Value: 9 


SYSCONF(3)                            Linux Programmer's Manual                 
          SYSCONF(3)

NAME
       sysconf - Get configuration information at runtime

SYNOPSIS
       #include <unistd.h>

       long sysconf(int name);
  POSIX.1 Variables
  LOGIN_NAME_MAX - _SC_LOGIN_NAME_MAX
              Maximum length of a login name, including the terminating null 
byte.  Must not be less
              than _POSIX_LOGIN_NAME_MAX (9).


man useradd(1) references a limit of 32 characters:

" You may not add a user to a NIS or LDAP group. This must be performed on the 
corresponding
       server.

       Similarly, if the username already exists in an external user database 
such as NIS or LDAP,
       useradd will deny the user account creation request.

       It is usually recommended to only use usernames that begin with a lower 
case letter or an
       underscore, followed by lower case letters, digits, underscores, or 
dashes. They can end with
       a dollar sign. In regular expression terms: [a-z_][a-z0-9_-]*[$]?

       On Debian, the only constraints are that usernames must neither start 
with a dash ('-') nor
       contain a colon (':') or a whitespace (space: ' ', end of line: '\n', 
tabulation: '\t',
       etc.). Note that using a slash ('/') may break the default algorithm for 
the definition of
       the user's home directory.

       Usernames may only be up to 32 characters long."


Ciao,
Tito
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to