[SSSD] [PATCH] Add user and group search LDAP filter options

Stephen Gallagher sgallagh at redhat.com
Thu Apr 14 18:04:36 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/06/2011 11:44 AM, Jakub Hrozek wrote:
> On 04/06/2011 12:40 PM, Jakub Hrozek wrote:
>> On 04/06/2011 08:58 AM, Jan Zelený wrote:
>>> Ack
> 
>>> Jan
> 
>> Self nack, this needs documentation, too.
> 
> att.


Nack. I don't like the design of the sdap_get_id_specific_filter()
function at all.

The assumption of the inputs should be that base_filter is always a
complete filter (including parentheses). If there is an extra_filter, it
should be handled thusly:

If it starts with a parenthesis,

filter = talloc_asprintf(mem_ctx, "(&%s%s), base_filter, extra_filter)

If it does not,
filter = talloc_asprintf(mem_ctx, "(&%s(%s)), base_filter, extra_filter)

If there is no extra_filter, it should just talloc_strdup() the
base_filter and return that (since the parent function is always
expecting the return value to be allocated freshly on mem_ctx).

The advantage to this approach is that it won't require any special
hoops to jump through if base_filter happened to include something OTHER
than an '&' grouping.

- -- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2nNzQACgkQeiVVYja6o6NXqgCgpHzbZxODkc3G1oNwkf4sSVCF
GCgAoKcFZ9pjPFiQvyd/kM0Uwjx0B9EV
=zCt/
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list