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
btw, more correct patch, which revert back bind from config in lak_auth_bind
diff -ur lak.c.orig lak.c
(ISSET( lak->conf- >group_ dn) ||
ISSET( lak->conf- >group_ filter) ) ) member( lak, user, service, realm, dn->value); >authz_ id, >password,
--- 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 &&
- rc = lak_group_
+ {
+ /* restore config bind */
+ lak_unbind(lak);
+ rc = lak_user(
+ lak->conf->bind_dn,
+ lak->conf->id,
+ lak->conf-
+ lak->conf->mech,
+ lak->conf->realm,
+ lak->conf-
+ &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);
lak_user_ free(lu) ;
+ }
done:;
if (lu)
don't sure it is correct from leaking some resources though
anyway it works