X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=pam.c;h=81483800655243219612ccbaf51b39b258b7018d;hb=d67caab6ab5dfa342159fef7cef5ea91ccf0aad3;hp=c5a3001509b59364281466cca310d56ce523b990;hpb=8b2a776ddd47b74bb814a00ea7af3cc970063db7;p=opendoas.git diff --git a/pam.c b/pam.c index c5a3001..8148380 100644 --- a/pam.c +++ b/pam.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include @@ -21,10 +23,10 @@ #include #include #include -#ifdef HAVE_READPASSPHRASE_H +#ifdef HAVE_READPASSPHRASE # include #else -# include "readpassphrase.h" +# include "sys-readpassphrase.h" #endif #include #include @@ -35,7 +37,12 @@ #include -#include "includes.h" +#include "openbsd.h" +#include "doas.h" + +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif #define PAM_SERVICE_NAME "doas" @@ -117,7 +124,7 @@ fail: for (i = 0; i < nmsgs; i++) { if (rsp[i].resp == NULL) continue; - switch (style = msgs[i]->msg_style) { + switch (msgs[i]->msg_style) { case PAM_PROMPT_ECHO_OFF: case PAM_PROMPT_ECHO_ON: explicit_bzero(rsp[i].resp, strlen(rsp[i].resp)); @@ -125,6 +132,7 @@ fail: } rsp[i].resp = NULL; } + free(rsp); return PAM_CONV_ERR; }