Problem using pam

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am using the pam api to authenticate users on a daemon that I coded. I am 
using Mandrake 8.0 ( pam-0.74-6mdk ). Everyhting used to compile fine on 
Mandrake 7.2 but now I get this error.

In file included from /usr/include/security/pam_misc.h:7,
                 from pam/b_pam_auth.h:23,
                 from allDeamon.h:34,
                 from allDeamon.cpp:13:
/usr/include/security/pam_client.h:55: non-local function `int
pamc_converse (pamc_handle_s *, {anonymous struct} **)' uses anonymous
type
make: *** [allDeamon.o] Erreur 1

Here is my function that wraps the login process


int b_pam_auth(char *bp_app, char user[20], char password[20], char* rhost)
{

   int result;

   pam_handle_t *pamh=NULL;
         conv.appdata_ptr = (char *) strdup(password);
         result = pam_start(bp_app, user, &conv, &pamh);
         
	 if (result == PAM_SUCCESS) { 
    	    if(rhost!=NULL)	
	    return(BPA_NO); // this was added insted   YG
	 }
	 if (result == PAM_SUCCESS) {             
	    result = pam_authenticate(pamh, PAM_SILENT);
         }
         if (result == PAM_SUCCESS) {
            result = pam_acct_mgmt(pamh, PAM_SILENT);
         }
         if (result == PAM_SUCCESS) {
            result = pam_setcred(pamh, PAM_ESTABLISH_CRED);
         }
         if (pam_end(pamh, result) != PAM_SUCCESS)
            pamh = NULL;

         if (result != PAM_SUCCESS) {
            return(BPA_NO);
         }
      
      return(BPA_YES);
}


and here is the converse struct

static struct pam_conv conv = {
        pam_conv_auth,
        NULL
};

Did something change in pam that broke backward compatibility? Any help would 
be greatly appreciated. Thanks

Alexandre Sagala









[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux