GNU bug report logs - #5994
base64: I/O should be performed in binary-mode

Previous Next

Package: coreutils;

Reported by: Yutaka Amanai <yasai-itame1942 <at> jade.plala.or.jp>

Date: Wed, 21 Apr 2010 12:35:01 UTC

Severity: normal

Tags: patch

Merged with 5996

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5994 in the body.
You can then email your comments to 5994 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5994; Package coreutils. (Wed, 21 Apr 2010 12:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yutaka Amanai <yasai-itame1942 <at> jade.plala.or.jp>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 21 Apr 2010 12:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yutaka Amanai <yasai-itame1942 <at> jade.plala.or.jp>
To: bug-coreutils <at> gnu.org
Subject: base64: I/O should be performed in binary-mode
Date: Wed, 21 Apr 2010 18:46:23 +0900
base64 doesn't call freopen() nor setmode() against stdin, and doesn't
give "rb" flag to fopen(). So, base64 sometimes fails to encode data
correctly on some environment. For example, zsh on Cygwin forces stdin
to be text-mode.

Test case (zsh on Cygwin, filesystems are mounted as binary-mode):
$ printf '\x0D\x0A' > crlf-src
$ base64 < crlf-src | base64 -d > crlf-dst
$ cmp crlf-src crlf-dst
crlf-src crlf-dst differ: char 1, line 1





Merged 5994 5996. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 22 Apr 2010 06:00:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 May 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.