This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 07747b8ca36ffd29350af24d1c9fd05a174ba25d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Dec 10 14:55:53 2021 +0000

    Revert the previous fix for BZ 65714.
    
    Dispatching from the handshake completion handler was addressing the
    symptom of the lack of permissions rather than the cause.
---
 java/org/apache/tomcat/util/net/SecureNio2Channel.java | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SecureNio2Channel.java 
b/java/org/apache/tomcat/util/net/SecureNio2Channel.java
index 21a4ba1..1f537e4 100644
--- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java
+++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java
@@ -101,17 +101,12 @@ public class SecureNio2Channel extends Nio2Channel  {
             if (result.intValue() < 0) {
                 failed(new EOFException(), attachment);
             } else {
-                // When running under a security manager always dispatch so the
-                // processing occurs on a thread with the correct security
-                // context.
-                endpoint.processSocket(attachment, SocketEvent.OPEN_READ, 
Constants.IS_SECURITY_ENABLED);
+                endpoint.processSocket(attachment, SocketEvent.OPEN_READ, 
false);
             }
         }
         @Override
         public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> 
attachment) {
-            // When running under a security manager always dispatch so the
-            // processing occurs on a thread with the correct security context.
-            endpoint.processSocket(attachment, SocketEvent.ERROR, 
Constants.IS_SECURITY_ENABLED);
+            endpoint.processSocket(attachment, SocketEvent.ERROR, false);
         }
     }
 
@@ -123,17 +118,12 @@ public class SecureNio2Channel extends Nio2Channel  {
             if (result.intValue() < 0) {
                 failed(new EOFException(), attachment);
             } else {
-                // When running under a security manager always dispatch so the
-                // processing occurs on a thread with the correct security
-                // context.
-                endpoint.processSocket(attachment, SocketEvent.OPEN_WRITE, 
Constants.IS_SECURITY_ENABLED);
+                endpoint.processSocket(attachment, SocketEvent.OPEN_WRITE, 
false);
             }
         }
         @Override
         public void failed(Throwable exc, SocketWrapperBase<Nio2Channel> 
attachment) {
-            // When running under a security manager always dispatch so the
-            // processing occurs on a thread with the correct security context.
-            endpoint.processSocket(attachment, SocketEvent.ERROR, 
Constants.IS_SECURITY_ENABLED);
+            endpoint.processSocket(attachment, SocketEvent.ERROR, false);
         }
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to