diff options
author | Volker Lendecke <vl@samba.org> | 2017-02-12 20:12:10 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2017-02-15 11:40:32 +0100 |
commit | 129015d1a664e97410fa5fe2aef6bd8c494ffb5b (patch) | |
tree | f25bf9868a5a2383ea5f24362061a95a08f84a9e /source4/client | |
parent | e08110ece699eeb1b9ef688c92bf84c69a6fa5fc (diff) | |
download | samba-129015d1a664e97410fa5fe2aef6bd8c494ffb5b.tar.gz |
lib: Fix "is_case_sensitive" in "ms_fnmatch_protocol"' callers
In the optimization in f969be54417 I got the boolean flag "is_case_sensitive"
wrong. The behaviour was case *insensitive*, so all the flags should have been
"false", keeping the old behaviour. While there, simplify "mask_match" in
source4 client.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb 15 11:40:32 CET 2017 on sn-devel-144
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index 10d027b5e0b..1182e5be013 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -302,27 +302,17 @@ static int cmd_cd(struct smbclient_context *ctx, const char **args) static bool mask_match(struct smbcli_state *c, const char *string, const char *pattern, bool is_case_sensitive) { - char *p2, *s2; - bool ret; + int ret; if (ISDOTDOT(string)) string = "."; if (ISDOT(pattern)) return false; - - if (is_case_sensitive) - return ms_fnmatch_protocol( - pattern, string, c->transport->negotiate.protocol, - true) == 0; - - p2 = strlower_talloc(NULL, pattern); - s2 = strlower_talloc(NULL, string); - ret = ms_fnmatch_protocol(p2, s2, c->transport->negotiate.protocol, - true) == 0; - talloc_free(p2); - talloc_free(s2); - - return ret; + + ret = ms_fnmatch_protocol(pattern, string, + c->transport->negotiate.protocol, + is_case_sensitive); + return (ret == 0); } |