ldap_id.c revision 9e99e3c5c45b20189e76e4d2546966ff1fb3ce40
f3ec420152ca921e4c1ce77782f51b53f659018dnd LDAP Identity Backend Module
f3ec420152ca921e4c1ce77782f51b53f659018dnd Simo Sorce <ssorce@redhat.com>
f3ec420152ca921e4c1ce77782f51b53f659018dnd Copyright (C) 2008 Red Hat
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen This program is free software; you can redistribute it and/or modify
2e545ce2450a9953665f701bb05350f0d3f26275nd it under the terms of the GNU General Public License as published by
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the Free Software Foundation; either version 3 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
f3ec420152ca921e4c1ce77782f51b53f659018dnd This program is distributed in the hope that it will be useful,
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen but WITHOUT ANY WARRANTY; without even the implied warranty of
3f08db06526d6901aa08c110b5bc7dde6bc39905nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f3ec420152ca921e4c1ce77782f51b53f659018dnd GNU General Public License for more details.
f3ec420152ca921e4c1ce77782f51b53f659018dnd You should have received a copy of the GNU General Public License
3f08db06526d6901aa08c110b5bc7dde6bc39905nd along with this program. If not, see <http://www.gnu.org/licenses/>.
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen/* =Users-Related-Functions-(by-name,by-uid)============================== */
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen const char *name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char **attrs;
f3ec420152ca921e4c1ce77782f51b53f659018dndstatic void users_get_connect_done(struct tevent_req *subreq);
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char *name,
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char *attr_name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd req = tevent_req_create(memctx, &state, struct users_get_state);
f3ec420152ca921e4c1ce77782f51b53f659018dnd state->filter = talloc_asprintf(state, "(&(%s=%s)(objectclass=%s))",
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* TODO: handle attrs_type */
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* FIXME: add option to decide if tls should be used
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen * or SASL/GSSAPI, etc ... */
f3ec420152ca921e4c1ce77782f51b53f659018dnd tevent_req_set_callback(subreq, users_get_connect_done, req);
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowenstatic void users_get_connect_done(struct tevent_req *subreq)
f3ec420152ca921e4c1ce77782f51b53f659018dnd struct tevent_req *req = tevent_req_callback_data(subreq,
f3ec420152ca921e4c1ce77782f51b53f659018dnd DEBUG(0, ("Authentication mechanism not Supported by server"));
f3ec420152ca921e4c1ce77782f51b53f659018dnd struct tevent_req *req = tevent_req_callback_data(subreq,
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* it was an enumeration */
f3ec420152ca921e4c1ce77782f51b53f659018dnd/* =Groups-Related-Functions-(by-name,by-uid)============================= */
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char *name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char **attrs;
f3ec420152ca921e4c1ce77782f51b53f659018dndstatic void groups_get_connect_done(struct tevent_req *subreq);
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char *name,
f3ec420152ca921e4c1ce77782f51b53f659018dnd const char *attr_name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd req = tevent_req_create(memctx, &state, struct groups_get_state);
f3ec420152ca921e4c1ce77782f51b53f659018dnd attr_name = ctx->opts->group_map[SDAP_AT_GROUP_NAME].name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd attr_name = ctx->opts->group_map[SDAP_AT_GROUP_GID].name;
f3ec420152ca921e4c1ce77782f51b53f659018dnd state->filter = talloc_asprintf(state, "(&(%s=%s)(objectclass=%s))",
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* TODO: handle attrs_type */
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* FIXME: add option to decide if tls should be used
f3ec420152ca921e4c1ce77782f51b53f659018dnd * or SASL/GSSAPI, etc ... */
723b4be7951b76cd58116426912adacf55bf96ednilgun tevent_req_set_callback(subreq, groups_get_connect_done, req);
f3ec420152ca921e4c1ce77782f51b53f659018dndstatic void groups_get_connect_done(struct tevent_req *subreq)
f3ec420152ca921e4c1ce77782f51b53f659018dnd struct tevent_req *req = tevent_req_callback_data(subreq,
f3ec420152ca921e4c1ce77782f51b53f659018dnd DEBUG(0, ("Authentication mechanism not Supported by server"));
f3ec420152ca921e4c1ce77782f51b53f659018dnd struct tevent_req *req = tevent_req_callback_data(subreq,
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* it was an enumeration */
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen/* =Get-Groups-for-User================================================== */
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen const char *name;
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen const char **attrs;
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowenstatic void groups_by_user_connect_done(struct tevent_req *subreq);
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowenstatic void groups_by_user_done(struct tevent_req *subreq);
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowenstatic struct tevent_req *groups_by_user_send(TALLOC_CTX *memctx,
d1636bdc2e674b84ee46f534b51be18ecac6bef5rbowen const char *name)
f3ec420152ca921e4c1ce77782f51b53f659018dnd req = tevent_req_create(memctx, &state, struct groups_by_user_state);
f3ec420152ca921e4c1ce77782f51b53f659018dnd /* FIXME: add option to decide if tls should be used
f3ec420152ca921e4c1ce77782f51b53f659018dnd * or SASL/GSSAPI, etc ... */
f3ec420152ca921e4c1ce77782f51b53f659018dnd tevent_req_set_callback(subreq, groups_by_user_connect_done, req);
f3ec420152ca921e4c1ce77782f51b53f659018dnd tevent_req_set_callback(subreq, groups_by_user_done, req);
f3ec420152ca921e4c1ce77782f51b53f659018dndstatic void groups_by_user_connect_done(struct tevent_req *subreq)
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung struct tevent_req *req = tevent_req_callback_data(subreq,
0d0ba3a410038e179b695446bb149cce6264e0abnd struct groups_by_user_state *state = tevent_req_data(req,
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh DEBUG(0, ("Authentication mechanism not Supported by server"));
struct tevent_req);
int ret;
if (ret) {
return EOK;
if (!req) {
if (!req) {
void *private_data)
return ELOOP;
if (!im) {
return ENOMEM;
return EOK;
const char *str_on_err)
struct sdap_id_ctx);
int ret;
int ret;
int ret;