]> granicus.if.org Git - procps-ng/commitdiff
Fix user and group name to number conversion for uid/gid above 2^31.
authorTodd Lewis <utoddl@gmail.com>
Mon, 29 Oct 2018 18:33:48 +0000 (18:33 +0000)
committerCraig Small <csmall@dropbear.xyz>
Fri, 24 Apr 2020 07:28:42 +0000 (17:28 +1000)
pgrep.c

diff --git a/pgrep.c b/pgrep.c
index bde7448771a52121e95fcb7c0a02f07b39156289..8b82a542221b92131bb484687d998057c8a9b10e 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -280,7 +280,7 @@ static int conv_uid (const char *restrict name, struct el *restrict e)
                xwarnx(_("invalid user name: %s"), name);
                return 0;
        }
-       e->num = pwd->pw_uid;
+       e->num = (int) pwd->pw_uid;
        return 1;
 }
 
@@ -297,7 +297,7 @@ static int conv_gid (const char *restrict name, struct el *restrict e)
                xwarnx(_("invalid group name: %s"), name);
                return 0;
        }
-       e->num = grp->gr_gid;
+       e->num = (int) grp->gr_gid;
        return 1;
 }