From 515f1227d42a7aa8adee6a11539eb2720508509a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jul 2013 15:54:39 -0700 Subject: [PATCH] Ensure we can't create a file using NTTRANS with an invalid EA list. Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison Reviewed-by: Andrew Bartlett --- source3/smbd/nttrans.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 5595af29712..a0c05f5cd46 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1147,6 +1147,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, -- 2.11.4.GIT