X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconfig.c;h=c9763bf8be0a853e261675708f1cc6cbce97457e;hb=9767c87531d193a4bef19286b77623aff18590fb;hp=e6c138b3ac66c5c726802a1107c1435f41977370;hpb=f2cc7e8a0ac4453435b54a4abb42a1d5abc03b3d;p=openldap diff --git a/servers/slapd/config.c b/servers/slapd/config.c index e6c138b3ac..c9763bf8be 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -64,6 +64,7 @@ int global_gentlehup = 0; int global_idletimeout = 0; int global_writetimeout = 0; char *global_host = NULL; +struct berval global_host_bv = BER_BVNULL; char *global_realm = NULL; char *sasl_host = NULL; char **default_passwd_hash = NULL; @@ -215,6 +216,16 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) { ch_free( c->value_ndn.bv_val ); ch_free( c->value_dn.bv_val ); } + } else if(arg_type == ARG_ATDESC) { + const char *text = NULL; + c->value_ad = NULL; + rc = slap_str2ad( c->argv[1], &c->value_ad, &text ); + if ( rc != LDAP_SUCCESS ) { + snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> invalid AttributeDescription %d (%s)", + c->argv[0], rc, text ); + Debug(LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "%s: %s\n" , c->log, c->cr_msg, 0); + return(ARG_BAD_CONF); + } } else { /* all numeric */ int j; iarg = 0; larg = 0; barg = 0; @@ -365,6 +376,9 @@ int config_set_vals(ConfigTable *Conf, ConfigArgs *c) { case ARG_BERVAL: *(struct berval *)ptr = c->value_bv; break; + case ARG_ATDESC: + *(AttributeDescription **)ptr = c->value_ad; + break; } return(0); } @@ -442,6 +456,8 @@ config_get_vals(ConfigTable *cf, ConfigArgs *c) break; case ARG_BERVAL: ber_dupbv( &c->value_bv, (struct berval *)ptr ); break; + case ARG_ATDESC: + c->value_ad = *(AttributeDescription **)ptr; break; } } if ( cf->arg_type & ARGS_TYPES) { @@ -468,6 +484,13 @@ config_get_vals(ConfigTable *cf, ConfigArgs *c) return 1; } break; + case ARG_ATDESC: + if ( c->value_ad ) { + bv = c->value_ad->ad_cname; + } else { + return 1; + } + break; default: bv.bv_val = NULL; break;