From: Pierangelo Masarati Date: Sat, 14 Feb 2009 10:39:45 +0000 (+0000) Subject: let special attrnames slip through (ITS#5760) X-Git-Tag: ACLCHECK_0~828 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8f96e646057ede26ebeaab60f744c06b19ef1b75;p=openldap let special attrnames slip through (ITS#5760) --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index e1dab72b3e..c881612799 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -27,6 +27,10 @@ #include "slap.h" #include "lutil.h" +static struct berval bv_no_attrs = BER_BVC( LDAP_NO_ATTRS ); +static struct berval bv_all_user_attrs = BER_BVC( "*" ); +static struct berval bv_all_operational_attrs = BER_BVC( "+" ); + static AttributeName anlist_no_attrs[] = { { BER_BVC( LDAP_NO_ATTRS ), NULL, 0, NULL }, { BER_BVNULL, NULL, 0, NULL } @@ -53,6 +57,10 @@ AttributeName *slap_anlist_all_user_attributes = anlist_all_user_attributes; AttributeName *slap_anlist_all_operational_attributes = anlist_all_operational_attributes; AttributeName *slap_anlist_all_attributes = anlist_all_attributes; +struct berval * slap_bv_no_attrs = &bv_no_attrs; +struct berval * slap_bv_all_user_attrs = &bv_all_user_attrs; +struct berval * slap_bv_all_operational_attrs = &bv_all_operational_attrs; + typedef struct Attr_option { struct berval name; /* option name or prefix */ int prefix; /* NAME is a tag and range prefix */ diff --git a/servers/slapd/back-meta/map.c b/servers/slapd/back-meta/map.c index 4ceaebd174..90ee782322 100644 --- a/servers/slapd/back-meta/map.c +++ b/servers/slapd/back-meta/map.c @@ -119,6 +119,15 @@ ldap_back_mapping ( struct ldapmap *map, struct berval *s, struct ldapmapping ** assert( m != NULL ); + /* let special attrnames slip through (ITS#5760) */ + if ( bvmatch( s, slap_bv_no_attrs ) + || bvmatch( s, slap_bv_all_user_attrs ) + || bvmatch( s, slap_bv_all_operational_attrs ) ) + { + *m = NULL; + return 0; + } + if ( remap == BACKLDAP_REMAP ) { tree = map->remap; diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 67655c3068..5fd2fefcf1 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -121,6 +121,15 @@ rwm_mapping( struct ldapmap *map, struct berval *s, struct ldapmapping **m, int assert( m != NULL ); + /* let special attrnames slip through (ITS#5760) */ + if ( bvmatch( s, slap_bv_no_attrs ) + || bvmatch( s, slap_bv_all_user_attrs ) + || bvmatch( s, slap_bv_all_operational_attrs ) ) + { + *m = NULL; + return 0; + } + if ( remap == RWM_REMAP ) { tree = map->remap; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index f6a3478c7c..00eecbb539 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -191,6 +191,10 @@ LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_user_attributes; LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_operational_attributes; LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_attributes; +LDAP_SLAPD_V( struct berval * ) slap_bv_no_attrs; +LDAP_SLAPD_V( struct berval * ) slap_bv_all_user_attrs; +LDAP_SLAPD_V( struct berval * ) slap_bv_all_operational_attrs; + /* * add.c */