URL: https://github.com/freeipa/freeipa/pull/3920
Author: t-woerner
 Title: #3920: [Backport][ipa-4-8] Do not run trust upgrade code if master 
lacks Samba bindings
Action: opened

PR body:
"""
This PR was opened automatically because PR #3910 was pushed to master and 
backport to ipa-4-8 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3920/head:pr3920
git checkout pr3920
From 3729cb40920d926ed18546f5bf736e2b9a62e5f0 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <aboko...@redhat.com>
Date: Sun, 17 Nov 2019 19:37:03 +0200
Subject: [PATCH] Do not run trust upgrade code if master lacks Samba bindings

If a replica has no Samba bindings but there are trust agreements
configured on some trust controller, skip trust upgrade code on this
replica.

Resolves: https://pagure.io/freeipa/issue/8001
Signed-off-by: Alexander Bokovoy <aboko...@redhat.com>
---
 ipaserver/install/plugins/adtrust.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ipaserver/install/plugins/adtrust.py b/ipaserver/install/plugins/adtrust.py
index b7bb53fd00..2a9b4f04e2 100644
--- a/ipaserver/install/plugins/adtrust.py
+++ b/ipaserver/install/plugins/adtrust.py
@@ -24,6 +24,8 @@
     def ndr_unpack(x):
         raise NotImplementedError
 
+    drsblobs = None
+
 logger = logging.getLogger(__name__)
 
 register = Registry()
@@ -633,6 +635,10 @@ def execute(self, **options):
             logger.debug('AD Trusts are not enabled on this server')
             return False, []
 
+        # If we have no Samba bindings, this master is not a trust controller
+        if drsblobs is None:
+            return False, []
+
         ldap = self.api.Backend.ldap2
         gidNumber = get_gidNumber(ldap, self.api.env)
         if gidNumber is None:
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org

Reply via email to