Comment 1 for bug 1188475

Revision history for this message
sles (slesru) wrote :

btw, more correct patch, which revert back bind from config in lak_auth_bind

 diff -ur lak.c.orig lak.c
--- lak.c.orig 2013-06-07 09:15:20.098788278 +0400
+++ lak.c 2013-06-08 10:17:07.548233104 +0400
@@ -1448,8 +1448,25 @@
     if ( rc == LAK_OK &&
         (ISSET(lak->conf->group_dn) ||
          ISSET(lak->conf->group_filter)) )
- rc = lak_group_member(lak, user, service, realm, dn->value);
+ {
+ /* restore config bind */
+ lak_unbind(lak);
+ rc = lak_user(
+ lak->conf->bind_dn,
+ lak->conf->id,
+ lak->conf->authz_id,
+ lak->conf->mech,
+ lak->conf->realm,
+ lak->conf->password,
+ &lu);
+ if (rc != LAK_OK)
+ goto done;
+ rc = lak_bind(lak, lu);
+ if (rc != LAK_OK)
+ goto done;

+ rc = lak_group_member(lak, user, service, realm, dn->value);
+ }
 done:;
     if (lu)
         lak_user_free(lu);

don't sure it is correct from leaking some resources though

anyway it works