Skip to content

Commit

Permalink
MSFTidy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
smashery committed Nov 22, 2024
1 parent cd780e4 commit ae61d0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/ldap/change_password.rb
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(info = {})
info,
'Name' => 'Change Password',
'Description' => %q{
This module allows Active Directory users to change their own passwords, or reset passwords for
This module allows Active Directory users to change their own passwords, or reset passwords for
accounts they have privileges over.
},
'Author' => [
Expand Down Expand Up @@ -90,7 +90,7 @@ def run
fail_with(Failure::BadConfig, 'Must set PASSWORD when changing password') if datastore['PASSWORD'].blank?
end
if session.blank? && datastore['USERNAME'].blank?
print_warning("Connecting with an anonymous bind")
print_warning('Connecting with an anonymous bind')
end
ldap_connect do |ldap|
validate_bind_success!(ldap)
Expand Down Expand Up @@ -151,7 +151,7 @@ def action_change

new_pass = "\"#{datastore['NEW_PASSWORD']}\"".encode('utf-16le').bytes.pack('c*')
old_pass = "\"#{datastore['PASSWORD']}\"".encode('utf-16le').bytes.pack('c*')
unless @ldap.modify(:dn => obj['dn'], :operations => [[:delete, ATTRIBUTE, old_pass], [:add, ATTRIBUTE, new_pass]])
unless @ldap.modify(dn: obj['dn'], operations: [[:delete, ATTRIBUTE, old_pass], [:add, ATTRIBUTE, new_pass]])
fail_with_ldap_error("Failed to reset the password for #{datastore['USERNAME']}.")
end
print_good("Successfully changed password for #{datastore['USERNAME']}.")
Expand Down

0 comments on commit ae61d0a

Please sign in to comment.