From d3abd86df5815195e7ba3d219b3ffe57490163ce Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Fri, 13 Jun 2008 21:49:57 +0000 Subject: [PATCH] * libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs from login.defs. Type constants to long integers. --- ChangeLog | 5 +++++ libmisc/find_new_ids.c | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3071c0f6..d43d45ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-13 Nicolas François + + * 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 * lib/gshadow.c: Use a bool when possible instead of int integers. diff --git a/libmisc/find_new_ids.c b/libmisc/find_new_ids.c index 523862c8..3e7ed905 100644 --- a/libmisc/find_new_ids.c +++ b/libmisc/find_new_ids.c @@ -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)