summaryrefslogtreecommitdiff
path: root/source4/ntvfs/cifs_posix_cli/svfs_util.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source4/ntvfs/cifs_posix_cli/svfs_util.c
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source4/ntvfs/cifs_posix_cli/svfs_util.c')
-rw-r--r--source4/ntvfs/cifs_posix_cli/svfs_util.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source4/ntvfs/cifs_posix_cli/svfs_util.c b/source4/ntvfs/cifs_posix_cli/svfs_util.c
index d8a7909390..f351c5840e 100644
--- a/source4/ntvfs/cifs_posix_cli/svfs_util.c
+++ b/source4/ntvfs/cifs_posix_cli/svfs_util.c
@@ -41,16 +41,15 @@ char *cifspsx_unix_path(struct ntvfs_module_context *ntvfs,
{
struct cifspsx_private *p = ntvfs->private_data;
char *ret;
+ char *name_lower = strlower_talloc(p, name);
if (*name != '\\') {
- ret = talloc_asprintf(req, "%s/%s", p->connectpath, name);
+ ret = talloc_asprintf(req, "%s/%s", p->connectpath, name_lower);
} else {
- ret = talloc_asprintf(req, "%s%s", p->connectpath, name);
+ ret = talloc_asprintf(req, "%s%s", p->connectpath, name_lower);
}
all_string_sub(ret, "\\", "/", 0);
-
- strlower(ret + strlen(p->connectpath));
-
+ talloc_free(name_lower);
return ret;
}
@@ -85,9 +84,8 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request
/* the wildcard pattern is the last part */
mask = p+1;
- low_mask = talloc_strdup(mem_ctx, mask);
+ low_mask = strlower_talloc(mem_ctx, mask);
if (!low_mask) { return NULL; }
- strlower(low_mask);
odir = opendir(dir->unix_dir);
if (!odir) { return NULL; }
@@ -102,12 +100,11 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request
continue;
}
- low_name = talloc_strdup(mem_ctx, dent->d_name);
+ low_name = strlower_talloc(mem_ctx, dent->d_name);
if (!low_name) { continue; }
- strlower(low_name);
/* check it matches the wildcard pattern */
- if (ms_fnmatch(low_mask, low_name, PROTOCOL_NT1) != 0) {
+ if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) {
continue;
}