]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapi/plugin.c
allow to programmatically register new response code names
[openldap] / servers / slapd / slapi / plugin.c
index da0085ca50f2c098f9bf932e6f1212dddcfc92fe..a7f9e165e8024ffb756745f133d98ed6b34cffde 100644 (file)
@@ -598,7 +598,7 @@ slapi_int_call_plugins(
        rc = slapi_int_get_plugins( be, funcType, &tmpPlugin );
        if ( rc != LDAP_SUCCESS || tmpPlugin == NULL ) {
                /* Nothing to do, front-end should ignore. */
-               return 1;
+               return rc;
        }
 
        for ( pGetPlugin = tmpPlugin ; *pGetPlugin != NULL; pGetPlugin++ ) {
@@ -722,7 +722,11 @@ slapi_int_plugin_unparse(
                slapi_pblock_get( pp, SLAPI_X_CONFIG_ARGV, &argv );
                if ( argv == NULL ) /* could be dynamic plugin */
                        continue;
-               idx.bv_len = sprintf( idx.bv_val, "{%d}", i );
+               idx.bv_len = snprintf( idx.bv_val, sizeof( ibuf ), "{%d}", i );
+               if ( idx.bv_len >= sizeof( ibuf ) ) {
+                       /* FIXME: just truncating by now */
+                       idx.bv_len = sizeof( ibuf ) - 1;
+               }
                bv.bv_len = idx.bv_len;
                for (j=1; argv[j]; j++) {
                        bv.bv_len += strlen(argv[j]);