From e046b382f24f507a19bfb020b145ea2ec8acafcb Mon Sep 17 00:00:00 2001 From: Aravind Srinivasan Date: Wed, 26 Aug 2009 14:56:09 -0700 Subject: 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 --- source3/smbd/msdfs.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/smbd/msdfs.c') diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 74e46527bc..4a338fa590 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1548,6 +1548,7 @@ static int count_dfs_links(TALLOC_CTX *ctx, int snum) NULL)) { cnt++; } + TALLOC_FREE(dname); } SMB_VFS_CLOSEDIR(conn,dirp); @@ -1647,6 +1648,7 @@ static int form_junctions(TALLOC_CTX *ctx, if (cnt >= jn_remain) { DEBUG(2, ("form_junctions: ran out of MSDFS " "junction slots")); + TALLOC_FREE(dname); goto out; } if (is_msdfs_link_internal(ctx, @@ -1664,6 +1666,7 @@ static int form_junctions(TALLOC_CTX *ctx, dname); if (!jucn[cnt].service_name || !jucn[cnt].volume_name) { + TALLOC_FREE(dname); goto out; } jucn[cnt].comment = ""; @@ -1671,6 +1674,7 @@ static int form_junctions(TALLOC_CTX *ctx, } TALLOC_FREE(link_target); } + TALLOC_FREE(dname); } out: -- cgit