From b85926a2c10c9a891cd3510cf8389b458dce27ac Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 13 Jan 2006 16:42:34 +0000 Subject: [PATCH] ITS#4339 attributeoptions patch from Ralf Haferkamp @ SuSE --- servers/slapd/ad.c | 7 +++++++ servers/slapd/bconfig.c | 3 +++ servers/slapd/proto-slap.h | 1 + 3 files changed, 11 insertions(+) diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index c81422bda8..7183d5e59f 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -1177,6 +1177,13 @@ ad_define_option( const char *name, const char *fname, int lineno ) return 0; } +void ad_unparse_options( BerVarray *res ){ + int i; + for ( i=0; i < option_count; i++ ) { + ber_bvarray_add( res, ber_bvdup( &(options[i].name) )); + } +} + /* Find the definition of the option name or prefix matching the arguments */ static Attr_option * ad_find_option_definition( const char *opt, int optlen ) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 1014ec7fed..18a22edcb9 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -788,6 +788,9 @@ config_generic(ConfigArgs *c) { rc = 1; } break; + case CFG_ATOPT: + ad_unparse_options( &c->rvalue_vals ); + break; case CFG_OC: { ConfigFile *cf = c->private; if ( !cf ) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 41ddfe1804..82f754e5dc 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -172,6 +172,7 @@ LDAP_SLAPD_F (AttributeName *) file2anlist LDAP_P(( LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s )); LDAP_SLAPD_F (int) ad_define_option LDAP_P(( const char *name, const char *fname, int lineno )); +LDAP_SLAPD_F (void) ad_unparse_options LDAP_P(( BerVarray *res )); LDAP_SLAPD_F (MatchingRule *) ad_mr( AttributeDescription *ad, -- 2.39.5