(tomcat) branch main updated: If the Jakarta Authentication fails with an exception, set a 500 status

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 805ab28395 If the Jakarta Authentication fails with an exception, set 
a 500 status
805ab28395 is described below

commit 805ab28395dfd4f372376f648175585ef444fd88
Author: Mark Thomas 
AuthorDate: Thu Sep 19 13:25:24 2024 +0100

If the Jakarta Authentication fails with an exception, set a 500 status

Depending on what fails where, the status may not be set or may be set
incorrectly.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index ba5e1baa4b..db467ba4e9 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -803,6 +803,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 authStatus = 
state.serverAuthContext.validateRequest(state.messageInfo, client, null);
 } catch (AuthException e) {
 log.debug(sm.getString("authenticator.loginFail"), e);
+// Need to explicitly set the return code as the ServerAuthContext 
may not have done.
+response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 return false;
 }
 


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



(tomcat) branch 10.1.x updated: If the Jakarta Authentication fails with an exception, set a 500 status

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new acc2f01395 If the Jakarta Authentication fails with an exception, set 
a 500 status
acc2f01395 is described below

commit acc2f01395f895980f5d8a64573fcc1bade13369
Author: Mark Thomas 
AuthorDate: Thu Sep 19 13:25:24 2024 +0100

If the Jakarta Authentication fails with an exception, set a 500 status

Depending on what fails where, the status may not be set or may be set
incorrectly.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 ++
 webapps/docs/changelog.xml| 5 +
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index ba5e1baa4b..db467ba4e9 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -803,6 +803,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 authStatus = 
state.serverAuthContext.validateRequest(state.messageInfo, client, null);
 } catch (AuthException e) {
 log.debug(sm.getString("authenticator.loginFail"), e);
+// Need to explicitly set the return code as the ServerAuthContext 
may not have done.
+response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 return false;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2367fb89a6..310f6fd041 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -117,6 +117,11 @@
 creates one GenericPrincipal in the Subject.
 (markt)
   
+  
+If the Jakarta Authentication process fails with an Exception,
+explicitly set the HTTP response status to 500 as the
+ServerAuthContext may not have set it. (markt)
+  
 
   
 


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



(tomcat) branch 11.0.x updated: If the Jakarta Authentication fails with an exception, set a 500 status

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
 new 6d097a6674 If the Jakarta Authentication fails with an exception, set 
a 500 status
6d097a6674 is described below

commit 6d097a66746635df6880fe7662a792156b0eca14
Author: Mark Thomas 
AuthorDate: Thu Sep 19 13:25:24 2024 +0100

If the Jakarta Authentication fails with an exception, set a 500 status

Depending on what fails where, the status may not be set or may be set
incorrectly.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 ++
 webapps/docs/changelog.xml| 5 +
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index ba5e1baa4b..db467ba4e9 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -803,6 +803,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 authStatus = 
state.serverAuthContext.validateRequest(state.messageInfo, client, null);
 } catch (AuthException e) {
 log.debug(sm.getString("authenticator.loginFail"), e);
+// Need to explicitly set the return code as the ServerAuthContext 
may not have done.
+response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 return false;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fe24cb3bc0..10958df67c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -117,6 +117,11 @@
 creates one GenericPrincipal in the Subject.
 (markt)
   
+  
+If the Jakarta Authentication process fails with an Exception,
+explicitly set the HTTP response status to 500 as the
+ServerAuthContext may not have set it. (markt)
+  
 
   
 


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



(tomcat) branch 9.0.x updated: If the Jakarta Authentication fails with an exception, set a 500 status

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 7532f9dc4a If the Jakarta Authentication fails with an exception, set 
a 500 status
7532f9dc4a is described below

commit 7532f9dc4a8c37ec958f79dc82c4924a6c539223
Author: Mark Thomas 
AuthorDate: Thu Sep 19 13:25:24 2024 +0100

If the Jakarta Authentication fails with an exception, set a 500 status

Depending on what fails where, the status may not be set or may be set
incorrectly.
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 2 ++
 webapps/docs/changelog.xml| 5 +
 2 files changed, 7 insertions(+)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index c0d4d8ccd5..4388cd2e9e 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -802,6 +802,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 authStatus = 
state.serverAuthContext.validateRequest(state.messageInfo, client, null);
 } catch (AuthException e) {
 log.debug(sm.getString("authenticator.loginFail"), e);
+// Need to explicitly set the return code as the ServerAuthContext 
may not have done.
+response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 return false;
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8074f32c43..3f9d8095f3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -112,6 +112,11 @@
 creates one GenericPrincipal in the Subject.
 (markt)
   
+  
+If the Jakarta Authentication process fails with an Exception,
+explicitly set the HTTP response status to 500 as the
+ServerAuthContext may not have set it. (markt)
+  
 
   
 


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



Buildbot failure in on tomcat-11.0.x

2024-09-19 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1279
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 11.0.x] 6d097a66746635df6880fe7662a792156b0eca14


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 2


