Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14652 > unrolled thread

Re: bash sockets: printf \x0a does TCP fragmentation

Started byGreg Wooledge <wooledg@eeg.ccf.org>
First post2018-09-24 09:05 -0400
Last post2018-09-24 09:05 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: bash sockets: printf \x0a does TCP fragmentation Greg Wooledge <wooledg@eeg.ccf.org> - 2018-09-24 09:05 -0400

#14652 — Re: bash sockets: printf \x0a does TCP fragmentation

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-09-24 09:05 -0400
SubjectRe: bash sockets: printf \x0a does TCP fragmentation
Message-ID<mailman.1224.1537794758.1284.bug-bash@gnu.org>
On Sat, Sep 22, 2018 at 11:50:17AM +0200, dirk+bash@testssl.sh wrote:
> On 9/22/18 7:30 AM, Bob Proulx wrote:
> > dirk+bash@testssl.sh wrote:
> >> printf -- "$data" >&5 2>/dev/null
> > 
> > What happens if $data contains % format strings?  What happens if the
> > format contains a sequence such as \c?  This looks problematic.  This
> > is not a safe programming proctice.

Looking ONLY at this one line, there is an obvious bug, which Bob has
pointed out.  It should be

printf %s "$data" >&5 2>/dev/null

> I doubt you can judge on this by just looking at a single line
> of code -- the project has > 18k LoC in bash.

That is utterly horrifying.

I have no comments on the buffering issues.  Those have already been
covered.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web