LDB:ldbsearch - search filters do not only contain "="
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 4 May 2012 09:59:22 +0000 (11:59 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 14 Aug 2012 12:56:04 +0000 (14:56 +0200)
Also "<=", ">=", "~"... are allowed as well. Enumeration taken from
ldb_parse_filtertype().
This was the cause of not identifying the search filter as described in bug
https://bugzilla.samba.org/show_bug.cgi?id=8647.

lib/ldb/tools/ldbsearch.c

index 2da7072fa60045a54cd33f7517ed3bb1ccb370ac..a030a5abda663c05ec590243a6c0c15dc600bd42 100644 (file)
@@ -305,7 +305,7 @@ int main(int argc, const char **argv)
        /* the check for '=' is for compatibility with ldapsearch */
        if (!options->interactive &&
            options->argc > 0 && 
        /* the check for '=' is for compatibility with ldapsearch */
        if (!options->interactive &&
            options->argc > 0 && 
-           strchr(options->argv[0], '=')) {
+           strpbrk(options->argv[0], "=<>~:")) {
                expression = options->argv[0];
                options->argv++;
                options->argc--;
                expression = options->argv[0];
                options->argv++;
                options->argc--;