-- ASF Buildbot


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



Buildbot failure in on tomcat-10.1.x

2024-09-19 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1400
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 10.1.x] acc2f01395f895980f5d8a64573fcc1bade13369


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 2


-- ASF Buildbot


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



Buildbot success in on tomcat-11.0.x

2024-09-19 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/1278
Blamelist: Mark Thomas 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 11.0.x] 8339eb7660a4ff6afea687783541d97c819a41ac


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 0

  shell_10: 0

  Rsync docs to nightlies.apache.org: 0

  shell_11: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_12: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



(tomcat) branch main updated (805ab28395 -> ce3b3e624a)

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from 805ab28395 If the Jakarta Authentication fails with an exception, set 
a 500 status
 new 44f38b18c3 Create dirs if required when persisting Jakarta Auth 
provider config
 new ce3b3e624a Fix logic of delete tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../catalina/authenticator/jaspic/LocalStrings.properties |  1 +
 .../authenticator/jaspic/PersistentProviderRegistrations.java | 11 +--
 2 files changed, 10 insertions(+), 2 deletions(-)


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



(tomcat) 01/02: Create dirs if required when persisting Jakarta Auth provider config

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 44f38b18c3f1ad1b25316df0bd7f802c989e11c5
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:29 2024 +0100

Create dirs if required when persisting Jakarta Auth provider config

Unlikely to be required when running in Tomcat. Is required when running
the TCK since the persistence mechanism is used outside of Tomcat and
the dirs don.t exist.
---
 .../apache/catalina/authenticator/jaspic/LocalStrings.properties   | 1 +
 .../authenticator/jaspic/PersistentProviderRegistrations.java  | 7 +++
 2 files changed, 8 insertions(+)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties 
b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
index 1930492629..7a3b0ece4a 100644
--- a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
+++ b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
@@ -29,6 +29,7 @@ jaspicAuthenticator.authenticate=Authenticating request for 
[{0}] via JASPIC
 
 persistentProviderRegistrations.deleteFail=The temporary file [{0}] cannot be 
deleted
 persistentProviderRegistrations.existsDeleteFail=The temporary file [{0}] 
already exists and cannot be deleted
+persistentProviderRegistrations.mkdirsFail=The directory for the persistent 
provider registrations [{0}] cannot be created
 persistentProviderRegistrations.moveFail=Failed to move [{0}] to [{1}]
 persistentProviderRegistrations.xmlFeatureEncoding=Exception configuring 
JASPIC to permit java encoding names in XML configuration files. Only IANA 
encoding names will be supported.
 
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 40845783a0..2766807d9d 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -94,6 +94,7 @@ public final class PersistentProviderRegistrations {
 static void writeProviders(Providers providers, File configFile) {
 File configFileOld = new File(configFile.getAbsolutePath() + ".old");
 File configFileNew = new File(configFile.getAbsolutePath() + ".new");
+File configParent = configFileNew.getParentFile();
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
@@ -108,6 +109,12 @@ public final class PersistentProviderRegistrations {
 configFileNew.getAbsolutePath()));
 }
 }
