adduser/passwd: too long username

Laszlo Papp lpapp at kde.org
Tue Aug 5 16:09:08 UTC 2014


To challenge this a bit further for completeness: the other option would be
to limit the username length to 32 or 48 bytes rather than allowing the
whole 128-byte "desktop-range". 256 does look like a bit excessive that
getconf returns:

getconf LOGIN_NAME_MAX
256

I find it hard to achieve in even scripts and console, let alone user
interfaces like small touch screen. Although, that is probably an entirely
UI design area...


On Tue, Aug 5, 2014 at 4:15 PM, Laszlo Papp <lpapp at kde.org> wrote:

> commit 980965767ef3ace983746ee25e92665b87d16755
> Author: Laszlo Papp <lpapp at kde.org>
> Date:   Tue Aug 5 11:42:24 2014 +0100
>
>     Allow 256 bytes long usernames as per Unix standards (usually)
>
> diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
> index 2060d78..9e4424f 100644
> --- a/libpwdgrp/pwd_grp.c
> +++ b/libpwdgrp/pwd_grp.c
> @@ -23,8 +23,8 @@
>  /**********************************************************************/
>  /* Sizes for statically allocated buffers. */
>
> -#define PWD_BUFFER_SIZE 256
> -#define GRP_BUFFER_SIZE 256
> +#define PWD_BUFFER_SIZE 2*LOGIN_NAME_MAX+256
> +#define GRP_BUFFER_SIZE 2*LOGIN_NAME_MAX+256
>
>  /**********************************************************************/
>  /* Prototypes for internal functions. */
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140805/add75126/attachment.html>


More information about the busybox mailing list