diff options
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r-- | source/smbd/reply.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 8e757da706..499b67fb9f 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -2263,6 +2263,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; } @@ -2779,9 +2789,9 @@ void send_file_readbraw(connection_struct *conn, return; } -#endif normal_readbraw: +#endif outbuf = TALLOC_ARRAY(NULL, char, nread+4); if (!outbuf) { |