Commit 50f7157f authored by Patrick Dowler's avatar Patrick Dowler
Browse files

strip quotes from DN in servlet init

parent 966ea7a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ sourceCompatibility = 1.7

group = 'org.opencadc'

version = '1.1.1'
version = '1.1.2'

dependencies {
    compile 'log4j:log4j:1.+'
+2 −1
Original line number Diff line number Diff line
@@ -116,7 +116,8 @@ public class CadcDelegationServlet extends DelegationServlet
            String[] dns = suDNStr.split("\n");
            for (String dn : dns)
            {
                X500Principal su = new X500Principal(dn);
                String sp = dn.replaceAll("\"", "").trim();
                X500Principal su = new X500Principal(sp);
                suDNs.add(su);
                LOGGER.info("SU: " + su.getName());
            }
+8 −6
Original line number Diff line number Diff line
@@ -154,8 +154,8 @@ public class ProxyServlet extends HttpServlet
                String principalStr = st.nextToken();
                StringTokenizer st2 = new StringTokenizer(principalStr, ":",
                                                          false);
                final String principal; // the principal of the trusted client
                final Float maxDaysValid; // maximum lifetime of the returned proxy
                String principal; // the principal of the trusted client
                Float maxDaysValid; // maximum lifetime of the returned proxy

                if (st2.countTokens() == 1)
                {
@@ -179,10 +179,12 @@ public class ProxyServlet extends HttpServlet
                            "Cannot parse trusted principal from servlet " +
                            "config: " + principalStr);
                }
                LOGGER.info("trusted: " + principal + " , max days valid: "
                            + maxDaysValid);
                trustedPrincipals.put(new X500Principal(principal),
                                      maxDaysValid);
                if (principal != null)
                {
                    principal = principal.replaceAll("\"", "");
                    LOGGER.info("trusted: " + principal + " , max days valid: " + maxDaysValid);
                    trustedPrincipals.put(new X500Principal(principal), maxDaysValid);
                }
            }
        }