]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20190430 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 13 May 2019 14:04:20 +0000 (10:04 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 13 May 2019 14:04:20 +0000 (10:04 -0400)
CWRU/CWRU.chlog
bashhist.c
builtins/history.def
configure
configure.ac
doc/bashref.texi
doc/version.texi
execute_cmd.c
lib/readline/terminal.c
support/shobj-conf

index e513929257b09360d3d23cd57968b14cd767fc60..adbd2b62a4f7ba6721463bb94c35edffab0fdf02 100644 (file)
@@ -5865,3 +5865,41 @@ builtins/read.def
          don't terminate the buffer and go back to read another character;
          allow the NULL to pass through and terminate the read.
          Fixes bug report from Stephane Chazelas <stephane.chazelas@gmail.com>
+
+                                   5/9
+                                   ---
+bashhist.c
+       - bash_delete_histent: decrement history_lines_this_session only if
+         remove_history returns a non-null history entry, and return failure
+         if it does return a null entry
+
+builtins/history.def
+       - history_builtin: when checking the argument to -d, display an error
+         if the argument is >= history_base + history_length, since that's
+         what history_get and remove_history check. Fixes issue reported by
+         <jr@saturn.site>
+
+support/shobj-conf
+       - hpux11: change stanza to create shared libraries on later versions of
+         HPUX 11. Contributed by Michael Osipov <michael.osipov@siemens.com>
+
+lib/readline/terminal.c
+       - _rl_init_terminal_io: assume TGETENT_BROKEN defined means that tgetent
+         returns 0 on success, as on HPUX 11. Bug reported by Michael Osipov
+         <michael.osipov@siemens.com>
+
+configure.ac
+       - hpux: add -DTGETENT_BROKEN to LOCAL_CFLAGS. Still need to do this
+         in the readline configure.ac
+
+execute_cmd.c
+       - select_builtin: set executing_builtin around the call to read_builtin
+         so we can run traps if the read call is interrupted. From a report
+         from Andreas Kusalananda Kähäri <andreas.kahari@abc.se>
+
+                                  5/12
+                                  ----
+doc/bashref.texi
+       - The Restricted Shell: add some language detailing the weaknesses of
+         the restricted shell mode in isolation, inspired by a discussion on
+         the zsh mailing list
index ed16d7a71e4d2e97690cd3e387f79905f2bc41be..9ca29e53d25bdc09617bae4f08925b876d92cecc 100644 (file)
@@ -359,10 +359,11 @@ bash_delete_histent (i)
 
   discard = remove_history (i);
   if (discard)
-    free_history_entry (discard);
-  history_lines_this_session--;
-
-  return 1;
+    {
+      free_history_entry (discard);
+      history_lines_this_session--;
+    }
+  return discard != 0;
 }
 
 int
index 77093a45513f5cb13802414b0a26734fc859541c..5369ff23b7cedc8a2223d575e90af0afe3ab0ba0 100644 (file)
@@ -243,7 +243,7 @@ range_error:
            }
          opt = ind + history_base;     /* compensate for opt - history_base below */
        }
-      else if ((delete_offset < history_base) || (delete_offset > (history_base + history_length)))
+      else if ((delete_offset < history_base) || (delete_offset >= (history_base + history_length)))
        {
          sh_erange (delete_arg, _("history position"));
          return (EXECUTION_FAILURE);
index 9db96f16afa3587d6cc6921ebe278534d5017940..21a81cb16ef659f4ed0894dd4e2228c7018409d6 100755 (executable)
--- a/configure
+++ b/configure
@@ -20226,8 +20226,8 @@ sysv4*)         $as_echo "#define SVR4 1" >>confdefs.h
  ;;
 sysv5*)                $as_echo "#define SVR5 1" >>confdefs.h
  ;;
-hpux9*)                LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
-hpux*)         LOCAL_CFLAGS=-DHPUX ;;
+hpux9*)                LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN" ;;
+hpux*)         LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN" ;;
 dgux*)         LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
 isc*)          LOCAL_CFLAGS=-Disc386 ;;
 rhapsody*)     LOCAL_CFLAGS=-DRHAPSODY ;;
index 76264adec972f152d8384d5f5799bb20dfef9a20..7bff7f915aa507649a7d01a3a004c46305ff9cac 100644 (file)
@@ -1129,8 +1129,8 @@ sysv4.2*) AC_DEFINE(SVR4_2)
                AC_DEFINE(SVR4) ;;
 sysv4*)                AC_DEFINE(SVR4) ;;
 sysv5*)                AC_DEFINE(SVR5) ;;
