* src/gpasswd.c: Fix the support for usernames with arbitrary
length.
This commit is contained in:
parent
6405b58a98
commit
0bd396011a
@ -1,3 +1,8 @@
|
||||
2008-12-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/gpasswd.c: Fix the support for usernames with arbitrary
|
||||
length.
|
||||
|
||||
2008-12-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/groupadd.c, src/groupdel.c, src/groupmod.c: Re-indent.
|
||||
|
@ -211,14 +211,16 @@ static void fail_exit (int status)
|
||||
*/
|
||||
static bool is_valid_user_list (const char *users)
|
||||
{
|
||||
const char *username, *end;
|
||||
char *username, *end;
|
||||
bool is_valid = true;
|
||||
char *tmpusers = xstrdup (users);
|
||||
|
||||
for (username = users;
|
||||
for (username = tmpusers;
|
||||
(NULL != username) && ('\0' != *username);
|
||||
username = end) {
|
||||
end = strchr (username, ',');
|
||||
if (NULL != end) {
|
||||
*end = '\0';
|
||||
end++;
|
||||
}
|
||||
|
||||
@ -233,6 +235,9 @@ static bool is_valid_user_list (const char *users)
|
||||
is_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
free (tmpusers);
|
||||
|
||||
return is_valid;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user