Closed Bug 220611 Opened 21 years ago Closed 21 years ago

[FIX]binhex regression (endianness issue)

Categories

(Core :: Networking, defect, P1)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.6alpha

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: fixed1.4.2, regression)

Attachments

(1 file, 1 obsolete file)

cvs diff -u0 -r 1.11 -r 1.12 netwerk/streamconv/converters/nsBinHexDecoder.cpp 
-#ifndef XP_MAC
+#if defined(XP_MAC) || defined(XP_MACOSX)
                mOctetBuf.val = PR_ntohl(mOctetBuf.val);

Oops.  Now the endianness of the data is wrong on non-Mac systems (since this
code never runs now).  Not cool at all.

Patch coming up that makes binhex sorta limp again on Linux, though still with
issues.
Attached patch Patch to undo this insanity (obsolete) — Splinter Review
Comment on attachment 132333 [details] [diff] [review]
Patch to undo this insanity

biesi, darin, could you review?
Attachment #132333 - Flags: superreview?(darin)
Attachment #132333 - Flags: review?(cbiesinger)
Keywords: regression
Priority: -- → P1
Summary: Cavin Song hates binhex and broke it (endianness issue) → [FIX]Cavin Song hates binhex and broke it (endianness issue)
Target Milestone: --- → mozilla1.6alpha
Blocks: 215840
Comment on attachment 132333 [details] [diff] [review]
Patch to undo this insanity

sure, r=biesi, though I am not sure why we need binhex support on non-mac
systems
Attachment #132333 - Flags: review?(cbiesinger) → review+
We actually _only_ need this on non-mac systems.  On the mac this decoder is not
even built.

The idea here is that on non-mac systems you may want to extract the data fork
from a binhex file so as to be able to actually view the data or something, when
some mac person sends it to you in binhex form.
um, so, why do we need this ifdef at all, if the decoder isn't built on mac?
Comment on attachment 132333 [details] [diff] [review]
Patch to undo this insanity

uhm... would it make more sense to do #ifdef LITTLE_ENDIAN instead?
Yes, it would.  Couldn't we also remove the ifdef altogether, since ntohl should
do the right thing no matter what the native endianness is?
bz: good point.  that does seem better.  using ntohl directly would be even
better since it is probably compiled away on big endian machines.  fwiw, NSPR
uses ntohl internally, so it is available on all platforms that we care about. 
the XP problem might be knowing what header(s) to #include.
Attachment #132333 - Attachment is obsolete: true
Attachment #132333 - Flags: superreview?(darin)
Blocks: 217104
Blocks: 220167
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment on attachment 132618 [details] [diff] [review]
Patch to that effect.

This is a tiny patch that fixes a months-old regression that causes problems on
both the 1.4 and 1.5 branches.	There're a few bugs that seem to have been
filed on this, but nobody ever looked at them...

The patch just undoes an incorrect change to an #ifndef line (actually, removes
the ifdef altogether).	Very safe, and prevents dataloss -- without this patch,
Mozilla cannot handle binhex attachments to emails on non-Mac systems.
Attachment #132618 - Flags: approval1.5?
Attachment #132618 - Flags: approval1.4.2?
changing the subject to something more appropriate and not personal.
Summary: [FIX]Cavin Song hates binhex and broke it (endianness issue) → [FIX]binhex regression (endianness issue)
Still have a problem with binhex encoding on moz 2003100304 Windows (me)

when saving attachment moz keeps the file locked (sharing issue) and does not
decode it properly.

Should this bug be reopened?

below are mime headers etc

Content-Type: multipart/mixed;
boundary="------------030304040303010001080203"

This is a multi-part message in MIME format.
--------------030304040303010001080203
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

text part of email.......

--------------030304040303010001080203
Content-Type: application/mac-binhex40;
name="new.pdf"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="new.pdf"

(This file must be converted with BinHex 4.0)

:"fjPGbj`C'B!8%4')%0"8Nm"!!!!XA-!!!!!4+3P8%4',6%Z-L!0*H,Mcp-J$6B
J-#"[BQS02$`0,daPEQGdD#!h)$!J8Jd[4QPXG'9b)#p'E'&dC84PBfpNC5!02Mi
0Fh4bC@&Y$3T)LCbAZiiPZ3f'Rf$HiB66JGZk5j8DpJ*H1$$3lFK`C(J$SbZaJhe
pRk*%L6qTkKi["MM6C(hL6G3Y2(jqI'[a06p#2Tkrje2bcrqM#mrIMmHhYkHLe1Y
lbq0l*H#)%cKbN!$!N3X"EJ,9ACT3@`H'f))!)J)NYMD"d&fifS&Bh43l%$d"IX3
35jXL!JQ"C)##3*Q!Ma5f'd&kIdb4!3Sl9!"#e4BQ)!af`,fQ'"kr2[0pr2[ji`i
C8I"14X6Lb)"K*3li[drEPdP2a[fUhV),L43*I"ARq-jaqPLPDaB6Lf8RlZ+8KNk
6dKZD2Nd*"*!!%FKhQFV+M-EV'M9PBNj(CmiB4U1DeQ8,c+mXe+4RD-13!"0-qK"
jPSAc$f-E*aeAd#E1P#$1,NChQiMJZ9CY$MQR''k,D4Y2$MQ4ahfJh9S3BCmB8JG
bb4,)d3!9A15SA3`0"jPm8%(+h8PX9RI,ChbrfAM84X@`%RFc2J*c'+G0K!'E+FB
j[R1F1F"bC(%%aV!59CaN0q('Qcad2)Z*aE!6prQR6q*p3p1Rb8!!'B%X!#La,#J

etc etc
Steve,

1)  This was a bug for a particular very specific issue.  There are other issues
    with binhex that this bug did not fix.
2)  I checked in the patch at "2003-10-03 17:55", as you can see from the
    comments.  You are using build 2003100304.  That means your build was built 15
    hours before the patch was checked in.  So you may in fact be seeing this
    problem, still.
Boris,
Thanks for your comments. I knew that the fix went in on the 3rd Oct from
Jason's Forum. I downloaded zip file from nightly/latest on 7th Oct assuming
that the fix was in. I then tried again this time from nightly/latest-trunk
(don't know/understand the difference?) on the 8th and mail was able to decode
the binhex(ed) attachment.
Thanks for your help
Unless this fix has gone in to the 1.5 builds recently it isn't in the 1.5
release nor 1.4.1 !!!

Do we not need support for binhex attachments in the latest releases?
Steve, please note that I asked for driver approval to land this on the 1.4.2
and 1.5 branches....  Until I get that approval, I can't check in the fix to
those branches.  So no, this fix is not in 1.4.1 or 1.5.
Comment on attachment 132618 [details] [diff] [review]
Patch to that effect.

1.5 shipped. removing obsolete request.
Attachment #132618 - Flags: approval1.5?
Michael, who handles 1.4.2 approvals, do you know?
Comment on attachment 132618 [details] [diff] [review]
Patch to that effect.

me

a=mkaply for 1.4.2
Attachment #132618 - Flags: approval1.4.2? → approval1.4.2+
Hmm... http://tinderbox.mozilla.org/showbuilds.cgi?tree=Mozilla1.4 says the
branch is closed while we get 1.4.1 out.  Does that still apply?
Checked in to 1.4.2.
Keywords: fixed1.4.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: