Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-09 Thread Andreas Schwab
e. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Andreas Schwab
Linda Walsh writes: > Um...Not exactly. As long as there's a handle open to the previous path, > it still exists (at least on linux and unix). You cannot have handles on file names, only on files. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 019

Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > If you assume, as the OP said, that only the parent is removed, it's > unlikely. You cannot remove a non-empty directory, so this does not make sense. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 174

Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > On 2/8/16 9:59 AM, Andreas Schwab wrote: >> Chet Ramey writes: >> >>> `cd ..' should fail, since the parent no longer exists, and the pathname >>> canonicalization should fail, since there's presumably no longer a valid >>

Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Andreas Schwab
Chet Ramey writes: > It's still an unlikely scenario. What do you mean with unlikely? Removing some directory where there is still a shell active can happen all the time. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E

Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Andreas Schwab
lue. FWIW, this is what ksh uses in this case, it doesn't fail. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Security Vulnerability

2016-02-07 Thread Andreas Schwab
command. Sending arbitrary commands to a shell is a security bug, but not a bug in the shell which is working as designed. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Leak in BASH "named" file descriptors?

2016-01-28 Thread Andreas Schwab
n't close (or reuse) your descriptors you will run out of them eventually. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Leak in BASH "named" file descriptors?

2016-01-28 Thread Andreas Schwab
28 /dev/null > bash931 wooledg 255u CHR 136,0 0t0 3 /dev/pts/0 > > I actually ran the lsof multiple times, in between the calls to f and g. > FD 10 was opened by f (and kept open), and FD 9 was of course opened by g > (and kept open). Try replacing exec with :.

Re: implicit redirection of background within pipeline

2016-01-13 Thread Andreas Schwab
Martin Kealey writes: > On 13 Jan 2016 8:14 p.m., "Andreas Schwab" wrote: > >> I don't think so. >> > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07 >> doesn't mention pipelines. > > That was rather my poi

Re: implicit redirection of background within pipeline

2016-01-13 Thread Andreas Schwab
bs/9699919799/utilities/V3_chap02.html#tag_18_07 doesn't mention pipelines. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: implicit redirection of background within pipeline

2016-01-13 Thread Andreas Schwab
2: $x) & }' 1: 2: $ zsh -c 'printf "foo1\nfoo2\n" | { (read x; echo 1: $x) & (read x; echo 2: $x) & }' 1: foo1 2: foo2 $ bash -c 'printf "foo1\nfoo2\n" | { (read x; echo 1: $x) & (read x; echo 2: $x) & }' 1: 2: foo1 Andreas. -- Andr

Re: implicit redirection of background within pipeline

2016-01-11 Thread Andreas Schwab
s as /dev/null." But isn't it a bug that subsequent asynchronous commands in the list are not redirected from /dev/null? Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: doesn't bash do variable subst. or quote removal on function statement

2016-01-10 Thread Andreas Schwab
are: myfunc: not found >> >> def="function $fn () { echo $fn ; }" ## but same statement, eval'd works That's not the same statement. The same statement would be def='function $fn () { echo $fn ; }' Andreas. -- Andreas Schwab, sch...@linux-m68k.org

Re: Feature: Easily remove current command from history

2016-01-04 Thread Andreas Schwab
Victor Porton writes: > It should be easy to remove lines with passwords and potentially > harmful commands (like sudo with rm). C-a C-k Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now fo

Re: ${1+"$@"} does not generate multiple words if IFS is empty

2015-12-30 Thread Andreas Schwab
18_06_05 "If the value of IFS is null, no field splitting shall be performed." Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: rewriting a readonly var should exit

2015-12-15 Thread Andreas Schwab
rovar="badvalue" > echo "You should not see this message" You are not running the shell in posix mode. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Bug in bash 4.4-beta: suspending and restarting "man" program

2015-11-11 Thread Andreas Schwab
Keith Thompson writes: > On Tue, Nov 10, 2015 at 1:57 PM, Andreas Schwab > wrote: > >> Chet Ramey writes: >> >> > I can make bash blow away the original signal dispositions and pretend >> they >> > were SIG_DFL when an interactive shell starts, if

Re: Bug in bash 4.4-beta: suspending and restarting "man" program

2015-11-10 Thread Andreas Schwab
Chet Ramey writes: > I can make bash blow away the original signal dispositions and pretend they > were SIG_DFL when an interactive shell starts, if there is no alternative. Given that login(1) has the same behaviour there is probably no alternative. Andreas. -- Andreas Schwab, sch...

Re: Proposed Prompt Escapes

2015-11-10 Thread Andreas Schwab
Dennis Williamson writes: > But wait, you don't need the intermediate step! It already works!!! > > prompt=$'\u, something about dominoes \U1F061 \@ ' You should quote the backslashes. prompt=$'\\u, something about dominoes \U1F061 \\@ ' Andreas. -- And

Re: Out of bounds heap read in function rl_tilde_expand

2015-11-06 Thread Andreas Schwab
course, which is bound to tilde-expand. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: loadable builtins on HP-UX

2015-11-04 Thread Andreas Schwab
Greg Wooledge writes: > The linker option in HP-UX 11.11 is -E . FWIW, GNU ld also accepts this as a synonym for -rdynamic. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something co

Re: Paste with null delimiter

2015-11-03 Thread Andreas Schwab
Eric Blake writes: > There is NO way for any program using getopt() or getopt_long() to know s/using getopt() or getopt_long()// Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something co

Re: Paste with null delimiter

2015-11-03 Thread Andreas Schwab
julio.ne...@gmail.com writes: > $ paste -d"" odd even This is the same as `paste -d odd even', so the delimiter list is odd. As there is only one file, this in turn is the same as `paste even'. Ultimately this is the same as `cat even'. Andreas. -- Andreas Schwa

Re: a few unintended translations of command names

2015-11-02 Thread Andreas Schwab
Chet Ramey writes: > Well, the short docs are marked with N_ in the generated builtins.c, > but I guess the gettext tools aren't smart enough to not put them in > the pot files. If you don't want something to appear in the pot file, don't mark it as translatable. Andr

Re: Bug in bash 4.4-beta: suspending and restarting "man" program

2015-10-31 Thread Andreas Schwab
Keith Thompson writes: > For a while, I had two running login shells, one that had the problem > and one that didn't. Comparing the output of "set" and "shopt" from > both shells didn't show any differences that could explain this. What's the output

Re: PROMPT_COMMAND and PS1 error

2015-10-25 Thread Andreas Schwab
the shell is forgotten after expansion. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [PATCH] Correct typo in builtins man page

2015-10-20 Thread Andreas Schwab
Vascom writes: > doc/builtins.0 | 2 +- This is a generated file. You need to edit doc/bash.1. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

[PATCH] Remove bash.pc in distclean, not clean

2015-10-15 Thread Andreas Schwab
$(RM) $(OBJ1) + $(RM) bash.pc man2html.o: man2html.c -- 2.6.1 -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: minor language RFE(s)

2015-10-08 Thread Andreas Schwab
and ease-of-use "my=declare" > > that could then allow the "declare" of the 'for' iterator > as local, in-line. > > i.e. instead of predeclaring them w/'declare -i' or 'declare' > one could write: > > for((int i=0; i<10

Re: Inconsistent arithmetic evaluation of parameters

2015-09-02 Thread Andreas Schwab
Dennis Williamson writes: > On Tue, Sep 1, 2015 at 4:24 PM, Andreas Schwab > wrote: > >> Dennis Williamson writes: >> >> > $ echo $((foo)) # expansion succeeds, indirection fails >> > dash: 4: Illegal number: bar >> >> The indirection d

Re: Inconsistent arithmetic evaluation of parameters

2015-09-01 Thread Andreas Schwab
Dennis Williamson writes: > $ echo $((foo)) # expansion succeeds, indirection fails > dash: 4: Illegal number: bar The indirection didn't fail, it just didn't produce a number, so the expression is malformed. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerp

Re: In the bash man page the entry for the 'read' command has two spaces after it instead of one.

2015-08-22 Thread Andreas Schwab
Bob Proulx writes: > Andreas Schwab wrote: >> Ángel González writes: >> > entering «/^ *read⤶» may be easier to type (and remember) >> >> It won't match, though. > > It matches fine for me. How? There is no ⤶ in the output. Andreas. -- Andr

Re: In the bash man page the entry for the 'read' command has two spaces after it instead of one.

2015-08-21 Thread Andreas Schwab
Ángel González writes: > entering «/^ *read⤶» may be easier to type (and remember) It won't match, though. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: In the bash man page the entry for the 'read' command has two spaces after it instead of one.

2015-08-21 Thread Andreas Schwab
instead. There are commands that aren't followed by options in the description. > Remove the extra space. The extra space is part of justifying the text. Depending on the line length there may be different amount of space to spread out. Andreas. -- Andreas Schwab, sch...@linux-m68k.o

Re: -e does not take effects in subshell

2015-08-18 Thread Andreas Schwab
ng > as they correspond to a cmdline argument. That's the only sensible way to implement it. Which, incidentally, works exactly like find -xdev. Now please explain what this has anything to do with POSIX. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7

Re: bash expanding relative paths in auto-complete

2015-08-14 Thread Andreas Schwab
Linda Walsh writes: > in bash 4.3.39, > if I type a command, (like "."(source)) and a relative path > like : ../conf, > it expands the relative pathname to absolute pathnames. Worksforme. Make sure to run complete -r first. Andreas. -- Andreas Schwab, sch...@

Re: Bash 4.3.30 on AIX 6.1 filename completion

2015-08-03 Thread Andreas Schwab
Steve Dahl writes: > Is there already a version of "bash" somewhere that already supports large > file systems on AIX if its compilation is configured right? Try compiling with the flags as returned by "getconf LFS_CFLAGS". Andreas. -- Andreas Schwab, SUSE La

Re: BUG?: (or what's going on?) test for NL == NL fails (bash-4.3.39(3)-release)

2015-08-03 Thread Andreas Schwab
Greg Wooledge writes: > (Testing for a character device gives false positives if stdout is a > tape drive or similar device.) Even /dev/null. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now fo

exec doesn't restore terminal signals

2015-07-28 Thread Andreas Schwab
Running exec in an interactive shell does not restore the terminal signals TSTP, TTIN, TTOU, causing them to be ignored in the new command. $ trap $ exec bash $ trap trap -- '' SIGTSTP trap -- '' SIGTTIN trap -- '' SIGTTOU Andreas. -- Andreas Schwab, SUS

Re: Tab completion misbehaves with newlines

2015-07-17 Thread Andreas Schwab
Chet Ramey writes: > enough to know that even though it follows a newline, the current word is > not in a command position, Is it not? When executed the second line is treated as a command on its own. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C

bash-4.4-alpha: Update po/LINGUAS

2015-07-16 Thread Andreas Schwab
nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW +en@quot en@boldquot af bg ca cs da de el eo es et fi fr ga gl hr hu id it ja lt nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B

bash-4.4-alpha: Use itrace only if DEBUG

2015-07-16 Thread Andreas Schwab
4294967297>x */ { +#ifdef DEBUG itrace("redirection_error: temp->redirector.dest = %d", temp->redirector.dest); +#endif filename = _("file descriptor out of range"); } #ifdef EBADF Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 5

Re: Tab completion misbehaves with newlines

2015-07-15 Thread Andreas Schwab
further Tabbing (with or without characters) acts like a new > completion rather than a continuation of the previous completion, as > this bug report indicated. You are inserting an unquoted whitespace, which ends the current word. The only bug is that readline doesn't perform command comple

Re: Tab completion misbehaves with newlines

2015-07-15 Thread Andreas Schwab
gt; press tab. Result: > > cat He > > press tab twice. Two alternatives shown: > > Hello Henrik What happens if you run "complete -r" first? Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: ?:

2015-06-22 Thread Andreas Schwab
isabella parakiss writes: > In lib/readline/input.c line 108 > return (_isatty (fd) ? long) (HANDLE) _get_osfhandle (fd)) & 3) > == 3) ? 0); Where did you find that? It doesn't occur in the official source. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de G

Re: Feature : walkthrough lines of stdout

2015-06-17 Thread Andreas Schwab
Hrazel writes: > Now it would be nice just to log the last lines on stdout and walk it > through line by line ready to be put to the clipboard. M-x shell Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 &q

Re: Unexpected parse error in function definition involing grouping braces and redirections

2015-06-16 Thread Andreas Schwab
} > exit 1 >} > > bash does not report the syntax error and resumes interpretation, This is fully syntactical. It defines a function, then exits with 1 (ignoring the rest of the input). Braces are not special characters, only recognized as reserved words in som

Re: Unexpected parse error in function definition involing grouping braces and redirections

2015-06-16 Thread Andreas Schwab
mple command, but may only appear > at the END of a compound command. Brace grouping is a compound command, > so this is actually a syntax error. Not so much a syntax error, since { is not special except as the first word, so this is just a command-not-found error. $ 1>&2 { bash: {: c

Re: eval a=b\ c

2015-05-26 Thread Andreas Schwab
d...@yost.com writes: > eval$@ You are expanding a shell parameter unquoted. Never do that unless you know what you are doing. eval "$@" Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7

Re: Check linux 4

2015-05-25 Thread Andreas Schwab
.0 as well, or anything inbetween or beyond. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: readline-6.3: update config.h.in

2015-04-20 Thread Andreas Schwab
Chet Ramey writes: > On 4/19/15 2:00 PM, Andreas Schwab wrote: >> The config.h.in file in the standalone readline distribution is missing >> a lot of templates. It should really be generated by autoheader. >> >> --- readline-6.3/config.h.in.~1~ 2012-01-

readline-6.3: update config.h.in

2015-04-19 Thread Andreas Schwab
e the wctype function. */ #undef HAVE_WCTYPE @@ -244,9 +263,9 @@ #undef HAVE_GETPW_DECLS -#undef STRUCT_DIRENT_HAS_D_INO +#undef HAVE_STRUCT_DIRENT_D_INO -#undef STRUCT_DIRENT_HAS_D_FILENO +#undef HAVE_STRUCT_DIRENT_D_FILENO #undef HAVE_BSD_SIGNALS -- Andreas Schwab, sch...@linux-m68

Re: bash crashes on SIGPIPE

2015-04-14 Thread Andreas Schwab
Nikola Kržalić writes: > And if I decide to run echo again, bash simply crashes. It is not a crash, it is the correct behaviour. Don't try to write to a broken pipe. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8

Re: The restricted shell can be easily circumvented.

2015-04-04 Thread Andreas Schwab
David Bonner writes: > Repeat-By:1:Open a restricted shell2:Test with 'cd ..' > 3:Use 'chroot / bash'4:Test that you are no longer restricted with > 'chroot / bash' You can even call bash directly. Go figure! Andreas. --

Re: definite way to determine the running shell

2015-03-27 Thread Andreas Schwab
Christoph Anton Mitterer writes: > There are a lot of articles on the web about detecting the actually > running shell. Why do you need to know that? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "

Re: Feature: disallow | >

2015-03-18 Thread Andreas Schwab
Ed Avis writes: > If | > is a valid construct, what are its semantics? $ whoami | >out tr 'a 'b' Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Does [ -f FILE ] have a bug on testing a symlink ?

2015-02-09 Thread Andreas Schwab
are often used to examine the status of a file. There are string operators and numeric comparison operators as well. The behavior of test depends on the number of arguments. Read the bash manual page for the complete specification. Andreas. -- Andreas Schwab, sch...@linux-m68k.

Re: Does [ -f FILE ] have a bug on testing a symlink ?

2015-02-09 Thread Andreas Schwab
ash) Bash Conditional Expressions:: Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8

Re: If $HISTFILE is set to /dev/null and you execute more commands than $HISTFILESIZE, /dev/null is deleted.

2015-01-30 Thread Andreas Schwab
Jonathan Hankins writes: > Aside from the case where the user running bash is root, I think it's not > uncommon for users to have group write access to a variety of things in > /dev. Rename or delete requires write access to the containing directory. Andreas. -- Andreas Schwab

Re: Tab completion breaks for tilde-paths with filenames containing space

2015-01-14 Thread Andreas Schwab
Dave Rutherford writes: > On Wed, Jan 14, 2015 at 9:45 AM, Eduardo A. Bustamante López > wrote: >> Are you using any supplementary programs, like bash-completion? > > I don't think so, unless Debian turned it on for me. Run complete -p to find out. Andreas. -- Andreas

Re: using perl's gnu-readline interface, howto 'completion' & 'filter history'?

2015-01-09 Thread Andreas Schwab
your own. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Odd bash behaviour with time:

2014-11-04 Thread Andreas Schwab
Ángel González writes: > time | foo ksh fails the same as bash: ksh: syntax error at line 1: `|' unexpected Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: behaviour change between 4.2/4.3 with tilde

