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 <ma...@apache.org>
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)
       </fix>
+      <fix>
+        Correct the logic used to detect errors when deleting temporary files
+        associated with persisting the Jakarta Authentication provider
+        configuration. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>


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

Reply via email to