summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_gpfs.c
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2013-03-20 15:16:37 +0100
committerVolker Lendecke <vl@samba.org>2014-03-14 10:45:10 +0100
commit9debea56c8ad95e44355d8ed2a08ef42a8d0237e (patch)
treefc71f34719b36c5560c08f6beb364fe0d16a356f /source3/modules/vfs_gpfs.c
parent61b978872fe86906611f64430b2608f5e7ea7ad8 (diff)
downloadsamba-9debea56c8ad95e44355d8ed2a08ef42a8d0237e.tar.gz
samba-9debea56c8ad95e44355d8ed2a08ef42a8d0237e.tar.xz
samba-9debea56c8ad95e44355d8ed2a08ef42a8d0237e.zip
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 <ambi@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/modules/vfs_gpfs.c')
-rw-r--r--source3/modules/vfs_gpfs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 760d27fb5c..73ab4a463d 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;
}