summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-03-05 15:10:30 -0800
committerJeremy Allison <jra@samba.org>2010-03-05 15:13:37 -0800
commitc61c9c3a4cda79fb82adf59bcb563d85797b9b76 (patch)
tree3049052ca5181e9229d48de841c5635eef3ba055 /source3/include
parent95f22262656f38e5e0ea0b918ee68e958a9277f4 (diff)
downloadsamba-c61c9c3a4cda79fb82adf59bcb563d85797b9b76.tar.gz
samba-c61c9c3a4cda79fb82adf59bcb563d85797b9b76.tar.bz2
samba-c61c9c3a4cda79fb82adf59bcb563d85797b9b76.zip
Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
Ensure we don't use any of the create_options for Samba private use. Add a new parameter to the VFS_CREATE call (private_flags) which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code). Rev. the VFS interface to version 28. Jeremy.
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/include/smb.h15
-rw-r--r--source3/include/vfs.h5
-rw-r--r--source3/include/vfs_macros.h12
4 files changed, 25 insertions, 11 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 35f4703fc2..7c1f8fa92c 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6631,7 +6631,8 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
uint32 *paccess_mask,
uint32 *pshare_mode,
uint32 *pcreate_disposition,
- uint32 *pcreate_options);
+ uint32 *pcreate_options,
+ uint32_t *pprivate_flags);
NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
struct smb_filename *smb_fname,
files_struct **result);
@@ -6656,6 +6657,7 @@ NTSTATUS create_file_default(connection_struct *conn,
uint32_t file_attributes,
uint32_t oplock_request,
uint64_t allocation_size,
+ uint32_t private_flags,
struct security_descriptor *sd,
struct ea_list *ea_list,
diff --git a/source3/include/smb.h b/source3/include/smb.h
index de998cbe0a..8d1e148259 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -344,7 +344,8 @@ struct fd_handle {
SMB_OFF_T pos;
uint32 private_options; /* NT Create options, but we only look at
* NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and
- * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB (Except
+ * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and
+ * NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE
* for print files *only*, where
* DELETE_ON_CLOSE is not stored in the share
* mode database.
@@ -1372,13 +1373,17 @@ struct bitmap {
/*
* Private create options used by the ntcreatex processing code. From Samba4.
- * We reuse some ignored flags for private use.
+ * We reuse some ignored flags for private use. Passed in the private_flags
+ * argument.
*/
-#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x00010000
-#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x00020000
+#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x0001
+#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x0002
/* Private options for streams support */
-#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x00040000
+#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x0004
+
+/* Private options for printer support */
+#define NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 0x0008
/* Responses when opening a file. */
#define FILE_WAS_SUPERSEDED 0
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index aee84a70b7..9ec4c3ec69 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -125,7 +125,8 @@
* return to fs_capabilities call. JRA. */
/* Leave at 27 - not yet released. Add translate_name VFS call to convert
UNIX names to Windows supported names -- asrinivasan. */
-#define SMB_VFS_INTERFACE_VERSION 27
+/* Changed to version 28 - Add private_flags uint32_t to CREATE call. */
+#define SMB_VFS_INTERFACE_VERSION 28
/* to bug old modules which are trying to compile with the old functions */
@@ -213,6 +214,7 @@ struct vfs_fn_pointers {
uint32_t file_attributes,
uint32_t oplock_request,
uint64_t allocation_size,
+ uint32_t private_flags,
struct security_descriptor *sd,
struct ea_list *ea_list,
files_struct **result,
@@ -538,6 +540,7 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
uint32_t file_attributes,
uint32_t oplock_request,
uint64_t allocation_size,
+ uint32_t private_flags,
struct security_descriptor *sd,
struct ea_list *ea_list,
files_struct **result,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index c6f83bda07..4472e3a52a 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -120,10 +120,14 @@
#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) \
smb_vfs_call_open((handle)->next, (fname), (fsp), (flags), (mode))
-#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo) \
- smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo))
-#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo) \
- smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo))
+#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
+ create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
+ smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
+ (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \
+ create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \
+ smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \
+ (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo))
#define SMB_VFS_CLOSE(fsp) \
smb_vfs_call_close_fn((fsp)->conn->vfs_handles, (fsp))