blob: 0e89ba0cd49636acfc69cf209f723c10f67cbe0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/bash
#
# SPDX-License-Identifier: LGPL-2.1-only
#
# 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_UNLOAD=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_UNLOAD=1
# Verify that once PSEUDO_UNLOAD has been issued, that
# we can't restore pseudo into memory
uid=`env -i PSEUDO_DISABLED=0 id -u`
gid=`env -i PSEUDO_DISABLED=0 id -g`
if [ $uid -eq 0 -o $gid -eq 0 ]; then
exit 1
fi
exit 0
|