From 504604a3e90c8bad36d1919e13e0bf37f094ee2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Thu, 13 Aug 2015 12:46:59 +0200
Subject: [PATCH 52/57] IFP: use default limit if provided is 0
Returning zero values doesn't make any sense, so we may use it as
"use sssd configuration instead".
Reviewed-by: Petr Cech <pcech@redhat.com>
---
src/responder/ifp/ifpsrv_util.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/responder/ifp/ifpsrv_util.c b/src/responder/ifp/ifpsrv_util.c
index 3b02fd06f5227e4ffc3d40ffb20fed981c5028a7..904c4f62ec5653a534877fd6870832128720b694 100644
--- a/src/responder/ifp/ifpsrv_util.c
+++ b/src/responder/ifp/ifpsrv_util.c
@@ -274,7 +274,9 @@ ifp_is_user_attr_allowed(struct ifp_ctx *ifp_ctx, const char *attr)
static uint32_t ifp_list_limit(struct ifp_ctx *ctx, uint32_t limit)
{
- if (ctx->wildcard_limit) {
+ if (limit == 0) {
+ return ctx->wildcard_limit;
+ } else if (ctx->wildcard_limit) {
return MIN(ctx->wildcard_limit, limit);
} else {
return limit;
--
2.4.3