aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-pseudo_disable-fork-env_i.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-pseudo_disable-fork-env_i.sh')
-rwxr-xr-xtest/test-pseudo_disable-fork-env_i.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test-pseudo_disable-fork-env_i.sh b/test/test-pseudo_disable-fork-env_i.sh
new file mode 100755
index 0000000..1e679aa
--- /dev/null
+++ b/test/test-pseudo_disable-fork-env_i.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Verify normal operation...
+uid=`env -i id -u`
+gid=`env -i id -g`
+if [ $uid -ne 0 -o $gid -ne 0 ]; then
+ exit 1
+fi
+
+export PSEUDO_DISABLED=1
+# Verify we dropped OUT of pseudo control, even with env -i
+# This checks that env -i replacement functionality still works
+# as expected
+uid=`env -i id -u`
+gid=`env -i id -g`
+if [ $uid -eq 0 -o $gid -eq 0 ]; then
+ exit 1
+fi
+
+export PSEUDO_DISABLED=1
+# Verify we can change PSEUDO_DISABLED, even with env -i
+# This checks that env -i replacement functionality still works
+# as expected
+uid=`env -i PSEUDO_DISABLED=0 id -u`
+gid=`env -i PSEUDO_DISABLED=0 id -g`
+if [ $uid -ne 0 -o $gid -ne 0 ]; then
+ exit 1
+fi
+
+exit 0