summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-01 14:20:21 -0800
committerJeremy Allison <jra@samba.org>2008-12-01 14:20:21 -0800
commitb0c0b949feb7646d4c4077a04de2c0acd7720e44 (patch)
treec26fb5d714a74f358a168de66d412a53cf293707
parentd53f82a1cf9a369ae3e657fea845f19313f06eb4 (diff)
downloadsamba-b0c0b949feb7646d4c4077a04de2c0acd7720e44.tar.gz
samba-b0c0b949feb7646d4c4077a04de2c0acd7720e44.tar.bz2
samba-b0c0b949feb7646d4c4077a04de2c0acd7720e44.zip
s3:streams_depot: add an option to disable the xattr checks
streams_depot:check_valid=no is useful when the filesystem has no xattr support and files are only published via samba. metze
-rw-r--r--source3/modules/vfs_streams_depot.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index 9e0a5895ea..69d34940fd 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -67,10 +67,15 @@ static uint32_t hash_fn(DATA_BLOB key)
#define SAMBA_XATTR_MARKER "user.SAMBA_STREAMS"
-static bool file_is_valid(vfs_handle_struct *handle, const char *path)
+static bool file_is_valid(vfs_handle_struct *handle, const char *path,
+ bool check_valid)
{
char buf;
+ if (!check_valid) {
+ return true;
+ }
+
DEBUG(10, ("file_is_valid (%s) called\n", path));
if (SMB_VFS_NEXT_GETXATTR(handle, path, SAMBA_XATTR_MARKER,
@@ -87,11 +92,16 @@ static bool file_is_valid(vfs_handle_struct *handle, const char *path)
return true;
}
-static bool mark_file_valid(vfs_handle_struct *handle, const char *path)
+static bool mark_file_valid(vfs_handle_struct *handle, const char *path,
+ bool check_valid)
{
char buf = '1';
int ret;
+ if (!check_valid) {
+ return true;
+ }
+
DEBUG(10, ("marking file %s as valid\n", path));
ret = SMB_VFS_NEXT_SETXATTR(handle, path, SAMBA_XATTR_MARKER,
@@ -116,8 +126,12 @@ static char *stream_dir(vfs_handle_struct *handle, const char *base_path,
char *id_hex;
struct file_id id;
uint8 id_buf[16];
+ bool check_valid;
const char *rootdir;
+ check_valid = lp_parm_bool(SNUM(handle->conn),
+ "streams_depot", "check_valid", true);
+
tmp = talloc_asprintf(talloc_tos(), "%s/.streams", handle->conn->connectpath);
if (tmp == NULL) {
@@ -174,7 +188,7 @@ static char *stream_dir(vfs_handle_struct *handle, const char *base_path,
goto fail;
}
- if (file_is_valid(handle, base_path)) {
+ if (file_is_valid(handle, base_path, check_valid)) {
return result;
}
@@ -244,7 +258,7 @@ static char *stream_dir(vfs_handle_struct *handle, const char *base_path,
goto fail;
}
- if (!mark_file_valid(handle, base_path)) {
+ if (!mark_file_valid(handle, base_path, check_valid)) {
goto fail;
}