From bdd156406a02e575aad6607d454e02626ef2e704 Mon Sep 17 00:00:00 2001 From: jpzhang Date: Thu, 10 Sep 2020 16:56:34 +0800 Subject: [PATCH] Fix the bug of command execution --- 0000-Fix-the-bug-of-command-execution.patch | 63 +++++++++++++++++++++ pcp.spec | 7 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0000-Fix-the-bug-of-command-execution.patch diff --git a/0000-Fix-the-bug-of-command-execution.patch b/0000-Fix-the-bug-of-command-execution.patch new file mode 100644 index 0000000..fcfeb0a --- /dev/null +++ b/0000-Fix-the-bug-of-command-execution.patch @@ -0,0 +1,63 @@ +diff --git a/src/pcp/collectl/pcp-collectl.py b/src/pcp/collectl/pcp-collectl.py +index 3cff1f9..58b8c64 100755 +--- a/src/pcp/collectl/pcp-collectl.py ++++ b/src/pcp/collectl/pcp-collectl.py +@@ -841,7 +841,7 @@ class _Options(object): + opts = pmapi.pmOptions() + opts.pmSetOptionCallback(self.option_callback) + opts.pmSetOverrideCallback(self.override) +- opts.pmSetShortOptions("vp:a:c:f:R:i:s:h:?") ++ opts.pmSetShortOptions("Vvp:a:c:f:R:i:s:h:?") + opts.pmSetLongOptionText("") + opts.pmSetLongOptionText("Interactive: pcp collectl [-h HOST] [options]") + opts.pmSetLongOptionText("Read PCP archive: pcp collectl -a ARCHIVE [options]") +diff --git a/src/pcp/dmcache/pcp-dmcache.py b/src/pcp/dmcache/pcp-dmcache.py +index cd88ed4..29eb0ec 100755 +--- a/src/pcp/dmcache/pcp-dmcache.py ++++ b/src/pcp/dmcache/pcp-dmcache.py +@@ -155,7 +155,7 @@ class DmCachePrinter(pmcc.MetricGroupPrinter): + + if __name__ == '__main__': + try: +- options = pmapi.pmOptions('iR:?') ++ options = pmapi.pmOptions('ViR:?') + options.pmSetShortUsage('[options] [device ...]') + options.pmSetOptionCallback(option) + options.pmSetLongOptionHeader('Options') +diff --git a/src/pmlogconf/pmlogconf.sh b/src/pmlogconf/pmlogconf.sh +index 44f5099..af2bf37 100755 +--- a/src/pmlogconf/pmlogconf.sh ++++ b/src/pmlogconf/pmlogconf.sh +@@ -161,7 +161,7 @@ _split() + $PCP_AWK_PROG <$tmp/ctl ' + BEGIN { out = "'"$tmp/head"'" } + /DO NOT UPDATE THE FILE ABOVE/ { seen = 1 } +-seen == 0 && /^\#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'" ++seen == 0 && /^#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'" + out = "'"$tmp/tail"'" + seen = 1 + next +@@ -180,8 +180,8 @@ _update() + $PCP_AWK_PROG <$tmp/in >$tmp/ctl ' + /DO NOT UPDATE THE FILE ABOVE/ { tail = 1 } + tail == 1 { print; next } +-/^\#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next } +-skip == 1 && /^\#----/ { skip = 0; next } ++/^#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next } ++skip == 1 && /^#----/ { skip = 0; next } + skip == 1 { next } + { print }' + +diff --git a/src/pmprobe/pmprobe.c b/src/pmprobe/pmprobe.c +index dcf1567..d6d7ab5 100644 +--- a/src/pmprobe/pmprobe.c ++++ b/src/pmprobe/pmprobe.c +@@ -63,7 +63,7 @@ overrides(int opt, pmOptions *opts) + + static pmOptions opts = { + .flags = PM_OPTFLAG_STDOUT_TZ, +- .short_options = "a:b:D:efh:IiK:Ln:FO:VvZ:z?", ++ .short_options = "a:b:D:defh:IiK:Ln:FO:VvZ:z?", + .long_options = longopts, + .short_usage = "[options] [metricname ...]", + .override = overrides, diff --git a/pcp.spec b/pcp.spec index e6fa1b2..ca5d415 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 9 +Release: 10 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -17,6 +17,7 @@ Source1: https://github.com/performancecopilot/pcp-webapp-vector/archiv Source2: https://github.com/performancecopilot/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2.tar.gz Source3: https://github.com/performancecopilot/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz Source4: https://github.com/performancecopilot/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz +Patch0000: 0000-Fix-the-bug-of-command-execution.patch Patch6000: CVE-2019-3695-CVE-2019-3696.patch Patch9000: 9000-fix-new-function-not-found-when-Install.patch @@ -860,6 +861,7 @@ This package installs selinux support files for PCP. %setup -q -T -D -a 3 -c -n graphite %setup -q -T -D -a 4 -c -n blinkenlights %setup -q +%patch0000 -p1 %patch6000 -p1 %patch9000 -p1 @@ -2215,6 +2217,9 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Thu Sep 10 2020 zhangjiapeng - 4.1.3-10 +- Fix the bug of command execution + * Fri Aug 28 2020 lingsheng - 4.1.3-9 - Fix .NeedRebuild unfound when removing rpm -- Gitee