libmisc: minimum id check for system accounts
The minimum id allocation for system accounts shouldn't be 0 as this is reserved for root. Signed-off-by: Tomáš Mráz <tm@t8m.info> Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
parent
ead03afeba
commit
d324c6776b
@ -60,6 +60,13 @@ static int get_ranges (bool sys_group, gid_t *min_id, gid_t *max_id,
|
|||||||
(unsigned long) *max_id);
|
(unsigned long) *max_id);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Zero is reserved for root and the allocation algorithm does not
|
||||||
|
* work right with it.
|
||||||
|
*/
|
||||||
|
if (*min_id == 0) {
|
||||||
|
*min_id = (gid_t) 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Non-system groups */
|
/* Non-system groups */
|
||||||
|
|
||||||
|
@ -60,6 +60,13 @@ static int get_ranges (bool sys_user, uid_t *min_id, uid_t *max_id,
|
|||||||
(unsigned long) *max_id);
|
(unsigned long) *max_id);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Zero is reserved for root and the allocation algorithm does not
|
||||||
|
* work right with it.
|
||||||
|
*/
|
||||||
|
if (*min_id == 0) {
|
||||||
|
*min_id = (uid_t) 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Non-system users */
|
/* Non-system users */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user