summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.c
diff options
context:
space:
mode:
authorFrank Lahm <franklahm@googlemail.com>2011-10-13 15:41:53 -0700
committerJeremy Allison <jra@samba.org>2011-10-14 03:26:06 +0200
commit7a0b5d6fc51d5d212529e82e5ed8e21516bfbe27 (patch)
treefad7ac26c5589be626395bd9fd710b3440fd5f54 /source3/modules/vfs_default.c
parent1b27efd9107eef290e2c7d4826953157bab2f3c4 (diff)
downloadsamba-7a0b5d6fc51d5d212529e82e5ed8e21516bfbe27.tar.gz
samba-7a0b5d6fc51d5d212529e82e5ed8e21516bfbe27.tar.bz2
samba-7a0b5d6fc51d5d212529e82e5ed8e21516bfbe27.zip
Add support for VFS op streaminfo chaining in all relevant VFS modules.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Oct 14 03:26:06 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 17200696b3..4fd844a104 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1692,8 +1692,7 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
struct stream_struct **pstreams)
{
SMB_STRUCT_STAT sbuf;
- unsigned int num_streams = 0;
- struct stream_struct *streams = NULL;
+ struct stream_struct *tmp_streams = NULL;
int ret;
if ((fsp != NULL) && (fsp->is_directory)) {
@@ -1728,25 +1727,21 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
goto done;
}
- streams = talloc(mem_ctx, struct stream_struct);
-
- if (streams == NULL) {
+ tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct,
+ (*pnum_streams) + 1);
+ if (tmp_streams == NULL) {
return NT_STATUS_NO_MEMORY;
}
-
- streams->size = sbuf.st_ex_size;
- streams->alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
-
- streams->name = talloc_strdup(streams, "::$DATA");
- if (streams->name == NULL) {
- TALLOC_FREE(streams);
+ tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA");
+ if (tmp_streams[*pnum_streams].name == NULL) {
return NT_STATUS_NO_MEMORY;
}
+ tmp_streams[*pnum_streams].size = sbuf.st_ex_size;
+ tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
- num_streams = 1;
+ *pnum_streams += 1;
+ *pstreams = tmp_streams;
done:
- *pnum_streams = num_streams;
- *pstreams = streams;
return NT_STATUS_OK;
}