]> granicus.if.org Git - procps-ng/commitdiff
testsuite: Add test for previous sysctl change
authorCraig Small <csmall@dropbear.xyz>
Tue, 20 Jul 2021 12:45:17 +0000 (22:45 +1000)
committerCraig Small <csmall@dropbear.xyz>
Tue, 20 Jul 2021 12:45:17 +0000 (22:45 +1000)
Add a check for path traversal to sysctl.

References:
 commit f25d462166f80b844d33dad3e4c06088c809a426

Signed-off-by: Craig Small <csmall@dropbear.xyz>
testsuite/sysctl.test/sysctl_read.exp

index aa2368c0366957afc4f6e639b6cf113bb193dd91..84d1742aee89304a70e99987b83a590185b130fd 100644 (file)
@@ -23,3 +23,7 @@ expect_pass "$test" "${hostname}"
 set test "sysctl reading a variable suppress value"
 spawn $sysctl -N kernel.hostname
 expect_pass "$test" "kernel.hostname"
+
+set test "sysctl reading using a path traversal"
+spawn $sysctl /../../etc/passwd
+expect_pass "$test" "sysctl: Path is not under /proc/sys/: /proc/sys//../../etc/passwd"