diff --git a/debian/changelog b/debian/changelog index a7b619a0..dff95c0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +bash (5.1-6ubuntu2) kinetic; urgency=medium + + * Ensure --rcfile prevents execution of the system-wide /etc/bash.bashrc + as well as the user ~/.bashrc (LP: #1097467) + + -- Dave Jones Tue, 23 Aug 2022 22:06:16 +0100 + bash (5.1-6ubuntu1) jammy; urgency=medium * Merge with Debian; remaining changes: diff --git a/debian/patches/fix-rcfile-system.diff b/debian/patches/fix-rcfile-system.diff new file mode 100644 index 00000000..e51424e6 --- /dev/null +++ b/debian/patches/fix-rcfile-system.diff @@ -0,0 +1,30 @@ +--- a/shell.c ++++ b/shell.c +@@ -1119,10 +1119,11 @@ run_startup_files () + if ((run_by_ssh || isnetconn (fileno (stdin))) && shell_level < 2) + { + #ifdef SYS_BASHRC ++ if (bashrc_file == DEFAULT_BASHRC) + # if defined (__OPENNT) +- maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); ++ maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); + # else +- maybe_execute_file (SYS_BASHRC, 1); ++ maybe_execute_file (SYS_BASHRC, 1); + # endif + #endif + maybe_execute_file (bashrc_file, 1); +@@ -1204,10 +1205,11 @@ run_startup_files () + if (act_like_sh == 0 && no_rc == 0) + { + #ifdef SYS_BASHRC ++ if (bashrc_file == DEFAULT_BASHRC) + # if defined (__OPENNT) +- maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); ++ maybe_execute_file (_prefixInstallPath(SYS_BASHRC, NULL, 0), 1); + # else +- maybe_execute_file (SYS_BASHRC, 1); ++ maybe_execute_file (SYS_BASHRC, 1); + # endif + #endif + maybe_execute_file (bashrc_file, 1); diff --git a/debian/patches/series b/debian/patches/series index 5c9b77c0..98244d14 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -34,3 +34,4 @@ use-system-texi2html.diff bzero.diff man-macro-warnings.diff man-vx-opts.diff +fix-rcfile-system.diff