* NEWS, src/gpasswd.c: Added support usernames with arbitrary
length.
This commit is contained in:
parent
66cb5b33ad
commit
a438c2f184
@ -1,3 +1,8 @@
|
|||||||
|
2008-12-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* NEWS, src/gpasswd.c: Added support usernames with arbitrary
|
||||||
|
length.
|
||||||
|
|
||||||
2008-11-27 Mike Frysinger <vapier@gentoo.org>
|
2008-11-27 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* configure.in: Fix the "$enable_acct_tools_setuid" = "yes" test.
|
* configure.in: Fix the "$enable_acct_tools_setuid" = "yes" test.
|
||||||
|
1
NEWS
1
NEWS
@ -32,6 +32,7 @@ shadow-4.1.2.2 -> shadow-4.1.3 UNRELEASED
|
|||||||
* Added support for long options --add (-a), --delete (-d),
|
* Added support for long options --add (-a), --delete (-d),
|
||||||
--remove-password (-r), --restrict (-R), --administrators (-A), and
|
--remove-password (-r), --restrict (-R), --administrators (-A), and
|
||||||
--members (-M).
|
--members (-M).
|
||||||
|
* Added support for usernames with arbitrary length.
|
||||||
- groupadd
|
- groupadd
|
||||||
* audit logging improvements.
|
* audit logging improvements.
|
||||||
* Speedup (see "addition of users or groups" above).
|
* Speedup (see "addition of users or groups" above).
|
||||||
|
@ -211,26 +211,17 @@ static void fail_exit (int status)
|
|||||||
*/
|
*/
|
||||||
static bool is_valid_user_list (const char *users)
|
static bool is_valid_user_list (const char *users)
|
||||||
{
|
{
|
||||||
const char *start, *end;
|
const char *username, *end;
|
||||||
char username[32];
|
|
||||||
bool is_valid = true;
|
bool is_valid = true;
|
||||||
size_t len;
|
|
||||||
|
|
||||||
for (start = users; (NULL != start) && ('\0' != *start); start = end) {
|
for (username = users;
|
||||||
end = strchr (start, ',');
|
(NULL != username) && ('\0' != *username);
|
||||||
|
username = end) {
|
||||||
|
end = strchr (username, ',');
|
||||||
if (NULL != end) {
|
if (NULL != end) {
|
||||||
len = (size_t) (end - start);
|
|
||||||
end++;
|
end++;
|
||||||
} else {
|
|
||||||
len = strlen (start);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > sizeof (username) - 1) {
|
|
||||||
len = sizeof (username) - 1;
|
|
||||||
}
|
|
||||||
strncpy (username, start, len);
|
|
||||||
username[len] = '\0';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This user must exist.
|
* This user must exist.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user