mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
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>
This commit is contained in:
parent
4a43600705
commit
b50b006ace
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user