Re: Password expiry warning not working with ppolicy control

View: New views
4 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Password expiry warning not working with ppolicy control

by Andreas Hasenack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 11 August 2006 00:34, Prakash Velayutham wrote:

> dn:
> supportedControl: 1.3.6.1.4.1.4203.1.9.1.1
> supportedControl: 2.16.840.1.113730.3.4.18
> supportedControl: 2.16.840.1.113730.3.4.2
> supportedControl: 1.3.6.1.4.1.4203.1.10.1
> supportedControl: 1.2.840.113556.1.4.319
> supportedControl: 1.2.826.0.1.334810.2.3
> supportedControl: 1.3.6.1.1.13.2
> supportedControl: 1.3.6.1.1.13.1
> supportedControl: 1.3.6.1.1.12
>
> # search result
> search: 2
> result: 0 Success
>
> # numResponses: 2
> # numEntries: 1
>
> But the control for Password Policy is 1.3.6.1.4.1.42.2.27.8.2.1, but

I don't know these numbers by memory, so I'll trust you on that :)

> that is not listed in my server's RootDSE for some reason. I am positive
> that I compiled with --enable-ppolicy flag. For some reason, it does not
> show up in the search.

You have to load the overlay:
overlay ppolicy

And possible load the module if your openldap server has this built as a
dynamic object:
modulepath /usr/lib/openldap (you may need to change this)
moduleload ppolicy.la


Re: Password expiry warning not working with ppolicy control

by vsp_123 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andreas Hasenack wrote:

> On Friday 11 August 2006 00:34, Prakash Velayutham wrote:
>  
>> dn:
>> supportedControl: 1.3.6.1.4.1.4203.1.9.1.1
>> supportedControl: 2.16.840.1.113730.3.4.18
>> supportedControl: 2.16.840.1.113730.3.4.2
>> supportedControl: 1.3.6.1.4.1.4203.1.10.1
>> supportedControl: 1.2.840.113556.1.4.319
>> supportedControl: 1.2.826.0.1.334810.2.3
>> supportedControl: 1.3.6.1.1.13.2
>> supportedControl: 1.3.6.1.1.13.1
>> supportedControl: 1.3.6.1.1.12
>>
>> # search result
>> search: 2
>> result: 0 Success
>>
>> # numResponses: 2
>> # numEntries: 1
>>
>> But the control for Password Policy is 1.3.6.1.4.1.42.2.27.8.2.1, but
>>    
>
> I don't know these numbers by memory, so I'll trust you on that :)
>  
>> that is not listed in my server's RootDSE for some reason. I am positive
>> that I compiled with --enable-ppolicy flag. For some reason, it does not
>> show up in the search.
>>    
>
> You have to load the overlay:
> overlay ppolicy
>
> And possible load the module if your openldap server has this built as a
> dynamic object:
> modulepath /usr/lib/openldap (you may need to change this)
> moduleload ppolicy.la

I had all of that in my slapd.conf except modulepath. No luck. What
should my modulepath be? I do not see ppolicy.la file anywhere in my
install tree. What I am wondering is that how would I see the
"ppolicy_bind: Setting warning for password expiry for cn=Prakash
Velayutham,ou=PI-users,dc=cchrf,dc=org = 85816 seconds" warning if my
ppolicy overlay is not working, right? So that part is working (please
correct me if I am wrong). Only thing is that the client side is not
getting the warning message even though the server is sending it. Do you
have this working in your LDAP setting with pam_ldap and SSH?

Inside pam_ldap.c code, I see a bunch of code (lines 2041 - 2052 in
pam_ldap-182) like this:

