* library: add support for accessing autogroups
* pkill: Check for lt- variants of program name issue #192
* pgrep: Add newline after regex error message merge #91
+ * pgrep: Fix selection where uid/gid > 2^31 merge !146
* ps: Add OOM and OOMADJ fields issue #198
* ps: Add IO Accounting fields issue #184
* ps: Add PSS and USS fields issue #112
for ( ; *str; ++str) {
if (! isdigit (*str))
- return (0);
+ return 0;
+ if (res >= LONG_MAX / 10)
+ return 0;
res *= 10;
+ if (res >= LONG_MAX - (*str - '0'))
+ return 0;
res += *str - '0';
}
*value = sign * res;
xwarnx(_("invalid user name: %s"), name);
return 0;
}
- e->num = (int) pwd->pw_uid;
+ e->num = pwd->pw_uid;
return 1;
}
xwarnx(_("invalid group name: %s"), name);
return 0;
}
- e->num = (int) grp->gr_gid;
+ e->num = grp->gr_gid;
return 1;
}
session, // stat session id
nlwp, // stat,status number of threads, or 0 if no clue
tgid, // (special) thread group ID, the POSIX PID (see also: tid)
- tty, // stat full device number of controlling terminal
+ tty; // stat full device number of controlling terminal
/* FIXME: int uids & gids should be uid_t or gid_t from pwd.h */
- euid, egid, // stat(),status effective
- ruid, rgid, // status real
- suid, sgid, // status saved
- fuid, fgid, // status fs (used for file access only)
+ uid_t euid; gid_t egid; // stat(),status effective
+ uid_t ruid; gid_t rgid; // status real
+ uid_t suid; gid_t sgid; // status saved
+ uid_t fuid; gid_t fgid; // status fs (used for file access only)
+ int
tpgid, // stat terminal process group id
exit_signal, // stat might not be SIGCHLD
processor; // stat current (or most recent?) CPU