ipa/SOURCES/0032-adtrustinstance-make-sure-NetBIOS-name-defaults-are-set-properly.patch
Eduard Abdullin 90796e1d08 - ipatests: restart ipa services after moving date
- ipatests: ignore nsslapd-accesslog-logbuffering WARN in healthcheck
- ipatests: Skip ds_encryption tests on RHEL9 SUT.
- adtrustinstance: make sure NetBIOS name defaults are set properly
- ipatests: wait for replica update in test_dns_locations
- ipapython: Clean up krb5_error
- ipapython: Correct return type of krb5_free_cred_contents
- ipapython: Propagate KRB5Error exceptions on iterating ccache
- ipa-kdb: Fix memory leak during PAC verification
- sidgen: ignore staged users when generating SIDs
- sidgen: fix missing prototypes
- kdb: PAC generator: do not fail if canonical principal is missing
- ipatests: fix tasks.wait_for_replication method
- ipa-kdb: Rework ipadb_reinit_mspac()
- ipa-kdb: Fix double free in ipadb_reinit_mspac()
2024-03-15 16:36:19 +03:00

33 lines
1.3 KiB
Diff

From 3baa30ad3f6ee563089839a5ef56d5ac6eb43959 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Jan 18 2024 09:05:30 +0000
Subject: adtrustinstance: make sure NetBIOS name defaults are set properly
Some tools may pass None as NetBIOS name if not put explicitly by a
user. This meant to use default NetBIOS name generator based on the
domain (realm) name. However, this wasn't done properly, so None is
passed later to python-ldap and it rejects such LDAP entry.
Fixes: https://pagure.io/freeipa/issue/9514
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
---
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index d55ba84..2ff68df 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -189,6 +189,8 @@ class ADTRUSTInstance(service.Service):
self.fqdn = self.fqdn or api.env.host
self.host_netbios_name = make_netbios_name(self.fqdn)
self.realm = self.realm or api.env.realm
+ if not self.netbios_name:
+ self.netbios_name = make_netbios_name(self.realm)
self.suffix = ipautil.realm_to_suffix(self.realm)
self.ldapi_socket = "%%2fvar%%2frun%%2fslapd-%s.socket" % \