]> git.pld-linux.org Git - packages/rt.git/blame - content-id.patch
- up to 4.2.10; fixes CVE-014-9472, CVE-2015-1165, CVE-2015-1464
[packages/rt.git] / content-id.patch
CommitLineData
df434706
AM
1From d2e519d4ed50ccc8f44b66b814f47de5ff63d0cc Mon Sep 17 00:00:00 2001
2From: Przemyslaw Plewa <przemyslaw.plewa@domena.pl>
3Date: Fri, 6 Feb 2015 13:50:11 +0100
4Subject: [PATCH] Use Content-ID when handling multipart message over REST.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Record Content-ID identifier that came over REST API.
10
11This allows us to have multipart messages with one (or more) part
12refering to other parts of message. Content-ID identifier is used for
13reference.
14
15Such message also needs multipart/related type (instead of default (in
16rt) multipart/mixed. So if we detect Content-ID in any part of multipart
17message we switch Content-Type to multipart/related.
18
19Signed-off-by: Przemysław Plewa <przemyslaw.plewa@domena.pl>
20---
21 lib/RT/Interface/REST.pm | 6 ++++++
22 1 file changed, 6 insertions(+)
23
24diff --git a/lib/RT/Interface/REST.pm b/lib/RT/Interface/REST.pm
25index edfc5d3..1c8f555 100644
26--- a/lib/RT/Interface/REST.pm
27+++ b/lib/RT/Interface/REST.pm
28@@ -324,11 +324,17 @@ sub process_attachments {
29 }
30
31 my $info = $cgi->uploadInfo($fh);
32+ # If Content-ID exists for attachment then we need multipart/related
33+ # to be able to refer to this Content-Id in core of mime message
34+ if($info->{'Content-ID'}) {
35+ $entity->head->set('Content-Type', 'multipart/related');
36+ }
37 my $new_entity = $entity->attach(
38 Path => $tmp_fn,
39 Type => $info->{'Content-Type'} || guess_media_type($tmp_fn),
40 Filename => $file,
41 Disposition => $info->{'Content-Disposition'} || "attachment",
42+ 'Content-ID' => $info->{'Content-ID'},
43 );
44 $new_entity->bodyhandle->{'_dirty_hack_to_save_a_ref_tmp_fh'} = $tmp_fh;
45 $i++;
46--
472.3.0
48
This page took 0.104913 seconds and 4 git commands to generate.