The Samba-Bugzilla – Attachment 11503 Details for
Bug 10634
Notify response is failing with NOTIFY_ENUM_DIR.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for master.
0001-smbd-Fix-file-name-buflen-and-padding-in-notify-reps.patch (text/plain), 2.04 KB, created by
Jeremy Allison
on 2015-10-16 22:29:03 UTC
(
hide
)
Description:
git-am fix for master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2015-10-16 22:29:03 UTC
Size:
2.04 KB
patch
obsolete
>From f58e84174471ff18cab2ea9c3af792b7de29e6c7 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 16 Oct 2015 15:13:47 -0700 >Subject: [PATCH] smbd: Fix file name buflen and padding in notify repsonse > >The array is uint16, doubling the file name length consumes twice the space >required. > >As we're hand assembling this as a series of concatinated individual data_blobs, >we must take care to ensure the correct 4 byte alignment that was >being masked by the previous doubling of the filename length. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=10634 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Signed-off-by: Volker Lendecke <vl@samba.org> >--- > librpc/idl/notify.idl | 4 +++- > source3/smbd/notify.c | 3 +++ > 2 files changed, 6 insertions(+), 1 deletion(-) > >diff --git a/librpc/idl/notify.idl b/librpc/idl/notify.idl >index 66422ec..853ac47 100644 >--- a/librpc/idl/notify.idl >+++ b/librpc/idl/notify.idl >@@ -93,6 +93,8 @@ interface notify > uint32 NextEntryOffset; > FILE_NOTIFY_ACTION Action; > [value(strlen_m(FileName1)*2)] uint32 FileNameLength; >- [charset(UTF16),flag(STR_NOTERM)] uint16 FileName1[FileNameLength]; >+ [charset(UTF16),flag(STR_NOTERM)] >+ uint16 FileName1[strlen_m(FileName1)]; >+ [flag(NDR_ALIGN4)] DATA_BLOB _pad; > } FILE_NOTIFY_INFORMATION; > } >diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c >index e776749..ff5ef76 100644 >--- a/source3/smbd/notify.c >+++ b/source3/smbd/notify.c >@@ -138,6 +138,7 @@ static bool notify_marshall_changes(int num_changes, > struct notify_change_event *c; > struct FILE_NOTIFY_INFORMATION m; > DATA_BLOB blob; >+ uint16_t pad = 0; > > /* Coalesce any identical records. */ > while (i+1 < num_changes && >@@ -151,6 +152,8 @@ static bool notify_marshall_changes(int num_changes, > m.FileName1 = c->name; > m.FileNameLength = strlen_m(c->name)*2; > m.Action = c->action; >+ m._pad = (m.FileNameLength % 4) == 2 ? data_blob_const(&pad, 2) : >+ data_blob_null; > m.NextEntryOffset = (i == num_changes-1) ? 0 : ndr_size_FILE_NOTIFY_INFORMATION(&m, 0); > > /* >-- >2.6.0.rc2.230.g3dd15c0 >
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
Actions:
View
Attachments on
bug 10634
:
9980
|
11500
|
11503
|
11504
|
11505