From 780d28c9f4b00d752cf4b7f1af43154ef754c2c6 Mon Sep 17 00:00:00 2001 From: Renbo Date: Tue, 2 Jul 2024 11:44:51 +0800 Subject: [PATCH 1/2] update to bash-4.4.20-5.src.rpm Signed-off-by: Renbo --- bash-3.2-audit.patch | 96 -------------------------------------------- bash-4.3-audit.patch | 12 ++++++ bash-4.4-sw.patch | 67 ------------------------------- bash.spec | 14 ++++--- dist | 1 + 5 files changed, 21 insertions(+), 169 deletions(-) delete mode 100644 bash-3.2-audit.patch create mode 100644 bash-4.3-audit.patch delete mode 100644 bash-4.4-sw.patch create mode 100644 dist diff --git a/bash-3.2-audit.patch b/bash-3.2-audit.patch deleted file mode 100644 index 48a1751..0000000 --- a/bash-3.2-audit.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -up bash-4.2/config.h.in.audit bash-4.2/config.h.in ---- bash-4.2/config.h.in.audit 2013-01-31 16:26:16.857698992 +0100 -+++ bash-4.2/config.h.in 2013-01-31 16:26:16.876699255 +0100 -@@ -1131,6 +1131,14 @@ - - /* End additions for lib/intl */ - -+ -+/* Additions for lib/readline */ -+ -+/* Define if you have and it defines AUDIT_USER_TTY */ -+#undef HAVE_DECL_AUDIT_USER_TTY -+ -+/* End additions for lib/readline */ -+ - #include "config-bot.h" - - #endif /* _CONFIG_H_ */ -diff -up bash-4.2/configure.in.audit bash-4.2/configure.in ---- bash-4.2/configure.in.audit 2013-01-31 16:26:16.858699005 +0100 -+++ bash-4.2/configure.ac 2013-01-31 16:26:16.877699269 +0100 -@@ -888,6 +888,8 @@ BASH_FUNC_DUP2_CLOEXEC_CHECK - BASH_SYS_PGRP_SYNC - BASH_SYS_SIGNAL_VINTAGE - -+AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include ]]) -+ - dnl checking for the presence of certain library symbols - BASH_SYS_ERRLIST - BASH_SYS_SIGLIST -diff -up bash-4.2/lib/readline/readline.c.audit bash-4.2/lib/readline/readline.c ---- bash-4.2/lib/readline/readline.c.audit 2013-01-31 16:26:16.871699185 +0100 -+++ bash-4.2/lib/readline/readline.c 2013-01-31 17:24:23.902744860 +0100 -@@ -55,6 +55,12 @@ - extern int errno; - #endif /* !errno */ - -+#if defined (HAVE_DECL_AUDIT_USER_TTY) -+# include -+# include -+# include -+#endif -+ - /* System-specific feature definitions and include files. */ - #include "rldefs.h" - #include "rlmbutil.h" -@@ -301,7 +307,48 @@ rl_set_prompt (prompt) - rl_visible_prompt_length = rl_expand_prompt (rl_prompt); - return 0; - } -- -+ -+#if defined (HAVE_DECL_AUDIT_USER_TTY) -+/* Report STRING to the audit system. */ -+static void -+audit_tty (char *string) -+{ -+ struct sockaddr_nl addr; -+ struct msghdr msg; -+ struct nlmsghdr nlm; -+ struct iovec iov[2]; -+ size_t size; -+ int fd; -+ -+ size = strlen (string) + 1; -+ fd = socket (AF_NETLINK, SOCK_RAW, NETLINK_AUDIT); -+ if (fd < 0) -+ return; -+ 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; -+ iov[0].iov_base = &nlm; -+ iov[0].iov_len = sizeof (nlm); -+ iov[1].iov_base = string; -+ iov[1].iov_len = size; -+ addr.nl_family = AF_NETLINK; -+ addr.nl_pad = 0; -+ 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); -+ close (fd); -+} -+#endif -+ - /* Read a line of input. Prompt with PROMPT. An empty PROMPT means - none. A return value of NULL means that EOF was encountered. */ - char * diff --git a/bash-4.3-audit.patch b/bash-4.3-audit.patch new file mode 100644 index 0000000..9270403 --- /dev/null +++ b/bash-4.3-audit.patch @@ -0,0 +1,12 @@ +diff --git a/lib/readline/rlconf.h b/lib/readline/rlconf.h +--- a/lib/readline/rlconf.h ++++ b/lib/readline/rlconf.h +@@ -64,7 +64,7 @@ + + /* Define this if you want to enable code that talks to the Linux kernel + tty auditing system. */ +-/* #define ENABLE_TTY_AUDIT_SUPPORT */ ++#define ENABLE_TTY_AUDIT_SUPPORT + + /* Defaults for the various editing mode indicators, inserted at the beginning + of the last (maybe only) line of the prompt if show-mode-in-prompt is on */ diff --git a/bash-4.4-sw.patch b/bash-4.4-sw.patch deleted file mode 100644 index 3bfde47..0000000 --- a/bash-4.4-sw.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -Naur bash-4.4.org/aclocal.m4 bash-4.4.sw/aclocal.m4 ---- bash-4.4.org/aclocal.m4 2023-05-12 17:24:14.286188860 +0800 -+++ bash-4.4.sw/aclocal.m4 2023-05-12 17:25:08.259079310 +0800 -@@ -2660,7 +2660,7 @@ - [ - # Guess based on the CPU. - case "$host_cpu" in -- alpha* | i[34567]86 | m68k | s390*) -+ sw_64* | alpha* | i[34567]86 | m68k | s390*) - gt_cv_int_divbyzero_sigfpe="guessing yes";; - *) - gt_cv_int_divbyzero_sigfpe="guessing no";; -diff -Naur bash-4.4.org/configure bash-4.4.sw/configure ---- bash-4.4.org/configure 2016-09-08 04:57:01.000000000 +0800 -+++ bash-4.4.sw/configure 2023-05-12 17:25:49.091509507 +0800 -@@ -2842,6 +2842,7 @@ - #htmldir= - - case "${host_cpu}-${host_os}" in -+sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux - alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux - *[Cc]ray*-*) opt_bash_malloc=no ;; # Crays - *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines -@@ -7228,7 +7229,7 @@ - - # Guess based on the CPU. - case "$host_cpu" in -- alpha* | i3456786 | m68k | s390*) -+ sw_64* | alpha* | i3456786 | m68k | s390*) - gt_cv_int_divbyzero_sigfpe="guessing yes";; - *) - gt_cv_int_divbyzero_sigfpe="guessing no";; -diff -Naur bash-4.4.org/configure.ac bash-4.4.sw/configure.ac ---- bash-4.4.org/configure.ac 2023-05-12 17:24:14.355191277 +0800 -+++ bash-4.4.sw/configure.ac 2023-05-12 17:26:14.230390019 +0800 -@@ -64,6 +64,7 @@ - dnl look in the NOTES file for more - case "${host_cpu}-${host_os}" in - alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux -+sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux - *[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays - *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines - sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 -diff -Naur bash-4.4.org/general.h bash-4.4.sw/general.h ---- bash-4.4.org/general.h 2016-08-11 23:17:13.000000000 +0800 -+++ bash-4.4.sw/general.h 2023-05-12 17:27:08.100276860 +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 -Naur bash-4.4.org/lib/intl/dcigettext.c bash-4.4.sw/lib/intl/dcigettext.c ---- bash-4.4.org/lib/intl/dcigettext.c 2009-01-05 03:32:30.000000000 +0800 -+++ bash-4.4.sw/lib/intl/dcigettext.c 2023-05-12 17:27:42.849493985 +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 --git a/bash.spec b/bash.spec index 71006ac..3e649cc 100644 --- a/bash.spec +++ b/bash.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 #% define beta_tag rc2 %global _hardened_build 1 %define patchleveltag .20 @@ -8,7 +7,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 4%{?anolis_release}%{?dist} +Release: 5%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/bash Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -33,7 +32,6 @@ Patch105: bash-2.05b-debuginfo.patch Patch106: bash-2.05b-manso.patch Patch107: bash-2.05b-pgrp_sync.patch Patch108: bash-2.05b-xcc.patch -Patch109: bash-3.2-audit.patch Patch110: bash-3.2-ssh_source_bash.patch Patch112: bash-infotags.patch Patch113: bash-requires.patch @@ -118,11 +116,14 @@ Patch138: bash-5.0-histtimeformat-segfault.patch #2062291 - Segfault in 'buffered_getchar()' function in bash Patch139: bash-4.4-fix-buffered_getchar-crash.patch -Patch140: bash-4.4-sw.patch + +# Enable audit logs +Patch140: bash-4.3-audit.patch BuildRequires: texinfo bison BuildRequires: ncurses-devel BuildRequires: autoconf, gettext +BuildRequires: audit-libs-devel Requires: filesystem >= 3 Provides: /bin/sh Provides: /bin/bash @@ -343,8 +344,9 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog -* Fri May 12 2023 wxiat - 4.4.20-4.0.1 -- add sw patch +* Fri Feb 09 2024 Siteshwar Vashisht - 4.4.20-5 +- Restore audit logs in bash-4.3 or newer versions + Resolves: RHEL-24990 * Tue Apr 05 2022 Siteshwar Vashisht - 4.4.20-4 - Fix a crash in buffered_getchar() function diff --git a/dist b/dist new file mode 100644 index 0000000..9c0e36e --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8 -- Gitee From 0d9132bad09c7da2ae2a7f796c331a22177d045e Mon Sep 17 00:00:00 2001 From: khy Date: Fri, 12 May 2023 17:36:50 +0800 Subject: [PATCH 2/2] sw 20230512 Signed-off-by: Weisson --- bash-4.4-sw.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++++ bash.spec | 7 ++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 bash-4.4-sw.patch diff --git a/bash-4.4-sw.patch b/bash-4.4-sw.patch new file mode 100644 index 0000000..3bfde47 --- /dev/null +++ b/bash-4.4-sw.patch @@ -0,0 +1,67 @@ +diff -Naur bash-4.4.org/aclocal.m4 bash-4.4.sw/aclocal.m4 +--- bash-4.4.org/aclocal.m4 2023-05-12 17:24:14.286188860 +0800 ++++ bash-4.4.sw/aclocal.m4 2023-05-12 17:25:08.259079310 +0800 +@@ -2660,7 +2660,7 @@ + [ + # Guess based on the CPU. + case "$host_cpu" in +- alpha* | i[34567]86 | m68k | s390*) ++ sw_64* | alpha* | i[34567]86 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; +diff -Naur bash-4.4.org/configure bash-4.4.sw/configure +--- bash-4.4.org/configure 2016-09-08 04:57:01.000000000 +0800 ++++ bash-4.4.sw/configure 2023-05-12 17:25:49.091509507 +0800 +@@ -2842,6 +2842,7 @@ + #htmldir= + + case "${host_cpu}-${host_os}" in ++sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux + alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux + *[Cc]ray*-*) opt_bash_malloc=no ;; # Crays + *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines +@@ -7228,7 +7229,7 @@ + + # Guess based on the CPU. + case "$host_cpu" in +- alpha* | i3456786 | m68k | s390*) ++ sw_64* | alpha* | i3456786 | m68k | s390*) + gt_cv_int_divbyzero_sigfpe="guessing yes";; + *) + gt_cv_int_divbyzero_sigfpe="guessing no";; +diff -Naur bash-4.4.org/configure.ac bash-4.4.sw/configure.ac +--- bash-4.4.org/configure.ac 2023-05-12 17:24:14.355191277 +0800 ++++ bash-4.4.sw/configure.ac 2023-05-12 17:26:14.230390019 +0800 +@@ -64,6 +64,7 @@ + dnl look in the NOTES file for more + case "${host_cpu}-${host_os}" in + alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux ++sw_64*-*) opt_bash_malloc=no ;; # sw_64 running osf/1 or linux + *[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays + *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines + sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2 +diff -Naur bash-4.4.org/general.h bash-4.4.sw/general.h +--- bash-4.4.org/general.h 2016-08-11 23:17:13.000000000 +0800 ++++ bash-4.4.sw/general.h 2023-05-12 17:27:08.100276860 +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 -Naur bash-4.4.org/lib/intl/dcigettext.c bash-4.4.sw/lib/intl/dcigettext.c +--- bash-4.4.org/lib/intl/dcigettext.c 2009-01-05 03:32:30.000000000 +0800 ++++ bash-4.4.sw/lib/intl/dcigettext.c 2023-05-12 17:27:42.849493985 +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 --git a/bash.spec b/bash.spec index 3e649cc..e21b181 100644 --- a/bash.spec +++ b/bash.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 #% define beta_tag rc2 %global _hardened_build 1 %define patchleveltag .20 @@ -7,7 +8,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 5%{?dist} +Release: 5%{?anolis_release}%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/bash Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -116,6 +117,7 @@ Patch138: bash-5.0-histtimeformat-segfault.patch #2062291 - Segfault in 'buffered_getchar()' function in bash Patch139: bash-4.4-fix-buffered_getchar-crash.patch +Patch1000: bash-4.4-sw.patch # Enable audit logs Patch140: bash-4.3-audit.patch @@ -344,6 +346,9 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Tue Jul 02 2024 wxiat - 4.4.20-5.0.1 +- add sw patch + * Fri Feb 09 2024 Siteshwar Vashisht - 4.4.20-5 - Restore audit logs in bash-4.3 or newer versions Resolves: RHEL-24990 -- Gitee