]> granicus.if.org Git - procps-ng/commitdiff
testsuite: Add sysctl test for directory checks
authorCraig Small <csmall@dropbear.xyz>
Wed, 15 Sep 2021 10:16:06 +0000 (20:16 +1000)
committerCraig Small <csmall@dropbear.xyz>
Wed, 15 Sep 2021 10:16:06 +0000 (20:16 +1000)
Adds a test to try to write a sysctl parameter above /proc
and passes if it gives an error message.

References:
 commit f25d462166f80b844d33dad3e4c06088c809a426

testsuite/sysctl.test/sysctl_write.exp

index 5a74decdead723c564a0e188b255d81f242f745a..bf0923f42cdfdf7dc936a83543554a45ddc0847c 100644 (file)
@@ -27,3 +27,7 @@ if {[file exists ${hostname_file}]} {
 } else {
   unsupported "sysctl write: hostname file doe not exist"
 }
+
+set test "sysctl write above /proc"
+spawn $sysctl /../../../etc=1
+expect_pass "$test" "sysctl: Path is not under /proc/sys/: /proc/sys//../../../etc"