From: Kurt Zeilenga Date: Sun, 6 Jan 2002 05:29:04 +0000 (+0000) Subject: Hide select matching rules from published schema X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~258 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=645ae7a22f92d162363d6c47aaa6e40823f00f72;p=openldap Hide select matching rules from published schema --- diff --git a/servers/slapd/mr.c b/servers/slapd/mr.c index e8529a251c..316ff13641 100644 --- a/servers/slapd/mr.c +++ b/servers/slapd/mr.c @@ -280,6 +280,11 @@ int mr_schema_info( Entry *e ) vals[1].bv_val = NULL; for ( mr = mr_list; mr; mr = mr->smr_next ) { + if ( mr->smr_usage & SLAP_MR_HIDE ) { + /* skip hidden rules */ + continue; + } + if ( ! mr->smr_match ) { /* skip rules without matching functions */ continue; diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index ed6015a74b..1555ce1056 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -4302,7 +4302,7 @@ static struct mrule_defs_rec { */ {"( " directoryStringApproxMatchOID " NAME 'directoryStringApproxMatch' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", - SLAP_MR_EQUALITY_APPROX | SLAP_MR_EXT, + SLAP_MR_HIDE | SLAP_MR_EQUALITY_APPROX | SLAP_MR_EXT, NULL, NULL, directoryStringApproxMatch, directoryStringApproxIndexer, @@ -4311,7 +4311,7 @@ static struct mrule_defs_rec { {"( " IA5StringApproxMatchOID " NAME 'IA5StringApproxMatch' " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )", - SLAP_MR_EQUALITY_APPROX | SLAP_MR_EXT, + SLAP_MR_HIDE | SLAP_MR_EQUALITY_APPROX | SLAP_MR_EXT, NULL, NULL, IA5StringApproxMatch, IA5StringApproxIndexer, diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 613936d151..32f1541e49 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -273,13 +273,13 @@ typedef struct slap_syntax { #define ssyn_extensions ssyn_syn.syn_extensions ber_len_t ssyn_oidlen; - unsigned ssyn_flags; + unsigned int ssyn_flags; -#define SLAP_SYNTAX_NONE 0x00U -#define SLAP_SYNTAX_BLOB 0x01U /* syntax treated as blob (audio) */ -#define SLAP_SYNTAX_BINARY 0x02U /* binary transfer required (certificate) */ -#define SLAP_SYNTAX_BER 0x04U /* stored using BER encoding (binary,certificate) */ -#define SLAP_SYNTAX_HIDE 0x80U /* hide (do not publish) */ +#define SLAP_SYNTAX_NONE 0x0000U +#define SLAP_SYNTAX_BLOB 0x0001U /* syntax treated as blob (audio) */ +#define SLAP_SYNTAX_BINARY 0x0002U /* binary transfer required (certificate) */ +#define SLAP_SYNTAX_BER 0x0004U /* stored in BER encoding (certificate) */ +#define SLAP_SYNTAX_HIDE 0x8000U /* hide (do not publish) */ slap_syntax_validate_func *ssyn_validate; slap_syntax_transform_func *ssyn_normalize; @@ -347,7 +347,9 @@ typedef struct slap_matching_rule { ber_len_t smr_oidlen; slap_mask_t smr_usage; -#define SLAP_MR_TYPE_MASK 0xFF00U +#define SLAP_MR_HIDE 0x8000U + +#define SLAP_MR_TYPE_MASK 0x0F00U #define SLAP_MR_SUBTYPE_MASK 0x00F0U #define SLAP_MR_USAGE 0x000FU @@ -371,9 +373,9 @@ typedef struct slap_matching_rule { * the provided value is expected to conform to the * attribute's value syntax. */ -#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U -#define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U -#define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U +#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U +#define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U +#define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U #define SLAP_IS_MR_ASSERTION_SYNTAX_MATCH( usage ) \ (!((usage) & SLAP_MR_VALUE_SYNTAX_MATCH))