]> 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:36:27 +0000 (17:36 +1000)
pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 0a2c4cc64998d45a4d99447ac5c0a036e68680db..d2f2b6542cdc60bcc5051f847a20e2abd29cee5b 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -296,7 +296,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;
 }
 
@@ -313,7 +313,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;
 }