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

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