Skip to content

Commit

Permalink
adtrustinstance: make sure NetBIOS name defaults are set properly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
abbra authored and flo-renaud committed Jan 17, 2024
1 parent 717ae87 commit 9b45610
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ipaserver/install/adtrustinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def __setup_default_attributes(self):
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" % \
Expand Down

0 comments on commit 9b45610

Please sign in to comment.