diff options
author | Sumit Bose <sbose@redhat.com> | 2009-08-18 21:38:58 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-08-19 10:19:58 -0400 |
commit | bd658691471ec283bfc2d7aa4018a2b83e00c7d9 (patch) | |
tree | 28d28dc90894b691367585561314a500e8414d2d /server/providers/ldap/sdap_async.c | |
parent | 519b6bacaec539d5aee041c63d8887cd8baa81af (diff) | |
download | sssd-bd658691471ec283bfc2d7aa4018a2b83e00c7d9.tar.gz sssd-bd658691471ec283bfc2d7aa4018a2b83e00c7d9.tar.xz sssd-bd658691471ec283bfc2d7aa4018a2b83e00c7d9.zip |
enable usage of defaultBindDn
Diffstat (limited to 'server/providers/ldap/sdap_async.c')
-rw-r--r-- | server/providers/ldap/sdap_async.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index b2e0fb214..b71b61f29 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -728,11 +728,17 @@ struct tevent_req *sdap_auth_send(TALLOC_CTX *memctx, struct tevent_context *ev, struct sdap_handle *sh, const char *user_dn, + const char *authtok_type, const char *password) { struct tevent_req *req, *subreq; struct sdap_auth_state *state; + if (authtok_type != NULL && strcasecmp(authtok_type,"password") != 0) { + DEBUG(1,("Authentication token type [%s] is not supported")); + return NULL; + } + req = tevent_req_create(memctx, &state, struct sdap_auth_state); if (!req) return NULL; @@ -884,6 +890,12 @@ static struct tevent_req *sdap_save_user_send(TALLOC_CTX *memctx, ret = sysdb_attrs_get_el(state->attrs, opts->user_map[SDAP_AT_USER_UID].sys_name, &el); if (ret) goto fail; + if (el->num_values == 0) { + DEBUG(1, ("no uid provided for user [%s] in domain [%s].\n", name, + dom->name)); + ret = EINVAL; + goto fail; + } errno = 0; l = strtol((const char *)el->values[0].data, NULL, 0); if (errno) { @@ -895,6 +907,12 @@ static struct tevent_req *sdap_save_user_send(TALLOC_CTX *memctx, ret = sysdb_attrs_get_el(state->attrs, opts->user_map[SDAP_AT_USER_GID].sys_name, &el); if (ret) goto fail; + if (el->num_values == 0) { + DEBUG(1, ("no gid provided for user [%s] in domain [%s].\n", name, + dom->name)); + ret = EINVAL; + goto fail; + } errno = 0; l = strtol((const char *)el->values[0].data, NULL, 0); if (errno) { |