summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_streams_depot.c
diff options
context:
space:
mode:
authorAravind Srinivasan <aravind.srinivasan@isilon.com>2009-08-26 14:56:09 -0700
committerTim Prouty <tprouty@samba.org>2009-08-28 16:38:57 -0700
commite046b382f24f507a19bfb020b145ea2ec8acafcb (patch)
tree867511a82c4772ee8f325c48ed1ec3f0b5e5d093 /source3/modules/vfs_streams_depot.c
parent77e2403f1314a28722f0fb21f6682320b2e9935d (diff)
downloadsamba-e046b382f24f507a19bfb020b145ea2ec8acafcb.tar.gz
samba-e046b382f24f507a19bfb020b145ea2ec8acafcb.tar.bz2
samba-e046b382f24f507a19bfb020b145ea2ec8acafcb.zip
s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAME
This vop is designed to work in tandem with SMB_VFS_READDIR to allow vfs modules to make modifications to arbitrary filenames before they're consumed by callers. Subsequently the core directory enumeration code in smbd is now changed to free the memory that may be allocated in a module. This vop enables the new version of catia in the following patch. Signed-off-by: Tim Prouty <tprouty@samba.org>
Diffstat (limited to 'source3/modules/vfs_streams_depot.c')
-rw-r--r--source3/modules/vfs_streams_depot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index aa0189123b..51cd56e8fb 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -384,7 +384,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
{
char *dirname;
SMB_STRUCT_DIR *dirhandle = NULL;
- char *dirent;
+ char *dirent = NULL;
dirname = stream_dir(handle, smb_fname_base, &smb_fname_base->st,
false);
@@ -411,14 +411,17 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
while ((dirent = vfs_readdirname(handle->conn, dirhandle, NULL)) != NULL) {
if (ISDOT(dirent) || ISDOTDOT(dirent)) {
+ TALLOC_FREE(dirent);
continue;
}
DEBUG(10, ("walk_streams: dirent=%s\n", dirent));
if (!fn(dirname, dirent, private_data)) {
+ TALLOC_FREE(dirent);
break;
}
+ TALLOC_FREE(dirent);
}
SMB_VFS_NEXT_CLOSEDIR(handle, dirhandle);