2014-10-22 Thread Andreas Schwab
do > so. Using escaping with \~ works in 4.3, but not in 4.2. t='~'; echo "${a/x/$t}" Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: bash-2.05b-013 appears to not work

2014-10-17 Thread Andreas Schwab
Eric Blake writes: > The following is a better test for whether CVE-2014-7187 can be > exploited to remotely attack your system: > > f='() { echo vulnerable; } bash -c f Missing quote character. f='() { echo vulnerable; }' bash -c f Andreas. -- Andreas Schwab, sc

Re: Bash-4.3 Official Patch 30

2014-10-08 Thread Andreas Schwab
ce? The only caller treats them the same. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: REGRESSION: shellshock patch rejects valid function names

2014-09-29 Thread Andreas Schwab
in a variable. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Issues with exported functions

2014-09-27 Thread Andreas Schwab
becker...@gmail.com writes: > $ (env;echo echo 'hello') | bash You cannot expect that the output of env is parsable by a shell. First and foremost, it lacks any kind of quoting. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 0

Re: version string can cause overflow and affect eip/rip (needs length check in version string)

2014-09-26 Thread Andreas Schwab
7;t do that then. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Detecting invocation as /bin/sh ?

2014-09-26 Thread Andreas Schwab
Alexandre Ferrieux writes: > So, what about, in bash's initialization, detecting that we are invoked as > "/bin/sh", It already does. See (bash) Bash POSIX Mode. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D

