X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fad.c;h=4ac9b6a8c042768c66d4632825fa8605ba45d021;hb=0a465343fb6d6d8df9091699885bf352c3b1d4b3;hp=d351c5c49dcf6743d1543754e51b5f99aaa4eac6;hpb=82998790bb33dd543d13ebc50bc57ff2fbd66d1f;p=openldap diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index d351c5c49d..4ac9b6a8c0 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2006 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -177,7 +177,7 @@ int slap_bv2ad( memset( &desc, 0, sizeof( desc ) ); desc.ad_cname = *bv; name = bv->bv_val; - options = strchr( name, ';' ); + options = ber_bvchr( bv, ';' ); if ( options != NULL && (unsigned) ( options - name ) < bv->bv_len ) { /* don't go past the end of the berval! */ desc.ad_cname.bv_len = options - name; @@ -1177,6 +1177,15 @@ 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++ ) { + value_add_one( res, &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 )