Merge pull request #100 from 0xC0ncord/bugfix/selinuxfs_restrictions

hide-hardware-info: allow unrestricting selinuxfs
This commit is contained in:
Patrick Schleizer 2021-03-01 14:11:28 +00:00 committed by GitHub
commit 2e8e3c07c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -6,3 +6,6 @@
## Disable the /proc/cpuinfo whitelist.
#cpuinfo_whitelist=0
## Disable selinux mode.
#selinux=0

View File

@ -7,6 +7,7 @@ set -e
sysfs_whitelist=1
cpuinfo_whitelist=1
selinux=1
shopt -s nullglob
@ -76,3 +77,16 @@ do
fi
fi
done
## on SELinux systems, at least /sys/fs/selinux
## must be visible to unprivileged users, else
## SELinux userspace utilities will not function
## properly
if [ -d /sys/fs/selinux ]; then
if [ "${selinux}" = "1" ]; then
chmod o+rx /sys /sys/fs /sys/fs/selinux
echo "INFO: SELinux mode enabled. Restrictions loosened slightly in order to allow userspace utilities to function."
else
echo "INFO: SELinux detected, but SELinux mode is not enabled. Some userspace utilities may not work properly."
fi
fi