Blame SOURCES/0003-Revert-Jaas-add-several-improvements-to-cover-more-v.patch

3b98a7
From cd586dfa4ade4ea574aae0fa6ac034c07c77b25a Mon Sep 17 00:00:00 2001
3b98a7
From: Dominic Cleal <dcleal@redhat.com>
3b98a7
Date: Fri, 12 Jun 2015 09:47:48 +0100
3b98a7
Subject: [PATCH] Revert "Jaas: add several improvements to cover more valid
3b98a7
 syntax"
3b98a7
3b98a7
This partially reverts commit d17f2fbc30a52edb3719fc6df4c24f01552dd203
3b98a7
for compatibility with Augeas 1.1.0.
3b98a7
3b98a7
Trailing semicolons remain part of the last value.  Only support for
3b98a7
"naked" booleans has been kept from 1.4.0.
3b98a7
3b98a7
Conflicts:
3b98a7
	NEWS
3b98a7
---
3b98a7
 lenses/jaas.aug            | 29 ++++++++++++-----------------
3b98a7
 lenses/tests/test_jaas.aug | 21 ++++++++++-----------
3b98a7
 2 files changed, 22 insertions(+), 28 deletions(-)
3b98a7
3b98a7
diff --git a/lenses/jaas.aug b/lenses/jaas.aug
3b98a7
index 4f06bad9..a13682e3 100644
3b98a7
--- a/lenses/jaas.aug
3b98a7
+++ b/lenses/jaas.aug
3b98a7
@@ -1,36 +1,31 @@
3b98a7
 (* Module Jaas *)
3b98a7
-(* Original Author: Simon Vocella <voxsim@gmail.com> *)
3b98a7
-(* Updated by: Steve Shipway <steve@steveshipway.org> *)
3b98a7
-(* Changes: allow comments within Modules, allow optionless flags,  *)
3b98a7
-(* allow options without linebreaks, allow naked true/false options *)
3b98a7
-(* Trailing ';' terminator should not be included in option value   *)
3b98a7
-(* Note: requires latest Util.aug for multiline comments to work    *)
3b98a7
+(* Author: Simon Vocella <voxsim@gmail.com> *)
3b98a7
 
3b98a7
 module Jaas =
3b98a7
 
3b98a7
 autoload xfm
3b98a7
 
3b98a7
 let space_equal = del (/[ \t]*/ . "=" . /[ \t]*/) (" = ")
3b98a7
-let lbrace = del (/[ \t\n]*\{[ \t]*\n/) " {\n"
3b98a7
-let rbrace = del (/[ \t]*}[ \t]*;/) " };"
3b98a7
+let lbrace = del (/[ \t\n]*/ . "{") "{"
3b98a7
+let rbrace = del ("};") "};"
3b98a7
 let word = /[A-Za-z0-9_.-]+/
3b98a7
-let wsnl = del (/[ \t\n]+/) ("\n")
3b98a7
-let endflag = del ( /[ \t]*;/ ) ( ";" )
3b98a7
+let wordonly = /[A-Za-z0-9_.-]+;/
3b98a7
 
3b98a7
 let value_re =
3b98a7
         let value_squote = /'[^\n']*'/
3b98a7
+        in let value_squote_2 = /'[^\n']*';/
3b98a7
         in let value_dquote = /"[^\n"]*"/
3b98a7
-        in let value_tf = /(true|false)/
3b98a7
-        in value_squote | value_dquote | value_tf
3b98a7
+        in let value_dquote_2 = /"[^\n"]*";/
3b98a7
+        in let value_tf = /(true|false);/
3b98a7
+        in let value_tf_2 = /(true|false);/
3b98a7
+        in value_squote | value_squote_2 | value_dquote | value_dquote_2 | value_tf | value_tf_2
3b98a7
 
3b98a7
-let moduleOption = [  wsnl . key word . space_equal . (store value_re) ]
3b98a7
-let moduleSuffix = ( moduleOption  | Util.eol . Util.comment_c_style | Util.comment_multiline  )
3b98a7
-let flag = [ Util.del_ws_spc . label "flag" . (store word) . moduleSuffix* . endflag ]
3b98a7
-let loginModuleClass = [( Util.del_opt_ws "" . label "loginModuleClass" . (store word) . flag ) ]
3b98a7
+let moduleOption = [Util.del_opt_ws "" . key word . space_equal . (store value_re . Util.comment_or_eol)]
3b98a7
+let flag = [label "flag" . ((store word . Util.eol . moduleOption+) | (store wordonly . Util.eol))]
3b98a7
+let loginModuleClass = [Util.del_opt_ws "" . label "loginModuleClass" . (store word . Util.del_ws_spc) . flag]
3b98a7
 