-hpux9*)                LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
-hpux*)         LOCAL_CFLAGS=-DHPUX ;;
+hpux9*)                LOCAL_CFLAGS="-DHPUX9 -DHPUX -DTGETENT_BROKEN" ;;
+hpux*)         LOCAL_CFLAGS="-DHPUX -DTGETENT_BROKEN" ;;
 dgux*)         LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
 isc*)          LOCAL_CFLAGS=-Disc386 ;;
 rhapsody*)     LOCAL_CFLAGS=-DRHAPSODY ;;
index 7678845b968eea89dab5eaea2ea4fb1d38976a01..5781d296af838ac6b29a85281649fb0e670a1472 100644 (file)
@@ -7548,6 +7548,19 @@ When a command that is found to be a shell script is executed
 (@pxref{Shell Scripts}), @code{rbash} turns off any restrictions in
 the shell spawned to execute the script.
 
+The restricted shell mode is only one component of a useful restricted
+environment. It should be accompanied by setting @env{PATH} to a value
+that allows execution of only a few verified commands (commands that
+allow shell escapes are particularly vulnerable), leaving the user
+in a non-writable directory other than his home directory after login,
+not allowing the restricted shell to execute shell scripts, and cleaning
+the environment of variables that cause some commands to modify their
+behavior (e.g., @env{VISUAL} or @{PAGER}).
+
+Modern systems provide more secure ways to implement a restricted environment,
+such as @code{jails}, @code{zones}, or @code{containers}.
+
+
 @node Bash POSIX Mode
 @section Bash POSIX Mode
 @cindex POSIX Mode
index abb7722f9789a5cfe0405b87a6434336adffb14c..9838a1a8a2c0e7b03dc8e061231952f0f822a12b 100644 (file)
@@ -2,10 +2,10 @@
 Copyright (C) 1988-2019 Free Software Foundation, Inc.
 @end ignore
 
-@set LASTCHANGE Sat Apr 20 12:32:57 EDT 2019
+@set LASTCHANGE Sun May 12 13:29:23 MDT 2019
 
 @set EDITION 5.0
 @set VERSION 5.0
 
-@set UPDATED 20 April 2019
-@set UPDATED-MONTH April 2019
+@set UPDATED 12 May 2019
+@set UPDATED-MONTH May 2019
index 7f5f41f6c2c954be3aa8d126accf8f4ed0d01dc1..17d40e414235d82d870b38fb5c023689841b10b8 100644 (file)
@@ -3263,7 +3263,7 @@ select_query (list, list_len, prompt, print_menu)
      char *prompt;
      int print_menu;
 {
-  int max_elem_len, indices_len, len;
+  int max_elem_len, indices_len, len, r, oe;
   intmax_t reply;
   WORD_LIST *l;
   char *repl_string, *t;
@@ -3297,7 +3297,11 @@ select_query (list, list_len, prompt, print_menu)
       fflush (stderr);
       QUIT;
 
-      if (read_builtin ((WORD_LIST *)NULL) != EXECUTION_SUCCESS)
+      oe = executing_builtin;
+      executing_builtin = 1;
+      r = read_builtin ((WORD_LIST *)NULL);
+      executing_builtin = oe;
+      if (r != EXECUTION_SUCCESS)
        {
          putchar ('\n');
          return ((char *)NULL);
index e5573897762ee8fc37840354a06ffe863ba2ad7d..fa0043820ad2b513b6072d687dc33422f7d64773 100644 (file)
@@ -483,7 +483,11 @@ _rl_init_terminal_io (const char *terminal_name)
       tgetent_ret = tgetent (term_buffer, term);
     }
 
+#ifdef TGETENT_BROKEN
+  if (tgetent_ret < 0)
+#else
   if (tgetent_ret <= 0)
+#endif
     {
       FREE (term_string_buffer);
       FREE (term_buffer);
index 7920f1b5cb907f84d06450fac158291ebe0f0401..95fa1ae7e2f4c8b97fd88e4ddf99b71fb8ece1bc 100644 (file)
@@ -402,18 +402,15 @@ hpux11*)
        SHLIB_STATUS=unsupported
 
        # If you are using the HP ANSI C compiler, you can uncomment and use
-       # this code (I have not tested it)
-#      SHOBJ_STATUS=supported
-#      SHLIB_STATUS=supported
-#
+       # this code from michael.osipov@siemens.com (I have not tested it)
 #      SHOBJ_CFLAGS='+z'
-#      SHOBJ_LD='ld'
-#      SHOBJ_LDFLAGS='-b +s +h $@'
+#      SHOBJ_LD='$(CC)'
+#      SHOBJ_LDFLAGS='-b -Wl,+s -Wl,+h,$@'
 #
-#      SHLIB_XLDFLAGS='+b $(libdir)'
-#      SHLIB_LIBSUFF='sl'
+#      SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
+#      SHLIB_LIBSUFF='so'
 #      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
-
+#      SHLIB_LIBS='$(TERMCAP_LIB)'
        ;;
 
 sysv4*-*gcc*)