From fcec4e7fe899f8c0077b3004eeccb7292a945a67 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Wed, 16 Aug 2017 13:37:40 +0800
Subject: [PATCH] vlock: add new recipe

Upstream-Status: Pending

written by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>

---
 src/auth-pam.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/auth-pam.c b/src/auth-pam.c
index 5cf93f6..c5cc67a 100644
--- a/src/auth-pam.c
+++ b/src/auth-pam.c
@@ -148,6 +148,9 @@ bool auth(const char *user, struct timespec *timeout)
 
   if (pam_status != PAM_SUCCESS) {
     fprintf(stderr, "vlock: %s\n", pam_strerror(pamh, pam_status));
+  } else {
+    pam_status = pam_acct_mgmt(pamh, 0);
+    if (pam_status == PAM_SUCCESS) pam_setcred(pamh, PAM_REINITIALIZE_CRED);
   }
 
 end:
