Only generate 'DC_HANDLE' if 'DC_NAME' exists

This commit is contained in:
Shreya 2020-11-05 23:26:18 +05:30
parent d8ee740750
commit f44e080b1c
1 changed files with 2 additions and 1 deletions

View File

@ -27,12 +27,13 @@ class WindowsServerFinger(HostFinger):
DC_IP = host.ip_addr DC_IP = host.ip_addr
DC_NAME = self.get_dc_name(DC_IP) DC_NAME = self.get_dc_name(DC_IP)
DC_HANDLE = '\\\\' + DC_NAME
if DC_NAME: # if it is a Windows DC if DC_NAME: # if it is a Windows DC
# Keep authenticating until successful. # Keep authenticating until successful.
# Expected average number of attempts needed: 256. # Expected average number of attempts needed: 256.
# Approximate time taken by 2000 attempts: 40 seconds. # Approximate time taken by 2000 attempts: 40 seconds.
DC_HANDLE = '\\\\' + DC_NAME
LOG.info('Performing Zerologon authentication attempts...') LOG.info('Performing Zerologon authentication attempts...')
rpc_con = None rpc_con = None
for _ in range(0, self.MAX_ATTEMPTS): for _ in range(0, self.MAX_ATTEMPTS):