ps and username size

walter harms WHarms at bfs.de
Thu Jan 10 14:37:15 UTC 2008



Tito wrote:
>
>> Cheers,
>>
> 
> Isn't there a maximum lenght for usernames on unix/linux?
> Would it make sense to set the width of this field to that value?
> 
> I ask this because on my system (Ubuntu 7.10 - more or less)
> adduser  fails with usernames longer than 32 chars.
> 
> Adding user `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' ...
> Adding new group `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' (1006) ...
> groupadd: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq is not a valid group name
> adduser: `/usr/sbin/groupadd -g 1006 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' returned error code 3. Exiting.
> 
> Just an idea.
> 

an interesting question,
i did a quick web search and found no answer. pw_name is (char *) and the maximum length seems
system dependent.

the important function is putpwent() (or is shadow counterpart) and it seems not to impose any limit.
glibc does a fprintf(stream,"%s ....") -> no limit.

re,
 wh



More information about the busybox mailing list