+if (!configParent.exists()) {
+if (!configParent.mkdirs()) {
+throw new 
SecurityException(sm.getString("persistentProviderRegistrations.mkdirsFail",
+configParent.getAbsolutePath()));
+}
+}
 
 // Write out the providers to the temporary new file
 try (OutputStream fos = new FileOutputStream(configFileNew);


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



(tomcat) 02/02: Fix logic of delete tests

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit ce3b3e624a6230305658b7021d9b89130fcb8497
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:55 2024 +0100

Fix logic of delete tests
---
 .../authenticator/jaspic/PersistentProviderRegistrations.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 2766807d9d..875ab1cff0 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -98,13 +98,13 @@ public final class PersistentProviderRegistrations {
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
-if (configFileOld.delete()) {
+if (!configFileOld.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileOld.getAbsolutePath()));
 }
 }
 if (configFileNew.exists()) {
-if (configFileNew.delete()) {
+if (!configFileNew.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileNew.getAbsolutePath()));
 }


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



(tomcat) branch main updated: Don't overwrite valid Principal from password callback will null

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 bf7374b8f4 Don't overwrite valid Principal from password callback will 
null
bf7374b8f4 is described below

commit bf7374b8f4ab6f497b8ff906980904e17f755335
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:59:04 2024 +0100

Don't overwrite valid Principal from password callback will null
---
 .../org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java 