Re: Bash security issue

2014-09-26 Thread Andreas Schwab
Eric Blake writes: > Overkill. The security hole arises because the problem, as it currently > exists, is triggerable by ANY portable environment variable definition. In the context of security you need to forget about portable. You need to think about the improbable. Andreas. -- A

Re: Bash-4.3 Official Patch 25

2014-09-25 Thread Andreas Schwab
> tty uses stdin, so this is the expected output. Why do you think this has anything to do with this patch? $ tty --help | head -n 2 Usage: tty [OPTION]... Print the file name of the terminal connected to standard input. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key finger

Re: Not so useless use of cat

2014-09-17 Thread Andreas Schwab
grams that open the files themselves. It cannot emulate "foo -o /dev/stdin" to make it the same as "foo >/dev/stdin". Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Feature request: Add "import" built-in.

2014-08-24 Thread Andreas Schwab
Tim Friske writes: > set -- "${@:2}" Aka shift. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: "echo" does not follow the "getopt" convention

2014-08-19 Thread Andreas Schwab
shall be recognized as a string operand. It also says: New applications are encouraged to use printf instead of echo. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Feature request - ganged file test switches

2014-08-09 Thread Andreas Schwab
[[ -r foo ]] && [[ -x foo ]] ; then . . . > > but > > if [[ -drx foo ]] ; then . . . > > is a lot easier. But it is ambigous. Does it mean adjuntion or conjunction? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 4

