+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.
*/
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++;
}
is_valid = false;
}
}
+
+ free (tmpusers);
+
return is_valid;
}