1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Fix more of the RAW-SEARCH test. Older info levels are

not 4 byte aligned (levels 1 - 3).
Jeremy.
This commit is contained in:
Jeremy Allison 2009-11-03 11:19:24 -08:00
parent 97a32035be
commit 6a61befe37

View File

@ -1525,7 +1525,9 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
pad -= off; pad -= off;
off += pad; off += pad;
/* initialize padding to 0 */ /* initialize padding to 0 */
memset(pdata, 0, pad); if (pad) {
memset(pdata, 0, pad);
}
space_remaining -= pad; space_remaining -= pad;
pdata += pad; pdata += pad;
@ -2159,13 +2161,18 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
struct ea_list *name_list) struct ea_list *name_list)
{ {
bool resume_key = false; bool resume_key = false;
const uint8_t align = 4; uint8_t align = 4;
const bool do_pad = true; const bool do_pad = true;
if (requires_resume_key) { if (requires_resume_key) {
resume_key = true; resume_key = true;
} }
if (info_level >= 1 && info_level <= 3) {
/* No alignment on earlier info levels. */
align = 1;
}
return smbd_dirptr_lanman2_entry(ctx, conn, dirptr, flags2, return smbd_dirptr_lanman2_entry(ctx, conn, dirptr, flags2,
path_mask, dirtype, info_level, path_mask, dirtype, info_level,
resume_key, dont_descend, ask_sharemode, resume_key, dont_descend, ask_sharemode,