diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-20 13:44:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:53:51 -0500 |
commit | 95c52e11a15fd3e46d514ae9d706356560bfebc8 (patch) | |
tree | f8c7d99fe5fee0725f2251dbe5ebc8cd5df766a0 /source4/rpc_server/samr | |
parent | acda755f54f7458d1ff5e41bbf3a4ec6af4dadc0 (diff) | |
download | samba-95c52e11a15fd3e46d514ae9d706356560bfebc8.tar.gz samba-95c52e11a15fd3e46d514ae9d706356560bfebc8.tar.bz2 samba-95c52e11a15fd3e46d514ae9d706356560bfebc8.zip |
r796: fixed samr_OemChangePasswordUser2() to replace attributes, not add
(This used to be commit 24bbf9f1bcfddb5131769439bd139faef2c022e2)
Diffstat (limited to 'source4/rpc_server/samr')
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 30856c6ce9..4d68212073 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -1946,7 +1946,7 @@ static NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, struct samr_CryptPassword *pwbuf = r->in.password; void *sam_ctx; const char *user_dn, *domain_dn; - int ret; + int ret, i; struct ldb_message **res, mod; const char * const attrs[] = { "objectSid", "lmPwdHash", NULL }; const char *domain_sid; @@ -2027,6 +2027,11 @@ static NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, return status; } + /* mark all the message elements as LDB_FLAG_MOD_REPLACE */ + for (i=0;i<mod.num_elements;i++) { + mod.elements[i].flags = LDB_FLAG_MOD_REPLACE; + } + /* modify the samdb record */ ret = samdb_modify(sam_ctx, mem_ctx, &mod); if (ret != 0) { |