Blame SOURCES/0048-nss-preserve-service-name-in-getsrv-call.patch

905b4d
From e6c49e90d752fdbdf5d12ac18ccb9f297baaa8f1 Mon Sep 17 00:00:00 2001
905b4d
From: Michal Zidek <mzidek@redhat.com>
905b4d
Date: Thu, 23 Oct 2014 20:27:57 +0200
905b4d
Subject: [PATCH 48/48] nss: preserve service name in getsrv call
905b4d
905b4d
About case_sensitive=preserving and services.
905b4d
905b4d
The name of the service can be preserved in
905b4d
result of 'getent service'. However we
905b4d
should still lowercase the protocol and
905b4d
service aliases because they serve as keys
905b4d
in some queries to sysdb. The lowercasing is done
905b4d
by the provider already. If we did not do that,
905b4d
we would lose case insesnsitivity.
905b4d
905b4d
With this patch the responder preserves the
905b4d
case of service name and protocol, to match
905b4d
the case that is stored in the sysdb (however
905b4d
the protocol is already lowercased by provider,
905b4d
so it was done only for consistent use of the
905b4d
case_sensitive=preserve option in the responders
905b4d
and only the case of name is the same as in
905b4d
ldap).
905b4d
905b4d
Fixes:
905b4d
https://fedorahosted.org/sssd/ticket/2460
905b4d
905b4d
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
905b4d
(cherry picked from commit c4e278c2637547640d28bda007c9c38a17956fcc)
905b4d
---
905b4d
 src/responder/nss/nsssrv_services.c | 4 ++--
905b4d
 1 file changed, 2 insertions(+), 2 deletions(-)
905b4d
905b4d
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
905b4d
index 7741768021cc4a669bd3eda286cd1f25876a55f6..f6abc445c82d268dafb4d1e1fa7336ad01912f9e 100644
905b4d
--- a/src/responder/nss/nsssrv_services.c
905b4d
+++ b/src/responder/nss/nsssrv_services.c
905b4d
@@ -642,7 +642,7 @@ fill_service(struct sss_packet *packet,
905b4d
 
905b4d
         /* Get the service name */
905b4d
         orig_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL);
905b4d
-        tmpstr = sss_get_cased_name(tmp_ctx, orig_name, dom->case_sensitive);
905b4d
+        tmpstr = sss_get_cased_name(tmp_ctx, orig_name, dom->case_preserve);
905b4d
         if (tmpstr == NULL) {
905b4d
             DEBUG(SSSDBG_CRIT_FAILURE,
905b4d
                   "Could not identify service name, skipping\n");
905b4d
@@ -677,7 +677,7 @@ fill_service(struct sss_packet *packet,
905b4d
             orig_proto = (const char *)el->values[0].data;
905b4d
         }
905b4d
 
905b4d
-        tmpstr = sss_get_cased_name(tmp_ctx, orig_proto, dom->case_sensitive);
905b4d
+        tmpstr = sss_get_cased_name(tmp_ctx, orig_proto, dom->case_preserve);
905b4d
         if (tmpstr == NULL) {
905b4d
             DEBUG(SSSDBG_CRIT_FAILURE,
905b4d
                   "sss_get_cased_name failed, skipping\n");
905b4d
-- 
905b4d
1.9.3
905b4d