Skip to content

Commit 2b45982

Browse files
committed
Check if sudo requires password in the ipc_os_prov test
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent 4865d89 commit 2b45982

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/ipc_os_prov.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ VAL=0
2020
if [ -f $PTRACE_SCOPE_FILE ]; then
2121
PTRACE_SCOPE_VAL=$(cat $PTRACE_SCOPE_FILE)
2222
if [ $PTRACE_SCOPE_VAL -ne $VAL ]; then
23+
# check if sudo requires password
24+
if ! timeout --kill-after=5s 3s sudo date; then
25+
echo "ERROR: sudo requires password - cannot set ptrace_scope to 0"
26+
exit 1
27+
fi
2328
echo "Setting ptrace_scope to 0 (classic ptrace permissions) ..."
2429
echo "$ sudo bash -c \"echo $VAL > $PTRACE_SCOPE_FILE\""
2530
sudo bash -c "echo $VAL > $PTRACE_SCOPE_FILE"

0 commit comments

Comments
 (0)