summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2013-06-09 10:46:06 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-06-10 05:40:21 +0200
commit2f7d9fddf7102d76b182fbd50ccaf18cb5a10014 (patch)
treef586042c128479a16b17fc1ef957f91b7036c9a8 /source4/rpc_server
parent036af07e863b09c6e84965ef288324cbac93de69 (diff)
downloadsamba-2f7d9fddf7102d76b182fbd50ccaf18cb5a10014.tar.gz
samba-2f7d9fddf7102d76b182fbd50ccaf18cb5a10014.tar.bz2
samba-2f7d9fddf7102d76b182fbd50ccaf18cb5a10014.zip
s4:samr RPC server - dcesrv_samr_SetUserInfo() - password expiration
Also on level 26 this has to be handled the same as on levels 21, 23, 25. Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 3826075ebc..7279fe02f7 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -3510,8 +3510,14 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
}
if (r->in.info->info26.password_expired > 0) {
+ NTTIME t = 0;
struct ldb_message_element *set_el;
- if (samdb_msg_add_uint64(sam_ctx, mem_ctx, msg, "pwdLastSet", 0) != LDB_SUCCESS) {
+ if (r->in.info->info26.password_expired
+ == PASS_DONT_CHANGE_AT_NEXT_LOGON) {
+ unix_to_nt_time(&t, time(NULL));
+ }
+ if (samdb_msg_add_uint64(sam_ctx, mem_ctx, msg,
+ "pwdLastSet", t) != LDB_SUCCESS) {
return NT_STATUS_NO_MEMORY;
}
set_el = ldb_msg_find_element(msg, "pwdLastSet");