[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.

>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

However, maybe it would be better to write it 'AttributeDescription'
instead of 'attribute description'.