diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-09-13 04:03:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:30 -0500 |
commit | 918db36213fdd2faea7dc200de43595259b397f4 (patch) | |
tree | efa22a3b82b9bea8efeec1d01c79003c16a430bd /source4 | |
parent | 6c48dc861266242ff85bf8aad9b7e4bb7f94411f (diff) | |
download | samba-918db36213fdd2faea7dc200de43595259b397f4.tar.gz samba-918db36213fdd2faea7dc200de43595259b397f4.tar.bz2 samba-918db36213fdd2faea7dc200de43595259b397f4.zip |
r18441: Allow searching for the high bit in these bitfields, when the client
asks for them as large integers, rather than a negative integer.
Due to an OpenLDAP bug, this only works reliably against OpenLDAP CVS
as of today. (but mostly works in older versions, depending on a
thread-specific value fo errno in the server).
Andrew Bartlett
(This used to be commit 3b5354aededc619ac6656611eacd43888e74260a)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/entryUUID.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/entryUUID.c b/source4/dsdb/samdb/ldb_modules/entryUUID.c index 29e80ff003..109e9be2f9 100644 --- a/source4/dsdb/samdb/ldb_modules/entryUUID.c +++ b/source4/dsdb/samdb/ldb_modules/entryUUID.c @@ -171,7 +171,22 @@ static struct ldb_val class_from_oid(struct ldb_module *module, TALLOC_CTX *ctx, } - +static struct ldb_val normalise_to_signed32(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val) +{ + long long int signed_ll = strtoll(val->data, NULL, 10); + if (signed_ll >= 0x80000000LL) { + union { + int32_t signed_int; + uint32_t unsigned_int; + } u = { + .unsigned_int = strtoul(val->data, NULL, 10) + }; + + struct ldb_val out = data_blob_string_const(talloc_asprintf(ctx, "%d", u.signed_int)); + return out; + } + return val_copy(module, ctx, val); +} const struct ldb_map_attribute entryUUID_attributes[] = { @@ -258,6 +273,28 @@ const struct ldb_map_attribute entryUUID_attributes[] = } }, { + .local_name = "groupType", + .type = MAP_CONVERT, + .u = { + .convert = { + .remote_name = "groupType", + .convert_local = normalise_to_signed32, + .convert_remote = val_copy, + }, + } + }, + { + .local_name = "samAccountType", + .type = MAP_CONVERT, + .u = { + .convert = { + .remote_name = "samAccountType", + .convert_local = normalise_to_signed32, + .convert_remote = val_copy, + }, + } + }, + { .local_name = "*", .type = MAP_KEEP, }, |