From: Lennart Poettering Date: Tue, 14 Apr 2020 17:26:48 +0000 (+0200) Subject: pam-systemd-home: print helpful message when token's PIN is locked X-Git-Tag: v246-rc1~45^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85b1294488d2de3a17dbd0f82771f03fd121e036;p=thirdparty%2Fsystemd.git pam-systemd-home: print helpful message when token's PIN is locked --- diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c index 87bf1620d55..2d2732a4401 100644 --- a/src/home/pam_systemd_home.c +++ b/src/home/pam_systemd_home.c @@ -385,6 +385,11 @@ static int handle_generic_user_record_error( return PAM_SERVICE_ERR; } + } else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_PIN_LOCKED)) { + + (void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Security token PIN is locked, please unlock it first. (Hint: Removal and re-insertion might suffice.)"); + return PAM_SERVICE_ERR; + } else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN)) { _cleanup_(erase_and_freep) char *newp = NULL;