On Fri, Jun 26, 2026 at 3:15 AM Christopher Schultz
<[email protected]> wrote:
>
> Mark,
>
> On 6/25/26 6:11 AM, [email protected] wrote:
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > markt-asf pushed a commit to branch main
> > in repository https://gitbox.apache.org/repos/asf/tomcat.git
> >
> >
> > The following commit(s) were added to refs/heads/main by this push:
> >       new 8f6d90c5bc Add i18n support to all uses of pathCheck
> > 8f6d90c5bc is described below
> >
> > commit 8f6d90c5bcceeadcd2bee90e39f3605328479be6
> > Author: Mark Thomas <[email protected]>
> > AuthorDate: Thu Jun 25 11:10:45 2026 +0100
> >
> >      Add i18n support to all uses of pathCheck
> > ---
> >   .../catalina/manager/host/HostManagerServlet.java  | 30 
> > +++++++++++++++++-----
> >   1 file changed, 24 insertions(+), 6 deletions(-)
> >
> > diff --git a/java/org/apache/catalina/manager/host/HostManagerServlet.java 
> > b/java/org/apache/catalina/manager/host/HostManagerServlet.java
> > index 7487edf410..0a7bfab5af 100644
> > --- a/java/org/apache/catalina/manager/host/HostManagerServlet.java
> > +++ b/java/org/apache/catalina/manager/host/HostManagerServlet.java
> > @@ -374,14 +374,14 @@ public class HostManagerServlet extends HttpServlet 
> > implements ContainerServlet
> >           }
> >
> >           // Create base for config files
> > -        File configBaseFile = getConfigBase(name);
> > +        File configBaseFile = getConfigBase(name, writer, smClient);
> > +        if (configBaseFile == null) {
> > +            
> > writer.println(smClient.getString("hostManagerServlet.configBaseCreateFail",
> >  name));
> > +            return;
> > +        }
> >
> >           // Copy manager.xml if requested
> >           if (manager) {
> > -            if (configBaseFile == null) {
> > -                
> > writer.println(smClient.getString("hostManagerServlet.configBaseCreateFail",
> >  name));
> > -                return;
> > -            }
> >               try (InputStream is = 
> > getServletContext().getResourceAsStream("/WEB-INF/manager.xml")) {
> >                   if (is == null) {
> >                       
> > writer.println(smClient.getString("hostManagerServlet.managerXml"));
> > @@ -651,8 +651,26 @@ public class HostManagerServlet extends HttpServlet 
> > implements ContainerServlet
> >        * @param hostName The host name
> >        *
> >        * @return the config base for the host
> > +     *
> > +     * @deprecated Unused. Will be removed in Tomcat 12. Use {@link 
> > #getConfigBase(String, PrintWriter, StringManager)}
> >        */
> > +    @Deprecated
> >       protected File getConfigBase(String hostName) {
> > +        return getConfigBase(hostName, null, null);
> > +    }
>
> This won't currently trigger any NPE, but the gate later in pathCheck
> only checks the "writer" for null and not the StringManager. Is it worth
> adding a null-check there, or is this sufficiently-internal that we can
> assume that when writer != null, smClient != null also?

Yes, it's tied to the writer != null.

Rémy

> -chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to