Skip to content

Commit

Permalink
Fix case problem on changePassword
Browse files Browse the repository at this point in the history
  • Loading branch information
CravateRouge committed Jan 7, 2022
1 parent cc557ce commit c82bca8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bloodyAD/modules.py
Expand Up @@ -175,7 +175,7 @@ def changePassword(conn, identity, new_pass):
# Check if identity is sAMAccountName
sAMAccountName = identity
for marker in ["dc=", "s-1", "{"]:
if marker in identity:
if marker in identity.lower():
ldap_filter = '(objectClass=*)'
entries = ldap_conn.search(target_dn, ldap_filter, attributes=['SAMAccountName'])
try:
Expand Down Expand Up @@ -413,4 +413,4 @@ def setAccountDisableFlag(conn, identity, enable="False"):
identity: sAMAccountName, DN, GUID or SID of the target
enable: True to enable the identity or False to disable it (default is False)
"""
userAccountControl(conn, identity, enable, samr.UF_ACCOUNTDISABLE)
userAccountControl(conn, identity, enable, samr.UF_ACCOUNTDISABLE)

0 comments on commit c82bca8

Please sign in to comment.