]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 714: fix Solaris build error due to PAM_MSG_VERSION
authorLee Howard <faxguy@howardsilvan.com>
Fri, 16 Dec 2005 01:11:12 +0000 (01:11 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Fri, 16 Dec 2005 01:11:12 +0000 (01:11 +0000)
CHANGES
hfaxd/Login.c++

diff --git a/CHANGES b/CHANGES
index bcaf2b542047494cf4231df0ba400a0db9ffdfe7..becdeee256cfc721f75ca3d6d24ff8434f1c4a1f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog since HylaFAX 4.2.3
 
+* fix a Solaris compile error due to PAM_CONV_AGAIN (15 Dec 2005)
 * fix Solaris 9 compile error due to PAM (15 Dec 2005)
 * all Mainpine boards no longer identified as the DUO+
   2-port model (5 Dec 2005)
index 52165b41c074e20031a68a3473352da694b5c275..cceb785897c58f8035656d2fdc93da8b7ffa4f1d 100644 (file)
@@ -107,7 +107,14 @@ pamconv(int num_msg, STRUCT_PAM_MESSAGE **msg, struct pam_response **resp, void
            return PAM_CONV_ERR;
 
        if (password == NULL)
-           return PAM_CONV_AGAIN;
+           /*
+            * Solaris doesn't have PAM_CONV_AGAIN defined.
+            */
+           #ifdef PAM_CONV_AGAIN
+               return PAM_CONV_AGAIN;
+           #else
+               return PAM_CONV_ERR;
+           #endif
 
        replies=(struct pam_response*)calloc(num_msg, sizeof(struct pam_response));
 
@@ -155,7 +162,16 @@ HylaFAXServer::pamCheck(const char* user, const char* pass)
 
        int pamret;
 
-       pamret = pam_set_item(pamh, PAM_CONV, &conv);
+       /*
+        * Solaris has proprietary pam_[sg]et_item() extension.
+        * Sun defines PAM_MSG_VERSION therefore is possible to use
+        * it in order to recognize the extensions of Solaris
+        */
+       #ifdef PAM_MSG_VERSION
+           pamret = pam_set_item(pamh, PAM_CONV, (const void *)&conv);
+       #else
+           pamret = pam_set_item(pamh, PAM_CONV, &conv);
+       #endif
 
        if (pamret == PAM_SUCCESS)
            pamret = pam_authenticate(pamh, 0);
@@ -180,8 +196,17 @@ void HylaFAXServer::pamEnd(int pamret)
            state |= S_PRIVILEGED;
 
        char *newname=NULL;
-       
-       pamret = pam_get_item(pamh, PAM_USER, (const void **)&newname);
+
+       /*
+        * Solaris has proprietary pam_[sg]et_item() extension.
+        * Sun defines PAM_MSG_VERSION therefore is possible to use
+        * it in order to recognize the extensions of Solaris
+        */
+       #ifdef PAM_MSG_VERSION
+           pamret = pam_get_item(pamh, PAM_USER, (void **)&newname);
+       #else
+           pamret = pam_get_item(pamh, PAM_USER, (const void **)&newname);
+       #endif
 
        if (pamret == PAM_SUCCESS && newname != NULL)
            the_user = strdup(newname);