Skip to content

Commit 0fb1ddb

Browse files
committed
use value-box escaping function.
1 parent 1e6660e commit 0fb1ddb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/modules/rlm_smtp/rlm_smtp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,17 @@ static int str_to_attachments(fr_mail_ctx_t *uctx, curl_mime *mime, fr_value_box
294294
/* Check to see if the file attachment is valid, skip it if not */
295295
RDEBUG2("Trying to set attachment: %pV", vb);
296296

297-
if (fr_value_box_escape_in_place_erules(vb, vb, &fr_filename_escape) < 0) {
298-
RPEDEBUG2("Failed escaping path");
297+
if (vb->type != FR_TYPE_STRING) {
299298
return -1;
300299
}
301300

301+
if (!fr_value_box_is_safe_for(vb, (fr_value_box_safe_for_t) rad_filename_box_make_safe)) {
302+
if (rad_filename_box_make_safe(vb, NULL) < 0) {
303+
RPEDEBUG2("Failed escaping path");
304+
return -1;
305+
}
306+
}
307+
302308
if (fr_sbuff_in_bstrncpy(path_buffer, vb->vb_strvalue, vb->vb_length) < 0) {
303309
RPEDEBUG2("Path is too long");
304310
return -1;

0 commit comments

Comments
 (0)