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)
committerDavid Disseldorp <ddiss@samba.org>
Tue, 2 Apr 2013 18:06:38 +0000 (20:06 +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>
Reviewed-by: David Disseldorp <ddiss@suse.de>
source3/smbd/trans2.c

index df6fe92c3aa627bebbb2caa7aaaf6f67168e1800..4cdd2394ca56f7b6d41e2162fdde1bb251dab9da 100644 (file)
@@ -499,7 +499,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;
                }