On Tuesday 09 August 2011 05:03, Rich Felker wrote:
> 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?
libbb.h:
#define isalnum(a) bb_ascii_isalnum(a)
static ALWAYS_INLINE int bb_ascii_isalnum(unsigned char a)
{
unsigned char b = a - '0';
if (b <= 9)
return (b <= 9);
b = (a|0x20) - 'a';
return b <= 'z' - 'a';
}
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox