1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r23909: Get closer to passing the cthon tests for delete open file.

It matters how the target is open.
Jeremy.
This commit is contained in:
Jeremy Allison 2007-07-17 02:06:38 +00:00 committed by Gerald (Jerry) Carter
parent a48e4a29e6
commit 0989877fd1

View File

@ -4447,9 +4447,12 @@ NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, pstrin
return NT_STATUS_OBJECT_NAME_COLLISION;
}
if (dst_exists && file_find_di_first(file_id_sbuf(&sbuf1)) != NULL) {
DEBUG(3, ("rename_internals_fsp: Target file open\n"));
return NT_STATUS_ACCESS_DENIED;
if (dst_exists) {
files_struct *dst_fsp = file_find_di_first(file_id_sbuf(&sbuf1));
if (dst_fsp && !(dst_fsp->share_access & FILE_SHARE_DELETE)) {
DEBUG(3, ("rename_internals_fsp: Target file open\n"));
return NT_STATUS_ACCESS_DENIED;
}
}
/* Ensure we have a valid stat struct for the source. */