> Hi,
> Could  this be more acceptable. Could be improved by removing
> the double strlen also the error message could be better.
> Just to see if I overlooked something obvious.
> 
> Ciao,
> Tito
> 
> void FAST_FUNC die_if_bad_username(const char *name)
> {
>       /* Enforce length limits on usernames. 
>        * LOGIN_NAME_MAX: Maximum length of a login name,
>        * including the terminating null byte.
>        * Must not be less than _POSIX_LOGIN_NAME_MAX (9).
>        */
>       if (!name 
>        || strlen(name) + 1 > sysconf(_SC_LOGIN_NAME_MAX)
>        || strlen(name) + 1 < _POSIX_LOGIN_NAME_MAX

That is no minimum, it's a minimum of the maximum. Consider names like
"root", "lp".

- Lauri

-- 
http://www.fastmail.fm - Does exactly what it says on the tin

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

Reply via email to