Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-130255 / 24.10 / Avoid DNS lookup when disabling Active Directory #14086

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/middlewared/middlewared/plugins/activedirectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,20 @@ async def update_netbios_data(self, old, new):

@private
async def common_validate(self, new, old, verrors):
try:
if not (await self.middleware.call('activedirectory.netbiosname_is_ours', new['netbiosname'], new['domainname'], new['dns_timeout'])):
verrors.add(
'activedirectory_update.netbiosname',
f'NetBIOS name [{new["netbiosname"]}] appears to be in use by another computer in Active Directory DNS. '
'Further investigation and DNS corrections will be required prior to using the aforementioned name to '
'join Active Directory.'
)
except CallError:
pass
if new['enable']:
try:
if not (await self.middleware.call(
'activedirectory.netbiosname_is_ours',
new['netbiosname'], new['domainname'], new['dns_timeout'])
):
verrors.add(
'activedirectory_update.netbiosname',
f'NetBIOS name [{new["netbiosname"]}] appears to be in use by another computer in Active Directory DNS. '
'Further investigation and DNS corrections will be required prior to using the aforementioned name to '
'join Active Directory.'
)
except CallError:
pass

if new['kerberos_realm'] and new['kerberos_realm'] != old['kerberos_realm']:
realm = await self.middleware.call('kerberos.realm.query', [("id", "=", new['kerberos_realm'])])
Expand Down
Loading