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

Re: ldap_str2dn etc.


I've done a big chunk of work; I think the largest part
that's still to do is the UTF-8 handling (I started working 
on it this morning on the commuter train :)

The code is kinda experimental, that is it is filled with
programmer's notes, and not optimized. After it works as 
expected I'll clean it a bit before commit.

I'll try to list all the open issues to see if I can fix any 
of them before I commit it (some of them simply are statements; 
correct them if they're wrong).

<grep FIXME getdn.c:>

a) there's no explicit mention both in RFC 2253 and 
in LDAPbis DN draft of language extensions to attr types.
I've figured out two behaviors:
	1) discard the extensions
	2) leave the extensions in place
	3) issue an error if PEDANTIC

b) string value means UTF-8 if LDAPv3 or T61 if LDAPv2;
I assume UTF-8 also if I'm reading DCE format, right?
But after I parsed a string into a DN, if I need to write 
it back, say, in LDAPv2, what should I do if it contains 
UTF-8? I was thinkning of extending the LDAPAVA struct
to hold flags that state if the value is UTF-8 or simply 
IA5 (correct?).

c) for performance issues, I think I should add a field
to the LDAPAVA struct that holds the length of the string
representation of the value, so I don't need to compute it 
all the times. I'd also like to turn the attribute type
field into a berval, to avoid computing its length many times
(maybe we could even use an AttributeDescription in union
with a berval in case the description is unknown).

d) I guess empty attributes are illegal in a DN; correct?
(I need to handle AVA separators right after the '=' sign).

e) I guess multi-AVA RDNs are allowed in DCE, right?

f) If I understood the point, I have to turn string 
representations of binary values ('#' + 1*(HEXPAIR) and 
'\' HEXPAIR) into their binary form, and back to string, 
right? (at least that's what I did).

g) I made leading and trailing spaces, and spaces around '=',
',', ';' and '+' admittable unless the PEDANTIC flag is set.
Are they allowed also in DCE format?

h) T61: what should I look at?.  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


Other points are very marginal, and will be dealt with after
this big chunk is in a satisfactory state. After you reply to 
points b) and f), and depending on the answer, I think I'll
commit the work shortly.


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   |