Commit c29542c4 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

ITS#8845 sc_extendedops is read-only

parent 8ccb3d4e
......@@ -405,27 +405,18 @@ register_control_exop( const char *controloid, char *exopoid )
return LDAP_PARAM_ERROR;
}
for ( i = 0; sc->sc_extendedops && sc->sc_extendedops[ i ]; i++ ) {
if ( strcmp( exopoid, sc->sc_extendedops[ i ] ) == 0 ) {
for ( i = 0; sc->sc_extendedopsbv && !BER_BVISNULL( &sc->sc_extendedopsbv[ i ] ); i++ ) {
if ( strcmp( exopoid, sc->sc_extendedopsbv[ i ].bv_val ) == 0 ) {
return LDAP_SUCCESS;
}
}
extendedops = ber_memrealloc( sc->sc_extendedops, (i + 2) * sizeof( char * ) );
if ( extendedops == NULL ) {
return LDAP_NO_MEMORY;
}
sc->sc_extendedops = extendedops;
extendedopsbv = ber_memrealloc( sc->sc_extendedopsbv, (i + 2) * sizeof( struct berval ) );
if ( extendedopsbv == NULL ) {
return LDAP_NO_MEMORY;
}
sc->sc_extendedopsbv = extendedopsbv;
extendedops[ i ] = exopoid;
extendedops[ i+1 ] = NULL;
ber_str2bv( exopoid, 0, 1, &extendedopsbv[ i ] );
BER_BVZERO( &extendedopsbv[ i+1 ] );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment