Defect #6090

Most binary files become corrupted when downloading from CVS repository browser when Redmine is running on a Windows server

Added by Gareth Sylvester-Bradley over 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2010-08-09
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:SCM
Target version:1.1.2
Resolution:Fixed Affected version:1.1.1

Description

Most binary files become corrupted when downloading from CVS repository browser when Redmine is running on a Windows server. The corruption is 100% repeatable.

The patch is a one character change at source:trunk/lib/redmine/scm/adapters/abstract_adapter.rb#L191.

<             IO.popen(cmd, "r+") do |io|
----
>             IO.popen(cmd, "r+b") do |io|

On Windows, without this change the pipe is opened in text mode and any 0x1A bytes are treated as EOF and subsequent bytes already in the pipe are discarded.

Note: "r+b" is equivalent to "r+" on non-Windows platforms, so this patch should be harmless for all platforms.

cvs-cat-bin.diff Magnifier (517 Bytes) Toshi MARUYAMA, 2011-02-10 00:49


Related issues

Related to Redmine - Defect #2664: Mercurial: Repository path encoding of non UTF-8 characters Closed 2009-02-04

Associated revisions

Revision 4815
Added by Toshi MARUYAMA almost 7 years ago

scm: cvs: fix most binary files become corrupted on Windows (#6090).

History

#1 Updated by Toshi MARUYAMA almost 7 years ago

  • Status changed from New to 7
  • Assignee set to Toshi MARUYAMA
  • Priority changed from High to Normal

#2 Updated by Toshi MARUYAMA almost 7 years ago

  • Tracker changed from Patch to Defect

#3 Updated by Toshi MARUYAMA almost 7 years ago

Gareth, Could you try this patch?
And where can I download Windows CVS 1.12 binary?

#4 Updated by Gareth Sylvester-Bradley almost 7 years ago

Maruyama-san,

Gareth, Could you try this patch?

Your patch works great on my system, thanks.

You probably spotted that my original patch was flawed, since some of the other calls to shellout() need to be opened using "r+" instead of "r+b"; since submitting my original one, I modified it locally to pass the mode as an argument with a default of "r+".

Your solution is neater!

And where can I download Windows CVS 1.12 binary?

My CVS servers are running CVS 1.11 (stable), although I'd like CVS 1.12 for the enhanced directory listing. At the moment, I'm relying on patch #4113.

My Redmine server seems to have very old CVSNT 2.5.03 client.

Links:

Thanks,
Gareth

#5 Updated by Toshi MARUYAMA almost 7 years ago

  • Target version set to 1.1.2
  • Affected version (unused) set to 1.1.1
  • Affected version set to 1.1.1

#6 Updated by Toshi MARUYAMA almost 7 years ago

  • Status changed from 7 to Closed
  • Resolution set to Fixed

I commited trunk r4815 and 1.1 stable r4818.

Thanks.

Also available in: Atom PDF