summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-04-11 21:49:03 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-04-11 16:10:56 -0400
commit822554137f72a0f28a485ce307e16c4b5fa7200b (patch)
tree8357910b55bd240b85d2ed470f49ef213ec270ad /src
parentd733768c02a097c32cfe85a567f3e04f319b2a0a (diff)
downloadsssd-822554137f72a0f28a485ce307e16c4b5fa7200b.tar.gz
sssd-822554137f72a0f28a485ce307e16c4b5fa7200b.tar.xz
sssd-822554137f72a0f28a485ce307e16c4b5fa7200b.zip
Initialise srv_opts even if rootDSE is missingsssd-1.5.1-26.el6
Diffstat (limited to 'src')
-rw-r--r--src/providers/ldap/sdap.c78
-rw-r--r--src/providers/ldap/sdap_async_connection.c17
2 files changed, 49 insertions, 46 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 95c39a0c9..237a1f230 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -606,46 +606,48 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx,
last_usn_name = opts->gen_map[SDAP_AT_LAST_USN].name;
entry_usn_name = opts->gen_map[SDAP_AT_ENTRY_USN].name;
- if (last_usn_name) {
- ret = sysdb_attrs_get_string(rootdse,
- last_usn_name, &last_usn_value);
- if (ret != EOK) {
- switch (ret) {
- case ENOENT:
- DEBUG(1, ("%s configured but not found in rootdse!\n",
- opts->gen_map[SDAP_AT_LAST_USN].opt_name));
- break;
- case ERANGE:
- DEBUG(1, ("Multiple values of %s found in rootdse!\n",
- opts->gen_map[SDAP_AT_LAST_USN].opt_name));
- break;
- default:
- DEBUG(1, ("Unkown error (%d) checking rootdse!\n", ret));
- }
- } else {
- if (!entry_usn_name) {
- DEBUG(1, ("%s found in rootdse but %s is not set!\n",
- last_usn_name,
- opts->gen_map[SDAP_AT_ENTRY_USN].opt_name));
+ if (rootdse) {
+ if (last_usn_name) {
+ ret = sysdb_attrs_get_string(rootdse,
+ last_usn_name, &last_usn_value);
+ if (ret != EOK) {
+ switch (ret) {
+ case ENOENT:
+ DEBUG(1, ("%s configured but not found in rootdse!\n",
+ opts->gen_map[SDAP_AT_LAST_USN].opt_name));
+ break;
+ case ERANGE:
+ DEBUG(1, ("Multiple values of %s found in rootdse!\n",
+ opts->gen_map[SDAP_AT_LAST_USN].opt_name));
+ break;
+ default:
+ DEBUG(1, ("Unkown error (%d) checking rootdse!\n", ret));
+ }
} else {
- so->supports_usn = true;
+ if (!entry_usn_name) {
+ DEBUG(1, ("%s found in rootdse but %s is not set!\n",
+ last_usn_name,
+ opts->gen_map[SDAP_AT_ENTRY_USN].opt_name));
+ } else {
+ so->supports_usn = true;
+ }
}
- }
- } else {
- /* no usn option configure, let's try to autodetect. */
- for (i = 0; usn_attrs[i].last_name; i++) {
- ret = sysdb_attrs_get_string(rootdse,
- usn_attrs[i].last_name,
- &last_usn_value);
- if (ret == EOK) {
- /* Fixate discovered configuration */
- opts->gen_map[SDAP_AT_LAST_USN].name =
- talloc_strdup(opts->gen_map, usn_attrs[i].last_name);
- opts->gen_map[SDAP_AT_ENTRY_USN].name =
- talloc_strdup(opts->gen_map, usn_attrs[i].entry_name);
- so->supports_usn = true;
- last_usn_name = usn_attrs[i].last_name;
- break;
+ } else {
+ /* no usn option configure, let's try to autodetect. */
+ for (i = 0; usn_attrs[i].last_name; i++) {
+ ret = sysdb_attrs_get_string(rootdse,
+ usn_attrs[i].last_name,
+ &last_usn_value);
+ if (ret == EOK) {
+ /* Fixate discovered configuration */
+ opts->gen_map[SDAP_AT_LAST_USN].name =
+ talloc_strdup(opts->gen_map, usn_attrs[i].last_name);
+ opts->gen_map[SDAP_AT_ENTRY_USN].name =
+ talloc_strdup(opts->gen_map, usn_attrs[i].entry_name);
+ so->supports_usn = true;
+ last_usn_name = usn_attrs[i].last_name;
+ break;
+ }
}
}
}
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index fbbb44479..bae412c7b 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1285,14 +1285,15 @@ static void sdap_cli_rootdse_done(struct tevent_req *subreq)
return;
}
- ret = sdap_get_server_opts_from_rootdse(state,
- state->service->uri, rootdse,
- state->opts, &state->srv_opts);
- if (ret) {
- DEBUG(1, ("sdap_get_server_opts_from_rootdse failed.\n"));
- tevent_req_error(req, ret);
- return;
- }
+ }
+
+ ret = sdap_get_server_opts_from_rootdse(state,
+ state->service->uri, rootdse,
+ state->opts, &state->srv_opts);
+ if (ret) {
+ DEBUG(1, ("sdap_get_server_opts_from_rootdse failed.\n"));
+ tevent_req_error(req, ret);
+ return;
}
sasl_mech = dp_opt_get_string(state->opts->basic, SDAP_SASL_MECH);