From 9d98e98ab37d86323034e7bc342f196b81fa07bc Mon Sep 17 00:00:00 2001 From: Fabiano Fidêncio Date: Aug 28 2017 18:41:26 +0000 Subject: HBAC: Document ipa_hbac_rule_info_next()'s behaviour 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 --- diff --git a/src/providers/ipa/ipa_hbac_rules.c b/src/providers/ipa/ipa_hbac_rules.c index b8d4535..cb5a716 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; }