X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibrewrite%2Fconfig.c;h=b6c729406eb5aa0df8b99b5b8ce116ff36ca8a2c;hb=ec24e6293fac6a4c196f49a8575707b5dedefd1d;hp=9cf3ad98dc45f6c5f2de29fb0d647ba464567398;hpb=fbba83b20f3a645b2dc19b8ec4a0026f71f5b15c;p=openldap diff --git a/libraries/librewrite/config.c b/libraries/librewrite/config.c index 9cf3ad98dc..b6c729406e 100644 --- a/libraries/librewrite/config.c +++ b/libraries/librewrite/config.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2000-2003 The OpenLDAP Foundation. + * Copyright 2000-2005 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ rewrite_parse_builtin_map( * lines handled are of the form: * * rewriteEngine {on|off} - * rewriteMaxPasses numPasses + * rewriteMaxPasses numPasses [numPassesPerRule] * rewriteContext contextName [alias aliasedContextName] * rewriteRule pattern substPattern [ruleFlags] * rewriteMap mapType mapName [mapArgs] @@ -103,7 +103,25 @@ rewrite_parse( fname, lineno, "" ); return -1; } + info->li_max_passes = atoi( argv[ 1 ] ); + if ( info->li_max_passes <= 0 ) { + Debug( LDAP_DEBUG_ANY, + "[%s:%d] negative or null rewriteMaxPasses'\n", + fname, lineno, 0 ); + } + + if ( argc > 2 ) { + info->li_max_passes_per_rule = atoi( argv[ 2 ] ); + if ( info->li_max_passes_per_rule <= 0 ) { + Debug( LDAP_DEBUG_ANY, + "[%s:%d] negative or null rewriteMaxPassesPerRule'\n", + fname, lineno, 0 ); + } + + } else { + info->li_max_passes_per_rule = info->li_max_passes; + } rc = REWRITE_SUCCESS; /*