diff options
author | Jeremy Allison <jra@samba.org> | 2009-02-26 11:42:23 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-02-26 11:42:23 -0800 |
commit | 3121249243f52dcbf8083f5ff137bd580515efa7 (patch) | |
tree | be0a48eb0ff6293a96312e275e263e95fb7f3be7 /source3/smbd/reply.c | |
parent | bcadb77c18f9ed9be22762871617f1a12294e88c (diff) | |
download | samba-3121249243f52dcbf8083f5ff137bd580515efa7.tar.gz samba-3121249243f52dcbf8083f5ff137bd580515efa7.tar.bz2 samba-3121249243f52dcbf8083f5ff137bd580515efa7.zip |
Make us pass the RAW-RENAME torture test I just added.
Inside a directory, keep a file open and then renaming
the directory should fail with ACCESS_DENIED.
Jeremy.
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r-- | source3/smbd/reply.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 80ed019e0f..22e4c1aad7 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2214,6 +2214,16 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp, } if (S_ISDIR(pst->st_mode)) { + if (fsp->posix_open) { + return NT_STATUS_OK; + } + + /* If no pathnames are open below this + directory, allow the rename. */ + + if (file_find_subpath(fsp)) { + return NT_STATUS_ACCESS_DENIED; + } return NT_STATUS_OK; } |