From 9d98e98ab37d86323034e7bc342f196b81fa07bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 3 Aug 2017 00:19:56 +0200 Subject: [PATCH 55/93] HBAC: Document ipa_hbac_rule_info_next()'s behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's add a comment on ipa_hbac_rule_info_send() in order to have cleaner why ret is set to EINVAL when ipa_hbac_rule_info_next() returns EOK. Signed-off-by: Fabiano Fidêncio Reviewed-by: Pavel Březina Reviewed-by: Jakub Hrozek --- src/providers/ipa/ipa_hbac_rules.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/providers/ipa/ipa_hbac_rules.c b/src/providers/ipa/ipa_hbac_rules.c index b8d45351994e7af1c31558238de8b5910a6ee943..cb5a716aa809ebd80891cb8508bc136a788e49f1 100644 --- a/src/providers/ipa/ipa_hbac_rules.c +++ b/src/providers/ipa/ipa_hbac_rules.c @@ -166,6 +166,14 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx, ret = ipa_hbac_rule_info_next(req, state); if (ret == EOK) { + /* ipa_hbac_rule_info_next should always have a search base when called + * for the first time. + * + * For the subsequent iterations, not finding any more search bases is + * fine though (thus the function returns EOK). + * + * As, here, it's the first case happening, let's return EINVAL. + */ ret = EINVAL; } -- 2.14.1