]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/get_subid_owners.c: Use uid_t for holding UIDs (and GIDs)
authorAlejandro Colomar <alx@kernel.org>
Sat, 29 Jun 2024 17:35:14 +0000 (19:35 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sat, 29 Jun 2024 18:00:18 +0000 (20:00 +0200)
Suggested-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/get_subid_owners.c

index 9fe07b62182325517abf62a6b87afd7e0bd0b8e0..1200bcb06b788d1828bc977a3a15156439f3e246 100644 (file)
@@ -24,7 +24,7 @@ static void usage(void)
 int main(int argc, char *argv[])
 {
        int    i, n;
-       long   l;
+       uid_t  u;
        uid_t  *uids;
 
        log_set_progname(Prog);
@@ -33,13 +33,13 @@ int main(int argc, char *argv[])
                usage();
        }
        if (argc == 3 && strcmp(argv[1], "-g") == 0) {
-               str2sl(&l, argv[2]);
-               n = subid_get_gid_owners(l, &uids);
+               str2i(uid_t, &u, argv[2]);
+               n = subid_get_gid_owners(u, &uids);
        } else if (argc == 2 && strcmp(argv[1], "-h") == 0) {
                usage();
        } else {
-               str2sl(&l, argv[1]);
-               n = subid_get_uid_owners(l, &uids);
+               str2i(uid_t, &u, argv[1]);
+               n = subid_get_uid_owners(u, &uids);
        }
        if (n < 0) {
                fprintf(stderr, "No owners found\n");