Closed Bug 322712 Opened 20 years ago Closed 20 years ago

cannot export local attachments

Categories

(Bugzilla :: Attachments & Requests, defect)

2.21
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

(Keywords: dataloss)

Attachments

(1 file)

When moving bugs to another installation, attachments stored in data/attachments/ are not correctly exported. Looks like they are truncated. Seems a problem with Attachment::data().
There is a missing "local $/;" in Attachment::data() when reading attachments stored in data/attachments. This truncates and corrupts them. That's what I call dataloss. This method was introduced in bug 302669 which landed on 2.22 only.
Flags: blocking2.22?
Keywords: dataloss
Indeed, we need a "local $/;" statement before we read the data. Frederic also asked me on IRC whether we really need "binmode". As far as I can tell from my reading of the binmode and PerlIO documentation, yes, we do need "binmode," although there may be some circumstances in which we don't want it (f.e. when dealing with text attachments if we want line ending translation on Windows machines). http://perldoc.perl.org/functions/binmode.html http://perldoc.perl.org/PerlIO.html
Attached patch patch, v1Splinter Review
add local $/;
Assignee: karl → LpSolit
Status: NEW → ASSIGNED
Attachment #208006 - Flags: review?(myk)
Attachment #208006 - Flags: review?(myk) → review+
Flags: approval?
Flags: blocking2.22?
Flags: blocking2.22+
Flags: approval?
Flags: approval+
Checking in Bugzilla/Attachment.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm,v <-- Attachment.pm new revision: 1.30; previous revision: 1.29 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: