diff options
author | Jeremy Allison <jra@samba.org> | 2007-07-17 02:06:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:40 -0500 |
commit | 5e3e15f754a9bc6412f6172d454f815e5b71307b (patch) | |
tree | 22e2773755f044492c0ce95fe80e6997d560f24a /source3 | |
parent | 44b9493418558fca03b1888a693ba516b3711e17 (diff) | |
download | samba-5e3e15f754a9bc6412f6172d454f815e5b71307b.tar.gz samba-5e3e15f754a9bc6412f6172d454f815e5b71307b.tar.bz2 samba-5e3e15f754a9bc6412f6172d454f815e5b71307b.zip |
r23909: Get closer to passing the cthon tests for delete open file.
It matters how the target is open.
Jeremy.
(This used to be commit 0989877fd191f7c9e195dc6e45dda5fd026f09dd)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/reply.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index d6b0dcab2e..e3ae0ef7f6 100644 --- a/source3/smbd/reply.c +++ b/source3/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. */ |