diff options
author | Aravind Srinivasan <aravind.srinivasan@isilon.com> | 2009-08-26 14:56:09 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-08-28 16:38:57 -0700 |
commit | e046b382f24f507a19bfb020b145ea2ec8acafcb (patch) | |
tree | 867511a82c4772ee8f325c48ed1ec3f0b5e5d093 /source3/smbd/filename.c | |
parent | 77e2403f1314a28722f0fb21f6682320b2e9935d (diff) | |
download | samba-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/smbd/filename.c')
-rw-r--r-- | source3/smbd/filename.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 2538bc1ea6..ee97388da2 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -829,7 +829,7 @@ static int get_real_filename_full_scan(connection_struct *conn, TALLOC_CTX *mem_ctx, char **found_name) { struct smb_Dir *cur_dir; - const char *dname; + char *dname = NULL; char *unmangled_name = NULL; long curpos; @@ -885,6 +885,7 @@ static int get_real_filename_full_scan(connection_struct *conn, /* Is it dot or dot dot. */ if (ISDOT(dname) || ISDOTDOT(dname)) { + TALLOC_FREE(dname); continue; } @@ -907,10 +908,13 @@ static int get_real_filename_full_scan(connection_struct *conn, TALLOC_FREE(cur_dir); if (!*found_name) { errno = ENOMEM; + TALLOC_FREE(dname); return -1; } + TALLOC_FREE(dname); return 0; } + TALLOC_FREE(dname); } TALLOC_FREE(unmangled_name); |