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

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