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

Re: inconsistencies in attribute chars macros (ITS#3225)

> At 01:32 PM 7/8/2004, ando@sys-net.it wrote:
>>#define ATTR_LEADCHAR(c)        ( DESC_LEADCHAR(c) || OID_LEADCHAR(c) )
>>#define ATTR_CHAR(c)    ( DESC_CHAR((c)) || OID_CHAR(c) )
>>#define AD_LEADCHAR(c)  ( ATTR_LEADCHAR(c) )
>>#define AD_CHAR(c)              ( ATTR_CHAR(c) || (c) == ';' )
> On the surface, that seems reasonable.  Likely need to check uses
> of these macros because there might be reason for the current oddities.

I did that, before going on with the changes.  What happens is that only
AD_CHAR() is used; it is also used to check the leading char of an
AttributeDescription, so I guess this could lead to ".attribute" being
legal at some point ...

>>Moreover, in servers/slapd/ad.c a static function ad_keystring()
>>is defined, whose code is a bit odd; I'd replace the first occurrence
>>of AD_CHAR() with AD_LEADCHAR() as defined above.
> Seems okay.
>>Finally, later on in slap_bv2ad the error message "attribute description
>>contains inappropriate characters", which is mentioned in
>>sounds a bit misleading,
> Maybe, but the term is proper and correct.  To use another term
> would even more misleading.
>>since it seems to indicate that the error is
>>in the DESC field of an attributeType,
> I argue that those prone to making such assumptions would likely not
> be helped by changing the message no matter what it was changed to.
>>while it is testing the string
>>used in the NAME field, i.e. the attributeType itself.  I'd change it to
>>"attributeType contains inappropriate characters".
> No.  The error means that some portion of the attribute description,
> not necessarily the attribute type's short name, contains inappropriate
> characters.
> However, maybe it would be better to write it 'AttributeDescription'
> instead of 'attribute description'.

I was considering "attribute name"; AttributeDescription is fine, though
(at least for developers, and to speed up problem recognition and solving
on the -software list :).


Pierangelo Masarati

    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497