[SSSD] [PATCH] correctly escape RDNs

Stephen Gallagher sgallagh at redhat.com
Fri Nov 20 16:21:57 UTC 2009


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

On 11/20/2009 09:17 AM, Sumit Bose wrote:
> On Fri, Nov 20, 2009 at 09:07:31AM -0500, Simo Sorce wrote:
>> On Fri, 2009-11-20 at 09:50 +0100, Sumit Bose wrote:
>>> On Thu, Nov 19, 2009 at 07:30:32PM -0500, Simo Sorce wrote:
>>>> See commit comment.
>>>>
>>>> -- 
>>>> Simo Sorce * Red Hat, Inc * New York
>>>
>>>> >From 49862816e3b7077bc7a002c980901d31aff06269 Mon Sep 17 00:00:00 2001
>>>> From: Simo Sorce <ssorce at redhat.com>
>>>> Date: Thu, 19 Nov 2009 19:28:36 -0500
>>>> Subject: [PATCH] Correctly escape DN value.
>>>>
>>>> In building the DN string we weren't correctly escaping the value of the RDN
>>>> component. This patches fixes that.
>>>> ---
>>>>  server/db/sysdb_ops.c |   48 ++++++++++++++++++++++++++++++++++++++++++------
>>>>  1 files changed, 42 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c
>>>> index 4a44f28..da53fd3 100644
>>>> --- a/server/db/sysdb_ops.c
>>>> +++ b/server/db/sysdb_ops.c
>>>> @@ -2769,6 +2769,42 @@ int sysdb_store_user_recv(struct tevent_req *req)
>>>>  
>>>>  /* =Store-Group-(Native/Legacy)-(replaces-existing-data)================== */
>>>>  
>>>> +static char *build_dom_dn_str_escape(TALLOC_CTX *memctx, const char *template,
>>>> +                                     const char *domain, const char *name)
>>>> +{
>>>> +    char *ret;
>>>> +    int l;
>>>> +
>>>> +    l = strcspn(name, ",=\n+<>#;\\\"");
>>>
>>> Wouldn't it be better to always call ldb_dn_escape_value() instead of
>>> depending on a hardcoded set of characters which might be different in
>>> other/coming versions of libldb?
>>
>> Theorethically it would, but members list can be quite long and
>> ldb_dn_escape_value() always allocates memory. 
>> The list is unlikely to change though, as it is in an LDAP standard.
>>
>> Simo.
>>
> 
> ok, ACK
> 
> bye,
> Sumit
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel

Pushed to master.


- -- 
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.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAksGwiUACgkQeiVVYja6o6OKgACggluf1HjHDScSyi2BgUhSY5f+
/rUAnjgy2t3NP4BFAIwMzGfpLtRXurHN
=8W90
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list