From d93901aa0cf00cf0f7b21160baed5e5fc336a87f Mon Sep 17 00:00:00 2001 From: Martin Seidl Date: Fri, 22 Sep 2023 16:09:31 +0200 Subject: [PATCH 1/5] (bsc#1211355) Fix issue where bad scc creds were preventing other credentials to refresh --- .../redhat/rhn/manager/content/ContentSyncManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java index 252a46a1056a..87f83962cec1 100644 --- a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java +++ b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java @@ -521,7 +521,8 @@ private List listProductsImpl() { */ private void refreshRepositoriesAuthentication(String mirrorUrl, boolean excludeSCC) throws ContentSyncException { List credentials = filterCredentials(); - + // ContentSyncException flag + boolean cse = false; ChannelFactory.cleanupOrphanVendorContentSource(); // Query repos for all mirror credentials and consolidate @@ -540,7 +541,8 @@ private void refreshRepositoriesAuthentication(String mirrorUrl, boolean exclude // test for OES credentials if (c == null || !accessibleUrl(OES_URL, c.getUsername(), c.getPassword())) { LOG.info("Credential is not an OES credentials"); - throw new ContentSyncException(e); + // ContentSyncException flag + cse = true; } } catch (URISyntaxException e) { @@ -564,6 +566,10 @@ else if (c.isTypeOf(Credentials.TYPE_CLOUD_RMT)) { ensureSUSEProductChannelData(); linkAndRefreshContentSource(mirrorUrl); ManagerInfoFactory.setLastMgrSyncRefresh(); + + if (cse) { + throw new ContentSyncException("Invalid credentials"); + } } /** From 2d74f223220f7777c4ef2926718927914001f65d Mon Sep 17 00:00:00 2001 From: Martin Seidl Date: Thu, 28 Sep 2023 15:51:16 +0200 Subject: [PATCH 2/5] Update java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java Co-authored-by: Can Bulut Bayburt <1103552+cbbayburt@users.noreply.github.com> --- .../src/com/redhat/rhn/manager/content/ContentSyncManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java index 87f83962cec1..1a03aae92e68 100644 --- a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java +++ b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java @@ -541,8 +541,7 @@ private void refreshRepositoriesAuthentication(String mirrorUrl, boolean exclude // test for OES credentials if (c == null || !accessibleUrl(OES_URL, c.getUsername(), c.getPassword())) { LOG.info("Credential is not an OES credentials"); - // ContentSyncException flag - cse = true; + syncException = e; } } catch (URISyntaxException e) { From c5891d44a833792e797286f3fb455dd3c25c4d95 Mon Sep 17 00:00:00 2001 From: Martin Seidl Date: Thu, 28 Sep 2023 15:51:31 +0200 Subject: [PATCH 3/5] Update java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java Co-authored-by: Can Bulut Bayburt <1103552+cbbayburt@users.noreply.github.com> --- .../src/com/redhat/rhn/manager/content/ContentSyncManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java index 1a03aae92e68..33bf2356eba9 100644 --- a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java +++ b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java @@ -521,8 +521,7 @@ private List listProductsImpl() { */ private void refreshRepositoriesAuthentication(String mirrorUrl, boolean excludeSCC) throws ContentSyncException { List credentials = filterCredentials(); - // ContentSyncException flag - boolean cse = false; + Exception syncException = null; ChannelFactory.cleanupOrphanVendorContentSource(); // Query repos for all mirror credentials and consolidate From 356110c82a0287eb3dcd0fec9e601a8dfabc7a3b Mon Sep 17 00:00:00 2001 From: Martin Seidl Date: Thu, 28 Sep 2023 15:52:04 +0200 Subject: [PATCH 4/5] Update java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java Co-authored-by: Can Bulut Bayburt <1103552+cbbayburt@users.noreply.github.com> --- .../com/redhat/rhn/manager/content/ContentSyncManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java index 33bf2356eba9..718ccfec6e53 100644 --- a/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java +++ b/java/code/src/com/redhat/rhn/manager/content/ContentSyncManager.java @@ -544,7 +544,7 @@ private void refreshRepositoriesAuthentication(String mirrorUrl, boolean exclude } } catch (URISyntaxException e) { - throw new ContentSyncException(e); + syncException = e; } } else if (c.isTypeOf(Credentials.TYPE_CLOUD_RMT)) { @@ -565,8 +565,8 @@ else if (c.isTypeOf(Credentials.TYPE_CLOUD_RMT)) { linkAndRefreshContentSource(mirrorUrl); ManagerInfoFactory.setLastMgrSyncRefresh(); - if (cse) { - throw new ContentSyncException("Invalid credentials"); + if (syncException != null) { + throw new ContentSyncException(syncException); } } From a358837e497765ca02d3b889e3773da916d33206 Mon Sep 17 00:00:00 2001 From: Martin Seidl Date: Fri, 6 Oct 2023 17:02:25 +0200 Subject: [PATCH 5/5] update changelog --- java/spacewalk-java.changes.mseidl.Manager-4.3-fix-scc-badcred | 1 + 1 file changed, 1 insertion(+) create mode 100644 java/spacewalk-java.changes.mseidl.Manager-4.3-fix-scc-badcred diff --git a/java/spacewalk-java.changes.mseidl.Manager-4.3-fix-scc-badcred b/java/spacewalk-java.changes.mseidl.Manager-4.3-fix-scc-badcred new file mode 100644 index 000000000000..04d4bae90850 --- /dev/null +++ b/java/spacewalk-java.changes.mseidl.Manager-4.3-fix-scc-badcred @@ -0,0 +1 @@ +- Fix issue where bad scc creds were preventing other credentials to refresh (bsc#1211355)