From: Jeremy Allison Date: Tue, 17 Jul 2007 02:06:38 +0000 (+0000) Subject: r23909: Get closer to passing the cthon tests for delete open file. X-Git-Tag: samba-misc-tags/initial-v3-2-unstable~699 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0989877fd191f7c9e195dc6e45dda5fd026f09dd;p=thirdparty%2Fsamba.git r23909: Get closer to passing the cthon tests for delete open file. It matters how the target is open. Jeremy. --- diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d6b0dcab2e1..e3ae0ef7f6a 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -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. */