Ensure we can't create a file using NTTRANS with an invalid EA list.
authorJeremy Allison <jra@samba.org>
Tue, 9 Jul 2013 22:54:39 +0000 (15:54 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 19 Jul 2013 07:52:44 +0000 (17:52 +1000)
Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":"

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/nttrans.c

index 516b8267960e7d24c03eeaec6433e836cdf8a8b6..1c3e3b8a452394f7ba6fb29613566a0e6878a86b 100644 (file)
@@ -1142,6 +1142,26 @@ static void call_nt_transact_create(connection_struct *conn,
                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
                        goto out;
                }
+
+               if (ea_list_has_invalid_name(ea_list)) {
+                       /* Realloc the size of parameters and data we will return */
+                       if (flags & EXTENDED_RESPONSE_REQUIRED) {
+                               /* Extended response is 32 more byyes. */
+                               param_len = 101;
+                       } else {
+                               param_len = 69;
+                       }
+                       params = nttrans_realloc(ppparams, param_len);
+                       if(params == NULL) {
+                               reply_nterror(req, NT_STATUS_NO_MEMORY);
+                               goto out;
+                       }
+
+                       memset(params, '\0', param_len);
+                       send_nt_replies(conn, req, STATUS_INVALID_EA_NAME,
+                               params, param_len, NULL, 0);
+                       goto out;
+               }
        }
 
        srvstr_get_path(ctx, params, req->flags2, &fname,