The Samba-Bugzilla – Attachment 5945 Details for
Bug 7662
Change notify replies must be aligned on 4-byte boundary for Win7.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git am patch for 3.5.x.
0001-s3-smbd-Align-change-notify-replies-on-4-byte-bounda.patch (text/plain), 1.54 KB, created by
Jeremy Allison
on 2010-09-03 18:53:59 UTC
(
hide
)
Description:
git am patch for 3.5.x.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2010-09-03 18:53:59 UTC
Size:
1.54 KB
patch
obsolete
>From 00056e73c1cb54f5d6c10e63b70afc2c84e5883e Mon Sep 17 00:00:00 2001 >From: Chere Zhou <chere.zhou@isilon.com> >Date: Mon, 5 Jul 2010 17:18:35 -0700 >Subject: [PATCH] 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 files changed, 10 insertions(+), 0 deletions(-) > >diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c >index dc13aad..e473d99 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; i<num_changes; i++) { > struct notify_change *c; > size_t namelen; >+ int rem = 0; > uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid > * signed/unsigned issues */ > >@@ -102,6 +103,11 @@ static bool notify_marshall_changes(int num_changes, > */ > > u32_tmp = (i == num_changes-1) ? 0 : namelen + 12; >+ >+ /* Align on 4-byte boundary according to MS-CIFS 2.2.7.4.2 */ >+ if ((rem = u32_tmp % 4 ) != 0) >+ u32_tmp += 4 - rem; >+ > if (!prs_uint32("offset", ps, 1, &u32_tmp)) goto fail; > > u32_tmp = c->action; >@@ -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) { >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
vl
:
review+
Actions:
View
Attachments on
bug 7662
: 5945