Final fix for bug #9130 - Certain xattrs cause Windows error 0x800700FF
authorJeremy Allison <jra@samba.org>
Wed, 27 Mar 2013 18:54:34 +0000 (11:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Apr 2013 07:25:03 +0000 (09:25 +0200)
The spec lies when it says that NextEntryOffset is the only value
considered when finding the next EA. We were adding 4 more extra
pad bytes than needed (i.e. if the next entry already was on a 4
byte boundary, then we were adding 4 additional pad bytes).

Signed-off-by: Jeremy Allison <jra@samba.org>
The last 5 patches address bug #9130 - Certain xattrs cause Windows error
0x800700FF.
(cherry picked from commit 57db33599589b06a60cb7cbb454f87bf40c542e0)

source3/smbd/trans2.c

index f88c9868c0d846f47939242ce4d12ebd4a9a972e..01b0130a38de3d7b06fabd01362fd3c76e67e4e5 100644 (file)
@@ -451,7 +451,7 @@ static NTSTATUS fill_ea_chained_buffer(TALLOC_CTX *mem_ctx,
                this_size = 0x08 + dos_namelen + 1 + ea_list->ea.value.length;
 
                if (ea_list->next) {
-                       pad = 4 - (this_size % 4);
+                       pad = (4 - (this_size % 4)) % 4;
                        this_size += pad;
                }