@@ -316,37 +316,6 @@ static xlat_action_t xlat_func_pairs_debug(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcu
316316#pragma clang diagnostic ignored "-Wgnu-designator"
317317#endif
318318
319- static const fr_sbuff_escape_rules_t xlat_filename_escape = {
320- .name = "filename" ,
321- .chr = '_' ,
322- .do_utf8 = true,
323- .do_hex = true,
324-
325- .esc = {
326- [ 0x00 ... 0x2d ] = true, // special characters, but not '.'
327- [ 0x2f ] = true, // /
328- [ 0x3A ... 0x3f ] = true, // :;<=>?, but not "@"
329- [ 0x5b ... 0x5e ] = true, // [\]^
330- [ 0x60 ] = true, // back-tick
331- [ 0x7b ... 0xff ] = true, // {|}, and all chars which have high bit set, but aren't UTF-8
332- },
333- };
334-
335- static const fr_sbuff_escape_rules_t xlat_filename_escape_dots = {
336- .name = "filename" ,
337- .chr = '_' ,
338- .do_utf8 = true,
339- .do_hex = true,
340-
341- .esc = {
342- [ 0x00 ... 0x2f ] = true, // special characters, '.', '/', etc.
343- [ 0x3A ... 0x3f ] = true, // :;<=>?, but not "@"
344- [ 0x5b ... 0x5e ] = true, // [\]^
345- [ 0x60 ] = true, // back-tick
346- [ 0x7b ... 0xff ] = true, // {|}, and all chars which have high bit set, but aren't UTF-8
347- },
348- };
349-
350319#define FR_FILENAME_SAFE_FOR ((uintptr_t) filename_xlat_escape)
351320
352321static int CC_HINT (nonnull (2 ,3 )) filename_xlat_escape (UNUSED request_t * request , fr_value_box_t * vb , UNUSED void * uctx )
@@ -400,7 +369,7 @@ static int CC_HINT(nonnull(2,3)) filename_xlat_escape(UNUSED request_t *request,
400369 */
401370 if (fr_value_box_cast_in_place (vb , vb , FR_TYPE_STRING , NULL ) < 0 ) return -1 ;
402371
403- fr_value_box_print (out , vb , & xlat_filename_escape );
372+ fr_value_box_print (out , vb , & fr_filename_escape );
404373 break ;
405374
406375 case FR_TYPE_STRING :
@@ -424,9 +393,9 @@ static int CC_HINT(nonnull(2,3)) filename_xlat_escape(UNUSED request_t *request,
424393 * "log/aland@freeradius.org".
425394 */
426395 if (vb -> vb_strvalue [0 ] == '.' ) {
427- fr_value_box_print (out , vb , & xlat_filename_escape_dots );
396+ fr_value_box_print (out , vb , & fr_filename_escape_dots );
428397 } else {
429- fr_value_box_print (out , vb , & xlat_filename_escape );
398+ fr_value_box_print (out , vb , & fr_filename_escape );
430399 }
431400
432401 break ;
0 commit comments