On 01 Feb 2021, at 11:51, Mark Thomas <[email protected]> wrote: >> + if (family == Socket.APR_UNIX) { >> + if (getUnixDomainSocketPathPermissions() != null) { >> + FileAttribute<Set<PosixFilePermission>> attrs = >> + >> PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString( >> + getUnixDomainSocketPathPermissions())); >> + Files.setAttribute(Paths.get(getUnixDomainSocketPath()), >> attrs.name(), attrs.value()); >> + } >> + else { >> + java.io.File file = >> Paths.get(getUnixDomainSocketPath()).toFile(); >> + file.setReadable(true, false); >> + file.setWritable(true, false); >> + file.setExecutable(false, false); > > There appears to be scope to simplify this. See > https://github.com/apache/tomcat/commit/8706f885a > > <snip/>
This breaks Windows, as I indicated in another message. > >> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml >> index 86123e9..ee05083 100644 >> --- a/webapps/docs/changelog.xml >> +++ b/webapps/docs/changelog.xml >> @@ -314,6 +314,11 @@ >> specified to wait for client connections to complete and close before >> the Container hierarchy is stopped. (markt) >> </add> >> + <add> >> + <bug>64943</bug>: Add support for Unix Domain Sockets to >> + <code>org.apache.coyote.http11.Http11AprProtocol</code>. Depends on >> + <code>tomcat-native</code> 1.2.26 and up. (minfrin) >> + </add> > > Wrong section. This belongs in Coyote. > >> <fix> >> <bug>64921</bug>: Ensure that the >> <code>LoadBalancerDrainingValve</code> >> uses the correct setting for the secure attribute for any session >> diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml >> index 4f2d17b..fdb86cd 100644 >> --- a/webapps/docs/config/http.xml >> +++ b/webapps/docs/config/http.xml >> @@ -898,12 +898,8 @@ >> <attribute name="unixDomainSocketPath" required="false"> >> <p>Where supported, the path to a Unix Domain Socket that this >> <strong>Connector</strong> will create and await incoming >> connections. >> - Tomcat will NOT automatically remove the socket on server shutdown. >> - If the socket already exists, care must be taken by the >> administrator >> - to remove the socket after verifying that the socket isn't already >> - being used by an existing Tomcat process. Using this requires >> - Java 16 or later. When this is specified, the otherwise mandatory >> - <code>port</code> attribute may be omitted.</p> >> + When this is specified, the otherwise mandatory <code>port</code> >> + attribute may be omitted.</p> >> </attribute> > > If you are going to remove the warning from this section then you should > add a link to the more detailed information on UDS supported added in > this commit. The warning is stale, the behaviour described was removed in a subsequent commit (but this doc was missed in that commit) - Tomcat does remove the socket on server shutdown, both in the NIO and APR case. Regards, Graham — --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
