mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#7964 avoid double-unescaping rewrite rules
config_fp_parse_line processes backslash escapes. When existing rewrite rules were reloaded while inserting a new rule, this caused backslashes to be lost from every rule except the most recently inserted one. config_parse_ldif performs similar splitting, but leaves backslashes alone.
This commit is contained in:
parent
e27108e7cb
commit
f5100665e3
@ -628,7 +628,7 @@ strtok_quote_ldif( char **line )
|
||||
return beg;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
config_parse_ldif( ConfigArgs *c )
|
||||
{
|
||||
char *next;
|
||||
|
@ -196,6 +196,7 @@ int config_add_vals(ConfigTable *ct, ConfigArgs *c);
|
||||
void init_config_argv( ConfigArgs *c );
|
||||
int init_config_attrs(ConfigTable *ct);
|
||||
int init_config_ocs( ConfigOCs *ocs );
|
||||
void config_parse_ldif( ConfigArgs *c );
|
||||
int config_parse_vals(ConfigTable *ct, ConfigArgs *c, int valx);
|
||||
int config_parse_add(ConfigTable *ct, ConfigArgs *c, int valx);
|
||||
int read_config_file(const char *fname, int depth, ConfigArgs *cf,
|
||||
|
@ -2179,7 +2179,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv0 = ca.argv[ 0 ];
|
||||
ca.argv[ 0 ] += STRLENOF( "rwm-" );
|
||||
@ -2248,7 +2249,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_map[ cnt ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv[1] = ca.argv[0];
|
||||
argv[2] = ca.argv[1];
|
||||
@ -2342,7 +2344,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv0 = ca.argv[ 0 ];
|
||||
ca.argv[ 0 ] += STRLENOF( "rwm-" );
|
||||
@ -2392,7 +2395,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv0 = ca.argv[ 0 ];
|
||||
ca.argv[ 0 ] += STRLENOF( "rwm-" );
|
||||
@ -2491,7 +2495,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_map[ cnt ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv[1] = ca.argv[0];
|
||||
argv[2] = ca.argv[1];
|
||||
@ -2524,7 +2529,8 @@ rwm_cf_gen( ConfigArgs *c )
|
||||
|
||||
ca.line = rwmap->rwm_bva_map[ cnt ].bv_val;
|
||||
ca.argc = 0;
|
||||
config_fp_parse_line( &ca );
|
||||
init_config_argv( &ca );
|
||||
config_parse_ldif( &ca );
|
||||
|
||||
argv[1] = ca.argv[0];
|
||||
argv[2] = ca.argv[1];
|
||||
|
Loading…
Reference in New Issue
Block a user