Projects
openEuler:Mainline
bash
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:bash.spec
Changed
@@ -1,6 +1,6 @@ Name: bash Version: 5.1.8 -Release: 2 +Release: 7 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -23,6 +23,15 @@ Patch137: bugfix-Forbidden-non-root-user-to-clear-history.patch Patch138: enable-dot-logout-and-source-bashrc-through-ssh.patch Patch139: cd-alias.patch +Patch140: bash-5.1-sw.patch +Patch141: backport-fix-crash-in-readline-when-started-with-an-invalid.patch +Patch142: backport-fix-CVE-2022-3715.patch + +Patch6001: backport-Bash-5.1-patch-10-fix-for-wait-n-being-interrupted-b.patch +Patch6002: backport-Bash-5.1-patch-11-save-and-restore-alias-parsing-whe.patch +Patch6003: backport-Bash-5.1-patch-12-fix-race-condition-with-child-proc.patch +Patch6004: backport-Bash-5.1-patch-15-fix-readline-display-of-some-chara.patch +Patch6005: backport-Bash-5.1-patch-16-fix-interpretation-of-multiple-ins.patch BuildRequires: gcc bison texinfo autoconf ncurses-devel # Required for bash tests @@ -116,6 +125,34 @@ %exclude %{_infodir}/dir %changelog +* Mon Jan 16 2023 wangyuhang <wangyuhang27@huawei.com> -5.1.8-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: add backport-Bash-5.1-patch-10-fix-for-wait-n-being-interrupted-b.patch + backport-Bash-5.1-patch-11-save-and-restore-alias-parsing-whe.patch + backport-Bash-5.1-patch-12-fix-race-condition-with-child-proc.patch + backport-Bash-5.1-patch-15-fix-readline-display-of-some-chara.patch + backport-Bash-5.1-patch-16-fix-interpretation-of-multiple-ins.patch + +* Thu Nov 10 2022 wangyuhang <wangyuhang27@huawei.com> -5.1.8-6 +- Type:CVE +- ID:NA +- SUG:NA +- DESC: fix CVE-2022-3715 + +* Sat Oct 29 2022 licihua <licihua@huawei.com> -5.1.8-5 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: fix crash in readline when started with an invalid locale specification + +* Mon Aug 15 2022 panxiaohe <panxh.life@foxmail.com> - 5.1.8-4 +- fix bugfix-Forbidden-non-root-user-to-clear-history.patch + +* Wed Jul 20 2022 wuzx<wuzx1226@qq.com> - 5.1.8-3 +- add sw64 patch + * Wed Jul 6 2022 zoulin <zoulin13@h-partners.com> - 5.1.8-2 - Type:enhancement - ID:NA @@ -140,14 +177,14 @@ - SUG:NA - DESC:upgrade to 5.1 -* Thu Mar 30 2021 shenyangyang<shenyangyang4@huawei.com> - 5.0-17 +* Tue Mar 30 2021 shenyangyang<shenyangyang4@huawei.com> - 5.0-17 - Type:bugfix - ID:NA - SUG:NA - DESC:Rebuild for openEuler-rpm-config moving /usr/lib/rpm/openEuler/xxxx to /usr/lib/xxxx -* Wed Jan 6 2020 Liquor <lirui130@huawei.com> - 5.0-16 +* Wed Jan 6 2021 Liquor <lirui130@huawei.com> - 5.0-16 - Type:bugfix - ID:NA - SUG:NA
View file
_service:tar_scm:backport-Bash-5.1-patch-10-fix-for-wait-n-being-interrupted-b.patch
Added
@@ -0,0 +1,38 @@ +From 910fcdc415abeb3d7d85fb46ee0d3e804a4c47a6 Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Wed, 17 Nov 2021 16:45:23 -0500 +Subject: PATCH Bash-5.1 patch 10: fix for wait -n being interrupted by a + trapped signal + +Conflict:NA +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=910fcdc415abeb3d7d85fb46ee0d3e804a4c47a6 +--- + builtins/wait.def | 5 ++++- + 1 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/builtins/wait.def b/builtins/wait.def +index 824c83fe..e70a4d94 100644 +--- a/builtins/wait.def ++++ b/builtins/wait.def +@@ -111,7 +111,8 @@ int + wait_builtin (list) + WORD_LIST *list; + { +- int status, code, opt, nflag, wflags; ++ int status, code, opt, nflag; ++ volatile int wflags; + char *vname; + SHELL_VAR *pidvar; + struct procstat pstat; +@@ -180,6 +181,8 @@ wait_builtin (list) + last_command_exit_signal = wait_signal_received; + status = 128 + wait_signal_received; + wait_sigint_cleanup (); ++ if (wflags & JWAIT_WAITING) ++ unset_waitlist (); + WAIT_RETURN (status); + } + +-- +2.33.0 +
View file
_service:tar_scm:backport-Bash-5.1-patch-11-save-and-restore-alias-parsing-whe.patch
Added
@@ -0,0 +1,68 @@ +From c839339fbfd2bb7ee4a523b64c7f3734ba36b9bc Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Wed, 17 Nov 2021 16:46:40 -0500 +Subject: PATCH Bash-5.1 patch 11: save and restore alias parsing when + performing compound array assignment + +Conflict:NA +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=c839339fbfd2bb7ee4a523b64c7f3734ba36b9bc +--- + parse.y | 4 ---- + y.tab.c | 4 ---- + 2 files changed, 1 insertion(+), 9 deletions(-) + +diff --git a/parse.y b/parse.y +index df1231da..f25575b5 100644 +--- a/parse.y ++++ b/parse.y +@@ -6493,10 +6493,8 @@ parse_string_to_word_list (s, flags, whom) + old_expand_aliases = expand_aliases; + + push_stream (1); +-#if 0 /* TAG: bash-5.2 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> 11/17/2020 */ + if (ea = expanding_alias ()) + parser_save_alias (); +-#endif + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; +@@ -6531,10 +6529,8 @@ parse_string_to_word_list (s, flags, whom) + last_read_token = '\n'; + pop_stream (); + +-#if 0 /* TAG: bash-5.2 */ + if (ea) + parser_restore_alias (); +-#endif + + #if defined (HISTORY) + remember_on_history = old_remember_on_history; +diff --git a/y.tab.c b/y.tab.c +index dcc5b7f3..c11d7aaa 100644 +--- a/y.tab.c ++++ b/y.tab.c +@@ -8787,10 +8787,8 @@ parse_string_to_word_list (s, flags, whom) + old_expand_aliases = expand_aliases; + + push_stream (1); +-#if 0 /* TAG: bash-5.2 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> 11/17/2020 */ + if (ea = expanding_alias ()) + parser_save_alias (); +-#endif + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; + echo_input_at_read = expand_aliases = 0; +@@ -8825,10 +8823,8 @@ parse_string_to_word_list (s, flags, whom) + last_read_token = '\n'; + pop_stream (); + +-#if 0 /* TAG: bash-5.2 */ + if (ea) + parser_restore_alias (); +-#endif + + #if defined (HISTORY) + remember_on_history = old_remember_on_history; +-- +2.33.0 +
View file
_service:tar_scm:backport-Bash-5.1-patch-12-fix-race-condition-with-child-proc.patch
Added
@@ -0,0 +1,184 @@ +From 15409324f1974d41c183904ad575da7188058c1c Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Wed, 17 Nov 2021 16:47:24 -0500 +Subject: PATCH Bash-5.1 patch 12: fix race condition with child processes + and resetting trapped signals + +Conflict:NA +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=15409324f1974d41c183904ad575da7188058c1c +--- + command.h | 1 + + execute_cmd.c | 8 +++++++- + jobs.c | 2 ++ + nojobs.c | 2 ++ + sig.c | 10 +++++++++- + subst.c | 2 ++ + trap.c | 26 ++++++++++++++++++++++++++ + 7 files changed, 50 insertions(+), 3 deletions(-) + +diff --git a/command.h b/command.h +index 914198f9..b8477528 100644 +--- a/command.h ++++ b/command.h +@@ -124,6 +124,7 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, + #define SUBSHELL_PROCSUB 0x20 /* subshell caused by <(command) or >(command) */ + #define SUBSHELL_COPROC 0x40 /* subshell from a coproc pipeline */ + #define SUBSHELL_RESETTRAP 0x80 /* subshell needs to reset trap strings on first call to trap */ ++#define SUBSHELL_IGNTRAP 0x100 /* subshell should reset trapped signals from trap_handler */ + + /* A structure which represents a word. */ + typedef struct word_desc { +diff --git a/execute_cmd.c b/execute_cmd.c +index 90129e06..425679a2 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -1547,6 +1547,9 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close) + clear_pending_traps (); + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; ++ /* Note that signal handlers have been reset, so we should no longer ++ reset the handler and resend trapped signals to ourselves. */ ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + /* We are in a subshell, so forget that we are running a trap handler or + that the signal handler has changed (we haven't changed it!) */ +@@ -4320,7 +4323,8 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close) + already_forked = 1; + cmdflags |= CMD_NO_FORK; + +- subshell_environment = SUBSHELL_FORK; /* XXX */ ++ /* We redo some of what make_child() does with SUBSHELL_IGNTRAP */ ++ subshell_environment = SUBSHELL_FORK|SUBSHELL_IGNTRAP; /* XXX */ + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; + if (async) +@@ -4574,6 +4578,7 @@ run_builtin: + trap strings if we run trap to change a signal disposition. */ + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + if (async) + { +@@ -5514,6 +5519,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, + reset_terminating_signals (); /* XXX */ + /* Cancel traps, in trap.c. */ + restore_original_signals (); ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + #if defined (JOB_CONTROL) + FREE (p); +diff --git a/jobs.c b/jobs.c +index a581f305..7c3b6e83 100644 +--- a/jobs.c ++++ b/jobs.c +@@ -2217,6 +2217,8 @@ make_child (command, flags) + signals to the default state for a new process. */ + pid_t mypid; + ++ subshell_environment |= SUBSHELL_IGNTRAP; ++ + /* If this ends up being changed to modify or use `command' in the + child process, go back and change callers who free `command' in + the child process when this returns. */ +diff --git a/nojobs.c b/nojobs.c +index c5fc83d9..f2563ca0 100644 +--- a/nojobs.c ++++ b/nojobs.c +@@ -575,6 +575,8 @@ make_child (command, flags) + last_asynchronous_pid = getpid (); + #endif + ++ subshell_environment |= SUBSHELL_IGNTRAP; ++ + default_tty_job_signals (); + } + else +diff --git a/sig.c b/sig.c +index 6964d862..e6537d26 100644 +--- a/sig.c ++++ b/sig.c +@@ -55,7 +55,8 @@ + # include "bashhist.h" + #endif + +-extern void initialize_siglist (); ++extern void initialize_siglist PARAMS((void)); ++extern void set_original_signal PARAMS((int, SigHandler *)); + + #if !defined (JOB_CONTROL) + extern void initialize_job_signals PARAMS((void)); +@@ -255,6 +256,13 @@ initialize_terminating_signals () + sigaction (XSIG (i), &act, &oact); + XHANDLER(i) = oact.sa_handler; + XSAFLAGS(i) = oact.sa_flags; ++ ++#if 0 ++ set_original_signal (XSIG(i), XHANDLER(i)); /* optimization */ ++#else ++ set_original_signal (XSIG(i), act.sa_handler); /* optimization */ ++#endif ++ + /* Don't do anything with signals that are ignored at shell entry + if the shell is not interactive. */ + /* XXX - should we do this for interactive shells, too? */ +diff --git a/subst.c b/subst.c +index 462752de..327de083 100644 +--- a/subst.c ++++ b/subst.c +@@ -5951,6 +5951,7 @@ process_substitute (string, open_for_read_in_child) + free_pushed_string_input (); + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + QUIT; /* catch any interrupts we got post-fork */ + setup_async_signals (); + #if 0 +@@ -6382,6 +6383,7 @@ command_substitute (string, quoted, flags) + } + QUIT; /* catch any interrupts we got post-fork */ + subshell_environment |= SUBSHELL_RESETTRAP; ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + } + + #if defined (JOB_CONTROL) +diff --git a/trap.c b/trap.c +index c7f8ded5..1b27fb3a 100644 +--- a/trap.c ++++ b/trap.c +@@ -481,6 +481,32 @@ trap_handler (sig) + SIGRETURN (0); + } + ++ /* This means we're in a subshell, but have not yet reset the handler for ++ trapped signals. We're not supposed to execute the trap in this situation; ++ we should restore the original signal and resend the signal to ourselves ++ to preserve the Posix "signal traps that are not being ignored shall be ++ set to the default action" semantics. */ ++ if ((subshell_environment & SUBSHELL_IGNTRAP) && trap_listsig != (char *)IGNORE_SIG) ++ { ++ sigset_t mask; ++ ++ /* Paranoia */ ++ if (original_signalssig == IMPOSSIBLE_TRAP_HANDLER) ++ original_signalssig = SIG_DFL; ++ ++ restore_signal (sig); ++ ++ /* Make sure we let the signal we just caught through */ ++ sigemptyset (&mask); ++ sigprocmask (SIG_SETMASK, (sigset_t *)NULL, &mask); ++ sigdelset (&mask, sig); ++ sigprocmask (SIG_SETMASK, &mask, (sigset_t *)NULL); ++ ++ kill (getpid (), sig); ++ ++ SIGRETURN (0); ++ } ++ + if ((sig >= NSIG) || + (trap_listsig == (char *)DEFAULT_SIG) || + (trap_listsig == (char *)IGNORE_SIG)) +-- +2.33.0 +
View file
_service:tar_scm:backport-Bash-5.1-patch-15-fix-readline-display-of-some-chara.patch
Added
@@ -0,0 +1,28 @@ +From 18ad612ea80ba978ae8271800814737e224a4baf Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Tue, 4 Jan 2022 17:01:33 -0500 +Subject: PATCH Bash-5.1 patch 15: fix readline display of some characters > + 128 in certain single-byte encodings + +Conflict:NA +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=18ad612ea80ba978ae8271800814737e224a4baf +--- + lib/readline/display.c | 2 +- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/readline/display.c b/lib/readline/display.c +index 38b3d0e7..f5d32945 100644 +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -1598,7 +1598,7 @@ puts_face (const char *str, const char *face, int n) + char cur_face; + + for (cur_face = FACE_NORMAL, i = 0; i < n; i++) +- putc_face (stri, facei, &cur_face); ++ putc_face ((unsigned char) stri, facei, &cur_face); + putc_face (EOF, FACE_NORMAL, &cur_face); + } + +-- +2.33.0 +
View file
_service:tar_scm:backport-Bash-5.1-patch-16-fix-interpretation-of-multiple-ins.patch
Added
@@ -0,0 +1,42 @@ +From 9439ce094c9aa7557a9d53ac7b412a23aa66e36b Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Tue, 4 Jan 2022 17:03:45 -0500 +Subject: PATCH Bash-5.1 patch 16: fix interpretation of multiple instances + of ! in conditional commands + +Conflict:NA +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=9439ce094c9aa7557a9d53ac7b412a23aa66e36b +--- + parse.y | 2 +- + y.tab.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/parse.y b/parse.y +index f25575b5..f4168c7c 100644 +--- a/parse.y ++++ b/parse.y +@@ -4796,7 +4796,7 @@ cond_term () + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) +- term->flags |= CMD_INVERT_RETURN; ++ term->flags ^= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word0 == '-' && yylval.word->word1 && yylval.word->word2 == 0 && test_unop (yylval.word->word)) + { +diff --git a/y.tab.c b/y.tab.c +index c11d7aaa..78b38250 100644 +--- a/y.tab.c ++++ b/y.tab.c +@@ -7090,7 +7090,7 @@ cond_term () + dispose_word (yylval.word); /* not needed */ + term = cond_term (); + if (term) +- term->flags |= CMD_INVERT_RETURN; ++ term->flags ^= CMD_INVERT_RETURN; + } + else if (tok == WORD && yylval.word->word0 == '-' && yylval.word->word1 && yylval.word->word2 == 0 && test_unop (yylval.word->word)) + { +-- +2.33.0 +
View file
_service:tar_scm:backport-fix-CVE-2022-3715.patch
Added
@@ -0,0 +1,27 @@ +From 9cef6d01181525de119832d2b6a925899cdec08e Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Fri, 9 Sep 2022 16:44:32 -0400 +Subject: PATCH Bash-5.2-rc4 release + +Conflict:backport partial patch to fix CVE-2022-3715 +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=9cef6d01181525de119832d2b6a925899cdec08e +--- + subst.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/subst.c b/subst.c +index 677eeed..8fd03f3 100644 +--- a/subst.c ++++ b/subst.c +@@ -7959,7 +7959,7 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl + return ((char *)NULL); + } + +- if (valid_parameter_transform (xform) == 0) ++ if (xform0 == 0 || valid_parameter_transform (xform) == 0) + { + this_command_name = oname; + #if 0 /* TAG: bash-5.2 Martin Schulte <gnu@schrader-schulte.de> 10/2020 */ +-- +2.33.0 +
View file
_service:tar_scm:backport-fix-crash-in-readline-when-started-with-an-invalid.patch
Added
@@ -0,0 +1,52 @@ +From a99d905216cc0aac5de0c3050f4afc54e21c6bc5 Mon Sep 17 00:00:00 2001 +From: Chet Ramey <chet.ramey@case.edu> +Date: Wed, 5 Oct 2022 10:37:38 -0400 +Subject: PATCH Bash-5.2 patch 2: fix crash in readline when started with an + invalid locale specification + +--- + lib/readline/nls.c | 8 +++++++- + patchlevel.h | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/lib/readline/nls.c b/lib/readline/nls.c +index d2f67e0..5d1cd19 100644 +--- a/lib/readline/nls.c ++++ b/lib/readline/nls.c +@@ -56,6 +56,8 @@ + + static int utf8locale PARAMS((char *)); + ++#define RL_DEFAULT_LOCALE "C" ++ + #if !defined (HAVE_SETLOCALE) + /* A list of legal values for the LANG or LC_CTYPE environment variables. + If a locale name in this list is the value for the LC_ALL, LC_CTYPE, +@@ -136,7 +138,11 @@ _rl_init_locale (void) + if (lspec == 0) + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ +- ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; ++ + _rl_utf8locale = (ret && *ret) ? utf8locale (ret) : 0; + + return ret; +diff --git a/patchlevel.h b/patchlevel.h +index 10fde2e..17586ff 100644 +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define *PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 8 ++#define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.35.1 +
View file
_service:tar_scm:bash-5.1-sw.patch
Added
@@ -0,0 +1,122 @@ +diff -Nuar bash-5.1.8.org/configure bash-5.1.8.sw/configure +--- bash-5.1.8.org/configure 2021-10-15 16:12:05.691193735 +0800 ++++ bash-5.1.8.sw/configure 2021-10-15 16:32:01.231145759 +0800 +@@ -2890,6 +2890,7 @@ + case "${host_cpu}-${host_os}" in + # mostly obsolete platforms + alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux ++sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux + *Ccray*-*) opt_bash_malloc=no ;; # Crays + *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines + *-dgux*) opt_bash_malloc=no ;; # DG/UX machines +@@ -7875,7 +7876,7 @@ + + # Guess based on the CPU. + case "$host_cpu" in +- alpha* | i3456786 | x86_64 | m68k | s390*) ++ sw_64* | alpha* | i3456786 | x86_64 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; +diff -Nuar bash-5.1.8.org/configure.ac bash-5.1.8.sw/configure.ac +--- bash-5.1.8.org/configure.ac 2021-10-15 16:12:05.727193733 +0800 ++++ bash-5.1.8.sw/configure.ac 2021-10-15 16:32:26.167144759 +0800 +@@ -65,6 +65,7 @@ + case "${host_cpu}-${host_os}" in + # mostly obsolete platforms + alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux ++sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux + *Ccray*-*) opt_bash_malloc=no ;; # Crays + *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines + *-dgux*) opt_bash_malloc=no ;; # DG/UX machines +diff -Nuar bash-5.1.8.org/general.h bash-5.1.8.sw/general.h +--- bash-5.1.8.org/general.h 2021-10-15 16:12:05.726193734 +0800 ++++ bash-5.1.8.sw/general.h 2021-10-15 16:28:55.053153230 +0800 +@@ -57,7 +57,7 @@ + /* Hardly used anymore */ + #define pointer_to_int(x) (int)((char *)x - (char *)0) + +-#if defined (alpha) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__) ++#if (defined (alpha) || defined (sw_64)) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__) + extern char *strchr (), *strrchr (); + #endif + +diff -Nuar bash-5.1.8.org/lib/intl/dcigettext.c bash-5.1.8.sw/lib/intl/dcigettext.c +--- bash-5.1.8.org/lib/intl/dcigettext.c 2021-10-15 16:12:05.686193735 +0800 ++++ bash-5.1.8.sw/lib/intl/dcigettext.c 2021-10-15 16:28:45.480153615 +0800 +@@ -74,7 +74,7 @@ + #ifdef _LIBC + /* Guess whether integer division by zero raises signal SIGFPE. + Set to 1 only if you know for sure. In case of doubt, set to 0. */ +-# if defined __alpha__ || defined __arm__ || defined __i386__ \ ++# if defined __alpha__ || defined __sw_64__ || defined __arm__ || defined __i386__ \ + || defined __m68k__ || defined __s390__ + # define INTDIV0_RAISES_SIGFPE 1 + # else +diff -Nuar bash-5.1.8.org/m4/host-cpu-c-abi.m4 bash-5.1.8.sw/m4/host-cpu-c-abi.m4 +--- bash-5.1.8.org/m4/host-cpu-c-abi.m4 2021-10-15 16:12:05.726193734 +0800 ++++ bash-5.1.8.sw/m4/host-cpu-c-abi.m4 2021-10-15 16:26:05.539160033 +0800 +@@ -91,6 +91,12 @@ + ;; + + changequote(,)dnl ++ sw_64* ) ++changequote(,)dnl ++ gl_cv_host_cpu_c_abi=sw_64 ++ ;; ++ ++changequote(,)dnl + alphaev4-8 | alphaev56 | alphapca567 | alphaev678 ) + changequote(,)dnl + gl_cv_host_cpu_c_abi=alpha +@@ -355,6 +361,9 @@ + #ifndef __x86_64__ + #undef __x86_64__ + #endif ++#ifndef __sw_64__ ++#undef __sw_64__ ++#endif + #ifndef __alpha__ + #undef __alpha__ + #endif +diff -Nuar bash-5.1.8.org/m4/intdiv0.m4 bash-5.1.8.sw/m4/intdiv0.m4 +--- bash-5.1.8.org/m4/intdiv0.m4 2021-10-15 16:12:05.726193734 +0800 ++++ bash-5.1.8.sw/m4/intdiv0.m4 2021-10-15 16:25:19.697161872 +0800 +@@ -69,7 +69,7 @@ + # Guess based on the CPU. + changequote(,)dnl + case "$host_cpu" in +- alpha* | i3456786 | x86_64 | m68k | s390*) ++ sw_64* | alpha* | i3456786 | x86_64 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; +diff -Nuar bash-5.1.8.org/support/config.guess bash-5.1.8.sw/support/config.guess +--- bash-5.1.8.org/support/config.guess 2021-10-15 16:12:05.690193735 +0800 ++++ bash-5.1.8.sw/support/config.guess 2021-10-15 16:21:57.441169989 +0800 +@@ -924,6 +924,14 @@ + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; ++ sw_64:Linux:*:*) ++ case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ echo "$UNAME_MACHINE"-sunway-linux-"$LIBC" ++ exit ;; + alpha:Linux:*:*) + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + EV5) UNAME_MACHINE=alphaev5 ;; +diff -Nuar bash-5.1.8.org/support/config.sub bash-5.1.8.sw/support/config.sub +--- bash-5.1.8.org/support/config.sub 2021-10-15 16:12:05.690193735 +0800 ++++ bash-5.1.8.sw/support/config.sub 2021-10-15 16:18:49.228177541 +0800 +@@ -1160,6 +1160,7 @@ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ ++ | sw_64 \ + | alpha | alphaev4-8 | alphaev56 | alphaev678 \ + | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 \ + | alphapca567 | alpha64pca567 \
View file
_service:tar_scm:bugfix-Forbidden-non-root-user-to-clear-history.patch
Changed
@@ -4,23 +4,66 @@ Subject: PATCH bugfix-Forbidden-non-root-user-to-clear-history --- - lib/readline/history.c | 4 ++++ - 1 file changed, 4 insertions(+) + bashhist.c | 5 +++-- + lib/readline/history.c | 8 +++++++- + lib/readline/history.h | 2 +- + 3 files changed, 11 insertions(+), 4 deletions(-) +diff --git a/bashhist.c b/bashhist.c +index d2155dc..e61bde6 100644 +--- a/bashhist.c ++++ b/bashhist.c +@@ -345,8 +345,9 @@ load_history () + void + bash_clear_history () + { +- clear_history (); +- history_lines_this_session = 0; ++ int ret = clear_history (); ++ if (ret == 0) ++ history_lines_this_session = 0; + /* XXX - reset history_lines_read_from_file? */ + } + diff --git a/lib/readline/history.c b/lib/readline/history.c -index 67158b1..8bc6a00 100644 +index 67158b1..3c1652b 100644 --- a/lib/readline/history.c +++ b/lib/readline/history.c -@@ -594,6 +594,10 @@ void +@@ -590,9 +590,14 @@ history_is_stifled (void) + return (history_stifled); + } + +-void ++int clear_history (void) { - register int i; + uid_t uid = getuid(); + + if (uid) -+ return; ++ return 1; ++ + register int i; /* This loses because we cannot free the data. */ - for (i = 0; i < history_length; i++) +@@ -604,4 +609,5 @@ clear_history (void) + + history_offset = history_length = 0; + history_base = 1; /* reset history base to default */ ++ return 0; + } +diff --git a/lib/readline/history.h b/lib/readline/history.h +index cc3de29..78f8f52 100644 +--- a/lib/readline/history.h ++++ b/lib/readline/history.h +@@ -110,7 +110,7 @@ extern histdata_t free_history_entry PARAMS((HIST_ENTRY *)); + extern HIST_ENTRY *replace_history_entry PARAMS((int, const char *, histdata_t)); + + /* Clear the history list and start over. */ +-extern void clear_history PARAMS((void)); ++extern int clear_history PARAMS((void)); + + /* Stifle the history list, remembering only MAX number of entries. */ + extern void stifle_history PARAMS((int)); -- -2.19.1 +2.27.0 +
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/bash.git</param> - <param name="revision">2d40b9c913f3918fc628b55d7eb31d365f98add7</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2