From bb7dd506fa9bd49cdad18ea7d34ba919087d328b Mon Sep 17 00:00:00 2001 From: Jan Rybar Date: Thu, 3 Aug 2023 13:45:52 +0200 Subject: [PATCH] sysctl -N shows values instead of names Resolves: rhbz#2222056 --- procps-ng.spec | 7 ++++++- sysctl-nameonly-shows-value.patch | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 sysctl-nameonly-shows-value.patch diff --git a/procps-ng.spec b/procps-ng.spec index 26f5efd..9e1e433 100644 --- a/procps-ng.spec +++ b/procps-ng.spec @@ -4,7 +4,7 @@ Summary: System and process monitoring utilities Name: procps-ng Version: 3.3.17 -Release: 11%{?dist} +Release: 12%{?dist} License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ URL: https://sourceforge.net/projects/procps-ng/ @@ -24,6 +24,7 @@ Patch6: sysctl-print-dotted-keys-again.patch Patch7: pgrep-uid-gid-overflow-backport.patch Patch8: display-sig-unsafe.patch Patch9: ps-out-of-bonds-read.patch +Patch10: sysctl-nameonly-shows-value.patch BuildRequires: make @@ -167,6 +168,10 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof %files i18n -f %{name}.lang %changelog +* Tue Jul 25 2023 Jan Rybar - 3.3.17-12 +- sysctl: '-N' option shows values instead of names if '-p' +- Resolves: rhbz#2222056 + * Thu Jan 26 2023 Jan Rybar - 3.3.17-11 - version bump requested to create -devel subpkg for CRB inclusion - Resolves: rhbz#2158253 diff --git a/sysctl-nameonly-shows-value.patch b/sysctl-nameonly-shows-value.patch new file mode 100644 index 0000000..bc26482 --- /dev/null +++ b/sysctl-nameonly-shows-value.patch @@ -0,0 +1,12 @@ +diff -up ./sysctl.c.old ./sysctl.c +--- ./sysctl.c.old 2023-07-20 14:43:10.271856721 +0200 ++++ ./sysctl.c 2023-07-21 14:50:39.792368077 +0200 +@@ -578,7 +578,7 @@ static int WriteSetting( + } + if ((rc == EXIT_SUCCESS && !Quiet) || DryRun) { + if (NameOnly) { +- printf("%s\n", value); ++ printf("%s\n", dotted_key); + } else { + if (PrintName) { + printf("%s = %s\n", dotted_key, value);