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

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