diff options
author | Jeremy Allison <jra@samba.org> | 2013-07-16 11:05:10 -0700 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-07-19 17:52:45 +1000 |
commit | b50b006ace92bb0781173b1244e84ae7bf64732f (patch) | |
tree | e247bb9c28983ad9b204cef008396f2a5b74f743 /source3 | |
parent | 4a4360070589a314667166f86c395878659123e1 (diff) | |
download | samba-b50b006ace92bb0781173b1244e84ae7bf64732f.tar.gz samba-b50b006ace92bb0781173b1244e84ae7bf64732f.tar.bz2 samba-b50b006ace92bb0781173b1244e84ae7bf64732f.zip |
Ensure we do pathname processing before SD and EA processing in NTTRANS_CREATE.
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>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/nttrans.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 1c3e3b8a45..c8116b0a43 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1092,6 +1092,44 @@ static void call_nt_transact_create(connection_struct *conn, */ create_options &= ~NTCREATEX_OPTIONS_MUST_IGNORE_MASK; + srvstr_get_path(ctx, params, req->flags2, &fname, + params+53, parameter_count-53, + STR_TERMINATE, &status); + if (!NT_STATUS_IS_OK(status)) { + reply_nterror(req, status); + goto out; + } + + if (file_attributes & FILE_FLAG_POSIX_SEMANTICS) { + case_state = set_posix_case_semantics(ctx, conn); + if (!case_state) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + goto out; + } + } + + status = filename_convert(ctx, + conn, + req->flags2 & FLAGS2_DFS_PATHNAMES, + fname, + (create_disposition == FILE_CREATE) + ? UCF_CREATING_FILE : 0, + NULL, + &smb_fname); + + TALLOC_FREE(case_state); + + if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { + reply_botherror(req, + NT_STATUS_PATH_NOT_COVERED, + ERRSRV, ERRbadpath); + goto out; + } + reply_nterror(req, status); + goto out; + } + /* Ensure the data_len is correct for the sd and ea values given. */ if ((ea_len + sd_len > data_count) || (ea_len > data_count) || (sd_len > data_count) @@ -1164,44 +1202,6 @@ static void call_nt_transact_create(connection_struct *conn, } } - srvstr_get_path(ctx, params, req->flags2, &fname, - params+53, parameter_count-53, - STR_TERMINATE, &status); - if (!NT_STATUS_IS_OK(status)) { - reply_nterror(req, status); - goto out; - } - - if (file_attributes & FILE_FLAG_POSIX_SEMANTICS) { - case_state = set_posix_case_semantics(ctx, conn); - if (!case_state) { - reply_nterror(req, NT_STATUS_NO_MEMORY); - goto out; - } - } - - status = filename_convert(ctx, - conn, - req->flags2 & FLAGS2_DFS_PATHNAMES, - fname, - (create_disposition == FILE_CREATE) - ? UCF_CREATING_FILE : 0, - NULL, - &smb_fname); - - TALLOC_FREE(case_state); - - if (!NT_STATUS_IS_OK(status)) { - if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { - reply_botherror(req, - NT_STATUS_PATH_NOT_COVERED, - ERRSRV, ERRbadpath); - goto out; - } - reply_nterror(req, status); - goto out; - } - oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0; if (oplock_request) { oplock_request |= (flags & REQUEST_BATCH_OPLOCK) |