mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
Fix from Andrew Bartlett to fix up the munged-dial problem.
Jeremy. (This used to be commit 703b1b76e25fc83b3b84767c0e1b64c97c21bf09)
This commit is contained in:
parent
5faae2df8a
commit
e0fd9d28e9
@ -1015,7 +1015,11 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
|
||||
str->uni_str_len = blob->length / sizeof(uint16);
|
||||
str->uni_max_len = str->uni_str_len;
|
||||
str->offset = 0;
|
||||
str->buffer = (uint16 *) memdup(blob->data, blob->length);
|
||||
if (blob->length) {
|
||||
str->buffer = (uint16 *) memdup(blob->data, blob->length);
|
||||
} else {
|
||||
str->buffer = NULL;
|
||||
}
|
||||
if ((str->buffer == NULL) && (blob->length > 0)) {
|
||||
smb_panic("init_unistr2_from_datablob: malloc fail\n");
|
||||
}
|
||||
|
@ -5938,7 +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);
|
||||
DATA_BLOB munged_dial_blob;
|
||||
|
||||
uint32 user_rid;
|
||||
const DOM_SID *user_sid;
|
||||
@ -5946,6 +5946,12 @@ NTSTATUS init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw, DOM_SID *
|
||||
uint32 group_rid;
|
||||
const DOM_SID *group_sid;
|
||||
|
||||
if (munged_dial) {
|
||||
munged_dial_blob = base64_decode_data_blob(munged_dial);
|
||||
} else {
|
||||
munged_dial_blob = data_blob(NULL, 0);
|
||||
}
|
||||
|
||||
/* Create NTTIME structs */
|
||||
unix_to_nt_time (&logon_time, pdb_get_logon_time(pw));
|
||||
unix_to_nt_time (&logoff_time, pdb_get_logoff_time(pw));
|
||||
@ -5975,7 +5981,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);
|
||||
data_blob_free(&munged_dial_blob);
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
@ -5989,7 +5995,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);
|
||||
data_blob_free(&munged_dial_blob);
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
@ -6049,9 +6055,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_from_datablob(&usr->uni_munged_dial, &blob);
|
||||
init_unistr2_from_datablob(&usr->uni_munged_dial, &munged_dial_blob);
|
||||
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
|
||||
data_blob_free(&blob);
|
||||
data_blob_free(&munged_dial_blob);
|
||||
|
||||
usr->unknown_6 = pdb_get_unknown_6(pw);
|
||||
usr->padding4 = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user