From: Craig Small Date: Tue, 20 Jul 2021 12:45:17 +0000 (+1000) Subject: testsuite: Add test for previous sysctl change X-Git-Tag: v4.0.0~169 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db4455cfc9e5ee98d4e55efc3e5635ae6c7f9975;p=procps-ng testsuite: Add test for previous sysctl change Add a check for path traversal to sysctl. References: commit f25d462166f80b844d33dad3e4c06088c809a426 Signed-off-by: Craig Small --- diff --git a/testsuite/sysctl.test/sysctl_read.exp b/testsuite/sysctl.test/sysctl_read.exp index aa2368c0..84d1742a 100644 --- a/testsuite/sysctl.test/sysctl_read.exp +++ b/testsuite/sysctl.test/sysctl_read.exp @@ -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"