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:
Ryan Tandy 2015-09-06 21:09:51 -07:00
parent e27108e7cb
commit f5100665e3
3 changed files with 14 additions and 7 deletions

View File

@ -628,7 +628,7 @@ strtok_quote_ldif( char **line )
return beg;
}
static void
void
config_parse_ldif( ConfigArgs *c )
{
char *next;

View File

@ -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,

View File

@ -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];