]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20181025 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 29 Oct 2018 20:06:50 +0000 (16:06 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 29 Oct 2018 20:06:50 +0000 (16:06 -0400)
CWRU/CWRU.chlog
doc/bash.1
doc/bashref.texi
doc/version.texi
execute_cmd.c
redir.c

index 930624435f0e52e8f5bd509b458fe940e46d3f4b..068f2580fe065f0c1c336a3627544e240809cf12 100644 (file)
@@ -4615,3 +4615,28 @@ subst.c
        - param_expand: don't set W_SPLITSPACE for $* unless IFS is NULL;
          consistent with other uses of W_SPLITSPACE
 
+                                  10/22
+                                  -----
+doc/{bash.1,bashref.texi}
+       - tweak description of bash conditional expressions to note that the
+         test and [ commands determine their behavior based on the number of
+         arguments. Suggested by Ilkka Virta <itvirta@iki.fi>
+
+                                  10/24
+                                  -----
+execute_cmd.c
+       - execute_simple_command: don't set $_ to NULL when executing a
+         command that forks; just leave it unchanged. Tweaked the documentation
+         slightly as a result. Inspired by report from Ricky Tigg
+         <ricky.tigg@gmail.com>
+
+                                  10/28
+                                  -----
+redir.c
+       - here_document_to_fd: make sure the temp files used to store here
+         documents are readable (and writable, where necessary) by the user.
+         This can happen in the unlikely case that someone decides to shoot
+         himself in the foot by setting the umask to 400. Issue originally
+         raised back in March by Stephane Chazelas
+         <stephane.chazelas@gmail.com>; fix inspired by Martijn Dekker
+         <martijn@inlv.org>
index a22768ac5a038f61a82c7cbbc1d000b6e6b2ad38..0b072b988e11eb7f68e53c45f49c7e51a5ab65db 100644 (file)
@@ -5,12 +5,12 @@
 .\"    Case Western Reserve University
 .\"    chet.ramey@case.edu
 .\"
-.\"    Last Change: Fri Oct  5 14:53:12 EDT 2018
+.\"    Last Change: Mon Oct 22 09:55:27 EDT 2018
 .\"
 .\" bash_builtins, strip all but Built-Ins section
 .if \n(zZ=1 .ig zZ
 .if \n(zY=1 .ig zY
-.TH BASH 1 "2018 October 5" "GNU Bash 5.0"
+.TH BASH 1 "2018 October 22" "GNU Bash 5.0"
 .\"
 .\" There's some problem with having a `@'
 .\" in a tagged paragraph with the BSD man macros.
@@ -1427,8 +1427,8 @@ as given by argument zero.
 At shell startup, set to the absolute pathname used to invoke the
 shell or shell script being executed as passed in the environment
 or argument list.
-Subsequently, expands to the last argument to the previous command,
-after expansion.
+Subsequently, expands to the last argument to the previous simple
+command executed in the foreground, after expansion.
 Also set to the full pathname used to invoke each command executed
 and placed in the environment exported to that command.
 When checking mail, this parameter holds the name of the mail file
@@ -4494,6 +4494,10 @@ rules above.
 Conditional expressions are used by the \fB[[\fP compound command and
 the \fBtest\fP and \fB[\fP builtin commands to test file attributes
 and perform string and arithmetic comparisons.
+The \fBtest\fP abd \fB[\fP commands determine their behavior based on
+the number of arguments; see the descriptions of those commands for any
+other command-specific actions.
+.PP
 Expressions are formed from the following unary or binary primaries.
 \fBBash\fP handles several filenames specially when they are used in
 expressions.
index 7d1b53bbcfcdfcde91fc7fd1704fa9e92ee68e3a..96484eede6b5c741489fd2034273cf3f88c38d96 100644 (file)
@@ -1738,8 +1738,8 @@ to the filename used to invoke Bash, as given by argument zero.
 At shell startup, set to the absolute pathname used to invoke the
 shell or shell script being executed as passed in the environment
 or argument list.
-Subsequently, expands to the last argument to the previous command,
-after expansion.   
+Subsequently, expands to the last argument to the previous simple
+command executed in the foreground, after expansion. 
 Also set to the full pathname used to invoke each command executed
 and placed in the environment exported to that command.
 When checking mail, this parameter holds the name of the mail file.
@@ -3795,18 +3795,25 @@ false.
 
 @item 3 arguments
 The following conditions are applied in the order listed.
+
+@enumerate
+@item
 If the second argument is one of the binary conditional
 operators (@pxref{Bash Conditional Expressions}), the
 result of the expression is the result of the binary test using the
 first and third arguments as operands.
 The @samp{-a} and @samp{-o} operators are considered binary operators
 when there are three arguments.
+@item
 If the first argument is @samp{!}, the value is the negation of
 the two-argument test using the second and third arguments.
+@item
 If the first argument is exactly @samp{(} and the third argument is
 exactly @samp{)}, the result is the one-argument test of the second
 argument.
+@item
 Otherwise, the expression is false.
+@end enumerate
 
 @item 4 arguments
 If the first argument is @samp{!}, the result is the negation of
@@ -6821,9 +6828,13 @@ printing @env{$PS1} (@pxref{Bash Variables}).
 @cindex expressions, conditional
 
 Conditional expressions are used by the @code{[[} compound command
-and the @code{test} and @code{[} builtin commands.
+and the @code{test} and @code{[} builtin commands. The @code{test}
+and @code{[} commands determine their behavior based on the number
+of arguments; see the descriptions of those commands for any other
+command-specific actions.
 
-Expressions may be unary or binary.
+Expressions may be unary or binary,
+and are formed from the following primaries.
 Unary expressions are often used to examine the status of a file.
 There are string operators and numeric comparison operators as well.
 Bash handles several filenames specially when they are used in
index f7eab2bbc2f38872988ec969197a4dc65dd3c65e..54089a90510d03c020cbb2965179bfe098d73b7d 100644 (file)
@@ -2,10 +2,10 @@
 Copyright (C) 1988-2018 Free Software Foundation, Inc.
 @end ignore
 
-@set LASTCHANGE Fri Oct  5 14:52:51 EDT 2018
+@set LASTCHANGE Mon Oct 22 09:55:52 EDT 2018
 
 @set EDITION 5.0
 @set VERSION 5.0
 
-@set UPDATED 5 October 2018
+@set UPDATED 22 October 2018
 @set UPDATED-MONTH October 2018
index 4c2b15cd21c84bb579ff96b08700ebb0f321dfc7..83e46dba2df0a3c68eb6a9b9ccedcadb20aa3100 100644 (file)
@@ -4285,7 +4285,9 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
 #endif
 #endif
          command_line = (char *)NULL;      /* don't free this. */
+#if 0
          bind_lastarg ((char *)NULL);
+#endif
          return (result);
        }
     }
diff --git a/redir.c b/redir.c
index f5276dc650813e49f871fb1198c6a146caa561eb..1fd4d269a3b2f40a4050078c16626a76c00f875b 100644 (file)
--- a/redir.c
+++ b/redir.c
@@ -465,6 +465,7 @@ here_document_to_fd (redirectee, ri)
       return (fd);
     }
 
+  fchmod (fd, S_IRUSR | S_IWUSR);
   SET_CLOSE_ON_EXEC (fd);
 
   errno = r = 0;               /* XXX */
@@ -508,6 +509,8 @@ here_document_to_fd (redirectee, ri)
     }
 
   free (filename);
+
+  fchmod (fd2, S_IRUSR);
   return (fd2);
 }