emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#24276: closed (head without pipline is not reading


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24276: closed (head without pipline is not reading complete STDIN, resulting in unwilling and unexpected command execution)
Date: Sun, 21 Aug 2016 00:13:01 +0000

Your message dated Sat, 20 Aug 2016 17:12:36 -0700
with message-id <address@hidden>
and subject line Re: bug#24276: head without pipline is not reading complete 
STDIN, resulting in unwilling and unexpected command execution
has caused the debbugs.gnu.org bug report #24276,
regarding head without pipline is not reading complete STDIN, resulting in 
unwilling and unexpected command execution
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
24276: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24276
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: head without pipline is not reading complete STDIN, resulting in unwilling and unexpected command execution Date: Sat, 20 Aug 2016 23:01:07 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2
hi,

while comparing my rewrite in google go of coreutils i noticed that head 
without pipeline
is not reading complete STDIN:

> head -c 2

enter:

> asdf

press return

this results in printing "as" and execution of the df command. thats highly 
unexpected and 
probably a good example for a variant of WYSINWYC (What you see is not what you 
copy)*.
someone might even come up with a not harmful looking code, that is harmful 
(heredoc?).

> head --version
> head (GNU coreutils) 8.25

> bash --version
> GNU bash, version 4.3.46(1)-release (x86_64-suse-linux-gnu)

> uname -o
> GNU/Linux

> printfile /etc/os-release
> NAME=openSUSE
> VERSION="Tumbleweed"
> VERSION_ID="20160811"
> PRETTY_NAME="openSUSE Tumbleweed (20160811) (x86_64)"
> ID=opensuse
> ANSI_COLOR="0;32"
> CPE_NAME="cpe:/o:opensuse:opensuse:20160811"
> BUG_REPORT_URL="https://bugs.opensuse.org";
> HOME_URL="https://www.opensuse.org/";

* 
http://www.ush.it/team/ascii/hack-tricks_253C_CCC2008/wysinwyc/what_you_see_is_not_what_you_copy.txt

-- 
Sebastian Kratz
@ProhtMeyhet



--- End Message ---
--- Begin Message --- Subject: Re: bug#24276: head without pipline is not reading complete STDIN, resulting in unwilling and unexpected command execution Date: Sat, 20 Aug 2016 17:12:36 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 This is not a bug. It's quite OK for 'head' to read just as much input as is required, and to not bother to read the rest of input. In fact, POSIX requires this behavior if standard input is a seekable file. See:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html

and look for "seekable input".



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]