[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap_str2dn etc.

"Kurt D. Zeilenga" wrote:
> >I strip quotes from quoted
> >values; as a consequence I need to escape chars that need it
> >(according to RFC 1779). I've a small doubt: in a quoted
> >attribute only double quotes need be escaped (among printable
> >chars); so if I find an escape not followed by a quote do I
> >need to consider it a normal char (and thus escape it while
> >eliminating quotes)? According to rfc 1779, a quoted string
> >can contain what is called a PAIR. Example:
> >
> >'","'   => '\,'         OK
> >'"\,"'  => '\,'         OK
> I guess I don't understand the question (I haven't finished
> my morning cold carbonated caffeine yet:-).  But let me see
> if I can clarify.
> In parsing a string representation of a value, that string
> may be quoted or may be escaped.  In either case, the value
> is the unquoted/unescaped value and that's what stored in
> la_value.
> In generating a string representation, the value (la_value)
> may contain characters which require quoting and/or escaping.
> I suggest that here that only escaping be used.  Hence,
>         dn2str(str2dn(cn="foo,bar")) returns cn=foo\,bar

All the points seem to be clarified enough; here I mean:
from rfc 1779 it seems that "\," should be interpreted
as a single comma despite of the quotes:

	dn2str(str2dn(cn="foo\,bar")) returns cn=foo\,bar

while an interpretation that seems reasonable to me is that 
quotes should deactivate backslashes (except when escaping 
commas), so that "\," results in a backslash and a comma:

	dn2str(str2dn(cn="foo\,bar")) returns cn=foo\\\,bar


Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 | mailto:masarati@aero.polimi.it
via La Masa 34, 20156 Milano, Italy   |