Blame SOURCES/0004-pkispawn-fails-against-389-ds-1.4.3.19-3458-3465.patch

7e02d1
From d17df6f22376753b5cd156f1b7f51837cae1f522 Mon Sep 17 00:00:00 2001
7e02d1
From: jmagne <jmagne@redhat.com>
7e02d1
Date: Mon, 22 Feb 2021 13:44:20 -0800
7e02d1
Subject: [PATCH] pkispawn fails against 389-ds 1.4.3.19 #3458 (#3465)
7e02d1
7e02d1
Add suggested patch from stanislavlevin to solve this issue.
7e02d1
Also add f34 to the ipa tests,this time really add the tests.
7e02d1
Upon further review, back out of f34 tests until the infractructure
7e02d1
supports it.
7e02d1
7e02d1
Also hardcode tomcat app setting in spec file for the moment to
7e02d1
avoid possible glitches on certain platform.
7e02d1
7e02d1
Co-authored-by: Jack Magne <jmagne@localhost.localdomain>
7e02d1
---
7e02d1
 .../com/netscape/cmscore/apps/CMSEngine.java   | 18 +++++++-----------
7e02d1
 1 file changed, 7 insertions(+), 11 deletions(-)
7e02d1
7e02d1
diff --git a/base/server/src/com/netscape/cmscore/apps/CMSEngine.java b/base/server/src/com/netscape/cmscore/apps/CMSEngine.java
7e02d1
index 295c4d4cc..f40f99136 100644
7e02d1
--- a/base/server/src/com/netscape/cmscore/apps/CMSEngine.java
7e02d1
+++ b/base/server/src/com/netscape/cmscore/apps/CMSEngine.java
7e02d1
@@ -156,9 +156,8 @@ public class CMSEngine {
7e02d1
 
7e02d1
     private static final int PW_OK =0;
7e02d1
     //private static final int PW_BAD_SETUP = 1;
7e02d1
-    private static final int PW_INVALID_PASSWORD = 2;
7e02d1
+    private static final int PW_INVALID_CREDENTIALS = 2;
7e02d1
     private static final int PW_CANNOT_CONNECT = 3;
7e02d1
-    private static final int PW_NO_USER = 4;
7e02d1
     private static final int PW_MAX_ATTEMPTS = 3;
7e02d1
 
7e02d1
 
7e02d1
@@ -332,16 +331,16 @@ public class CMSEngine {
7e02d1
             }
7e02d1
 
7e02d1
             int iteration = 0;
7e02d1
-            int result = PW_INVALID_PASSWORD;
7e02d1
+            int result = PW_INVALID_CREDENTIALS;
7e02d1
 
7e02d1
             do {
7e02d1
                 String passwd = mPasswordStore.getPassword(tag, iteration);
7e02d1
                 result = testLDAPConnection(tag, connInfo, binddn, passwd);
7e02d1
                 iteration++;
7e02d1
-            } while ((result == PW_INVALID_PASSWORD) && (iteration < PW_MAX_ATTEMPTS));
7e02d1
+            } while ((result == PW_INVALID_CREDENTIALS) && (iteration < PW_MAX_ATTEMPTS));
7e02d1
 
7e02d1
             if (result != PW_OK) {
7e02d1
-                if ((result == PW_NO_USER) && (tag.equals("replicationdb"))) {
7e02d1
+                if ((result == PW_INVALID_CREDENTIALS) && (tag.equals("replicationdb"))) {
7e02d1
                     logger.warn(
7e02d1
                         "CMSEngine: password test execution failed for replicationdb " +
7e02d1
                         "with NO_SUCH_USER. This may not be a latest instance. Ignoring ..");
7e02d1
@@ -364,7 +363,7 @@ public class CMSEngine {
7e02d1
         int ret = PW_OK;
7e02d1
 
7e02d1
         if (StringUtils.isEmpty(pwd)) {
7e02d1
-            return PW_INVALID_PASSWORD;
7e02d1
+            return PW_INVALID_CREDENTIALS;
7e02d1
         }
7e02d1
 
7e02d1
         String host = info.getHost();
7e02d1
@@ -383,12 +382,9 @@ public class CMSEngine {
7e02d1
 
7e02d1
             switch (e.getLDAPResultCode()) {
7e02d1
             case LDAPException.NO_SUCH_OBJECT:
7e02d1
-                logger.debug("CMSEngine: user does not exist: " + binddn);
7e02d1
-                ret = PW_NO_USER;
7e02d1
-                break;
7e02d1
             case LDAPException.INVALID_CREDENTIALS:
7e02d1
-                logger.debug("CMSEngine: invalid password");
7e02d1
-                ret = PW_INVALID_PASSWORD;
7e02d1
+                logger.debug("CMSEngine: invalid credentials");
7e02d1
+                ret = PW_INVALID_CREDENTIALS;
7e02d1
                 break;
7e02d1
             default:
7e02d1
                 logger.debug("CMSEngine: unable to connect to " + name + ": " + e.getMessage());
7e02d1
-- 
7e02d1
2.29.2
7e02d1