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

RE: InvalidAttributeSyntax(21) and Constraint violation(19)



I don't think the LDAP RFCs make any comments on the lower bounds for
attribute lengths, however, in X.520 DirectryString is defined with a lower
bound of 1, so clearly your NULL value should generate an error. 

	DirectoryString { INTEGER : maxSize } ::= CHOICE {
	teletexString		TeletexString (SIZE (1..maxSize)),
	printableString		PrintableString (SIZE (1..maxSize)),
	universalString		UniversalString (SIZE (1..maxSize)) }

Unfortunately, as Kurt points out, it is a little ambiguous whether a size
violation here would result in an error of constraintViolation or
invalidAttributeSyntax. It depends on whether you view the size limits on an
attribute as bound up with the syntax or separate.  Since in X.511, size
limits are explicitly listed as an example of attribute constraints then it
may be reasonable to assume that the appropriate error would be
constraintViolation, however, I expect you'll find a lot of variability in
what error various servers will return.
Regards,
-Kristianne



-----Original Message-----
From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org]
Sent: Wednesday, May 31, 2000 10:29 AM
To: Vithalprasad Gaitonde
Cc: ietf-ldapext@netscape.com
Subject: Re: InvalidAttributeSyntax(21) and Constraint violation(19)


At 05:36 AM 5/31/00 -0600, Vithalprasad Gaitonde wrote:
>Hi, 
>	Could any one tell me when should the ldap server return an
InvalidAttributeSyntax and when should it return constraint violation. What
is the criteria which distinguishes these two errors.
>e.g. If I have title as an attibute for a user, and I try to do an
ldapmodify with the value as NULL for title should I get a
InvalidAttributeSyntax or a ConstraintViolation.

>From X.521:
  invalidAttributeSyntax - A purported attribute value, specified as an
  argument of the operation, does not conform to the attribute syntax of the
  attribute type.

  constraintViolation - An attribute value supplied in the argument of an
  operation does not conform to the constraints imposed by ITU-T Rec. X.501
  | ISO/IEC 9594-2 or by the attribute definition (e.g. the value exceeds
  the maximum size allowed).

So, you have to ask, is the empty value violate (or not) the attribute
syntax
of the attribute type or does it violate (or not) some other constraint?