git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acf33e0
)
s4-dsdb: added samdb_ldb_val_case_cmp()
author
Andrew Tridgell
<tridge@samba.org>
Sat, 9 Jan 2010 06:42:05 +0000
(17:42 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Sat, 9 Jan 2010 07:56:29 +0000
(18:56 +1100)
source4/dsdb/common/util.c
patch
|
blob
|
history
diff --git
a/source4/dsdb/common/util.c
b/source4/dsdb/common/util.c
index 632025da54edaf794d6aea2a9332271894d1fe60..139ea4dc6b4ab2d2e8911abe6c50397a86c3e124 100644
(file)
--- a/
source4/dsdb/common/util.c
+++ b/
source4/dsdb/common/util.c
@@
-3198,3
+3198,19
@@
int dsdb_tombstone_lifetime(struct ldb_context *ldb, uint32_t *lifetime)
talloc_free(dn);
return LDB_SUCCESS;
}
+
+/*
+ compare a ldb_val to a string case insensitively
+ */
+int samdb_ldb_val_case_cmp(const char *s, struct ldb_val *v)
+{
+ size_t len = strlen(s);
+ int ret;
+ if (len > v->length) return 1;
+ ret = strncasecmp(s, (const char *)v->data, v->length);
+ if (ret != 0) return ret;
+ if (v->length > len && v->data[len] != 0) {
+ return -1;
+ }
+ return 0;
+}