Re: Bug or feature: Why does Bash's "printf" define global variables?

2014-08-03 Thread Andreas Schwab
Tim Friske writes: > my assumption was that Bash's "printf" builtin implicitly defines a local > variable when used inside a function like so: Why? A simple assignment doesn't either, and that's what printf does in the end. Andreas. -- Andreas Schwab

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Andreas Schwab
r for your memory storage. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: 'time' not recognized as reserved when first word after 'if'

2014-06-10 Thread Andreas Schwab
ot; which appears as a component in > the definitions of "pipeline", "list", and "complex command". A command can be either a simple command, a compound command, or a function definition, but not a pipeline or a list. Andreas. -- Andreas Schwab, SUSE Labs, sch

Re: Arithmetic + array allows for code injection

2014-06-02 Thread Andreas Schwab
If you want to write robust scripts, don't use shell. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Arithmetic + array allows for code injection

2014-06-02 Thread Andreas Schwab
ror token is "$(date)") > > That also looks OK. Here the index is '$x'. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: What is the difference between a newline and a semi-colon?

2014-05-30 Thread Andreas Schwab
Bruce Korb writes: > Thanks, Eric & Chet. I hope nobody ever needs to load up a set of > aliases within a Makefile script. A non-interactive shell does not have aliases. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5

