]> granicus.if.org Git - procps-ng/commit
sysctl: print dotted keys again
authorCraig Small <csmall@dropbear.xyz>
Sat, 9 Apr 2022 04:18:28 +0000 (14:18 +1000)
committerCraig Small <csmall@dropbear.xyz>
Sat, 9 Apr 2022 04:18:28 +0000 (14:18 +1000)
commitb159c198c9160a8eb13254e2b631d0035b9b542c
treeffe148b2391b0ea4d8074fbcedcb987b92ac5ebb
parent4fbf8d22a99445bc7b37c6d36ed9e045821439e3
sysctl: print dotted keys again

When the globbing update was put into sysctl, you could no longer
simply use the keys because one key could potentially be
multiple paths once the glob expansion occured.  Using the path
instead gave a unique output.

Except certain programs, such as salt, expected the output to use
the dotted path "kernel.hostname" and not "kernel/hostname".

We can no longer use the original key, so now for each path:
  Copy the path
  strip off /proc/
  convert all / to .

The sysctl testsuite was also updated to check for a few different
types of conversion failures.

References:
 commit 6389deca5bf667f5fab5912acde78ba8e0febbc7
 https://www.freelists.org/post/procps/some-procpsn4400-fixes,4
 https://repo.saltproject.io/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
NEWS
sysctl.c
testsuite/sysctl.test/sysctl_write.exp
testsuite/sysctl_slash_test.conf [new file with mode: 0644]