Rename function name for human and modify associated file.

This commit is contained in:
Samson-W 2018-11-06 04:31:36 +08:00
parent 2fa1dd1287
commit e0265d7517
3 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ audit () {
does_pattern_exist_in_file $FILE $PATTERN
if [ $FNRET = 0 ]; then
ok "$PATTERN is present in $FILE"
check_password_option_by_pam $KEYWORD $OPTIONNAME $FILE
check_no_param_option_by_pam $KEYWORD $OPTIONNAME $FILE
if [ $FNRET = 0 ]; then
ok "$OPTIONNAME is already configured"
else

View File

@ -31,7 +31,7 @@ audit () {
does_pattern_exist_in_file $FILE $PATTERN
if [ $FNRET = 0 ]; then
ok "$PATTERN is present in $FILE"
check_password_option_by_pam $KEYWORD $OPTIONNAME $FILE
check_no_param_option_by_pam $KEYWORD $OPTIONNAME $FILE
if [ $FNRET = 0 ]; then
ok "$OPTIONNAME is already configured"
else

View File

@ -494,7 +494,7 @@ check_param_pair_by_pam()
}
# Only check option name
check_password_option_by_pam()
check_no_param_option_by_pam()
{
KEYWORD=$1
OPTION=$2
@ -554,7 +554,7 @@ add_option_to_session_check()
# For example :
# password requisite pam_cracklib.so minlen=8 difok=3
# password requisite pam_cracklib.so minlen=8 difok=3 retry=3
sed -ie "s;\(^session.*$KEYWORD.*\);\1 $OPTIONSTR;" $PAMPWDFILE
sed -i "s;\(^session.*$KEYWORD.*\);\1 $OPTIONSTR;" $PAMPWDFILE
}
@ -573,7 +573,7 @@ add_option_to_auth_check()
# For example :
# password requisite pam_cracklib.so minlen=8 difok=3
# password requisite pam_cracklib.so minlen=8 difok=3 retry=3
sed -ie "s;\(^auth.*$KEYWORD.*\);\1 $OPTIONSTR;" $PAMPWDFILE
sed -i "s;\(^auth.*$KEYWORD.*\);\1 $OPTIONSTR;" $PAMPWDFILE
}
# Reset password check option value when option is not set a correct value
@ -593,7 +593,7 @@ reset_option_to_password_check()
# For example :
# password requisite pam_cracklib.so minlen=8 difok=3 retry=1
# password requisite pam_cracklib.so minlen=8 difok=3 retry=3
sed -ie "s/${OPTIONNAME}=./${OPTIONNAME}=${OPTIONVAL}/" $PAMPWDFILE
sed -i "s/${OPTIONNAME}=./${OPTIONNAME}=${OPTIONVAL}/" $PAMPWDFILE
}
# Reset auth check option value when option is not set a correct value
@ -613,7 +613,7 @@ reset_option_to_auth_check()
# For example :
# password requisite pam_cracklib.so minlen=8 difok=3 retry=1
# password requisite pam_cracklib.so minlen=8 difok=3 retry=3
sed -ie "s/${OPTIONNAME}=.*/${OPTIONNAME}=${OPTIONVAL}/" $PAMPWDFILE
sed -i "s/${OPTIONNAME}=.*/${OPTIONNAME}=${OPTIONVAL}/" $PAMPWDFILE
}
# Only check option name