* 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:
nekral-guest 2008-06-13 21:49:57 +00:00
parent 838f39d0fd
commit d3abd86df5
2 changed files with 15 additions and 10 deletions

View File

@ -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>
* lib/gshadow.c: Use a bool when possible instead of int integers.

View File

@ -56,12 +56,12 @@ int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid)
assert (uid != NULL);
if (!sys_user) {
uid_min = getdef_unum ("UID_MIN", 1000);
uid_max = getdef_unum ("UID_MAX", 60000);
uid_min = getdef_ulong ("UID_MIN", 1000L);
uid_max = getdef_ulong ("UID_MAX", 60000L);
} else {
uid_min = getdef_unum ("SYS_UID_MIN", 1);
uid_max = getdef_unum ("UID_MIN", 1000) - 1;
uid_max = getdef_unum ("SYS_UID_MAX", uid_max);
uid_min = getdef_ulong ("SYS_UID_MIN", 1L);
uid_max = getdef_ulong ("UID_MIN", 1000L) - 1;
uid_max = getdef_ulong ("SYS_UID_MAX", (unsigned long) uid_max);
}
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);
if (!sys_group) {
gid_min = getdef_unum ("GID_MIN", 1000);
gid_max = getdef_unum ("GID_MAX", 60000);
gid_min = getdef_ulong ("GID_MIN", 1000L);
gid_max = getdef_ulong ("GID_MAX", 60000L);
} else {
gid_min = getdef_unum ("SYS_GID_MIN", 1);
gid_max = getdef_unum ("GID_MIN", 1000) - 1;
gid_max = getdef_unum ("SYS_GID_MAX", gid_max);
gid_min = getdef_ulong ("SYS_GID_MIN", 1L);
gid_max = getdef_ulong ("GID_MIN", 1000L) - 1;
gid_max = getdef_ulong ("SYS_GID_MAX", (unsigned long) gid_max);
}
if ( (NULL != preferred_gid)