Skip to content

Commit ee37fc0

Browse files
committed
Remove unnecessary None checks
1 parent c78bb6b commit ee37fc0

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

nxc/modules/change-password.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ def _smb_samr_change(self, context, connection, target_username, target_domain,
135135
# Reset the password for a different user
136136
if target_username != connection.username:
137137
user_handle = self._hSamrOpenUser(connection, target_username)
138-
if not user_handle:
139-
return False
140138
samr.hSamrSetNTInternal1(self.dce, user_handle, newPassword, newHash)
141139
context.log.success(f"Successfully changed password for {target_username}")
142140
else:
@@ -147,8 +145,6 @@ def _smb_samr_change(self, context, connection, target_username, target_domain,
147145
else:
148146
# Change the password with new hash
149147
user_handle = self._hSamrOpenUser(connection, target_username)
150-
if not user_handle:
151-
return False
152148
samr.hSamrChangePasswordUser(self.dce, user_handle, self.oldpass, "", oldHash, "aad3b435b51404eeaad3b435b51404ee", newHash)
153149
context.log.highlight("Note: Target user must change password at next logon.")
154150
context.log.success(f"Successfully changed password for {target_username}")

0 commit comments

Comments
 (0)