mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-07-30 09:06:01 +02:00
Fix a bug: when --dont-auditd-by-uid is not set a valid value, it's continues running
This commit is contained in:
parent
a9dc7057ae
commit
6209e876e1
@ -91,9 +91,9 @@ $LONG_SCRIPT_NAME <RUN_MODE> [OPTIONS], where RUN_MODE is one of:
|
|||||||
password strength and robustness;
|
password strength and robustness;
|
||||||
2. Aide reinitializes.
|
2. Aide reinitializes.
|
||||||
|
|
||||||
--dont-auditd-by-uid
|
--dont-auditd-by-uid <1/0>
|
||||||
Auditd rules do not use uid parameter, for all user to auditd. If set 1 will not use uid, else if
|
Auditd rules do not use uid parameter, for all user to auditd. If set 1 will not use uid, else if
|
||||||
set 0 will use uid.
|
set 0 will use uid. Default is 0.
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
|
|
||||||
@ -185,15 +185,19 @@ if [ -z "$CIS_ROOT_DIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# For --dont-auditd-by-uid
|
# For --dont-auditd-by-uid
|
||||||
if [ $DONT_BY_UID_G_CONFIG -ne 127 ]; then
|
if [ -z "$DONT_BY_UID_G_CONFIG" ]; then
|
||||||
if [ $DONT_BY_UID_G_CONFIG -eq 1 ]; then
|
usage
|
||||||
echo "Set dont use uid for auditd rules"
|
else
|
||||||
sed -i 's/^DONT_AUDITD_BY_UID=.*/DONT_AUDITD_BY_UID=1/g' $CIS_ROOT_DIR/etc/hardening.cfg
|
if [ $DONT_BY_UID_G_CONFIG -ne 127 ]; then
|
||||||
else
|
if [ $DONT_BY_UID_G_CONFIG -eq 1 ]; then
|
||||||
echo "Set use uid for auditd rules"
|
echo "Set dont use uid for auditd rules"
|
||||||
sed -i 's/^DONT_AUDITD_BY_UID=.*/DONT_AUDITD_BY_UID=0/g' $CIS_ROOT_DIR/etc/hardening.cfg
|
sed -i 's/^DONT_AUDITD_BY_UID=.*/DONT_AUDITD_BY_UID=1/g' $CIS_ROOT_DIR/etc/hardening.cfg
|
||||||
|
else
|
||||||
|
echo "Set use uid for auditd rules"
|
||||||
|
sed -i 's/^DONT_AUDITD_BY_UID=.*/DONT_AUDITD_BY_UID=0/g' $CIS_ROOT_DIR/etc/hardening.cfg
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -r $CIS_ROOT_DIR/lib/constants.sh ] && . $CIS_ROOT_DIR/lib/constants.sh
|
[ -r $CIS_ROOT_DIR/lib/constants.sh ] && . $CIS_ROOT_DIR/lib/constants.sh
|
||||||
@ -201,8 +205,6 @@ fi
|
|||||||
[ -r $CIS_ROOT_DIR/lib/common.sh ] && . $CIS_ROOT_DIR/lib/common.sh
|
[ -r $CIS_ROOT_DIR/lib/common.sh ] && . $CIS_ROOT_DIR/lib/common.sh
|
||||||
[ -r $CIS_ROOT_DIR/lib/utils.sh ] && . $CIS_ROOT_DIR/lib/utils.sh
|
[ -r $CIS_ROOT_DIR/lib/utils.sh ] && . $CIS_ROOT_DIR/lib/utils.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# For --init
|
# For --init
|
||||||
if [ $INIT_G_CONFIG -eq 1 ]; then
|
if [ $INIT_G_CONFIG -eq 1 ]; then
|
||||||
if [ -r /etc/redhat-release ]; then
|
if [ -r /etc/redhat-release ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user