GNU bug report logs - #17360
base64 bug of result ending founded

Previous Next

Package: coreutils;

Reported by: Алексей <gasx <at> rambler.ru>

Date: Mon, 28 Apr 2014 08:25:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

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 17360 in the body.
You can then email your comments to 17360 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 bug-coreutils <at> gnu.org:
bug#17360; Package coreutils. (Mon, 28 Apr 2014 08:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Алексей <gasx <at> rambler.ru>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 28 Apr 2014 08:25:02 GMT) Full text and rfc822 format available.

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

From: Алексей <gasx <at> rambler.ru>
To: bug-coreutils <at> gnu.org
Subject: base64 bug of result ending founded
Date: Mon, 28 Apr 2014 11:24:19 +0300
[Message part 1 (text/plain, inline)]
I take some difference of results base64 command and base64 php function

*echo "111111" | base64*
give result
*MTExMTExCg==*


but base64 php function give result
*MTExMTEx*


I take incorrect result: *MTExMTExCg==*
because the end *Cg==* are wrong
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#17360; Package coreutils. (Mon, 28 Apr 2014 08:57:02 GMT) Full text and rfc822 format available.

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

From: Ruediger Meier <sweet_f_a <at> gmx.de>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#17360: base64 bug of result ending founded
Date: Mon, 28 Apr 2014 10:56:07 +0200
On Monday 28 April 2014, Алексей wrote:
> I take some difference of results base64 command and base64 php
> function
>
> *echo "111111" | base64*
> give result
> *MTExMTExCg==*

echo prints a newline per default
$ echo -n "111111" | base64
MTExMTEx

>
> but base64 php function give result
> *MTExMTEx*

cu,
Rudi




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 28 Apr 2014 10:15:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 17360 <at> debbugs.gnu.org and Алексей <gasx <at> rambler.ru> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Mon, 28 Apr 2014 10:15:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#17360; Package coreutils. (Mon, 28 Apr 2014 12:52:02 GMT) Full text and rfc822 format available.

Message #15 received at 17360-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Ruediger Meier <sweet_f_a <at> gmx.de>, 17360-done <at> debbugs.gnu.org
Subject: Re: bug#17360: base64 bug of result ending founded
Date: Mon, 28 Apr 2014 06:51:15 -0600
[Message part 1 (text/plain, inline)]
tag 17360 notabug
thanks

On 04/28/2014 02:56 AM, Ruediger Meier wrote:
> On Monday 28 April 2014, Алексей wrote:
>> I take some difference of results base64 command and base64 php
>> function
>>
>> *echo "111111" | base64*
>> give result
>> *MTExMTExCg==*
> 
> echo prints a newline per default
> $ echo -n "111111" | base64
> MTExMTEx
> 

'echo -n' is not portable; the portable spelling is:

printf 111111 | base64

But the analysis is correct - depending on whether you feed the trailing
newline as part of the buffer to be encoded, the base64 encoding is
correct either way.  So I'm closing this as not a bug.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

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

This bug report was last modified 11 years and 22 days ago.

Previous Next


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