##########################################################################
      if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRING))
        {
          char seconds[32];
          snprintf (seconds, sizeof seconds, "%.*s",
            (int) (*ctlp)->ldctl_value.bv_len,
            (*ctlp)->ldctl_value.bv_val);
          session->info->password_expiration_time = atol (seconds);
        }
      else if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRED))
        {
          if (session->info->policy_error == POLICY_ERROR_SUCCESS)
        session->info->policy_error = POLICY_ERROR_PASSWORD_EXPIRED;
##########################################################################

But both the LDAP_CONTROL_PWEXPIRING and LDAP_CONTROL_PWEXPIRED are not
defined in openldap's ldap.h file. So how exactly would this be
recognized by pam_ldap?

Also could you give me your set of configure flags while building
openldap? I will try to replicate that in my setting to see if that
clears some things. When I give a configure flag like
--enable-modules=yes --enable-overlays=yes --enable-ppolicy, where
should I expect the system to put the ppolicy.la module?

Thanks,
Prakash

Re: Password expiry warning not working with ppolicy control

by Andreas Hasenack :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Aug 11, 2006 at 10:49:33AM -0400, Prakash Velayutham wrote:
> I had all of that in my slapd.conf except modulepath. No luck. What
> should my modulepath be? I do not see ppolicy.la file anywhere in my
> install tree. What I am wondering is that how would I see the
> "ppolicy_bind: Setting warning for password expiry for cn=Prakash
> Velayutham,ou=PI-users,dc=cchrf,dc=org = 85816 seconds" warning if my
> ppolicy overlay is not working, right? So that part is working (please

Right, you probably have it built statically with your slapd.

> correct me if I am wrong). Only thing is that the client side is not
> getting the warning message even though the server is sending it. Do you
> have this working in your LDAP setting with pam_ldap and SSH?

I didn't test this part: my tests were only as far as testing the
password must change control.

>
> Inside pam_ldap.c code, I see a bunch of code (lines 2041 - 2052 in
> pam_ldap-182) like this:
>
> ##########################################################################
>       if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRING))
>         {
>           char seconds[32];
>           snprintf (seconds, sizeof seconds, "%.*s",
>             (int) (*ctlp)->ldctl_value.bv_len,
>             (*ctlp)->ldctl_value.bv_val);
>           session->info->password_expiration_time = atol (seconds);
>         }
>       else if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRED))
>         {
>           if (session->info->policy_error == POLICY_ERROR_SUCCESS)
>         session->info->policy_error = POLICY_ERROR_PASSWORD_EXPIRED;
> ##########################################################################
>
> But both the LDAP_CONTROL_PWEXPIRING and LDAP_CONTROL_PWEXPIRED are not
> defined in openldap's ldap.h file. So how exactly would this be
> recognized by pam_ldap?

I think you should open a ticket at bugzilla.padl.com with all this
information.

>
> Also could you give me your set of configure flags while building
> openldap? I will try to replicate that in my setting to see if that
> clears some things. When I give a configure flag like
> --enable-modules=yes --enable-overlays=yes --enable-ppolicy, where
> should I expect the system to put the ppolicy.la module?

I don't think this will change things.


Re: Password expiry warning not working with ppolicy control

by vsp_123 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andreas Hasenack wrote:

> On Fri, Aug 11, 2006 at 10:49:33AM -0400, Prakash Velayutham wrote:
>  
>> I had all of that in my slapd.conf except modulepath. No luck. What
>> should my modulepath be? I do not see ppolicy.la file anywhere in my
>> install tree. What I am wondering is that how would I see the
>> "ppolicy_bind: Setting warning for password expiry for cn=Prakash
>> Velayutham,ou=PI-users,dc=cchrf,dc=org = 85816 seconds" warning if my
>> ppolicy overlay is not working, right? So that part is working (please
>>    
>
> Right, you probably have it built statically with your slapd.
>  
>> correct me if I am wrong). Only thing is that the client side is not
>> getting the warning message even though the server is sending it. Do you
>> have this working in your LDAP setting with pam_ldap and SSH?
>>    
>
> I didn't test this part: my tests were only as far as testing the
> password must change control.
>  
>> Inside pam_ldap.c code, I see a bunch of code (lines 2041 - 2052 in
>> pam_ldap-182) like this:
>>
>> ##########################################################################
>>       if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRING))
>>         {
>>           char seconds[32];
>>           snprintf (seconds, sizeof seconds, "%.*s",
>>             (int) (*ctlp)->ldctl_value.bv_len,
>>             (*ctlp)->ldctl_value.bv_val);
>>           session->info->password_expiration_time = atol (seconds);
>>         }
>>       else if (!strcmp ((*ctlp)->ldctl_oid, LDAP_CONTROL_PWEXPIRED))
>>         {
>>           if (session->info->policy_error == POLICY_ERROR_SUCCESS)
>>         session->info->policy_error = POLICY_ERROR_PASSWORD_EXPIRED;
>> ##########################################################################
>>
>> But both the LDAP_CONTROL_PWEXPIRING and LDAP_CONTROL_PWEXPIRED are not
>> defined in openldap's ldap.h file. So how exactly would this be
>> recognized by pam_ldap?
>>    
>
> I think you should open a ticket at bugzilla.padl.com with all this
> information.
>  
>> Also could you give me your set of configure flags while building
>> openldap? I will try to replicate that in my setting to see if that
>> clears some things. When I give a configure flag like
>> --enable-modules=yes --enable-overlays=yes --enable-ppolicy, where
>> should I expect the system to put the ppolicy.la module?
>>    
>
> I don't think this will change things.
I am going to bugzilla on this one. Thanks. In the meanwhile, do you
think you would be willing (and have the time) to test the password
expiry warning on your setup and see if it works for you.


Thanks again,
Prakash
LightInTheBox - Buy quality products at wholesale price