Blame SOURCES/0017-Krb5-permit-braces-in-values-when-not-in-sub-section.patch

c537d4
From 1ac63d941a60816799b7c70941fefbafdb4d79de Mon Sep 17 00:00:00 2001
c537d4
From: Dominic Cleal <dcleal@redhat.com>
c537d4
Date: Tue, 25 Feb 2014 16:19:51 +0000
c537d4
Subject: [PATCH 3/3] Krb5: permit braces in values when not in sub-section
c537d4
c537d4
Fixes RHBZ#1066419
c537d4
c537d4
(cherry picked from commit d9465ab8e88f91cb5a29eb9f04044876ce45a2d9)
c537d4
c537d4
Conflicts:
c537d4
	NEWS
c537d4
---
c537d4
 lenses/krb5.aug            | 15 ++++++++-------
c537d4
 lenses/tests/test_krb5.aug |  7 +++++++
c537d4
 2 files changed, 15 insertions(+), 7 deletions(-)
c537d4
c537d4
diff --git a/lenses/krb5.aug b/lenses/krb5.aug
c537d4
index 8d26cfe..8b4ebe4 100644
c537d4
--- a/lenses/krb5.aug
c537d4
+++ b/lenses/krb5.aug
c537d4
@@ -25,16 +25,17 @@ let realm_re = /[A-Z][.a-zA-Z0-9-]*/
c537d4
 let app_re = /[a-z][a-zA-Z0-9_]*/
c537d4
 let name_re = /[.a-zA-Z0-9_-]+/
c537d4
 
c537d4
-let value = store /[^;# \t\r\n{}]+/
c537d4
-let entry (kw:regexp) (sep:lens) (comment:lens)
c537d4
+let value_br = store /[^;# \t\r\n{}]+/
c537d4
+let value = store /[^;# \t\r\n]+/
c537d4
+let entry (kw:regexp) (sep:lens) (value:lens) (comment:lens)
c537d4
     = [ indent . key kw . sep . value . (comment|eol) ] | comment
c537d4
 
c537d4
 let subsec_entry (kw:regexp) (sep:lens) (comment:lens)
c537d4
-    = ( entry kw sep comment ) | empty
c537d4
+    = ( entry kw sep value_br comment ) | empty
c537d4
 
c537d4
 let simple_section (n:string) (k:regexp) =
c537d4
   let title = Inifile.indented_title n in
c537d4
-  let entry = entry k eq comment in
c537d4
+  let entry = entry k eq value comment in
c537d4
     Inifile.record title entry
c537d4
 
c537d4
 let record (t:string) (e:lens) =
c537d4
@@ -59,7 +60,7 @@ let enctype_list (nr:regexp) (ns:string) =
c537d4
     . (comment|eol) . [ label "#eol" ]
c537d4
 
c537d4
 let libdefaults =
c537d4
-  let option = entry (name_re - ("v4_name_convert" |enctypes)) eq comment in
c537d4
+  let option = entry (name_re - ("v4_name_convert" |enctypes)) eq value comment in
c537d4
   let enctype_lists = enctype_list /permitted_enctypes/i "permitted_enctypes"
c537d4
                       | enctype_list /default_tgs_enctypes/i "default_tgs_enctypes"
c537d4
                       | enctype_list /default_tkt_enctypes/i "default_tkt_enctypes" in
c537d4
@@ -73,7 +74,7 @@ let login =
c537d4
     simple_section "login" keys
c537d4
 
c537d4
 let appdefaults =
c537d4
-  let option = entry (name_re - ("realm" | "application")) eq comment in
c537d4
+  let option = entry (name_re - ("realm" | "application")) eq value_br comment in
c537d4
   let realm = [ indent . label "realm" . store realm_re .
c537d4
                   eq_openbr . (option|empty)* . closebr . eol ] in
c537d4
   let app = [ indent . label "application" . store app_re .
c537d4
@@ -117,7 +118,7 @@ let logging =
c537d4
 let capaths =
c537d4
   let realm = [ indent . key realm_re .
c537d4
                   eq_openbr .
c537d4
-                  (entry realm_re eq comment)* . closebr . eol ] in
c537d4
+                  (entry realm_re eq value_br comment)* . closebr . eol ] in
c537d4
     record "capaths" (realm|comment)
c537d4
 
c537d4
 let dbdefaults =
c537d4
diff --git a/lenses/tests/test_krb5.aug b/lenses/tests/test_krb5.aug
c537d4
index 0547b65..b0ec6d6 100644
c537d4
--- a/lenses/tests/test_krb5.aug
c537d4
+++ b/lenses/tests/test_krb5.aug
c537d4
@@ -995,3 +995,10 @@ test Krb5.lns get v4_name_convert =
c537d4
 (* Ticket #288: semicolons for comments *)
c537d4
 test Krb5.lns get "; AD  : This Kerberos configuration is for CERN's Active Directory realm.\n" =
c537d4
     { "#comment" = "AD  : This Kerberos configuration is for CERN's Active Directory realm." }
c537d4
+
c537d4
+(* RHBZ#1066419: braces in values *)
c537d4
+test Krb5.lns get "[libdefaults]\n
c537d4
+default_ccache_name = KEYRING:persistent:%{uid}\n" =
c537d4
+  { "libdefaults"
c537d4
+    {  }
c537d4
+    { "default_ccache_name" = "KEYRING:persistent:%{uid}" } }
c537d4
-- 
c537d4
1.8.5.3
c537d4