From 9debea56c8ad95e44355d8ed2a08ef42a8d0237e Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Wed, 20 Mar 2013 15:16:37 +0100 Subject: [PATCH] s3:modules/vfs_gpfs add gpfs:recalls option When this option is set to no, an attempt to open an offline file will be rejected with access denied. This helps preventing recall storms triggered by careless applications like Finder and Explorer. Signed-off-by: Christian Ambach Reviewed-by: Christof Schmitt Reviewed-by: Volker Lendecke --- source3/modules/vfs_gpfs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 760d27fb5cc..73ab4a463d9 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -49,6 +49,7 @@ struct gpfs_config_data { bool prealloc; bool acl; bool settimes; + bool recalls; }; @@ -1810,6 +1811,8 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle, config->settimes = lp_parm_bool(SNUM(handle->conn), "gpfs", "settimes", true); + config->recalls = lp_parm_bool(SNUM(handle->conn), "gpfs", + "recalls", true); SMB_VFS_HANDLE_SET_DATA(handle, config, NULL, struct gpfs_config_data, @@ -2015,6 +2018,16 @@ static int vfs_gpfs_open(struct vfs_handle_struct *handle, struct gpfs_config_data, return -1); + if (config->hsm && !config->recalls) { + if (VALID_STAT(smb_fname->st) && + (smb_fname->st.vfs_private & GPFS_WINATTR_OFFLINE)) { + DEBUG(10, ("Refusing access to offline file %s\n", + fsp_str_dbg(fsp))); + errno = EACCES; + return -1; + } + } + if (config->syncio) { flags |= O_SYNC; } -- 2.34.1