summaryrefslogtreecommitdiff
path: root/source3/modules
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/modules
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/modules')
-rw-r--r--source3/modules/onefs_open.c22
-rw-r--r--source3/modules/vfs_acl_common.c2
-rw-r--r--source3/modules/vfs_default.c4
-rw-r--r--source3/modules/vfs_full_audit.c2
-rw-r--r--source3/modules/vfs_onefs_shadow_copy.c4
5 files changed, 24 insertions, 10 deletions
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 2b4e106f91..378d9f69f7 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -54,6 +54,7 @@ static NTSTATUS onefs_create_file_unixpath(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,
files_struct **result,
@@ -438,6 +439,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
uint32 create_options,
uint32 new_dos_attributes,
int oplock_request,
+ uint32_t private_flags,
struct security_descriptor *sd,
files_struct *fsp,
int *pinfo,
@@ -818,7 +820,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
DEBUG(10, ("fsp = %p\n", fsp));
fsp->share_access = share_access;
- fsp->fh->private_options = create_options;
+ fsp->fh->private_options = private_flags;
fsp->access_mask = open_access_mask; /* We change this to the
* requested access_mask after
* the open is done. */
@@ -992,7 +994,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
* calls. */
/* Try to find dup fsp if possible. */
- if (create_options &
+ if (private_flags &
(NTCREATEX_OPTIONS_PRIVATE_DENY_DOS|
NTCREATEX_OPTIONS_PRIVATE_DENY_FCB)) {
@@ -1261,9 +1263,6 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
* deny mode is compatible with all current opens.
*/
- /* Record the options we were opened with. */
- fsp->share_access = share_access;
- fsp->fh->private_options = create_options;
/*
* According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted,
*/
@@ -1629,7 +1628,7 @@ static NTSTATUS onefs_open_directory(connection_struct *conn,
fsp->can_write = False;
fsp->share_access = share_access;
- fsp->fh->private_options = create_options;
+ fsp->fh->private_options = 0;
/*
* According to Samba4, SEC_FILE_READ_ATTRIBUTE is always granted,
*/
@@ -1718,6 +1717,7 @@ static NTSTATUS onefs_create_file_unixpath(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,
files_struct **result,
@@ -1732,7 +1732,8 @@ static NTSTATUS onefs_create_file_unixpath(connection_struct *conn,
DEBUG(10,("onefs_create_file_unixpath: access_mask = 0x%x "
"file_attributes = 0x%x, share_access = 0x%x, "
"create_disposition = 0x%x create_options = 0x%x "
- "oplock_request = 0x%x ea_list = 0x%p, sd = 0x%p, "
+ "oplock_request = 0x%x private_flags = 0x%x "
+ "ea_list = 0x%p, sd = 0x%p, "
"fname = %s\n",
(unsigned int)access_mask,
(unsigned int)file_attributes,
@@ -1740,6 +1741,7 @@ static NTSTATUS onefs_create_file_unixpath(connection_struct *conn,
(unsigned int)create_disposition,
(unsigned int)create_options,
(unsigned int)oplock_request,
+ (unsigned int)private_flags,
ea_list, sd, smb_fname_str_dbg(smb_fname)));
if (create_options & FILE_OPEN_BY_FILE_ID) {
@@ -1823,6 +1825,7 @@ static NTSTATUS onefs_create_file_unixpath(connection_struct *conn,
file_attributes, /* file_attributes */
NO_OPLOCK, /* oplock_request */
0, /* allocation_size */
+ 0, /* private_flags */
NULL, /* sd */
NULL, /* ea_list */
&base_fsp, /* result */
@@ -2066,6 +2069,7 @@ NTSTATUS onefs_create_file(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,
@@ -2080,7 +2084,7 @@ NTSTATUS onefs_create_file(vfs_handle_struct *handle,
DEBUG(10,("onefs_create_file: access_mask = 0x%x "
"file_attributes = 0x%x, share_access = 0x%x, "
"create_disposition = 0x%x create_options = 0x%x "
- "oplock_request = 0x%x "
+ "oplock_request = 0x%x private_flags = 0x%x"
"root_dir_fid = 0x%x, ea_list = 0x%p, sd = 0x%p, "
"fname = %s\n",
(unsigned int)access_mask,
@@ -2089,6 +2093,7 @@ NTSTATUS onefs_create_file(vfs_handle_struct *handle,
(unsigned int)create_disposition,
(unsigned int)create_options,
(unsigned int)oplock_request,
+ (unsigned int)private_flags,
(unsigned int)root_dir_fid,
ea_list, sd, smb_fname_str_dbg(smb_fname)));
@@ -2118,6 +2123,7 @@ NTSTATUS onefs_create_file(vfs_handle_struct *handle,
file_attributes, /* file_attributes */
oplock_request, /* oplock_request */
allocation_size, /* allocation_size */
+ private_flags,
sd, /* sd */
ea_list, /* ea_list */
&fsp, /* result */
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 1f1e40343b..5d6cfe7f3e 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -873,6 +873,7 @@ static NTSTATUS create_file_acl_common(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,
@@ -894,6 +895,7 @@ static NTSTATUS create_file_acl_common(struct vfs_handle_struct *handle,
file_attributes,
oplock_request,
allocation_size,
+ private_flags,
sd,
ea_list,
result,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6e2a5712c8..ed9bb36d48 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -298,6 +298,7 @@ static NTSTATUS vfswrap_create_file(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,
@@ -307,7 +308,8 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
access_mask, share_access,
create_disposition, create_options,
file_attributes, oplock_request,
- allocation_size, sd, ea_list, result,
+ allocation_size, private_flags,
+ sd, ea_list, result,
pinfo);
}
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 8a40f6712c..7e7a4f4158 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -868,6 +868,7 @@ static NTSTATUS smb_full_audit_create_file(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_fsp,
@@ -911,6 +912,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
file_attributes, /* file_attributes */
oplock_request, /* oplock_request */
allocation_size, /* allocation_size */
+ private_flags,
sd, /* sd */
ea_list, /* ea_list */
result_fsp, /* result */
diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c
index c733392d27..cf84e58171 100644
--- a/source3/modules/vfs_onefs_shadow_copy.c
+++ b/source3/modules/vfs_onefs_shadow_copy.c
@@ -233,6 +233,7 @@ onefs_shadow_copy_create_file(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,
@@ -243,7 +244,8 @@ onefs_shadow_copy_create_file(vfs_handle_struct *handle,
access_mask, share_access,
create_disposition, create_options,
file_attributes, oplock_request,
- allocation_size, sd, ea_list, result, pinfo),
+ allocation_size, private_flags,
+ sd, ea_list, result, pinfo),
NTSTATUS);
}