Skip to content

Commit ac2ae9e

Browse files
authored
Merge pull request #473 from ldorau/Check_if_sudo_requires_password_in_the_ipc_os_prov_test
Check if sudo requires password in the ipc_os_prov test
2 parents 4865d89 + 59fc552 commit ac2ae9e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install apt packages
3535
run: |
3636
apt-get update
37-
apt-get install -y libnuma-dev libjemalloc-dev libtbb-dev libhwloc-dev
37+
apt-get install -y libnuma-dev libjemalloc-dev libtbb-dev libhwloc-dev sudo
3838
3939
- name: Configure build
4040
run: >

.github/workflows/sanitizers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install apt packages
3333
run: |
3434
apt-get update
35-
apt-get install -y cmake libnuma-dev libjemalloc-dev libtbb-dev libhwloc-dev
35+
apt-get install -y cmake libnuma-dev libjemalloc-dev libtbb-dev libhwloc-dev sudo
3636
3737
- name: Configure build
3838
run: >

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)