opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit c05e559c4c473655da25d0fcae207aa3345b029b
parent aedbe76e8443757d8553a35fdc217722dcd1470b
Author: Duncaen <mail@duncano.de>
Date:   Mon, 27 Jun 2016 18:19:31 +0200

fix pamcleanup

Diffstat:
pam.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 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); }