aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_faillock
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_faillock')
-rw-r--r--modules/pam_faillock/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/pam_faillock/main.c b/modules/pam_faillock/main.c
index 35208870..a5e2cd60 100644
--- a/modules/pam_faillock/main.c
+++ b/modules/pam_faillock/main.c
@@ -137,8 +137,12 @@ do_user(struct options *opts, const char *user)
const char *dir = get_tally_dir(opts);
pwd = getpwnam(user);
+ if (pwd == NULL) {
+ fprintf(stderr, "%s: Error no such user: %s\n", opts->progname, user);
+ return 1;
+ }
- fd = open_tally(dir, user, pwd != NULL ? pwd->pw_uid : 0, 0);
+ fd = open_tally(dir, user, pwd->pw_uid, 1);
if (fd == -1) {
if (errno == ENOENT) {