commit bash-20150904 snapshot

This commit is contained in:
Chet Ramey
2015-09-11 14:20:03 -04:00
parent 4eb81d59d0
commit de8f105604
18 changed files with 162 additions and 34 deletions
+45
View File
@@ -9514,3 +9514,48 @@ examples/loadables/Makefile.in
an example
- uninstall-supported,uninistall-unsupported: uninstall targets,
make uninstall chooses one based on $(SHOBJ_STATUS)
8/31
----
lib/glob/Makefile.in
- CPPFLAGS: move after ${INCLUDES} so library-specific include paths
take precedence. This is what the other parts of the shell do.
Report from Poor Yorick <org.gnu.lists.bug-bash@pooryorick.com>
builtins/read.def
- reset_alarm: cancel alarm before restoring signal handler to avoid
possible race condition. Report and fix from Oleg Popov
<dev-random@mail.ru>
subst.c
- string_extract_verbatim: if SEPARATORS is "'", don't short-circuit
to string_extract_single_quoted unless the SX_NOCTLESC flag is set.
Callers expect this function to honor CTLESC, even to quote a single
quote. Fixes bug reported by isabella parakiss <izaberina@gmail.com>
and several others
9/2
---
include/chartypes.h
- TOCTRL: handle '?' by special-casing it to 0x7f. Fixes a problem
with $'\c?' reported by Helmut Karlowski <helmut.karlowski@ish.de>
redir.c
- write_here_string: don't word-split the here string document. The
bash documentation has always said this doesn't happen, even though
bash has done so for years, and other shells that implement here-
strings don't perform any word splitting. The practical effect is
that sequences of IFS characters are collapsed to spaces. Fixes
bug reported by Clint Hepner <clint.hepner@gmail.com>
9/3
---
doc/{bash.1,bashref.texi}
- add \? to the list of backslash escapes expanded by $'...' ANSI-C
quoting. It was expanded but not documented
lib/readline/util.c
- _rl_audit_tty: updated from Red Hat patch
lib/readline/readline.c
- HAVE_DECL_AUDIT_USER_TTY: correct #define check
+2
View File
@@ -915,6 +915,7 @@ tests/dollar-at-star2.sub f
tests/dollar-at-star3.sub f
tests/dollar-at-star4.sub f
tests/dollar-at-star5.sub f
tests/dollar-at-star6.sub f
tests/dollar-at1.sub f
tests/dollar-at2.sub f
tests/dollar-at3.sub f
@@ -1010,6 +1011,7 @@ tests/heredoc2.sub f
tests/heredoc3.sub f
tests/herestr.tests f
tests/herestr.right f
tests/herestr1.sub f
tests/histexp.tests f
tests/histexp1.sub f
tests/histexp.right f
+2 -1
View File
@@ -165,8 +165,9 @@ sigalrm (s)
static void
reset_alarm ()
{
set_signal_handler (SIGALRM, old_alrm);
/* Cancel alarm before restoring signal handler. */
falarm (0, 0);
set_signal_handler (SIGALRM, old_alrm);
}
/* Read the value of the shell variables whose names follow.
+5 -2
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Sat Aug 15 15:17:33 EDT 2015
.\" Last Change: Thu Sep 3 15:09:13 EDT 2015
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2015 August 15" "GNU Bash 4.4"
.TH BASH 1 "2015 September 3" "GNU Bash 4.4"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -1135,6 +1135,9 @@ single quote
.B \e\(dq
double quote
.TP
.B \e?
question mark
.TP
.B \e\fInnn\fP
the eight-bit character whose value is the octal value \fInnn\fP
(one to three digits)
+2
View File
@@ -500,6 +500,8 @@ backslash
single quote
@item \"
double quote
@item \?
question mark
@item \@var{nnn}
the eight-bit character whose value is the octal value @var{nnn}
(one to three digits)
+3 -3
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2015 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Sat Aug 15 15:17:52 EDT 2015
@set LASTCHANGE Thu Sep 3 15:09:13 EDT 2015
@set EDITION 4.4
@set VERSION 4.4
@set UPDATED 15 August 2015
@set UPDATED-MONTH August 2015
@set UPDATED 3 September 2015
@set UPDATED-MONTH September 2015
+1 -1
View File
@@ -103,7 +103,7 @@
#ifndef TOCTRL
/* letter to control char -- ASCII. The TOUPPER is in there so \ce and
\cE will map to the same character in $'...' expansions. */
# define TOCTRL(x) (TOUPPER(x) & 037)
# define TOCTRL(x) ((x) == '?' ? 0x7f : (TOUPPER(x) & 0x1f))
#endif
#ifndef UNCTRL
/* control char to letter -- ASCII */
+1 -1
View File
@@ -52,7 +52,7 @@ BASHINCDIR = ${topdir}/include
INCLUDES = -I. -I../.. -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib
CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) ${INCLUDES} \
CCFLAGS = $(PROFILE_FLAGS) $(DEFS) $(LOCAL_DEFS) ${INCLUDES} $(CPPFLAGS) \
$(LOCAL_CFLAGS) $(CFLAGS)
# Here is a rule for making .o files from .c files that doesn't force
+1 -1
View File
@@ -386,7 +386,7 @@ readline (prompt)
RL_SETSTATE (RL_STATE_CALLBACK);
#endif
#if HAVE_DECL_AUDIT_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT)
#if HAVE_DECL_AUDIT_USER_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT)
if (value)
_rl_audit_tty (value);
#endif
+14 -22
View File
@@ -551,6 +551,7 @@ _rl_settracefp (fp)
#if HAVE_DECL_AUDIT_USER_TTY && defined (ENABLE_TTY_AUDIT_SUPPORT)
#include <sys/socket.h>
#include <libaudit.h>
#include <linux/audit.h>
#include <linux/netlink.h>
@@ -559,42 +560,33 @@ void
_rl_audit_tty (string)
char *string;
{
struct audit_message req;
struct sockaddr_nl addr;
struct msghdr msg;
struct nlmsghdr nlm;
struct iovec iov[2];
size_t size;
int fd;
fd = socket (AF_NETLINK, SOCK_RAW, NETLINK_AUDIT);
fd = socket (PF_NETLINK, SOCK_RAW, NETLINK_AUDIT);
if (fd < 0)
return;
size = strlen (string) + 1;
nlm.nlmsg_len = NLMSG_LENGTH (size);
nlm.nlmsg_type = AUDIT_USER_TTY;
nlm.nlmsg_flags = NLM_F_REQUEST;
nlm.nlmsg_seq = 0;
nlm.nlmsg_pid = 0;
if (NLMSG_SPACE (size) > MAX_AUDIT_MESSAGE_LENGTH)
return;
iov[0].iov_base = &nlm;
iov[0].iov_len = sizeof (nlm);
iov[1].iov_base = string;
iov[1].iov_len = size;
memset (&req, 0, sizeof(req));
req.nlh.nlmsg_len = NLMSG_SPACE (size);
req.nlh.nlmsg_type = AUDIT_USER_TTY;
req.nlh.nlmsg_flags = NLM_F_REQUEST;
req.nlh.nlmsg_seq = 0;
if (size && string)
memcpy (NLMSG_DATA(&req.nlh), string, size);
memset (&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_pid = 0;
addr.nl_groups = 0;
msg.msg_name = &addr;
msg.msg_namelen = sizeof (addr);
msg.msg_iov = iov;
msg.msg_iovlen = 2;
msg.msg_control = NULL;
msg.msg_controllen = 0;
msg.msg_flags = 0;
(void)sendmsg (fd, &msg, 0);
sendto (fd, &req, req.nlh.nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr));
close (fd);
}
#endif
+2 -2
View File
@@ -1,6 +1,6 @@
/* redir.c -- Functions to perform input and output redirection. */
/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -325,7 +325,7 @@ write_here_string (fd, redirectee)
/* Now that we've changed the variable search order to ignore the temp
environment, see if we need to change the cached IFS values. */
sv_ifs ("IFS");
herestr = expand_string_to_string (redirectee->word, 0);
herestr = expand_string_unsplit_to_string (redirectee->word, 0);
expanding_redir = 0;
/* Now we need to change the variable search order back to include the temp
environment. We force the temp environment search by forcing
+1 -1
View File
@@ -1100,7 +1100,7 @@ string_extract_verbatim (string, slen, sindex, charlist, flags)
char *temp;
DECLARE_MBSTATE;
if (charlist[0] == '\'' && charlist[1] == '\0')
if ((flags & SX_NOCTLESC) && charlist[0] == '\'' && charlist[1] == '\0')
{
temp = string_extract_single_quoted (string, sindex);
--*sindex; /* leave *sindex at separator character */
+1
View File
@@ -217,6 +217,7 @@ ${THIS_SH} ./dollar-at-star2.sub
${THIS_SH} ./dollar-at-star3.sub
${THIS_SH} ./dollar-at-star4.sub
${THIS_SH} ./dollar-at-star5.sub
${THIS_SH} ./dollar-at-star6.sub
# tests for special expansion of "$*" and "${array[*]}" when used with other
# expansions -- bugs through bash-2.05b
+29
View File
@@ -0,0 +1,29 @@
OIFS="$IFS"
arr=(a b c)
recho ${arr[@]@Q}
recho "${arr[@]@Q}"
IFS="'"
recho ${arr[@]@Q}
recho "${arr[@]@Q}"
IFS="$OIFS"
arr=("'a'" "'b'" "'c'")
IFS="'"
recho ${arr[@]}
recho "${arr[@]}"
IFS="$OIFS"
IFS="'"
a="'a'"
recho $a
recho "$a"
IFS="$OIFS"
set -- "'a'" "'b'" "'c'"
IFS="'"
recho "${@}"
recho "$@"
+37
View File
@@ -229,6 +229,43 @@ argv[1] = <>
variable
argv[1] = <>
dollar-at
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
argv[1] = <>
argv[2] = <a>
argv[3] = <>
argv[4] = <>
argv[5] = <b>
argv[6] = <>
argv[7] = <>
argv[8] = <c>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
argv[1] = <>
argv[2] = <a>
argv[3] = <>
argv[4] = <>
argv[5] = <b>
argv[6] = <>
argv[7] = <>
argv[8] = <c>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
argv[1] = <>
argv[2] = <a>
argv[1] = <'a'>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
argv[1] = <'a'>
argv[2] = <'b'>
argv[3] = <'c'>
xa|xb|xc
xa|xb|xc
a|b|c
+4
View File
@@ -26,3 +26,7 @@ echo ho
echo off to work we go
declare -a uu=([0]="" [1]="kghfjk" [2]="jkfzuk" [3]="i
")
foo bar
foo bar
qux:::::bax
qux:::::bax
+2
View File
@@ -37,3 +37,5 @@ cat <<< "echo $(echo off to work we go)"
IFS="/" read -r -d $'\000' -a uu <<< /kghfjk/jkfzuk/i
declare -p uu
${THIS_SH} ./herestr1.sub
+10
View File
@@ -0,0 +1,10 @@
# problems with word splitting unquoted here-strings present since bash-3.2
x="foo bar"
cat <<< $x # Word-splitting appears to collapse the run of whitespace
cat <<< "$x" # Whitespace preserved, as with here doc
x="qux:::::bax"
IFS=':'
cat <<< $x # Word-splitting appears to collapse the run of whitespace
cat <<< "$x" # Whitespace preserved, as with here doc