aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2016-06-27 18:19:31 +0200
committerDuncaen <mail@duncano.de>2016-06-27 18:20:03 +0200
commitc05e559c4c473655da25d0fcae207aa3345b029b (patch)
tree9c217f607d4d9097ceed075167424c7a0601d12b
parentaedbe76e8443757d8553a35fdc217722dcd1470b (diff)
downloadopendoas-c05e559c4c473655da25d0fcae207aa3345b029b.tar.gz
fix pamcleanup
-rw-r--r--pam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pam.c b/pam.c
index 7842c9a..ec89d04 100644
--- a/pam.c
+++ b/pam.c
@@ -130,17 +130,17 @@ fail:
void
pamcleanup(int ret)
{
- if (session_opened)
+ if (session_opened != 0) {
ret = pam_close_session(pamh, 0);
if (ret != PAM_SUCCESS)
errx(1, "pam_close_session: %s", pam_strerror(pamh, ret));
-
- if (cred_established)
+ }
+ if (cred_established != 0) {
ret = pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT);
if (ret != PAM_SUCCESS)
warn("pam_setcred(?, PAM_DELETE_CRED | PAM_SILENT): %s",
pam_strerror(pamh, ret));
-
+ }
pam_end(pamh, ret);
}