diff options
author | Jeremy Allison <jra@samba.org> | 2003-11-07 18:32:29 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-11-07 18:32:29 +0000 |
commit | a3aa2c9ed44f5967986d340456efd5828bd5f2ff (patch) | |
tree | 0e56075981a33c9323376067e337571f7b91d0cd /source3/rpc_parse/parse_samr.c | |
parent | e9bd28d0a7b0fd667e52683013404dc4b1e03673 (diff) | |
download | samba-a3aa2c9ed44f5967986d340456efd5828bd5f2ff.tar.gz samba-a3aa2c9ed44f5967986d340456efd5828bd5f2ff.tar.bz2 samba-a3aa2c9ed44f5967986d340456efd5828bd5f2ff.zip |
Handle munged dial string. Patch from Aur?lien Degr?mont <adegremont@idealx.com>
with memory leak fixes by me.
Jeremy.
(This used to be commit daceed37387c517b3f0ab9c173f419215e3d676b)
Diffstat (limited to 'source3/rpc_parse/parse_samr.c')
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 939b652a1e..73107f8f61 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -5485,6 +5485,8 @@ void init_sam_user_info23A(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all z LOGON_HRS * hrs, uint16 bad_password_count, uint16 logon_count, char newpass[516], uint32 unknown_6) { + DATA_BLOB blob = base64_decode_data_blob(mung_dial); + usr->logon_time = *logon_time; /* all zeros */ usr->logoff_time = *logoff_time; /* all zeros */ usr->kickoff_time = *kickoff_time; /* all zeros */ @@ -5544,9 +5546,11 @@ void init_sam_user_info23A(SAM_USER_INFO_23 * usr, NTTIME * logon_time, /* all z init_unistr2(&usr->uni_unknown_str, unk_str, UNI_FLAGS_NONE); init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str); - init_unistr2(&usr->uni_munged_dial, mung_dial, UNI_FLAGS_NONE); + init_unistr2_from_datablob(&usr->uni_munged_dial, &blob); init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial); + data_blob_free(&blob); + usr->unknown_6 = unknown_6; /* 0x0000 04ec */ usr->padding4 = 0; @@ -5934,6 +5938,7 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID * const char* description = pdb_get_acct_desc(pw); const char* workstations = pdb_get_workstations(pw); const char* munged_dial = pdb_get_munged_dial(pw); + DATA_BLOB blob = base64_decode_data_blob(munged_dial); uint32 user_rid; const DOM_SID *user_sid; @@ -5970,6 +5975,7 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID * user_name, sid_to_string(user_sid_string, user_sid), sid_to_string(domain_sid_string, domain_sid))); + data_blob_free(&blob); return NT_STATUS_UNSUCCESSFUL; } @@ -5983,6 +5989,7 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID * user_name, sid_to_string(group_sid_string, group_sid), sid_to_string(domain_sid_string, domain_sid))); + data_blob_free(&blob); return NT_STATUS_UNSUCCESSFUL; } @@ -6042,8 +6049,9 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID * init_unistr2(&usr->uni_unknown_str, NULL, UNI_STR_TERMINATE); init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str); - init_unistr2(&usr->uni_munged_dial, munged_dial, UNI_STR_TERMINATE); + init_unistr2_from_datablob(&usr->uni_munged_dial, &blob); init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial); + data_blob_free(&blob); usr->unknown_6 = pdb_get_unknown_6(pw); usr->padding4 = 0; @@ -6184,10 +6192,11 @@ static BOOL sam_io_user_info21(const char *desc, SAM_USER_INFO_21 * usr, void init_sam_user_info20A(SAM_USER_INFO_20 *usr, SAM_ACCOUNT *pw) { const char *munged_dial = pdb_get_munged_dial(pw); - - init_unistr2(&usr->uni_munged_dial, munged_dial, UNI_STR_TERMINATE); + DATA_BLOB blob = base64_decode_data_blob(munged_dial); + + init_unistr2_from_datablob(&usr->uni_munged_dial, &blob); init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial); - + data_blob_free(&blob); } /******************************************************************* |