summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c14
-rw-r--r--source3/modules/vfs_recycle.c4
-rw-r--r--source3/modules/vfs_streams_depot.c13
-rw-r--r--source3/modules/vfs_streams_xattr.c27
4 files changed, 28 insertions, 30 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 2e620d04cc..cf135dfd03 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -90,6 +90,17 @@ static int vfswrap_statvfs(struct vfs_handle_struct *handle, const char *path,
return sys_statvfs(path, statbuf);
}
+static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle)
+{
+#if defined(DARWINOS)
+ struct vfs_statvfs_struct statbuf;
+ ZERO_STRUCT(statbuf);
+ sys_statvfs(handle->conn->connectpath, &statbuf);
+ return statbuf.FsCapabilities;
+#endif
+ return FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+}
+
/* Directory operations */
static SMB_STRUCT_DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attr)
@@ -950,7 +961,6 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
struct stream_struct **pstreams)
{
SMB_STRUCT_STAT sbuf;
- NTSTATUS status;
unsigned int num_streams = 0;
struct stream_struct *streams = NULL;
int ret;
@@ -1330,6 +1340,8 @@ static vfs_op_tuple vfs_default_ops[] = {
SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(vfswrap_statvfs), SMB_VFS_OP_STATVFS,
SMB_VFS_LAYER_OPAQUE},
+ {SMB_VFS_OP(vfswrap_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
+ SMB_VFS_LAYER_OPAQUE},
/* Directory operations */
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index fef65efa77..da1716719a 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -269,6 +269,7 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
char *token;
char *tok_str;
bool ret = False;
+ char *saveptr;
mode = recycle_directory_mode(handle);
@@ -286,7 +287,8 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
}
/* Create directory tree if neccessary */
- for(token = strtok(tok_str, "/"); token; token = strtok(NULL, "/")) {
+ for(token = strtok_r(tok_str, "/", &saveptr); token;
+ token = strtok_r(NULL, "/", &saveptr)) {
safe_strcat(new_dir, token, len);
if (recycle_directory_exist(handle, new_dir))
DEBUG(10, ("recycle: dir %s already exists\n", new_dir));
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index 68e7a75947..fa85ea4a57 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -610,22 +610,15 @@ static NTSTATUS streams_depot_streaminfo(vfs_handle_struct *handle,
return NT_STATUS_OK;
}
-static int streams_depot_statvfs(struct vfs_handle_struct *handle,
- const char *path,
- struct vfs_statvfs_struct *statbuf)
+static uint32_t streams_depot_fs_capabilities(struct vfs_handle_struct *handle)
{
- int ret;
-
- ret = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
- statbuf->FsCapabilities |= FILE_NAMED_STREAMS;
- return ret;
-
+ return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_NAMED_STREAMS;
}
/* VFS operations structure */
static vfs_op_tuple streams_depot_ops[] = {
- {SMB_VFS_OP(streams_depot_statvfs), SMB_VFS_OP_STATVFS,
+ {SMB_VFS_OP(streams_depot_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(streams_depot_open), SMB_VFS_OP_OPEN,
SMB_VFS_LAYER_TRANSPARENT},
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 7ce90ab30b..766e7d10ab 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -26,8 +26,6 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
-#define XATTR_DOSSTREAM_PREFIX "user.DosStream."
-
struct stream_io {
char *base;
char *xattr_name;
@@ -140,7 +138,7 @@ static int streams_xattr_stat(vfs_handle_struct *handle, const char *fname,
}
xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
- XATTR_DOSSTREAM_PREFIX, sname);
+ SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
if (xattr_name == NULL) {
errno = ENOMEM;
goto fail;
@@ -187,7 +185,7 @@ static int streams_xattr_lstat(vfs_handle_struct *handle, const char *fname,
}
xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
- XATTR_DOSSTREAM_PREFIX, sname);
+ SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
if (xattr_name == NULL) {
errno = ENOMEM;
goto fail;
@@ -239,7 +237,7 @@ static int streams_xattr_open(vfs_handle_struct *handle, const char *fname,
}
xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
- XATTR_DOSSTREAM_PREFIX, sname);
+ SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
if (xattr_name == NULL) {
errno = ENOMEM;
goto fail;
@@ -373,7 +371,7 @@ static int streams_xattr_unlink(vfs_handle_struct *handle, const char *fname)
}
xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
- XATTR_DOSSTREAM_PREFIX, sname);
+ SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
if (xattr_name == NULL) {
errno = ENOMEM;
goto fail;
@@ -403,7 +401,7 @@ static NTSTATUS walk_xattr_streams(connection_struct *conn, files_struct *fsp,
NTSTATUS status;
char **names;
size_t i, num_names;
- size_t prefix_len = strlen(XATTR_DOSSTREAM_PREFIX);
+ size_t prefix_len = strlen(SAMBA_XATTR_DOSSTREAM_PREFIX);
status = get_ea_names_from_file(talloc_tos(), conn, fsp, fname,
&names, &num_names);
@@ -414,7 +412,7 @@ static NTSTATUS walk_xattr_streams(connection_struct *conn, files_struct *fsp,
for (i=0; i<num_names; i++) {
struct ea_struct ea;
- if (strncmp(names[i], XATTR_DOSSTREAM_PREFIX,
+ if (strncmp(names[i], SAMBA_XATTR_DOSSTREAM_PREFIX,
prefix_len) != 0) {
continue;
}
@@ -560,16 +558,9 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
return NT_STATUS_OK;
}
-static int streams_xattr_statvfs(struct vfs_handle_struct *handle,
- const char *path,
- struct vfs_statvfs_struct *statbuf)
+static uint32_t streams_xattr_fs_capabilities(struct vfs_handle_struct *handle)
{
- int ret;
-
- ret = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
- statbuf->FsCapabilities |= FILE_NAMED_STREAMS;
- return ret;
-
+ return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_NAMED_STREAMS;
}
static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
@@ -663,7 +654,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *handle,
/* VFS operations structure */
static vfs_op_tuple streams_xattr_ops[] = {
- {SMB_VFS_OP(streams_xattr_statvfs), SMB_VFS_OP_STATVFS,
+ {SMB_VFS_OP(streams_xattr_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(streams_xattr_open), SMB_VFS_OP_OPEN,
SMB_VFS_LAYER_TRANSPARENT},