From 00056e73c1cb54f5d6c10e63b70afc2c84e5883e Mon Sep 17 00:00:00 2001 From: Chere Zhou Date: Mon, 5 Jul 2010 17:18:35 -0700 Subject: s3:smbd: Align change notify replies on 4-byte boundary MS-CIFS section 2.2.7.4.2 states this is mandatory. WinXP clients don't seem to care, but a Win7 client will send an immediate Close() to the directory handle when receiving an incorrectly aligned change notify response. --- source3/smbd/notify.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3') diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index dc13aadadd..e473d99ff0 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -77,6 +77,7 @@ static bool notify_marshall_changes(int num_changes, for (i=0; iaction; @@ -117,6 +123,10 @@ static bool notify_marshall_changes(int num_changes, */ prs_set_offset(ps, prs_offset(ps)-2); + if (rem != 0) { + if (!prs_align_custom(ps, 4)) goto fail; + } + TALLOC_FREE(uni_name.buffer); if (prs_offset(ps) > max_offset) { -- cgit