summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/samdb.py
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-11-23 21:54:09 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-11-23 21:02:03 +0100
commite95a350682f965780841712527e8e0cac282218d (patch)
tree04a8d2e413e6cc0791902eb337f6a33b837908c9 /source4/scripting/python/samba/samdb.py
parent5e0130c51e7b82ed82f08d5089cf7cbdbc6b3142 (diff)
downloadsamba-e95a350682f965780841712527e8e0cac282218d.tar.gz
samba-e95a350682f965780841712527e8e0cac282218d.tar.bz2
samba-e95a350682f965780841712527e8e0cac282218d.zip
s4-dsdb: Changed filter to find the account of a user by samAccountName
In newuser, a filter by dn was given to setpassword to find the account whose password is to be reset. It appears however that if given filter of type (dn=CN=smth) Windows fails to return the entry, and the tests that use newuser fail against it. Changed to use samAccountName instead.
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r--source4/scripting/python/samba/samdb.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 98ae6791a5..668c6003d6 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -337,7 +337,7 @@ member: %s
# Sets the password for it
if setpassword:
- self.setpassword("(dn=" + user_dn + ")", password,
+ self.setpassword("(samAccountName=%s)" % username, password,
force_password_change_at_next_login_req)
except:
self.transaction_cancel()
@@ -362,7 +362,6 @@ member: %s
raise Exception('Unable to find user "%s"' % (username or search_filter))
assert(len(res) == 1)
user_dn = res[0].dn
-
setpw = """
dn: %s
changetype: modify