summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/posix/pvfs_search.c4
-rw-r--r--source4/ntvfs/posix/pvfs_shortname.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/source4/ntvfs/posix/pvfs_search.c b/source4/ntvfs/posix/pvfs_search.c
index f8d538bab2..211cb68b86 100644
--- a/source4/ntvfs/posix/pvfs_search.c
+++ b/source4/ntvfs/posix/pvfs_search.c
@@ -125,7 +125,7 @@ static NTSTATUS fill_search_info(struct pvfs_state *pvfs,
file->both_directory_info.alloc_size = name->dos.alloc_size;
file->both_directory_info.attrib = name->dos.attrib;
file->both_directory_info.ea_size = name->dos.ea_size;
- file->both_directory_info.short_name.s = pvfs_short_name(pvfs, name);
+ file->both_directory_info.short_name.s = pvfs_short_name(pvfs, file, name);
file->both_directory_info.name.s = fname;
return NT_STATUS_OK;
@@ -154,7 +154,7 @@ static NTSTATUS fill_search_info(struct pvfs_state *pvfs,
file->id_both_directory_info.attrib = name->dos.attrib;
file->id_both_directory_info.ea_size = name->dos.ea_size;
file->id_both_directory_info.file_id = name->dos.file_id;
- file->id_both_directory_info.short_name.s = pvfs_short_name(pvfs, name);
+ file->id_both_directory_info.short_name.s = pvfs_short_name(pvfs, file, name);
file->id_both_directory_info.name.s = fname;
return NT_STATUS_OK;
diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c
index 33e601e429..21c0ca6ea0 100644
--- a/source4/ntvfs/posix/pvfs_shortname.c
+++ b/source4/ntvfs/posix/pvfs_shortname.c
@@ -38,8 +38,10 @@ char *pvfs_short_name_component(struct pvfs_state *pvfs, const char *name)
return the short name for a given entry in a directory
TODO: this is obviously not very useful in its current form !
*/
-char *pvfs_short_name(struct pvfs_state *pvfs, struct pvfs_filename *name)
+char *pvfs_short_name(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, struct pvfs_filename *name)
{
char *p = strrchr(name->full_name, '/');
- return pvfs_short_name_component(pvfs, p+1);
+ char *ret = pvfs_short_name_component(pvfs, p+1);
+ talloc_steal(mem_ctx, ret);
+ return ret;
}