Re: Bind builtin does not run readline commands

2014-05-27 Thread Andreas Schwab
Chet Ramey writes: > Sure, since you've just managed to unbind all of the characters in that > command (you didn't provide a command name to bind them to). Not all, only l (ie, the first character following the last dash). Andreas. -- Andreas Schwab, SUSE Labs, sch...

Re: winch trap delayed until keypress

2014-05-23 Thread Andreas Schwab
a signal while waiting for input. You don't need pselect if your goal is to block a signal around select. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: test for "command not found" before expanding shell parameters

2014-04-21 Thread Andreas Schwab
is non-zero, greo exists and you can run > it. And if $greo is null the condition will also be true. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: bash-4.3 bug report

2014-04-14 Thread Andreas Schwab
Eric Blake writes: > In that case, the index check is dead code, No. You don't understand. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: bash-4.3 bug report

2014-04-14 Thread Andreas Schwab
avoid an out-of-bounds access > causing a SEGFAULT. invokers[] is guaranteed to end with a NULL element, so there cannot be any out-of-bounds access, and the use is completely defined. The NULL check is the primary condition, with the index check only being secondary. Andreas. -- Andreas Schw

Re: UTF-8 printf string formating problem

2014-04-05 Thread Andreas Schwab
Jan Novak writes: > IMHO this is a big bug, because it breaks any non ASCII chars formating. It is consistent with printf(3). Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Interactive Expect from bash Script

