Problems loading a pam module

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

 




Hello,

I'm new to the list.I hope that this question hasn't been posted before.
I search the archives without success, so here is my question:

I've been trying for several days to use a pam LDAP module on a linux
platform.
The module compiles and loads without any error message, but always
returns PERMISSION_DENIED when trying to authenticate, even if
pam_sm_authenticate only returns PAM_SUCCESS

As my other modules work fine I did some cut and paste, and I saw that
calling an ldap function from the module prevents it from working
properly. (even if this function isn't actually called)

I guess it is a problem with the linker, but I cannot find error messages.


I'm quite lost and any help will be appreciated..

Thanks

Guillaume




Examples:



Works fine :


*************************************************************

PAM_EXTERN
int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const
char **argv)
{
return PAM_SUCCESS;
}


PAM_EXTERN
int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char
**argv)
{
      return PAM_SUCCESS;
}


**************************************************************




Does not work because of _LDAP_pwd_check !!!!!




static int _LDAP_pwd_check (pam_handle_t *pamh) {
    int result = PAM_AUTH_ERR;

    _pam_log (LOG_INFO, "session PAMPAM " );

    if (_get_dn (pamh) == PAM_SUCCESS) {
      LDAP *ldap;
      if (ldap = _LDAP_connect (_dn, _passwd)) {
        _LDAP_disconnect (ldap);
        result =  PAM_SUCCESS;
        }
      }
    return result;
    }


PAM_EXTERN
int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const
char **argv)
{
return PAM_SUCCESS;
}


PAM_EXTERN
int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char
**argv)
{
      return PAM_SUCCESS;
}



********************************************************************









_______________________________________________

Pam-list@redhat.com
https://listman.redhat.com/mailman/listinfo/pam-list

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

  Powered by Linux