LDB:ldif_handlers.c - LDB_OP_GREATER/LDB_OP_LESS are thought as ">=" or "<="
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 4 May 2012 09:41:03 +0000 (11:41 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 21 Aug 2012 23:31:55 +0000 (01:31 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb-samba/ldif_handlers.c
lib/ldb/common/ldb_parse.c

index af66623efaf4c098f0a4819169382d9d94010a4b..1cf7df76ff6bfd5ce51e454cf8970c832fe62438 100644 (file)
@@ -1139,9 +1139,9 @@ static int samba_syntax_operator_fn(struct ldb_context *ldb, enum ldb_parse_op o
                ret = a->syntax->comparison_fn(ldb, tmp_ctx, v1, v2);
                talloc_free(tmp_ctx);
                if (operation == LDB_OP_GREATER) {
-                       *matched = (ret > 0);
+                       *matched = (ret >= 0);
                } else if (operation == LDB_OP_LESS) {
-                       *matched = (ret < 0);
+                       *matched = (ret <= 0);
                } else {
                        *matched = (ret == 0);
                }
index 47145a23011699e6bc0b47373e0c8d4991cba222..cfa2959194071d8574a9aeffa34b1683670dcf84 100644 (file)
@@ -343,7 +343,7 @@ static enum ldb_parse_op ldb_parse_filtertype(TALLOC_CTX *mem_ctx, char **type,
        }
        if (!filter) {
                talloc_free(name);
-               return filter;
+               return 0;
        }
        p++;