diff options
author | David Disseldorp <ddiss@samba.org> | 2013-11-18 14:54:37 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-11-22 08:56:45 -0800 |
commit | 9a3d4d484e0868d9174f37a8dfd9efd4e77c044d (patch) | |
tree | 58dd94fe436f535ba70a3ce6b1bae1e245443255 | |
parent | 8bc4e6a9e0b09c744351e60f66c33c4d22dcfb6e (diff) | |
download | samba-9a3d4d484e0868d9174f37a8dfd9efd4e77c044d.tar.gz samba-9a3d4d484e0868d9174f37a8dfd9efd4e77c044d.tar.xz samba-9a3d4d484e0868d9174f37a8dfd9efd4e77c044d.zip |
smbd/open: disable compression with FILE_NO_COMPRESSION
Files and directories created with FILE_NO_COMPRESSION should not
inherit the compression attribute from their parent directory.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/smbd/open.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 105eb09530..5370cb8ab1 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -29,6 +29,7 @@ #include "../librpc/gen_ndr/ndr_security.h" #include "../librpc/gen_ndr/open_files.h" #include "../librpc/gen_ndr/idmap.h" +#include "../librpc/gen_ndr/ioctl.h" #include "passdb/lookup_sid.h" #include "auth.h" #include "serverid.h" @@ -4067,6 +4068,17 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, } } + if ((conn->fs_capabilities & FILE_FILE_COMPRESSION) + && (create_options & FILE_NO_COMPRESSION) + && (info == FILE_WAS_CREATED)) { + status = SMB_VFS_SET_COMPRESSION(conn, fsp, fsp, + COMPRESSION_FORMAT_NONE); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("failed to disable compression: %s\n", + nt_errstr(status))); + } + } + DEBUG(10, ("create_file_unixpath: info=%d\n", info)); *result = fsp; |