diff options
author | Ralph Boehme <slow@samba.org> | 2015-01-22 10:00:15 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-12-18 10:26:22 +0100 |
commit | b5a081bb5ef414c94fc67e03cf74e27146605eae (patch) | |
tree | 11df361f682e280f60f981bf00ad17b8f4fc8e81 | |
parent | c91214fa6e74a3e547165631aac0bdce159ad01a (diff) | |
download | samba-b5a081bb5ef414c94fc67e03cf74e27146605eae.tar.gz |
s3:smbd: file_struct: seperate POSIX directory rename cap from POSIX open
We need more fine grained control over which POSIX semantics we'd like
to enable per file handle. Currently POSIX_FLAGS_OPEN is a kitchensink
for all kinds of stuff like:
- POSIX unlink
- POSIX byte-range locks
- POSIX rename
- delayed writetime update
- more...
For CIFS UNIX extensions we use POSIX_FLAGS_ALL so semantics are
preserved. OS X clients will enable POSIX rename via AAPL.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit bf1957584e341473edcd5025b7f77766440d408b)
-rw-r--r-- | source3/include/vfs.h | 4 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h index e2031b34c9e..d475d990283 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -295,9 +295,11 @@ typedef struct files_struct { } files_struct; #define FSP_POSIX_FLAGS_OPEN 0x01 +#define FSP_POSIX_FLAGS_RENAME 0x02 #define FSP_POSIX_FLAGS_ALL \ - (FSP_POSIX_FLAGS_OPEN) + (FSP_POSIX_FLAGS_OPEN | \ + FSP_POSIX_FLAGS_RENAME) struct vuid_cache_entry { struct auth_session_info *session_info; diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 54cea91d3fa..d9be1b3a70c 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2649,7 +2649,7 @@ static NTSTATUS can_rename(connection_struct *conn, files_struct *fsp, } if (S_ISDIR(fsp->fsp_name->st.st_ex_mode)) { - if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) { + if (fsp->posix_flags & (FSP_POSIX_FLAGS_OPEN|FSP_POSIX_FLAGS_RENAME)) { return NT_STATUS_OK; } |