Hi,

the attached patch makes service lookups great again.

To reproduce, just run:
    getent service -s sss ldap
before the patch we would look up ipService="" because DP gives us an
empty string after the recent DP patches.
>From ba9834637b3cc0d7d98f704ba70f9dcb6f9a70e9 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Tue, 5 Jul 2016 12:23:23 +0200
Subject: [PATCH] LDAP: Lookup services by all protocols unless a protocol is
 specified

The DP refactoring changed the way we handle strings from sbus. We no
longer receive NULL strings, but empty strings instead.
---
 src/providers/ldap/ldap_id_services.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/ldap/ldap_id_services.c 
b/src/providers/ldap/ldap_id_services.c
index 
77215127b53297d840eaa4d2f35a75eedb085e43..db47e3fc55eea969371d61c3c5ac7f818196f3d5
 100644
--- a/src/providers/ldap/ldap_id_services.c
+++ b/src/providers/ldap/ldap_id_services.c
@@ -114,7 +114,7 @@ services_get_send(TALLOC_CTX *mem_ctx,
     ret = sss_filter_sanitize(state, name, &clean_name);
     if (ret != EOK)  goto error;
 
-    if (protocol) {
+    if (protocol && protocol[0] != '\0') {
         ret = sss_filter_sanitize(state, protocol, &clean_protocol);
         if (ret != EOK)  goto error;
     }
-- 
2.4.11

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to