mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-08-03 06:26:17 -04:00
pam-info: improve error handling
https://github.com/Kicksecure/security-misc/pull/305#issuecomment-2892378246
This commit is contained in:
parent
5c981e0891
commit
5930e27052
1 changed files with 15 additions and 1 deletions
|
@ -19,8 +19,22 @@ fi
|
|||
|
||||
true "$0: START PHASE 2"
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o pipefail
|
||||
|
||||
error_handler() {
|
||||
exit_code="$?"
|
||||
printf '%s\n' "\
|
||||
$0: ERROR: Unexpected error.
|
||||
BASH_COMMAND: '$BASH_COMMAND'
|
||||
exit_code: '$exit_code'
|
||||
ERROR: Please report this bug." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
trap error_handler ERR
|
||||
|
||||
## Named constants.
|
||||
pam_faillock_state_dir="/var/lib/security-misc/faillock"
|
||||
|
||||
|
@ -35,7 +49,7 @@ if [ "$PAM_USER" = "" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
grep_result="$(grep -- "accessfile=/etc/security/access-security-misc.conf" /etc/pam.d/common-account 2>/dev/null)"
|
||||
grep_result="$(grep -- "accessfile=/etc/security/access-security-misc.conf" /etc/pam.d/common-account 2>/dev/null)" || true
|
||||
|
||||
## Check if grep matched something.
|
||||
if [ ! "$grep_result" = "" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue