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

Re: supporting range retrieval (ITS#3193)



At 01:56 AM 6/22/2004, lukeh@PADL.COM wrote:

>--19701020
>Content-Type: text/plain; charset=US-ASCII
>Content-Disposition: inline
>
>
>Comments noted, I'll keep it as a private patch (see attached FYI).

Though much more complicated, I suggest you find a way to
allow "=" and "*" only for select (non-stored?) options,
not all.  Otherwise you'll end up with crap like cn;lang_en=au
stored in your directory.

>Note that in our implementation we don't actually impose any limits
>on number of values returned - I agree that imposing an "optional"
>extension on clients is bad.

It's equally bad for clients to impose such on servers, such
as what these clients are doing.  They are suppose to, per
MS's own specification, use feature discover before utilizing
an extensions (especially one which changes basic protocol
encodings).  Of course, since MS AD server doesn't follow
their own specification either, it's not surprising that
clients designed for it don't as well.

>However, we need to deal with clients, such as the Active Directory
>Users & Computers snap-in, that request "member;range=0-*" instead
>of just "member".
>
>So, our implementation (which only works on linked attributes; it is
>implemented within the LinkEngine presented at ODD Wien) will honor
>client requests for a specific range but not return a range option
>if the client did not ask for it.
>
>-- Luke
>
>
>--19701020
>Content-Type: text/plain; name="2.2.14.diff"; x-unix-mode=0644
>Content-Disposition: attachment; filename="2.2.14.diff"
>
>Index: servers/slapd/ad.c
>===================================================================
>RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/ad.c,v
>retrieving revision 1.59.2.4
>diff -u -r1.59.2.4 ad.c
>--- servers/slapd/ad.c  1 Jan 2004 18:16:32 -0000       1.59.2.4
>+++ servers/slapd/ad.c  21 Jun 2004 13:30:14 -0000
>@@ -33,11 +33,13 @@
>        int           prefix;   /* NAME is a tag and range prefix */
> } Attr_option;
> 
>-static Attr_option lang_option = { { sizeof("lang-")-1, "lang-" }, 1 };
>-
> /* Options sorted by name, and number of options */
>-static Attr_option *options = &lang_option;
>-static int option_count = 1;
>+static Attr_option internal_options[] = {
>+       { { sizeof("lang-")-1, "lang-" }, 1 },
>+       { { sizeof("range=")-1, "range=" }, 1 } };
>+
>+static Attr_option *options = internal_options;
>+static int option_count = 2;
> 
> static Attr_option *ad_find_option_definition( const char *opt, int optlen );
> 
>@@ -844,7 +846,7 @@
>        int i;
>        unsigned int optlen;
> 
>-       if ( options == &lang_option ) {
>+       if ( options == internal_options ) {
>                options = NULL;
>                option_count = 0;
>        }
>Index: servers/slapd/slap.h
>===================================================================
>RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/slap.h,v
>retrieving revision 1.452.2.21
>diff -u -r1.452.2.21 slap.h
>--- servers/slapd/slap.h        16 Jun 2004 21:53:56 -0000      1.452.2.21
>+++ servers/slapd/slap.h        21 Jun 2004 13:30:15 -0000
>@@ -151,7 +151,7 @@
> #define ATTR_CHAR(c)   ( DESC_CHAR((c)) || (c) == '.' )
> 
> #define AD_LEADCHAR(c) ( ATTR_CHAR(c) )
>-#define AD_CHAR(c)             ( ATTR_CHAR(c) || (c) == ';' )
>+#define AD_CHAR(c)             ( ATTR_CHAR(c) || (c) == ';' || (c) == '=' || (c) == '*' )
> 
> #define SLAP_NUMERIC(c) ( ASCII_DIGIT(c) || ASCII_SPACE(c) )
> 
>Index: servers/slapd/slapi/slapi_utils.c
>===================================================================
>RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/slapi/slapi_utils.c,v
>retrieving revision 1.86.2.12
>diff -u -r1.86.2.12 slapi_utils.c
>--- servers/slapd/slapi/slapi_utils.c   16 Jun 2004 22:45:33 -0000      1.86.2.12
>+++ servers/slapd/slapi/slapi_utils.c   21 Jun 2004 13:30:17 -0000
>@@ -3584,7 +3584,7 @@
>                return 1;
>        }
> 
>-       if ( !c->cac_attrsonly ) {
>+       if ( !c->cac_attrsonly && a->a_vals != NULL ) {
>                for ( i = 0; a->a_vals[i].bv_val != NULL; i++ ) {
>                        if ( !access_allowed( op, e,
>                                desc, &a->a_vals[i], ACL_READ, &c->cac_acl_state)) {
>
>--19701020--