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