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>
bool prealloc;
bool acl;
bool settimes;
+ bool recalls;
};
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,
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;
}