summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_dirlist.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-02 12:25:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:33 -0500
commit84bbe948f3beff0fbdc51c9c63e2f674b70b5bbe (patch)
treefedf0c6857bd02ad038eeabd54ad52601db2941d /source4/ntvfs/posix/pvfs_dirlist.c
parentc62a988c3986e6c1c3269ad4af36f653f08b3c96 (diff)
downloadsamba-84bbe948f3beff0fbdc51c9c63e2f674b70b5bbe.tar.gz
samba-84bbe948f3beff0fbdc51c9c63e2f674b70b5bbe.tar.bz2
samba-84bbe948f3beff0fbdc51c9c63e2f674b70b5bbe.zip
r2786: - match on both long and short name for search posix backend
- a final name component of . is illegal (This used to be commit 11c852170b83e5adbdb58407e1c7d3aeb4ab5bb8)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_dirlist.c')
-rw-r--r--source4/ntvfs/posix/pvfs_dirlist.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c
index 56afb4f33b..79d9a9a3fa 100644
--- a/source4/ntvfs/posix/pvfs_dirlist.c
+++ b/source4/ntvfs/posix/pvfs_dirlist.c
@@ -98,11 +98,20 @@ 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, PROTOCOL_NT1) != 0) {
+ if (ms_fnmatch(pattern, dname,
+ pvfs->tcon->smb_conn->negotiate.protocol) != 0 &&
+ ms_fnmatch(pattern, short_name,
+ pvfs->tcon->smb_conn->negotiate.protocol) != 0) {
+ talloc_free(short_name);
continue;
}
+
+ talloc_free(short_name);
if (dir->count >= allocated) {
allocated = (allocated + 100) * 1.2;