]> granicus.if.org Git - shadow/commitdiff
* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:49:57 +0000 (21:49 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:49:57 +0000 (21:49 +0000)
from login.defs. Type constants to long integers.

ChangeLog
libmisc/find_new_ids.c

index 3071c0f6eb049b997d6b380d72aa8081c41ad633..d43d45adb10e11c01f01cd822e3f390b7257cc8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 523862c81584887ae76718de94ecb81e2883091d..3e7ed905db3427c46c44e67e74cc77155713b89e 100644 (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)