command builtin should not abort on variable assignment errors
Resolves: #1389838
This commit is contained in:
parent
31a9b53e19
commit
b316f71360
31
bash-4.4-assignment-error.patch
Normal file
31
bash-4.4-assignment-error.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff --git a/execute_cmd.h b/execute_cmd.h
|
||||
--- a/execute_cmd.h
|
||||
+++ b/execute_cmd.h
|
||||
@@ -37,6 +37,9 @@ struct func_array_state
|
||||
};
|
||||
#endif
|
||||
|
||||
+/* Variables delared in execute_cmd.c, used by many other files */
|
||||
+extern int executing_command_builtin;
|
||||
+
|
||||
extern struct fd_bitmap *new_fd_bitmap __P((int));
|
||||
extern void dispose_fd_bitmap __P((struct fd_bitmap *));
|
||||
extern void close_fd_bitmap __P((struct fd_bitmap *));
|
||||
diff --git a/subst.c b/subst.c
|
||||
--- a/subst.c
|
||||
+++ b/subst.c
|
||||
@@ -10676,11 +10676,12 @@ expand_word_list_internal (list, eflags)
|
||||
tint = do_word_assignment (temp_list->word, 0);
|
||||
this_command_name = savecmd;
|
||||
/* Variable assignment errors in non-interactive shells
|
||||
- running in Posix.2 mode cause the shell to exit. */
|
||||
+ running in Posix.2 mode cause the shell to exit, unless
|
||||
+ they are being run by the `command' builtin. */
|
||||
if (tint == 0)
|
||||
{
|
||||
last_command_exit_value = EXECUTION_FAILURE;
|
||||
- if (interactive_shell == 0 && posixly_correct)
|
||||
+ if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0)
|
||||
exp_jump_to_top_level (FORCE_EOF);
|
||||
else
|
||||
exp_jump_to_top_level (DISCARD);
|
10
bash.spec
10
bash.spec
@ -8,7 +8,7 @@
|
||||
Version: %{baseversion}%{patchleveltag}
|
||||
Name: bash
|
||||
Summary: The GNU Bourne Again shell
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
License: GPLv3+
|
||||
Url: http://www.gnu.org/software/bash
|
||||
Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz
|
||||
@ -86,6 +86,10 @@ Patch128: bash-4.4-heredoc-cloexec.patch
|
||||
# This should be dropped while rebasing to bash-4.5
|
||||
Patch129: bash-4.4-unset-nonblock-stdin.patch
|
||||
|
||||
# 1389838 - command builtin should not abort on variable assignment errors
|
||||
# This should be dropped while rebasing to bash-4.5
|
||||
Patch130: bash-4.4-assignment-error.patch
|
||||
|
||||
BuildRequires: texinfo bison
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: autoconf, gettext
|
||||
@ -302,6 +306,10 @@ end
|
||||
%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
|
||||
|
||||
%changelog
|
||||
* Tue May 30 2017 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.12-5
|
||||
- command builtin should not abort on variable assignment errors
|
||||
Resolves: #1389838
|
||||
|
||||
* Wed Apr 26 2017 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.12-4
|
||||
- Explicitly unset nonblocking mode while reading from stdin
|
||||
Resolves: #1068697
|
||||
|
Loading…
Reference in New Issue
Block a user