* NEWS, src/grpck.c, src/pwck.c: Issue a warning if an ID is set
to -1.
This commit is contained in:
10
src/grpck.c
10
src/grpck.c
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2008, Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -542,6 +542,14 @@ static void check_grp_file (int *errors, bool *changed)
|
||||
printf (_("invalid group name '%s'\n"), grp->gr_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for invalid user ID.
|
||||
*/
|
||||
if (grp->gr_gid == (gid_t)-1) {
|
||||
printf (_("invalid user ID '%lu'\n"), grp->gr_gid);
|
||||
*errors += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround for a NYS libc 5.3.12 bug on RedHat 4.2 -
|
||||
* groups with no members are returned as groups with one
|
||||
|
10
src/pwck.c
10
src/pwck.c
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
|
||||
* Copyright (c) 2001 , Michał Moskal
|
||||
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
|
||||
* Copyright (c) 2007 - 2008, Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -395,6 +395,14 @@ static void check_pw_file (int *errors, bool *changed)
|
||||
*errors += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for invalid user ID.
|
||||
*/
|
||||
if (pwd->pw_uid == (uid_t)-1) {
|
||||
printf (_("invalid user ID '%lu'\n"), pwd->pw_uid);
|
||||
*errors += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure the primary group exists
|
||||
*/
|
||||
|
Reference in New Issue
Block a user