summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_samr.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-09-26 10:25:34 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-09-26 10:25:34 +0000
commitad514000db54b887c5c0f8734415e2b10698b365 (patch)
tree5bd885d043786d2e8bef317c10adb54c13c835cb /source3/rpc_parse/parse_samr.c
parent9e70b39ab29b877906ca3e20bc25700c2e05ae1b (diff)
downloadsamba-ad514000db54b887c5c0f8734415e2b10698b365.tar.gz
samba-ad514000db54b887c5c0f8734415e2b10698b365.tar.bz2
samba-ad514000db54b887c5c0f8734415e2b10698b365.zip
Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de> to do a *much*
better job of working with usrmgr. Previously we were blanking out entires, and all sort of mischif. The new patch (which I've now had a chance to test/modify) also takes care not to expand % values (ie we go \\%L\%U -> \\server\user, we don't want to store \\server\user back) and to correctly notice 'not set' compared to 'null string' etc. Andrew Bartlett (This used to be commit ab878b6cc4132594fc33f78aeebf0d8b7266c150)
Diffstat (limited to 'source3/rpc_parse/parse_samr.c')
-rw-r--r--source3/rpc_parse/parse_samr.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 1137993bb6..ddf51fcf0b 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -5470,7 +5470,15 @@ void init_sam_user_info23W(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all z
usr->logon_divs = logon_divs; /* should be 168 (hours/week) */
usr->ptr_logon_hrs = hrs ? 1 : 0;
+ if (nt_time_is_zero(pass_must_change_time)) {
+ usr->passmustchange=PASS_MUST_CHANGE_AT_NEXT_LOGON;
+ } else {
+ usr->passmustchange=0;
+ }
+
+
ZERO_STRUCT(usr->padding1);
+ ZERO_STRUCT(usr->padding2);
usr->unknown_5 = unknown_5; /* 0x0001 0000 */
@@ -5558,7 +5566,14 @@ void init_sam_user_info23A(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all z
usr->logon_divs = logon_divs; /* should be 168 (hours/week) */
usr->ptr_logon_hrs = hrs ? 1 : 0;
+ if (nt_time_is_zero(pass_must_change_time)) {
+ usr->passmustchange=PASS_MUST_CHANGE_AT_NEXT_LOGON;
+ } else {
+ usr->passmustchange=0;
+ }
+
ZERO_STRUCT(usr->padding1);
+ ZERO_STRUCT(usr->padding2);
usr->unknown_5 = unknown_5; /* 0x0001 0000 */
@@ -5651,11 +5666,18 @@ static BOOL sam_io_user_info23(char *desc, SAM_USER_INFO_23 * usr,
return False;
if(!prs_uint32("ptr_logon_hrs ", ps, depth, &usr->ptr_logon_hrs))
return False;
+
+ if(!prs_uint32("unknown_5 ", ps, depth, &usr->unknown_5))
+ return False;
+
if(!prs_uint8s(False, "padding1 ", ps, depth, usr->padding1, sizeof(usr->padding1)))
return False;
- if(!prs_uint32("unknown_5 ", ps, depth, &usr->unknown_5))
+ if(!prs_uint8("passmustchange ", ps, depth, &usr->passmustchange))
+ return False;
+ if(!prs_uint8("padding2 ", ps, depth, &usr->padding2))
return False;
+
if(!prs_uint8s(False, "password ", ps, depth, usr->pass, sizeof(usr->pass)))
return False;
@@ -5905,7 +5927,15 @@ void init_sam_user_info21W(SAM_USER_INFO_21 * usr,
usr->ptr_logon_hrs = hrs ? 1 : 0;
usr->unknown_5 = unknown_5; /* 0x0002 0000 */
+ if (nt_time_is_zero(pass_must_change_time)) {
+ usr->passmustchange=PASS_MUST_CHANGE_AT_NEXT_LOGON;
+ } else {
+ usr->passmustchange=0;
+ }
+
+
ZERO_STRUCT(usr->padding1);
+ ZERO_STRUCT(usr->padding2);
copy_unistr2(&usr->uni_user_name, user_name);
copy_unistr2(&usr->uni_full_name, full_name);
@@ -6037,7 +6067,15 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID *
usr->ptr_logon_hrs = pdb_get_hours(pw) ? 1 : 0;
usr->unknown_5 = pdb_get_unknown5(pw); /* 0x0002 0000 */
+ if (pdb_get_pass_must_change_time(pw) == 0) {
+ usr->passmustchange=PASS_MUST_CHANGE_AT_NEXT_LOGON;
+ } else {
+ usr->passmustchange=0;
+ }
+
+
ZERO_STRUCT(usr->padding1);
+ ZERO_STRUCT(usr->padding2);
init_unistr2(&usr->uni_user_name, user_name, len_user_name);
init_unistr2(&usr->uni_full_name, full_name, len_full_name);
@@ -6132,11 +6170,16 @@ static BOOL sam_io_user_info21(char *desc, SAM_USER_INFO_21 * usr,
return False;
if(!prs_uint32("ptr_logon_hrs ", ps, depth, &usr->ptr_logon_hrs))
return False;
+
if(!prs_uint32("unknown_5 ", ps, depth, &usr->unknown_5))
return False;
if(!prs_uint8s(False, "padding1 ", ps, depth, usr->padding1, sizeof(usr->padding1)))
return False;
+ if(!prs_uint8("passmustchange ", ps, depth, &usr->passmustchange))
+ return False;
+ if(!prs_uint8("padding2 ", ps, depth, &usr->padding2))
+ return False;
/* here begins pointed-to data */