Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Examples for SymlinkAllowedResourceAliasChecker in XML config file

Hi,

It takes the ContextHandler and optional base resource (if the base resource is different to that of the ContextHandler).
The symlink must exist under your resourceBase for the SymlinkAllowedResourceAliasChecker to approve it.

So your XML could now look something like this:

<Configure id="MyContext" class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/css-validator</Set>
  <Set name="war">/usr/share/css-validator/css-validator</Set>

  <!-- Enable symlinks -->
  <Call name="addAliasCheck">
    <Arg>
      <New class="org.eclipse.jetty.server.AllowedResourceAliasChecker">
        <Arg><Ref refid="MyContext"/></Arg>
      <New/>
    </Arg>
  </Call>

</Configure>


cheers,
Lachlan

On Wed, Jun 25, 2025 at 8:37 PM Fab Stz via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
Hello,

I have a web app configuration XML file like this (because there are symbolic
links to the jars in WEB-INF/libs), but AllowSymLinkAliasChecker [1] is said
to be deprecated and replaced by SymlinkAllowedResourceAliasChecker.

However I can't manage to switch to that. Do you have an example? The symbolic
links point to jars in /usr/share/java.


<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/css-validator</Set>
  <Set name="war">/usr/share/css-validator/css-validator</Set>

  <!-- Enable symlinks -->
  <Call name="addAliasCheck">
    <Arg>
      <New class="org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker" /
>
    </Arg>
  </Call>

</Configure>


[1] https://javadoc.jetty.org/jetty-11/org/eclipse/jetty/server/handler/
AllowSymLinkAliasChecker.html


Regards
Fab


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top