3b98a7
 let content = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModuleClass)*
3b98a7
 let loginModule = [Util.del_opt_ws "" . label "login" . (store word . lbrace) . (content . rbrace)]
3b98a7
-
3b98a7
 let lns = (Util.empty | Util.comment_c_style | Util.comment_multiline | loginModule)*
3b98a7
 let filter = incl "/opt/shibboleth-idp/conf/login.config"
3b98a7
 let xfm = transform lns filter
3b98a7
diff --git a/lenses/tests/test_jaas.aug b/lenses/tests/test_jaas.aug
3b98a7
index 5f2bfb13..d5ede698 100644
3b98a7
--- a/lenses/tests/test_jaas.aug
3b98a7
+++ b/lenses/tests/test_jaas.aug
3b98a7
@@ -54,7 +54,6 @@ ShibUserPassAuth {
3b98a7
       serviceCredential = \"ldappassword\"
3b98a7
       ssl = \"false\"
3b98a7
       userField = \"uid\"
3b98a7
-      // Example comment within definition
3b98a7
       subtreeSearch = \"true\";
3b98a7
 };
3b98a7
 
3b98a7
@@ -64,8 +63,9 @@ NetAccountAuth {
3b98a7
 };
3b98a7
 
3b98a7
 com.sun.security.jgss.krb5.initiate {
3b98a7
-   // Test of omitted linebreaks and naked boolean
3b98a7
-   com.sun.security.auth.module.Krb5LoginModule required useTicketCache=true;
3b98a7
+   // Test of naked boolean
3b98a7
+   com.sun.security.auth.module.Krb5LoginModule required
3b98a7
+      useTicketCache=true;
3b98a7
 };"
3b98a7
 
3b98a7
 test Jaas.lns get conf =
3b98a7
@@ -89,6 +89,7 @@ test Jaas.lns get conf =
3b98a7
   {  }
3b98a7
   {  }
3b98a7
   { "login" = "ShibUserPassAuth"
3b98a7
+    {  }
3b98a7
     {  }
3b98a7
     { "#comment" = "Example LDAP authentication" }
3b98a7
     { "#comment" = "See: https://wiki.shibboleth.net/confluence/display/SHIB2/IdPAuthUserPass" }
3b98a7
@@ -116,29 +117,27 @@ test Jaas.lns get conf =
3b98a7
         { "serviceCredential" = "\"ldappassword\"" }
3b98a7
         { "ssl" = "\"false\"" }
3b98a7
         { "userField" = "\"uid\"" }
3b98a7
-        { "#comment" = "Example comment within definition" }
3b98a7
-        { "subtreeSearch" = "\"true\"" }
3b98a7
+        { "subtreeSearch" = "\"true\";" }
3b98a7
       }
3b98a7
     }
3b98a7
-    {  }
3b98a7
   }
3b98a7
   {  }
3b98a7
   {  }
3b98a7
   { "login" = "NetAccountAuth"
3b98a7
+    {  }
3b98a7
     { "#comment" = "Test of optionless flag" }
3b98a7
     { "loginModuleClass" = "nz.ac.auckland.jaas.Krb5LoginModule"
3b98a7
-      { "flag" = "required" }
3b98a7
+      { "flag" = "required;" }
3b98a7
     }
3b98a7
-    {  }
3b98a7
   }
3b98a7
   {  }
3b98a7
   {  }
3b98a7
   { "login" = "com.sun.security.jgss.krb5.initiate"
3b98a7
-    { "#comment" = "Test of omitted linebreaks and naked boolean" }
3b98a7
+    {  }
3b98a7
+    { "#comment" = "Test of naked boolean" }
3b98a7
     { "loginModuleClass" = "com.sun.security.auth.module.Krb5LoginModule"
3b98a7
       { "flag" = "required"
3b98a7
-        { "useTicketCache" = "true" }
3b98a7
+        { "useTicketCache" = "true;" }
3b98a7
       }
3b98a7
     }
3b98a7
-    {  }
3b98a7
   }
3b98a7
-- 
c941cc
2.24.1
3b98a7