[PATCH] improve checks on usernames V3.

Rich Felker dalias at aerifal.cx
Tue Aug 9 03:03:24 UTC 2011


On Tue, Aug 09, 2011 at 02:40:37AM +0200, Denys Vlasenko wrote:
> On Monday 01 August 2011 22:01, Tito wrote:
> > Hi,
> > this patch improves the checks performed on usernames 
> > with the die_if_bad_username() function by adduser and addgroup.
> > The changes are:
> > 1) better comments;
> > 2) use of the portable filename character set plus '@' and '$';
> > 3) don't use isalnum as it  will allow non-ASCII letters in legacy 8-bit locales as pointed out by Rich Felker;
> 
> We use ASCII-only isalnum throughout bbox anyway. But ok.

Do you mean you have a special isalnum for ASCII-only, or you assume
the system isalnum is ASCII-only? The latter is only true if you don't
call setlocale, and even then the system isalnum is going to be a lot
more bloated than a custom ASCII-only one.

Rich


More information about the busybox mailing list