Your message dated Fri, 30 Mar 2012 07:37:16 -0400
with message-id <[email protected]>
and subject line Re: Bug#666198: ls: add -y option
has caused the Debian Bug report #666198,
regarding ls: add -y option
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
666198: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666198
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: coreutils
Version: 8.13-3.1
Severity: normal
Tags: patch
Attached patch adds a -y option, which makes ls behave as if "y" is
entered in response to all prompts.
This is needed for compatability with an early form of shar archive
posted to Usenet in the early 80's. There is valuable historical data
to be extracted from these, but they often seem to use this -y option
to ls that is not present in modern versions. I had been puzzled about
this and laboriously editing it out when unsharring old archives, but
then I stumbled on this 30 year delayed post in my olduse.net feed
that explained the mystery option.
> Newsgroups: net.unix-wizards
> Path: utzoo!decvax!pur-ee!davy
> Date: Sun Mar 28 19:56:33 1982
> Subject: Onyx and BBN C machine ls peculiarity
> From: davy
> X-OldUsenet-Modified: added From; converted from A-news; fixed Message-ID;
> added
>
> 1
> 2
> 3
> DECVAX
>
> A while back I asked for information on ls command-line arguments
> portability. Here are the answers I got:
>
> There is such a -y option for several unix systems. I don't know
> much about it (ls does not ask me many questions), but it is
> available on the Onyx for sure, and maybe others.
>
> I also received one account of someone's experience with ls on the BBN C
> machine:
>
> My wife has used the Ryan-McFarland UNIX tools on the BBN C machine
> in a beginning UNIX class, and we found no significant departures
> from the ls from AT&T. There is a -y option which avoids prompts
> regarding display of unsafe terminal control characters.
>
> Thanks to ittvax!cox, pur-ee!sb, and sii!wje
>
> --Dave Curree
> pur-ee!davy
In this time period, there had recently been press coverage of an early
Unix security flaw, where programmable terminals were exploited through
display of control characters, to get root etc. It was a new and big deal
then, so I think this explains why utilities like ls were trying to filter
them out and this -y switch was added.
This would be a useful option to have in ls for historical compatability.
And if ls ever needs to prompt again, -y will be there to use. Please
apply the attached patch.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.1.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages coreutils depends on:
ii dpkg 1.16.2
ii install-info 4.13a.dfsg.1-8
ii libacl1 2.2.51-5
ii libattr1 1:2.4.46-5
ii libc6 2.13-27
ii libselinux1 2.1.9-2
coreutils recommends no packages.
coreutils suggests no packages.
-- no debconf information
--
see shy jo
diff -ur orig/coreutils-8.13/src/ls.c coreutils-8.13/src/ls.c
--- orig/coreutils-8.13/src/ls.c 2011-07-28 06:38:27.000000000 -0400
+++ coreutils-8.13/src/ls.c 2012-03-29 12:01:20.834556184 -0400
@@ -705,6 +708,10 @@
static bool format_needs_type;
+/* Answer "yes" to all prompts. */
+
+static bool yes;
+
/* An arbitrary limit on the number of bytes in a printed time stamp.
This is set to a relatively small value to avoid the need to worry
about denial-of-service attacks on servers that run "ls" on behalf
@@ -1559,6 +1566,7 @@
print_block_size = false;
indicator_style = none;
print_inode = false;
+ yes = false;
dereference = DEREF_UNDEFINED;
recursive = false;
immediate_dirs = false;
@@ -1644,7 +1652,7 @@
{
int oi = -1;
int c = getopt_long (argc, argv,
- "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ1",
+ "abcdfghiklmnopqrstuvw:xyABCDFGHI:LNQRST:UXZ1",
long_options, &oi);
if (c == -1)
break;
@@ -1765,6 +1781,10 @@
format = horizontal;
break;
+ case 'y':
+ yes = true;
+ break;
+
case 'A':
if (ignore_mode == IGNORE_DEFAULT)
ignore_mode = IGNORE_DOT_AND_DOTDOT;
@@ -4733,6 +4778,7 @@
-w, --width=COLS assume screen width instead of current value\n\
-x list entries by lines instead of by columns\n\
-X sort alphabetically by entry extension\n\
+ -y answer all questions with \"yes\"\n\
-Z, --context print any SELinux security context of each file\n\
-1 list one file per line\n\
"), stdout);
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---
On Thu, Mar 29, 2012 at 12:50:49PM -0400, Joey Hess wrote:
Attached patch adds a -y option, which makes ls behave as if "y" is
entered in response to all prompts.
This is needed for compatability with an early form of shar archive
posted to Usenet in the early 80's. There is valuable historical data
to be extracted from these, but they often seem to use this -y option
to ls that is not present in modern versions. I had been puzzled about
this and laboriously editing it out when unsharring old archives, but
then I stumbled on this 30 year delayed post in my olduse.net feed
that explained the mystery option.
There is a very strong desire to avoid adding new short options to the
standard utilities. I do not think adding compatability for old shars
reaches the bar. (Side note--shars are a good demonstration that not all
of the industry's bad ideas came from Microsoft. You really want to
execute obfuscated code downloaded off the internet in order to extract
a file? My suggestion would be to work on a shar unpacker that can
extract without executing and also handle different variants.)
Mike Stone
--- End Message ---