]> granicus.if.org Git - procps-ng/commitdiff
pgrep: Remove >15 warning
authorCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 22:14:06 +0000 (08:14 +1000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 22:14:06 +0000 (08:14 +1000)
As comm length can be longer than 15 characters with newer kernels, it
doesn't make sense to have a warning when you make the match string
longer than this.

As a side-effect, it removes the false-positive you got when you used
long regex matches (see issue #92 )

References:
 commit 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
 procps-ng/procps#92

NEWS
pgrep.c

diff --git a/NEWS b/NEWS
index 0483f270a664956c79e3b5374b918f0e65a32faa..70f2b455a27fce89e77ba5906cada354fd56174b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ procps-ng-3.3.15
     No removals, no new functions
     Changes: slab and pid structures
   * pgrep: Fix stack-based buffer overflow                 CVE-2018-1125
+  * pgrep: Remove >15 warning as comm can be longer        issue #92
   * ps: Fix buffer overflow in output buffer, causing DOS  CVE-2018-1123
   * library: Just check for SIGLOST and don't delete it    issue #93
   * library: Fix integer overflow and LPE in file2strvec   CVE-2018-1124
diff --git a/pgrep.c b/pgrep.c
index 65a7a7d28a330ec16bf1e62b6fd99838b42c0d0d..715e5cfbfdee5de87f93838af1743017f1275dcc 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -653,10 +653,6 @@ static struct el * select_procs (int *num)
        closeproc (ptp);
        *num = matches;
 
-       if ((!matches) && (!opt_full) && opt_pattern && (strlen(opt_pattern) > 15))
-               xwarnx(_("pattern that searches for process name longer than 15 characters will result in zero matches\n"
-                                "Try `%s -f' option to match against the complete command line."),
-                                program_invocation_short_name);
        return list;
 }