2014-03-29 Thread Andreas Schwab
Bob Proulx writes: > #!/bin/bash expect -c '...' "$_usr" "$_host" "$_passwd" RTFM? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Interactive Expect from bash Script

2014-03-29 Thread Andreas Schwab
ter sends to it. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Interactive Expect from bash Script

2014-03-29 Thread Andreas Schwab
Esben Stien writes: > Hmm, I see, so how am I supposed to run it?;) As above. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Interactive Expect from bash Script

2014-03-29 Thread Andreas Schwab
out. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Interactive Expect from bash Script

2014-03-29 Thread Andreas Schwab
Esben Stien writes: > # _run=`/usr/bin/expect<<'EOF' > /usr/bin/expect<<'EOF' > set passwd $env(_passwd) > set usr $env(_usr) > set host $env(_host) You never set these variables. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerp

Re: printf cannot write more than one line to /proc/pid/uid_map

2014-03-25 Thread Andreas Schwab
Greg Wooledge writes: > Sounds like Bash is using the standard I/O library routines, in line > buffering mode (i.e. setvbuf(..., _IOLBF, ...); ). See sh_setlinebuf in shell_initialize. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 197

Re: Top does not handle more than 100 cores

2014-03-24 Thread Andreas Schwab
: http://sf.net/projects/procps-ng/ Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Top does not handle more than 100 cores

2014-03-24 Thread Andreas Schwab
Alexandre De Champeaux writes: > The top command is not part of bash, and thus off-topic. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Bug with bash 4.3

2014-03-06 Thread Andreas Schwab
Albert Shih writes: > For example if I do > > mkdir emptydir > cd emptydir > touch \(\) > rm + Tab > > don't give me anything. Make sure you are not using any custom completions, or if you do that you use -o bashdefault. Andreas. -- Andreas Schw

Re: Commands containing UTF8 characters mess up bash history

2014-03-03 Thread Andreas Schwab
Yuri writes: > I just got the same problem again on 4.2.45. I wonder how can I make a > testcase, short of using a keylogger. Try script(1). Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now fo

Re: RFE: a way to echo the arguments with quoting

2014-03-02 Thread Andreas Schwab
gt; 0 635 Z% > > It would be nice if there were an easy way to do this in bash. printf "%q" does that. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Please accept M-p as well as C-p

2014-02-14 Thread Andreas Schwab
Thinking about it I think that the recent addition of line-move-visual > to emacs and not to libreadline is probably the reason for the request > for this feature. I have always missed that feature, though not desperately enough to bother asking for it or implementing it myself. Andreas. -

<    1   2   3   4   5   6   7   8   >