-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/14/2011 08:04 PM, Stephen Gallagher wrote:
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.
Thank you, it is indeed quite cleaner. A new patch is attached.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora -
http://enigmail.mozdev.org/
iEYEARECAAYFAk2oACEACgkQHsardTLnvCXCOQCg2/L9XAuQgxmLhDioW/FGWjDX
XqgAnRmYUKOfgA/xF0D8egTVvfFV2NQk
=rbCu
-----END PGP SIGNATURE-----