diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-12 05:10:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:49 -0500 |
commit | 52f525c104ae2d17901f104cbf482395dc803cc1 (patch) | |
tree | 1ccd6d3879a0d82311f8796cb15e958b1e77ab5a /source4/ntvfs/posix/pvfs_dirlist.c | |
parent | c7130b816b29cab981646482e57cb6923ae91b4f (diff) | |
download | samba-52f525c104ae2d17901f104cbf482395dc803cc1.tar.gz samba-52f525c104ae2d17901f104cbf482395dc803cc1.tar.bz2 samba-52f525c104ae2d17901f104cbf482395dc803cc1.zip |
r2927: imported the hash2 name mangling code from Samba3 into Samba4, but
heavily modified to suit the Samba4 architecture.
Samba4 with posix backend now passes the BASE-MANGLE test
(This used to be commit ed52d69e8a065b6a8df2fb73c89be67acfdbca65)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_dirlist.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_dirlist.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c index 79d9a9a3fa..0482cda808 100644 --- a/source4/ntvfs/posix/pvfs_dirlist.c +++ b/source4/ntvfs/posix/pvfs_dirlist.c @@ -98,21 +98,19 @@ NTSTATUS pvfs_list(struct pvfs_state *pvfs, struct pvfs_filename *name, struct p while ((dent = readdir(odir))) { uint_t i = dir->count; const char *dname = dent->d_name; - char *short_name; - short_name = pvfs_short_name_component(pvfs, dname); - - /* check it matches the wildcard pattern */ if (ms_fnmatch(pattern, dname, - pvfs->tcon->smb_conn->negotiate.protocol) != 0 && - ms_fnmatch(pattern, short_name, pvfs->tcon->smb_conn->negotiate.protocol) != 0) { + char *short_name = pvfs_short_name_component(pvfs, dname); + if (short_name == NULL || + ms_fnmatch(pattern, short_name, + pvfs->tcon->smb_conn->negotiate.protocol) != 0) { + talloc_free(short_name); + continue; + } talloc_free(short_name); - continue; } - talloc_free(short_name); - if (dir->count >= allocated) { allocated = (allocated + 100) * 1.2; dir->names = talloc_realloc_p(dir, dir->names, const char *, allocated); |