aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_faillock/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Include pam_i18n.h where i18n definitions are requiredDmitry V. Levin2024-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not include <libintl.h> and other i18n stuff via config.h which is included into every compilation unit, include "pam_i18n.h" explicitly where necessary. * configure.ac (AH_BOTTOM): Remove. * libpam/pam_get_authtok.c: Include "pam_i18n.h". * libpam/pam_item.c: Likewise. * libpam/pam_strerror.c: Likewise. * libpam_misc/misc_conv.c: Likewise. * modules/pam_exec/pam_exec.c: Likewise. * modules/pam_faillock/main.c: Likewise. * modules/pam_faillock/pam_faillock.c: Likewise. * modules/pam_lastlog/pam_lastlog.c: Likewise. * modules/pam_limits/pam_limits.c: Likewise. * modules/pam_mail/pam_mail.c: Likewise. * modules/pam_mkhomedir/pam_mkhomedir.c: Likewise. * modules/pam_pwhistory/pam_pwhistory.c: Likewise. * modules/pam_selinux/pam_selinux.c: Likewise. * modules/pam_selinux/pam_selinux_check.c: Likewise. * modules/pam_timestamp/pam_timestamp.c: Likewise. * modules/pam_unix/pam_unix_acct.c: Likewise. * modules/pam_unix/pam_unix_passwd.c: Likewise. * modules/pam_userdb/pam_userdb.c: Likewise.
* pam_faillock: silence compilation warningDmitry V. Levin2024-07-281-1/+2
| | | | | | | | | | | | | | | | Since audit_log_acct_message() was decorated with warn_unused_result attribute, compilation of faillock helper produces the following diagnostics: main.c: In function 'do_user': main.c:250:25: warning: ignoring return value of 'audit_log_acct_message' declared with attribute 'warn_unused_result' [-Wunused-result] Given that this helper has never been picky about audit, e.g. audit_open() errors do not affect its exit status, just silence this new warning. * modules/pam_faillock/main.c [HAVE_LIBAUDIT] (do_user): Silence compilation warning.
* pam_faillock: fix typo in usage diagnosticsDmitry V. Levin2022-11-111-1/+1
| | | | | | | * modules/pam_faillock/main.c (usage): Remove extra whitespace from the usage diagnostics. Fixes: 94f0f5ebb ("faillock: add support to print login failure info in legacy format")
* faillock: add support to print login failure info in legacy formatShreenidhi Shedi2022-07-011-11/+65
| | | | | | | | | | | pam_tally2 had a simple and minimalstic output to show login failure info, new output of faillock makes the output look a bit complex and doesn't show failure counts in a straight manner. This patch fixes the above issue by adding "--legacy-output" flag to faillock which makes it possible to get output in pam_tally2 style. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
* faillock: refactor faillock info printing codeShreenidhi Shedi2022-07-011-21/+31
| | | | | | Move the code to it's own function. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
* faillock: error out if user does not existShreenidhi Shedi2022-07-011-1/+5
| | | | | | | | | | No need to do any further processing if a non existent username is given to faillock. For first time successful login, failure field should be 0 and faillock should show something like pam_tally2 did. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
* faillock: load configuration from fileIker Pedrosa2022-05-241-13/+38
| | | | | | | | | | | | | | | | * modules/pam_faillock/main.c: Load configuration from file * modules/pam_faillock/pam_faillock: Improve tally directory management * modules/pam_faillock/faillock_config.c: Print errors * modules/pam_faillock/faillock_config.h: Extend options structure and define get_tally_dir(). * modules/pam_faillock/Makefile.am: Compile faillock_config.c for faillock binary. * modules/pam_faillock/faillock.8.xml: Update with the new configuration option. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1978029 Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
* Check the return value of localtime in faillock (#421)pyllyukko2022-01-121-0/+5
|
* pam_faillock: convert spaces to tab to keep code stylechuanqin2021-03-251-3/+2
| | | | convert spaces to tab which mixture use in modules/pam_faillock/main.c
* pam_faillock: fix unread store statementikerexxe2020-11-031-1/+1
| | | | | modules/pam_faillock/main.c: remove store statement since the value is only read in the enclosing expression.
* pam_faillock: New module for locking after multiple auth failuresTomas Mraz2020-04-301-0/+232