From 07002c911aa643000856f78707f1fee72b5eea29 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 26 Apr 2012 11:21:59 +0200 Subject: IPA: Check return values --- src/providers/ipa/ipa_common.c | 8 ++++++-- src/providers/ipa/ipa_hosts.c | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 225c9786..262a9bcc 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -916,6 +916,10 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_AUTOFS_SEARCH_BASE, &ipa_opts->id->autofs_search_bases); + if (ret != EOK && ret != ENOENT) { + DEBUG(SSSDBG_OP_FAILURE, ("Could not parse autofs search base\n")); + goto done; + } ret = sdap_get_map(ipa_opts->id, cdb, conf_path, ipa_autofs_mobject_map, @@ -924,7 +928,7 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs map object attribute map\n")); - return ret; + goto done; } ret = sdap_get_map(ipa_opts->id, cdb, conf_path, @@ -934,7 +938,7 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs entry object attribute map\n")); - return ret; + goto done; } *_opts = ipa_opts->id; diff --git a/src/providers/ipa/ipa_hosts.c b/src/providers/ipa/ipa_hosts.c index 5252ac9b..30013864 100644 --- a/src/providers/ipa/ipa_hosts.c +++ b/src/providers/ipa/ipa_hosts.c @@ -332,6 +332,12 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) &hostgroup_count, &hostgroups); talloc_zfree(subreq); + if (ret != EOK) { + DEBUG(SSSDBG_OP_FAILURE, + ("sdap_get_generic_recv failed: [%d]\n", ret)); + tevent_req_error(req, ret); + return; + } /* Merge the two arrays */ if (hostgroup_count > 0) { -- cgit