sdap_async_groups_ad.c revision 97ae45d61d921f07e812620e0156aee02b7b83a7
/*
SSSD
Authors:
Stephen Gallagher <sgallagh@redhat.com>
Copyright (C) 2012 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "providers/ldap/sdap_async.h"
#include "providers/ldap/ldap_common.h"
struct sdap_ad_match_rule_state {
struct tevent_context *ev;
struct sdap_handle *sh;
const char **attrs;
struct sdap_options *opts;
const char *base_filter;
char *filter;
int timeout;
struct sdap_search_base **search_bases;
struct sysdb_attrs **users;
};
static errno_t
static void
struct tevent_req *
struct tevent_context *ev,
struct sdap_options *opts,
struct sdap_handle *sh,
struct sysdb_attrs *group,
int timeout)
{
struct tevent_req *req;
struct sdap_ad_match_rule_state *state;
const char *group_dn;
char *sanitized_group_dn;
/* Request all of the user attributes that we know about. */
("Could not build attribute map: [%s]\n",
goto immediate;
}
/* Get the DN of the group */
("Could not retrieve originalDN for group: %s\n",
goto immediate;
}
/* Sanitize it in case we have special characters in DN */
("Could not sanitize group DN: %s\n",
goto immediate;
}
/* Craft a special filter according to
*/
state->base_filter =
"(&(%s:%s:=%s)(objectClass=%s))",
if (!state->base_filter) {
goto immediate;
}
/* Start the loop through the search bases to get all of the users */
("sdap_get_ad_match_rule_members_next_base failed: [%s]\n",
goto immediate;
}
return req;
return req;
}
static errno_t
{
struct tevent_req *subreq;
struct sdap_ad_match_rule_state *state;
return ENOMEM;
}
("Searching for users with base [%s]\n",
if (!subreq) {
return ENOMEM;
}
return EOK;
}
static void
{
struct tevent_req *req =
struct sdap_ad_match_rule_state *state =
struct sysdb_attrs **users;
return;
}
("Search for users returned %d results\n", count));
/* Add this batch of users to the list */
if (count > 0) {
struct sysdb_attrs *,
return;
}
/* Copy the new users into the list */
for (i = 0; i < count; i++) {
}
}
/* Continue checking other search bases */
/* There are more search bases to try */
}
return;
}
/* No more search bases. We're done here. */
("No users matched in any search base\n"));
return;
}
}
struct sysdb_attrs ***users)
{
struct sdap_ad_match_rule_state *state =
return EOK;
}