source: debian-alt/disco/patches/0002-jetty-compatibility.patch @ 272588d

Last change on this file since 272588d was 272588d, checked in by zzz <zzz@…>, 20 months ago

Debian: Add Disco files, refresh patch for Jetty 9.4

  • Property mode set to 100644
File size: 6.7 KB
  • apps/jetty/java/src/net/i2p/jetty/JettyXmlConfigurationParser.java

    a b  
    4343    private static XmlParser initParser()
    4444    {
    4545        XmlParser parser = new XmlParser();
    46         URL config60 = Loader.getResource(XmlConfiguration.class, "org/eclipse/jetty/xml/configure_6_0.dtd");
    47         URL config76 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_7_6.dtd");
    48         URL config90 = Loader.getResource(XmlConfiguration.class,"org/eclipse/jetty/xml/configure_9_0.dtd");
     46        URL config60 = Loader.getResource("org/eclipse/jetty/xml/configure_6_0.dtd");
     47        URL config76 = Loader.getResource("org/eclipse/jetty/xml/configure_7_6.dtd");
     48        URL config90 = Loader.getResource("org/eclipse/jetty/xml/configure_9_0.dtd");
    4949        parser.redirectEntity("configure.dtd",config90);
    5050        parser.redirectEntity("configure_1_0.dtd",config60);
    5151        parser.redirectEntity("configure_1_1.dtd",config60);
  • apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java

    a b  
    132132     *
    133133     * Get the resource list as a HTML directory listing.
    134134     */
    135     @Override
    136135    protected void sendDirectory(HttpServletRequest request,
    137136            HttpServletResponse response,
    138137            Resource resource,
  • apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java

    a b  
    317317                buf.append(request.getMethod());
    318318                buf.append(' ');
    319319               
    320                 request.getUri().writeTo(u8buf);
     320                u8buf.append(request.getHttpURI().toString());
    321321               
    322322                buf.append(' ');
    323323                buf.append(request.getProtocol());
  • apps/routerconsole/java/src/net/i2p/router/web/HostCheckHandler.java

    a b  
    1515import net.i2p.util.PortMapper;
    1616
    1717import org.eclipse.jetty.server.Request;
    18 import org.eclipse.jetty.servlets.gzip.GzipHandler;
     18import org.eclipse.jetty.server.handler.gzip.GzipHandler;
    1919
    2020/**
    2121 * Block certain Host headers to prevent DNS rebinding attacks.
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    a b  
    2222import java.util.SortedSet;
    2323import java.util.StringTokenizer;
    2424import java.util.concurrent.LinkedBlockingQueue;
     25import javax.servlet.ServletRequest;
    2526
    2627import net.i2p.I2PAppContext;
    2728import net.i2p.app.ClientApp;
     
    4849import org.eclipse.jetty.security.HashLoginService;
    4950import org.eclipse.jetty.security.ConstraintMapping;
    5051import org.eclipse.jetty.security.ConstraintSecurityHandler;
     52import org.eclipse.jetty.security.UserStore;
    5153import org.eclipse.jetty.security.authentication.DigestAuthenticator;
    5254import org.eclipse.jetty.server.AbstractConnector;
    5355import org.eclipse.jetty.server.ConnectionFactory;
     
    959961            } else {
    960962                HashLoginService realm = new CustomHashLoginService(JETTY_REALM, context.getContextPath(),
    961963                                                                    ctx.logManager().getLog(RouterConsoleRunner.class));
     964                UserStore userStore = new UserStore();
     965                realm.setUserStore(userStore);
    962966                sec.setLoginService(realm);
    963967                sec.setAuthenticator(authenticator);
    964968                String[] role = new String[] {JETTY_ROLE};
     
    966970                    String user = e.getKey();
    967971                    String pw = e.getValue();
    968972                    Credential cred = Credential.getCredential(MD5_CREDENTIAL_TYPE + pw);
    969                     realm.putUser(user, cred, role);
     973                    userStore.addUser(user, cred, role);
    970974                    Constraint constraint = new Constraint(user, JETTY_ROLE);
    971975                    constraint.setAuthenticate(true);
    972976                    ConstraintMapping cm = new ConstraintMapping();
     
    986990                        try {
    987991                            // each char truncated to 8 bytes
    988992                            String user2 = new String(b2, "ISO-8859-1");
    989                             realm.putUser(user2, cred, role);
     993                            userStore.addUser(user2, cred, role);
    990994                            constraint = new Constraint(user2, JETTY_ROLE);
    991995                            constraint.setAuthenticate(true);
    992996                            cm = new ConstraintMapping();
     
    9971001                            // each UTF-8 byte as a char
    9981002                            // this is what chrome does
    9991003                            String user3 = new String(b1, "ISO-8859-1");
    1000                             realm.putUser(user3, cred, role);
     1004                            userStore.addUser(user3, cred, role);
    10011005                            constraint = new Constraint(user3, JETTY_ROLE);
    10021006                            constraint.setAuthenticate(true);
    10031007                            cm = new ConstraintMapping();
     
    10721076        }
    10731077
    10741078        @Override
    1075         public UserIdentity login(String username, Object credentials) {
    1076             UserIdentity rv = super.login(username, credentials);
     1079        public UserIdentity login(String username, Object credentials, ServletRequest request) {
     1080            UserIdentity rv = super.login(username, credentials, request);
    10771081            if (rv == null)
    10781082                //_log.logAlways(net.i2p.util.Log.WARN, "Console authentication failed, webapp: " + _webapp + ", user: " + username);
    10791083                _log.logAlways(net.i2p.util.Log.WARN, "Console authentication failed, user: " + username);
  • apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java

    a b  
    8585                    String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
    8686                    // Do we have a servlet for the new path that isn't the catchall *.jsp?
    8787                    @SuppressWarnings("rawtypes")
    88                     Map.Entry servlet = _wac.getServletHandler().getHolderEntry(testPath);
     88                    org.eclipse.jetty.http.pathmap.MappedResource servlet = _wac.getServletHandler().getMappedServlet(testPath);
    8989                    if (servlet != null) {
    90                         String servletPath = (String) servlet.getKey();
     90                        String servletPath = servlet.getPathSpec().getDeclaration();
    9191                        if (servletPath != null && !servletPath.startsWith("*")) {
    9292                            // success!!
    9393                            //System.err.println("Servlet is: " + servletPath);
Note: See TracBrowser for help on using the repository browser.