1From fcec4e7fe899f8c0077b3004eeccb7292a945a67 Mon Sep 17 00:00:00 2001 2From: Jackie Huang <jackie.huang@windriver.com> 3Date: Wed, 16 Aug 2017 13:37:40 +0800 4Subject: [PATCH] vlock: add new recipe 5 6Upstream-Status: Pending 7 8written by: Jeff Polk <jeff.polk@windriver.com> 9Signed-off-by: Jackie Huang <jackie.huang@windriver.com> 10 11--- 12 src/auth-pam.c | 3 +++ 13 1 file changed, 3 insertions(+) 14 15diff --git a/src/auth-pam.c b/src/auth-pam.c 16index 5cf93f6..c5cc67a 100644 17--- a/src/auth-pam.c 18+++ b/src/auth-pam.c 19@@ -148,6 +148,9 @@ bool auth(const char *user, struct timespec *timeout) 20 21 if (pam_status != PAM_SUCCESS) { 22 fprintf(stderr, "vlock: %s\n", pam_strerror(pamh, pam_status)); 23+ } else { 24+ pam_status = pam_acct_mgmt(pamh, 0); 25+ if (pam_status == PAM_SUCCESS) pam_setcred(pamh, PAM_REINITIALIZE_CRED); 26 } 27 28 end: 29