summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-02-22 20:50:30 -0800
committerTim Prouty <tprouty@samba.org>2009-02-23 23:21:48 -0800
commit7bcaaf14fbf22805d88b945256b6bd31121c7c66 (patch)
tree5ee1ab04fa721dcde8e9857207221c7562bdafcc /source3
parent8d63c596a0f512c96f5663c0a9bd49d3c98c6df9 (diff)
downloadsamba-7bcaaf14fbf22805d88b945256b6bd31121c7c66.tar.gz
samba-7bcaaf14fbf22805d88b945256b6bd31121c7c66.tar.bz2
samba-7bcaaf14fbf22805d88b945256b6bd31121c7c66.zip
s3 OneFS: Add a parameter that unconditionally allows execute access
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/onefs.h2
-rw-r--r--source3/modules/onefs_system.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/source3/modules/onefs.h b/source3/modules/onefs.h
index a70664bbf3..418e13d9d2 100644
--- a/source3/modules/onefs.h
+++ b/source3/modules/onefs.h
@@ -41,6 +41,8 @@ enum onefs_acl_wire_format
#define PARM_ONEFS_TYPE "onefs"
#define PARM_ACL_WIRE_FORMAT "acl wire format"
#define PARM_ACL_WIRE_FORMAT_DEFAULT ACL_FORMAT_WINDOWS_SD
+#define PARM_ALLOW_EXECUTE_ALWAYS "allow execute always"
+#define PARM_ALLOW_EXECUTE_ALWAYS_DEFAULT false
#define PARM_ATIME_NOW "atime now files"
#define PARM_ATIME_NOW_DEFAULT NULL
#define PARM_ATIME_STATIC "atime static files"
diff --git a/source3/modules/onefs_system.c b/source3/modules/onefs_system.c
index 10802895cd..76df006d82 100644
--- a/source3/modules/onefs_system.c
+++ b/source3/modules/onefs_system.c
@@ -132,6 +132,30 @@ int onefs_sys_create_file(connection_struct *conn,
if (lp_nt_acl_support(SNUM(conn)) && !lp_inherit_perms(SNUM(conn)))
cf_flags = cf_flags_or(cf_flags, CF_FLAGS_DEFAULT_ACL);
+ /*
+ * Some customer workflows require the execute bit to be ignored.
+ */
+ if (lp_parm_bool(SNUM(conn), PARM_ONEFS_TYPE,
+ PARM_ALLOW_EXECUTE_ALWAYS,
+ PARM_ALLOW_EXECUTE_ALWAYS_DEFAULT) &&
+ (open_access_mask & FILE_EXECUTE)) {
+
+ DEBUG(3, ("Stripping execute bit from %s: (0x%x)\n", path,
+ open_access_mask));
+
+ /* Strip execute. */
+ open_access_mask &= ~FILE_EXECUTE;
+
+ /*
+ * Add READ_DATA, so we're not left with desired_access=0. An
+ * execute call should imply the client will read the data.
+ */
+ open_access_mask |= FILE_READ_DATA;
+
+ DEBUGADD(3, ("New stripped access mask: 0x%x\n",
+ open_access_mask));
+ }
+
DEBUG(10,("onefs_sys_create_file: base_fd = %d, "
"open_access_mask = 0x%x, flags = 0x%x, mode = 0%o, "
"desired_oplock = %s, id = 0x%x, secinfo = 0x%x, sd = %p, "