sysctl -N shows values instead of names

Resolves: rhbz#2222056
This commit is contained in:
Jan Rybar 2023-08-03 13:45:52 +02:00
parent f3b68adddf
commit bb7dd506fa
2 changed files with 18 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Summary: System and process monitoring utilities Summary: System and process monitoring utilities
Name: procps-ng Name: procps-ng
Version: 3.3.17 Version: 3.3.17
Release: 11%{?dist} Release: 12%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
URL: https://sourceforge.net/projects/procps-ng/ 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 Patch7: pgrep-uid-gid-overflow-backport.patch
Patch8: display-sig-unsafe.patch Patch8: display-sig-unsafe.patch
Patch9: ps-out-of-bonds-read.patch Patch9: ps-out-of-bonds-read.patch
Patch10: sysctl-nameonly-shows-value.patch
BuildRequires: make BuildRequires: make
@ -167,6 +168,10 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%files i18n -f %{name}.lang %files i18n -f %{name}.lang
%changelog %changelog
* Tue Jul 25 2023 Jan Rybar <jrybar@redhat.com> - 3.3.17-12
- sysctl: '-N' option shows values instead of names if '-p'
- Resolves: rhbz#2222056
* Thu Jan 26 2023 Jan Rybar <jrybar@redhat.com> - 3.3.17-11 * Thu Jan 26 2023 Jan Rybar <jrybar@redhat.com> - 3.3.17-11
- version bump requested to create -devel subpkg for CRB inclusion - version bump requested to create -devel subpkg for CRB inclusion
- Resolves: rhbz#2158253 - Resolves: rhbz#2158253

View File

@ -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);