b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
index e95654c4bc..afb0626eaf 100644
--- a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
@@ -69,7 +69,9 @@ public class CallbackHandlerImpl implements CallbackHandler, 
Contained {
 if (callback instanceof CallerPrincipalCallback) {
 CallerPrincipalCallback cpc = (CallerPrincipalCallback) 
callback;
 name = cpc.getName();
-principal = cpc.getPrincipal();
+if (cpc.getPrincipal() != null) {
+principal = cpc.getPrincipal();
+}
 subject = cpc.getSubject();
 } else if (callback instanceof GroupPrincipalCallback) {
 GroupPrincipalCallback gpc = (GroupPrincipalCallback) 
callback;


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



Re: [PR] Resize elements array and update index in SynchronizedStack#setLimit when needed [tomcat]

2024-09-19 Thread via GitHub


Chenjp commented on PR #750:
URL: https://github.com/apache/tomcat/pull/750#issuecomment-2360303343

   @markt-asf Would you please review detail of 
```Http2Protocol#setHttp11Protocol```? reconfigure stack limitation occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Buildbot success in on tomcat-9.0.x

2024-09-19 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/1084
Blamelist: Mark Thomas 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] ba7f750efae55338bd930ab372795585c803a085


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



(tomcat) 03/03: Don't overwrite valid Principal from password callback will null

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit db91aa4186446b01f414002a421db05be25fe242
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:59:04 2024 +0100

Don't overwrite valid Principal from password callback will null
---
 .../apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java   | 4 +++-
 webapps/docs/changelog.xml  | 6 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java 
b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
index e95654c4bc..afb0626eaf 100644
--- a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
@@ -69,7 +69,9 @@ public class CallbackHandlerImpl implements CallbackHandler, 
Contained {
 if (callback instanceof CallerPrincipalCallback) {
 CallerPrincipalCallback cpc = (CallerPrincipalCallback) 
callback;
 name = cpc.getName();
-principal = cpc.getPrincipal();
+if (cpc.getPrincipal() != null) {
+principal = cpc.getPrincipal();
+}
 subject = cpc.getSubject();
 } else if (callback instanceof GroupPrincipalCallback) {
 GroupPrincipalCallback gpc = (GroupPrincipalCallback) 
callback;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c2c359f1f3..3bfc6b30e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -132,6 +132,12 @@
 associated with persisting the Jakarta Authentication provider
 configuration. (markt)
   
+  
+When processing Jakarta Authentication callbacks, don't overwrite a
+Principal obtained from the PasswordValidationCallback 
with
+null if the CallerPrincipalCallback does not
+provide a Principal. (markt)
+  
 
   
 


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



(tomcat) 01/03: Create dirs if required when persisting Jakarta Auth provider config

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit a731053ef7b17afba2cda86612b8fad5112c5430
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:29 2024 +0100

Create dirs if required when persisting Jakarta Auth provider config

Unlikely to be required when running in Tomcat. Is required when running
the TCK since the persistence mechanism is used outside of Tomcat and
the dirs don.t exist.
---
 .../apache/catalina/authenticator/jaspic/LocalStrings.properties   | 1 +
 .../authenticator/jaspic/PersistentProviderRegistrations.java  | 7 +++
 webapps/docs/changelog.xml | 5 +
 3 files changed, 13 insertions(+)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties 
b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
index 1930492629..7a3b0ece4a 100644
--- a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
+++ b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
@@ -29,6 +29,7 @@ jaspicAuthenticator.authenticate=Authenticating request for 
[{0}] via JASPIC
 
 persistentProviderRegistrations.deleteFail=The temporary file [{0}] cannot be 
deleted
 persistentProviderRegistrations.existsDeleteFail=The temporary file [{0}] 
already exists and cannot be deleted
+persistentProviderRegistrations.mkdirsFail=The directory for the persistent 
provider registrations [{0}] cannot be created
 persistentProviderRegistrations.moveFail=Failed to move [{0}] to [{1}]
 persistentProviderRegistrations.xmlFeatureEncoding=Exception configuring 
JASPIC to permit java encoding names in XML configuration files. Only IANA 
encoding names will be supported.
 
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 40845783a0..2766807d9d 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -94,6 +94,7 @@ public final class PersistentProviderRegistrations {
 static void writeProviders(Providers providers, File configFile) {
 File configFileOld = new File(configFile.getAbsolutePath() + ".old");
 File configFileNew = new File(configFile.getAbsolutePath() + ".new");
+File configParent = configFileNew.getParentFile();
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
@@ -108,6 +109,12 @@ public final class PersistentProviderRegistrations {
 configFileNew.getAbsolutePath()));
 }
 }
+if (!configParent.exists()) {
+if (!configParent.mkdirs()) {
+throw new 
SecurityException(sm.getString("persistentProviderRegistrations.mkdirsFail",
+configParent.getAbsolutePath()));
+}
+}
 
 // Write out the providers to the temporary new file
 try (OutputStream fos = new FileOutputStream(configFileNew);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 310f6fd041..8fade95db0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,11 @@
 explicitly set the HTTP response status to 500 as the
 ServerAuthContext may not have set it. (markt)
   
+  
+When persisting the Jakarta Authentication provider configuration,
+create any necessary parent directories that don't already exist.
+(markt)
+  
 
   
 


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



[Bug 69331] New: NullPointerException (HttpServlet.java:559)

2024-09-19 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69331

Bug ID: 69331
   Summary: NullPointerException (HttpServlet.java:559)
   Product: Tomcat 10
   Version: 10.1.30
  Hardware: PC
OS: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: elatl...@gmail.com
  Target Milestone: --

Created attachment 39869
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39869&action=edit
Stack trace

13-Sep-2024 16:28:31.054 SEVERE [https-jsse-nio-443-exec-3]
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for
servlet [Login] in context with path [] threw exception
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because
"method" is null at
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:559)



Full Stack trace attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 03/03: Don't overwrite valid Principal from password callback will null

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 9fadc20c1b953b2dadee04d49bb1dc01ae4482c0
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:59:04 2024 +0100

Don't overwrite valid Principal from password callback will null
---
 .../apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java   | 4 +++-
 webapps/docs/changelog.xml  | 6 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java 
b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
index b725ffe047..d9eedd3735 100644
--- a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
@@ -68,7 +68,9 @@ public class CallbackHandlerImpl implements CallbackHandler, 
Contained {
 if (callback instanceof CallerPrincipalCallback) {
 CallerPrincipalCallback cpc = (CallerPrincipalCallback) 
callback;
 name = cpc.getName();
-principal = cpc.getPrincipal();
+if (cpc.getPrincipal() != null) {
+principal = cpc.getPrincipal();
+}
 subject = cpc.getSubject();
 } else if (callback instanceof GroupPrincipalCallback) {
 GroupPrincipalCallback gpc = (GroupPrincipalCallback) 
callback;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 671f1f36d1..5b2db7db84 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,12 @@
 associated with persisting the Jakarta Authentication provider
 configuration. (markt)
   
+  
+When processing Jakarta Authentication callbacks, don't overwrite a
+Principal obtained from the PasswordValidationCallback 
with
+null if the CallerPrincipalCallback does not
+provide a Principal. (markt)
+  
 
   
 


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



(tomcat) 02/03: Fix logic of delete tests

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 1477dee9be3d873356fa35d8e4b7dce8b148da17
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:55 2024 +0100

Fix logic of delete tests
---
 .../authenticator/jaspic/PersistentProviderRegistrations.java| 4 ++--
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 2766807d9d..875ab1cff0 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -98,13 +98,13 @@ public final class PersistentProviderRegistrations {
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
-if (configFileOld.delete()) {
+if (!configFileOld.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileOld.getAbsolutePath()));
 }
 }
 if (configFileNew.exists()) {
-if (configFileNew.delete()) {
+if (!configFileNew.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileNew.getAbsolutePath()));
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 303a27cf39..6d0064461f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,11 @@
 create any necessary parent directories that don't already exist.
 (markt)
   
+  
+Correct the logic used to detect errors when deleting temporary files
+associated with persisting the Jakarta Authentication provider
+configuration. (markt)
+  
 
   
 


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



(tomcat) branch 11.0.x updated (6d097a6674 -> ebe54c8206)

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 6d097a6674 If the Jakarta Authentication fails with an exception, set 
a 500 status
 new fd33d1f399 Create dirs if required when persisting Jakarta Auth 
provider config
 new 1477dee9be Fix logic of delete tests
 new ebe54c8206 Don't overwrite valid Principal from password callback will 
null

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/jaspic/CallbackHandlerImpl.java|  4 +++-
 .../authenticator/jaspic/LocalStrings.properties |  1 +
 .../jaspic/PersistentProviderRegistrations.java  | 11 +--
 webapps/docs/changelog.xml   | 16 
 4 files changed, 29 insertions(+), 3 deletions(-)


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



(tomcat) 01/03: Create dirs if required when persisting Jakarta Auth provider config

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 995baba8cf59810a988b2f08a75956f0ce068b91
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:29 2024 +0100

Create dirs if required when persisting Jakarta Auth provider config

Unlikely to be required when running in Tomcat. Is required when running
the TCK since the persistence mechanism is used outside of Tomcat and
the dirs don.t exist.
---
 .../apache/catalina/authenticator/jaspic/LocalStrings.properties   | 1 +
 .../authenticator/jaspic/PersistentProviderRegistrations.java  | 7 +++
 webapps/docs/changelog.xml | 5 +
 3 files changed, 13 insertions(+)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties 
b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
index 5d7e3765b7..46c4c96c5e 100644
--- a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
+++ b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
@@ -27,6 +27,7 @@ jaspicAuthenticator.authenticate=Authenticating request for 
[{0}] via JASPIC
 
 persistentProviderRegistrations.deleteFail=The temporary file [{0}] cannot be 
deleted
 persistentProviderRegistrations.existsDeleteFail=The temporary file [{0}] 
already exists and cannot be deleted
+persistentProviderRegistrations.mkdirsFail=The directory for the persistent 
provider registrations [{0}] cannot be created
 persistentProviderRegistrations.moveFail=Failed to move [{0}] to [{1}]
 persistentProviderRegistrations.xmlFeatureEncoding=Exception configuring 
JASPIC to permit java encoding names in XML configuration files. Only IANA 
encoding names will be supported.
 
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 40845783a0..2766807d9d 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -94,6 +94,7 @@ public final class PersistentProviderRegistrations {
 static void writeProviders(Providers providers, File configFile) {
 File configFileOld = new File(configFile.getAbsolutePath() + ".old");
 File configFileNew = new File(configFile.getAbsolutePath() + ".new");
+File configParent = configFileNew.getParentFile();
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
@@ -108,6 +109,12 @@ public final class PersistentProviderRegistrations {
 configFileNew.getAbsolutePath()));
 }
 }
+if (!configParent.exists()) {
+if (!configParent.mkdirs()) {
+throw new 
SecurityException(sm.getString("persistentProviderRegistrations.mkdirsFail",
+configParent.getAbsolutePath()));
+}
+}
 
 // Write out the providers to the temporary new file
 try (OutputStream fos = new FileOutputStream(configFileNew);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3f9d8095f3..2b8c405ded 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -117,6 +117,11 @@
 explicitly set the HTTP response status to 500 as the
 ServerAuthContext may not have set it. (markt)
   
+  
+When persisting the Jakarta Authentication provider configuration,
+create any necessary parent directories that don't already exist.
+(markt)
+  
 
   
 


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



(tomcat) 02/03: Fix logic of delete tests

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit 50dddaa068655435902867f0b03159c442790a32
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:55 2024 +0100

Fix logic of delete tests
---
 .../authenticator/jaspic/PersistentProviderRegistrations.java| 4 ++--
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 2766807d9d..875ab1cff0 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -98,13 +98,13 @@ public final class PersistentProviderRegistrations {
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
-if (configFileOld.delete()) {
+if (!configFileOld.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileOld.getAbsolutePath()));
 }
 }
 if (configFileNew.exists()) {
-if (configFileNew.delete()) {
+if (!configFileNew.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileNew.getAbsolutePath()));
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8fade95db0..c2c359f1f3 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,11 @@
 create any necessary parent directories that don't already exist.
 (markt)
   
+  
+Correct the logic used to detect errors when deleting temporary files
+associated with persisting the Jakarta Authentication provider
+configuration. (markt)
+  
 
   
 


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



(tomcat) 02/03: Fix logic of delete tests

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit e05b6b1dcf01c1125b6b880822a8b9fcbb1ffd76
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:55 2024 +0100

Fix logic of delete tests
---
 .../authenticator/jaspic/PersistentProviderRegistrations.java| 4 ++--
 webapps/docs/changelog.xml   | 5 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 2766807d9d..875ab1cff0 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -98,13 +98,13 @@ public final class PersistentProviderRegistrations {
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
-if (configFileOld.delete()) {
+if (!configFileOld.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileOld.getAbsolutePath()));
 }
 }
 if (configFileNew.exists()) {
-if (configFileNew.delete()) {
+if (!configFileNew.delete()) {
 throw new 
SecurityException(sm.getString("persistentProviderRegistrations.existsDeleteFail",
 configFileNew.getAbsolutePath()));
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2b8c405ded..671f1f36d1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,11 @@
 create any necessary parent directories that don't already exist.
 (markt)
   
+  
+Correct the logic used to detect errors when deleting temporary files
+associated with persisting the Jakarta Authentication provider
+configuration. (markt)
+  
 
   
 


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



(tomcat) branch 10.1.x updated (acc2f01395 -> db91aa4186)

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from acc2f01395 If the Jakarta Authentication fails with an exception, set 
a 500 status
 new a731053ef7 Create dirs if required when persisting Jakarta Auth 
provider config
 new 50dddaa068 Fix logic of delete tests
 new db91aa4186 Don't overwrite valid Principal from password callback will 
null

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/jaspic/CallbackHandlerImpl.java|  4 +++-
 .../authenticator/jaspic/LocalStrings.properties |  1 +
 .../jaspic/PersistentProviderRegistrations.java  | 11 +--
 webapps/docs/changelog.xml   | 16 
 4 files changed, 29 insertions(+), 3 deletions(-)


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



(tomcat) branch 9.0.x updated (7532f9dc4a -> 9fadc20c1b)

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


from 7532f9dc4a If the Jakarta Authentication fails with an exception, set 
a 500 status
 new 995baba8cf Create dirs if required when persisting Jakarta Auth 
provider config
 new e05b6b1dcf Fix logic of delete tests
 new 9fadc20c1b Don't overwrite valid Principal from password callback will 
null

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../authenticator/jaspic/CallbackHandlerImpl.java|  4 +++-
 .../authenticator/jaspic/LocalStrings.properties |  1 +
 .../jaspic/PersistentProviderRegistrations.java  | 11 +--
 webapps/docs/changelog.xml   | 16 
 4 files changed, 29 insertions(+), 3 deletions(-)


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



Buildbot failure in on tomcat-12.0.x

2024-09-19 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/62
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch main] bf7374b8f4ab6f497b8ff906980904e17f755335


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  compile: 1

  shell_7: 0

  shell_8: 0

  shell_9: 2


-- ASF Buildbot


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



(tomcat) 03/03: Don't overwrite valid Principal from password callback will null

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit ebe54c8206e89813020e964de47fb6256d1eab6a
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:59:04 2024 +0100

Don't overwrite valid Principal from password callback will null
---
 .../apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java   | 4 +++-
 webapps/docs/changelog.xml  | 6 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java 
b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
index e95654c4bc..afb0626eaf 100644
--- a/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
+++ b/java/org/apache/catalina/authenticator/jaspic/CallbackHandlerImpl.java
@@ -69,7 +69,9 @@ public class CallbackHandlerImpl implements CallbackHandler, 
Contained {
 if (callback instanceof CallerPrincipalCallback) {
 CallerPrincipalCallback cpc = (CallerPrincipalCallback) 
callback;
 name = cpc.getName();
-principal = cpc.getPrincipal();
+if (cpc.getPrincipal() != null) {
+principal = cpc.getPrincipal();
+}
 subject = cpc.getSubject();
 } else if (callback instanceof GroupPrincipalCallback) {
 GroupPrincipalCallback gpc = (GroupPrincipalCallback) 
callback;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6d0064461f..5718f5898d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -132,6 +132,12 @@
 associated with persisting the Jakarta Authentication provider
 configuration. (markt)
   
+  
+When processing Jakarta Authentication callbacks, don't overwrite a
+Principal obtained from the PasswordValidationCallback 
with
+null if the CallerPrincipalCallback does not
+provide a Principal. (markt)
+  
 
   
 


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



(tomcat) 01/03: Create dirs if required when persisting Jakarta Auth provider config

2024-09-19 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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

commit fd33d1f39932aa483522e4ea68a94547d1040407
Author: Mark Thomas 
AuthorDate: Thu Sep 19 14:57:29 2024 +0100

Create dirs if required when persisting Jakarta Auth provider config

Unlikely to be required when running in Tomcat. Is required when running
the TCK since the persistence mechanism is used outside of Tomcat and
the dirs don.t exist.
---
 .../apache/catalina/authenticator/jaspic/LocalStrings.properties   | 1 +
 .../authenticator/jaspic/PersistentProviderRegistrations.java  | 7 +++
 webapps/docs/changelog.xml | 5 +
 3 files changed, 13 insertions(+)

diff --git 
a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties 
b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
index 1930492629..7a3b0ece4a 100644
--- a/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
+++ b/java/org/apache/catalina/authenticator/jaspic/LocalStrings.properties
@@ -29,6 +29,7 @@ jaspicAuthenticator.authenticate=Authenticating request for 
[{0}] via JASPIC
 
 persistentProviderRegistrations.deleteFail=The temporary file [{0}] cannot be 
deleted
 persistentProviderRegistrations.existsDeleteFail=The temporary file [{0}] 
already exists and cannot be deleted
+persistentProviderRegistrations.mkdirsFail=The directory for the persistent 
provider registrations [{0}] cannot be created
 persistentProviderRegistrations.moveFail=Failed to move [{0}] to [{1}]
 persistentProviderRegistrations.xmlFeatureEncoding=Exception configuring 
JASPIC to permit java encoding names in XML configuration files. Only IANA 
encoding names will be supported.
 
diff --git 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
index 40845783a0..2766807d9d 100644
--- 
a/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
+++ 
b/java/org/apache/catalina/authenticator/jaspic/PersistentProviderRegistrations.java
@@ -94,6 +94,7 @@ public final class PersistentProviderRegistrations {
 static void writeProviders(Providers providers, File configFile) {
 File configFileOld = new File(configFile.getAbsolutePath() + ".old");
 File configFileNew = new File(configFile.getAbsolutePath() + ".new");
+File configParent = configFileNew.getParentFile();
 
 // Remove left over temporary files if present
 if (configFileOld.exists()) {
@@ -108,6 +109,12 @@ public final class PersistentProviderRegistrations {
 configFileNew.getAbsolutePath()));
 }
 }
+if (!configParent.exists()) {
+if (!configParent.mkdirs()) {
+throw new 
SecurityException(sm.getString("persistentProviderRegistrations.mkdirsFail",
+configParent.getAbsolutePath()));
+}
+}
 
 // Write out the providers to the temporary new file
 try (OutputStream fos = new FileOutputStream(configFileNew);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 10958df67c..303a27cf39 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,11 @@
 explicitly set the HTTP response status to 500 as the
 ServerAuthContext may not have set it. (markt)
   
+  
+When persisting the Jakarta Authentication provider configuration,
+create any necessary parent directories that don't already exist.
+(markt)
+  
 
   
 


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



Jakarta Authentication TCK

2024-09-19 Thread Mark Thomas

Hi all,

The current status is that Tomcat 11.0.x passes the Jakarta 
Authentication TCK apart from tests that are currently being challenged. 
Those challenges are:


1. All the SOAP tests since SOAP support was removed from Jakarta EE for 
Jakarta EE 11.


2. The ServletProfileSPITest#CheckMsgInfoKey test since it is hard-coded 
to require Jakarta Authorization


I'm not planning on formally certifying for the Jakarta Authentication API.

Some of the configuration required to get the TCK running seemed a 
little hacky. I have an open issue with the Jakarta Authentication 
project to find out the right way to do things. My hope is that once 
that is resolved, I'll be able to add the Authentication TCK to the 
tomcat-tck project and run it with the others.


Mark


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



[PR] Fix: evict cached MBean when bean descriptor content changed to ensure ManagedBean#getMBeanInfo result is correct. [tomcat]

2024-09-19 Thread via GitHub


Chenjp opened a new pull request, #755:
URL: https://github.com/apache/tomcat/pull/755

   1. ensure evict cache for each modification like returnType, name, desc, 
addAttribute etc. 
   2. code refactoring.
   3. testcase added.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Buildbot success in on tomcat-10.1.x

2024-09-19 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/1399
Blamelist: Mark Thomas 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 10.1.x] 7a8756b41748ca6d7f97868ad73a474fd82d2933


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Re: [PR] Resize elements array and update index in SynchronizedStack#setLimit when needed [tomcat]

2024-09-19 Thread via GitHub


markt-asf commented on PR #750:
URL: https://github.com/apache/tomcat/pull/750#issuecomment-2360404011

   `maxConnections` is rarely changed at runtime. When it is changed, it is 
more likely to be increased than decreased. In the extremely rare cases it is 
decreased, the stack will remain larger than strictly necessary. And that is 
acceptable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Buildbot failure in on tomcat-9.0.x

2024-09-19 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/1085
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] 7532f9dc4a8c37ec958f79dc82c4924a6c539223


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 2


-- ASF Buildbot


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