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

Re: User-defined attribute options



Here is the next version of my patch for user-defined attribute options
and ranges.  Should I commit it?
  http://folk.uio.no/hbf/OpenLDAP/attr-options.txt
Looking at the code, I'm somewhat tempted to delete it all and instead
just predefine the `x-' tagging option range...

I'll make a separate patch later which renames
AttributeDescription.ad_lang to ad_tags, and similar changes elsewhere.

Implementation note:
AttributeDescription.ad_lang previously pointed into ad_cname.
That is no longer done if ;binary is present, because ;binary
might occur in the middle of the sorted attribute options.

Description, from slapd.conf(5):

  attributeoptions [option-name]...
    Define tagging attribute options or option ranges.  Options must not
    end with `-', ranges must end with `-'.  The `lang-' tagging option
    range is predefined.  If you use the attributeoptions directive,
    `lang-' will no longer be defined and you must specify it explicitly
    if you want it defined.

    Options defined this way have no special semantics.  Option ranges
    defined this way work like the `lang-' option range: They define a
    range of tagging options starting with the range name.  That is, if
    you define the range `x-foo-', you can use the options `x-foo-bar'
    or `x-foo-bar-baz'.  Furthermore, in a search or compare, a range or
    subrange name (with a trailing `-') matches all options starting
    with that name, as well as the option with the range name sans the
    trailing `-'.  That is, `x-foo-bar-' matches `x-foo-bar' and
    `x-foo-bar-baz'.

    RFC2251 reserves options beginning with "x-" for private
    experiments.  Other options should be registered with IANA, see
    RFC3383 section 3.4.  OpenLDAP also has the `binary' option built
    in, but this is a transfer option, not a tagging option.

  example:
    # Subtypes of "name" (e.g. "cn" and "ou") with the
    # option ";x-hidden" can be searched for/compared,
    # but are not shown.  See \fBslapd.access\fP(5).
    attributeoptions x-hidden lang-
    access to attr=name;x-hidden by * search

-- 
Hallvard