mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-23 01:33:35 +07:00
refactoring
This commit is contained in:
parent
b44e507900
commit
6c2e808b9f
@ -28,8 +28,7 @@ selinux=0
|
|||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
## Allows for disabling the whitelist.
|
## Allows for disabling the whitelist.
|
||||||
for i in /etc/hide-hardware-info.d/*.conf
|
for i in /etc/hide-hardware-info.d/*.conf ; do
|
||||||
do
|
|
||||||
bash -n "${i}"
|
bash -n "${i}"
|
||||||
source "${i}"
|
source "${i}"
|
||||||
done
|
done
|
||||||
@ -63,8 +62,7 @@ create_whitelist() {
|
|||||||
## and /proc/scsi to the root user only. This hides
|
## and /proc/scsi to the root user only. This hides
|
||||||
## many hardware identifiers from ordinary users
|
## many hardware identifiers from ordinary users
|
||||||
## and increases security.
|
## and increases security.
|
||||||
for i in /proc/cpuinfo /proc/bus /proc/scsi /sys
|
for i in /proc/cpuinfo /proc/bus /proc/scsi /sys ; do
|
||||||
do
|
|
||||||
if [ -e "${i}" ]; then
|
if [ -e "${i}" ]; then
|
||||||
if [ "${i}" = "/sys" ]; then
|
if [ "${i}" = "/sys" ]; then
|
||||||
if [ "${sysfs}" = "1" ]; then
|
if [ "${sysfs}" = "1" ]; then
|
||||||
@ -99,8 +97,7 @@ done
|
|||||||
if [ "${sysfs}" = "1" ]; then
|
if [ "${sysfs}" = "1" ]; then
|
||||||
## restrict permissions on everything but
|
## restrict permissions on everything but
|
||||||
## what is needed
|
## what is needed
|
||||||
for i in /sys/* /sys/fs/*
|
for i in /sys/* /sys/fs/* ; do
|
||||||
do
|
|
||||||
## Using '|| true':
|
## Using '|| true':
|
||||||
## https://github.com/Kicksecure/security-misc/pull/108
|
## https://github.com/Kicksecure/security-misc/pull/108
|
||||||
if [ "${sysfs_whitelist}" = "1" ]; then
|
if [ "${sysfs_whitelist}" = "1" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user