Re: [Cpu-users] fix for bug #729512 (cpu useradd/groupadd failes for uid/gid containing dashes)
Brought to you by:
matheny
From: Blake M. <bma...@pu...> - 2003-04-29 23:19:05
|
Hello Paul, I looked at the posix specs, and according to them the character class [A-Za-z0-9._-] is legal for a username, and the hyphen should not be the first character of the username. I have fixed this in CVS. Thanks. -Blake Paul Stevens wrote: > > Blake, > > I would propose a small fix that will close bug #729512 as I've > submitted today. > > I think dashes and numericals are perfectly valid in usernames and > groupnames since they are valid in passwd as well. > > I'm not much of a c-coder, though. > > > > > > > ------------------------------------------------------------------------ > > Index: src/plugins/ldap/commandline.c > =================================================================== > RCS file: /cvsroot/cpu/cpu/src/plugins/ldap/commandline.c,v > retrieving revision 1.7 > diff -u -r1.7 commandline.c > --- src/plugins/ldap/commandline.c 25 Apr 2003 20:51:45 -0000 1.7 > +++ src/plugins/ldap/commandline.c 29 Apr 2003 12:56:11 -0000 > @@ -342,7 +342,7 @@ > string */ > for ( k = 0; k < strlen(argv[optind+1]); k++ ) > { > - if ( !isalpha(argv[optind+1][k]) ) > + if ( !isalnum(argv[optind+1][k]) && !ispunct(argv[optind+1][k]) ) > { > CTEST(); > printHelp(operation); |