* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
from login.defs. Type constants to long integers.
This commit is contained in:
parent
838f39d0fd
commit
d3abd86df5
@ -1,3 +1,8 @@
|
|||||||
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
|
||||||
|
from login.defs. Type constants to long integers.
|
||||||
|
|
||||||
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* lib/gshadow.c: Use a bool when possible instead of int integers.
|
* lib/gshadow.c: Use a bool when possible instead of int integers.
|
||||||
|
@ -56,12 +56,12 @@ int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid)
|
|||||||
assert (uid != NULL);
|
assert (uid != NULL);
|
||||||
|
|
||||||
if (!sys_user) {
|
if (!sys_user) {
|
||||||
uid_min = getdef_unum ("UID_MIN", 1000);
|
uid_min = getdef_ulong ("UID_MIN", 1000L);
|
||||||
uid_max = getdef_unum ("UID_MAX", 60000);
|
uid_max = getdef_ulong ("UID_MAX", 60000L);
|
||||||
} else {
|
} else {
|
||||||
uid_min = getdef_unum ("SYS_UID_MIN", 1);
|
uid_min = getdef_ulong ("SYS_UID_MIN", 1L);
|
||||||
uid_max = getdef_unum ("UID_MIN", 1000) - 1;
|
uid_max = getdef_ulong ("UID_MIN", 1000L) - 1;
|
||||||
uid_max = getdef_unum ("SYS_UID_MAX", uid_max);
|
uid_max = getdef_ulong ("SYS_UID_MAX", (unsigned long) uid_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (NULL != preferred_uid)
|
if ( (NULL != preferred_uid)
|
||||||
@ -139,12 +139,12 @@ int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid)
|
|||||||
assert (gid != NULL);
|
assert (gid != NULL);
|
||||||
|
|
||||||
if (!sys_group) {
|
if (!sys_group) {
|
||||||
gid_min = getdef_unum ("GID_MIN", 1000);
|
gid_min = getdef_ulong ("GID_MIN", 1000L);
|
||||||
gid_max = getdef_unum ("GID_MAX", 60000);
|
gid_max = getdef_ulong ("GID_MAX", 60000L);
|
||||||
} else {
|
} else {
|
||||||
gid_min = getdef_unum ("SYS_GID_MIN", 1);
|
gid_min = getdef_ulong ("SYS_GID_MIN", 1L);
|
||||||
gid_max = getdef_unum ("GID_MIN", 1000) - 1;
|
gid_max = getdef_ulong ("GID_MIN", 1000L) - 1;
|
||||||
gid_max = getdef_unum ("SYS_GID_MAX", gid_max);
|
gid_max = getdef_ulong ("SYS_GID_MAX", (unsigned long) gid_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (NULL != preferred_gid)
|
if ( (NULL != preferred_gid)
|
||||||
|
Loading…
Reference in New Issue
Block a user