[rt-devel] Broken attachments -- possibly not mod_perl2

mixo mixo at coza.net.za
Thu Nov 13 06:59:31 EST 2003


Ruslan U. Zakirov wrote:

> mixo wrote:
>
>> Yes it is still an issue with both 3.0.6 and 3.0.7pre3, but 3.0.7pre3 
>> does send any error
>> message to syslog.
>>
>
>     Hello.
> I don't have such issue, but I have looked at diff between 3.0.4 and 
> 3.0.6. As for me only diif that could cause corruption is next code
> in bin/webmux.pl:
> if ($mod_perl::VERSION >= 1.9908) {
>     require Apache::RequestUtil;
>     no warnings 'redefine';
>     my $sub = *Apache::request{CODE};
>     *Apache::request = sub {
>         my $r;
>         eval { $r = $sub->('Apache'); };
>         # warn $@ if $@;
>         return $r;
>     };
> }
>
> It's just an idea. Could you try strip this code and test for coruption.
>         Best regards. Ruslan.

The problem seem to lie with the import. I have just extracted the 
attachment in question from the database with
++++++++++++++++
select Content from Attachments where id=25071 INTO OUTFILE 
'/tmp/test.out.5' FIELDS TERMINATED BY '' ENCLOSED BY '' ESCAPED BY '';
++++++++++++++++

And when I checked the contents  with "file /tmp/test.out.5" I get,
++++++++++++++++++++
/tmp/test.out.5: JPEG image data, JFIF standard 1.01, aspect ratio, 1 x 1
++++++++++++++++++++

Which lead me to view the file with the "gimp", and it is a jpeg.  Was 
this supposed to be base64 encoded,
which clealry isnt?  This would explain the messages:

++++++++++++++++++++
Premature padding of base64 data at 
/usr/lib/perl5/site_perl/5.8.0/MIME/Decoder/Base64.pm line 109.  
(/opt/rt3/lib/RT.pm:247)
++++++++++++++++++++

It seems the problem lies with the import/export scripts as jpegs images 
are not encoded as expected



+++++++++++++++++++++++++++++++++++++++

mysql> select 
id,TransactionId,length(Content),ContentType,ContentEncoding from 
Attachments where TransactionId=31531;
+-------+---------------+-----------------+-----------------+-----------------+
| id    | TransactionId | length(Content) | ContentType     | 
ContentEncoding |
+-------+---------------+-----------------+-----------------+-----------------+
| 25069 |         31531 |            NULL | multipart/mixed | 
NULL            |
| 25070 |         31531 |              23 | text/plain      | 
none            |
| 25071 |         31531 |          491463 | image/jpeg      | 
base64          |
+-------+---------------+-----------------+-----------------+-----------------+
3 rows in set (0.02 sec)







More information about the Rt-devel mailing list