[Lada-commits] [PATCH] Fix regression of Rev 37952c111f71

Wald Commits scm-commit at wald.intevation.org
Thu Oct 13 21:14:10 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1476380788 -7200
# Node ID 719129c13666d5a3d9b84ff0efcfc54e83022983
# Parent  cf03bdd5976701209449f74df150f07b6147f038
Fix regression of Rev 37952c111f71.

Rev 37952c111f71 led to wiping away every role given in a comma
separated list after the first comma, which also broke the automatic
tests.

diff -r cf03bdd59767 -r 719129c13666 src/main/java/de/intevation/lada/util/auth/ShibbolethFilter.java
--- a/src/main/java/de/intevation/lada/util/auth/ShibbolethFilter.java	Thu Oct 13 18:35:28 2016 +0200
+++ b/src/main/java/de/intevation/lada/util/auth/ShibbolethFilter.java	Thu Oct 13 19:46:28 2016 +0200
@@ -136,8 +136,10 @@
             String[] groupStrings = roles.split(";");
             String item;
             for (int i = 0; i < groupStrings.length; i++) {
-                item = groupStrings[i].replaceAll(",.*", "").replace("cn=", "");
-                groups.add(item);
+                String[] items = groupStrings[i].trim().split(",");
+                for (int j = 0; j < items.length; j++) {
+                    groups.add(items[j].replace("cn=", "").trim());
+                }
             }
             return groups;
         }


More information about the Lada-commits mailing list