]> granicus.if.org Git - procps-ng/commit
pgrep: check sanity of SC_ARG_MAX
authorCraig Small <csmall@dropbear.xyz>
Sun, 5 Jan 2020 04:05:55 +0000 (15:05 +1100)
committerCraig Small <csmall@dropbear.xyz>
Sun, 5 Jan 2020 04:05:55 +0000 (15:05 +1100)
commitbb96fc42956c9ed926a1b958ab715f8b4a663dec
tree2e1f4e26c6e3bf6851492f9954cb6b0c0d6e82ab
parent59c88e18f29000ceaf7e5f98181b07be443cf12f
pgrep: check sanity of SC_ARG_MAX

A kernel change means we cannot trust what sysconf(SC_ARG_MAX)
returns. We clamp it so its more than 4096 and less than 128*1024
which is what findutils does.

References:
 procps-ng/procps#152
 https://git.savannah.gnu.org/cgit/findutils.git/tree/lib/buildcmd.c#n535
 https://lwn.net/Articles/727862/
pgrep.c