Blame SOURCES/0092-UTIL-Sanitize-whitespaces.patch

2fc102
From 1c4109bf7f16016cf0b53cd73e7b80e0d87be660 Mon Sep 17 00:00:00 2001
2fc102
From: Lukas Slebodnik <lslebodn@redhat.com>
2fc102
Date: Mon, 24 Feb 2014 11:37:52 +0100
2fc102
Subject: [PATCH 92/92] UTIL: Sanitize whitespaces.
2fc102
2fc102
Original patches submitted by: mpesari(Thanks!!)
2fc102
2fc102
It can cause problems if user will hit spaces before entering username.
2fc102
(e.g in gdm). Spaces are ignored by LDAP; it's better to escape them.
2fc102
2fc102
Resolves:
2fc102
https://fedorahosted.org/sssd/ticket/1955
2fc102
2fc102
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
2fc102
(cherry picked from commit 2b8208b45feb2aab64d560d3e12e01e7b6d00d39)
2fc102
---
2fc102
 src/util/util.c | 10 ++++++++++
2fc102
 1 file changed, 10 insertions(+)
2fc102
2fc102
diff --git a/src/util/util.c b/src/util/util.c
2fc102
index fb3bed146e2c634375a1133ef512673dee16718a..1ec5c2a9474b0cd2d19a50b495e218d1da7da6c8 100644
2fc102
--- a/src/util/util.c
2fc102
+++ b/src/util/util.c
2fc102
@@ -537,6 +537,16 @@ errno_t sss_filter_sanitize(TALLOC_CTX *mem_ctx,
2fc102
 
2fc102
     while (input[i]) {
2fc102
         switch(input[i]) {
2fc102
+        case '\t':
2fc102
+            output[j++] = '\\';
2fc102
+            output[j++] = '0';
2fc102
+            output[j++] = '9';
2fc102
+            break;
2fc102
+        case ' ':
2fc102
+            output[j++] = '\\';
2fc102
+            output[j++] = '2';
2fc102
+            output[j++] = '0';
2fc102
+            break;
2fc102
         case '*':
2fc102
             output[j++] = '\\';
2fc102
             output[j++] = '2';
2fc102
-- 
2fc102
1.8.5.3
2fc102