slackware-current/source/a/bash/bash-4.4-patches/bash44-007
Patrick J Volkerding 646a5c1cbf Mon May 28 19:12:29 UTC 2018
a/pkgtools-15.0-noarch-13.txz:  Rebuilt.
  installpkg: default line length for --terselength is the number of columns.
  removepkg: added --terse mode.
  upgradepkg: default line length for --terselength is the number of columns.
  upgradepkg: accept -option in addition to --option.
ap/vim-8.1.0026-x86_64-1.txz:  Upgraded.
d/bison-3.0.5-x86_64-1.txz:  Upgraded.
e/emacs-26.1-x86_64-1.txz:  Upgraded.
kde/kopete-4.14.3-x86_64-8.txz:  Rebuilt.
  Recompiled against libidn-1.35.
n/conntrack-tools-1.4.5-x86_64-1.txz:  Upgraded.
n/libnetfilter_conntrack-1.0.7-x86_64-1.txz:  Upgraded.
n/libnftnl-1.1.0-x86_64-1.txz:  Upgraded.
n/links-2.16-x86_64-2.txz:  Rebuilt.
  Rebuilt to enable X driver for -g mode.
n/lynx-2.8.9dev.19-x86_64-1.txz:  Upgraded.
n/nftables-0.8.5-x86_64-1.txz:  Upgraded.
n/p11-kit-0.23.11-x86_64-1.txz:  Upgraded.
n/ulogd-2.0.7-x86_64-1.txz:  Upgraded.
n/whois-5.3.1-x86_64-1.txz:  Upgraded.
xap/network-manager-applet-1.8.12-x86_64-1.txz:  Upgraded.
xap/vim-gvim-8.1.0026-x86_64-1.txz:  Upgraded.
2018-05-31 23:39:35 +02:00

151 lines
4.5 KiB
Text

BASH PATCH REPORT
=================
Bash-Release: 4.4
Patch-ID: bash44-007
Bug-Reported-by: Jens Heyens <jens.heyens@cispa.saarland>
Bug-Reference-ID:
Bug-Reference-URL: https://savannah.gnu.org/support/?109224
Bug-Description:
When performing filename completion, bash dequotes the directory name being
completed, which can result in match failures and potential unwanted
expansion.
Patch (apply with `patch -p0'):
*** ../bash-4.4-patched/bashline.c 2016-08-05 21:44:05.000000000 -0400
--- bashline.c 2017-01-19 13:15:51.000000000 -0500
***************
*** 143,147 ****
static void restore_directory_hook __P((rl_icppfunc_t));
! static int directory_exists __P((const char *));
static void cleanup_expansion_error __P((void));
--- 144,148 ----
static void restore_directory_hook __P((rl_icppfunc_t));
! static int directory_exists __P((const char *, int));
static void cleanup_expansion_error __P((void));
***************
*** 3103,3111 ****
}
! /* Check whether not the (dequoted) version of DIRNAME, with any trailing slash
! removed, exists. */
static int
! directory_exists (dirname)
const char *dirname;
{
char *new_dirname;
--- 3107,3116 ----
}
! /* Check whether not DIRNAME, with any trailing slash removed, exists. If
! SHOULD_DEQUOTE is non-zero, we dequote the directory name first. */
static int
! directory_exists (dirname, should_dequote)
const char *dirname;
+ int should_dequote;
{
char *new_dirname;
***************
*** 3113,3118 ****
struct stat sb;
! /* First, dequote the directory name */
! new_dirname = bash_dequote_filename ((char *)dirname, rl_completion_quote_character);
dirlen = STRLEN (new_dirname);
if (new_dirname[dirlen - 1] == '/')
--- 3118,3124 ----
struct stat sb;
! /* We save the string and chop the trailing slash because stat/lstat behave
! inconsistently if one is present. */
! new_dirname = should_dequote ? bash_dequote_filename ((char *)dirname, rl_completion_quote_character) : savestring (dirname);
dirlen = STRLEN (new_dirname);
if (new_dirname[dirlen - 1] == '/')
***************
*** 3146,3150 ****
should_expand_dirname = '`';
! if (should_expand_dirname && directory_exists (local_dirname))
should_expand_dirname = 0;
--- 3152,3156 ----
should_expand_dirname = '`';
! if (should_expand_dirname && directory_exists (local_dirname, 0))
should_expand_dirname = 0;
***************
*** 3156,3160 ****
global_nounset = unbound_vars_is_error;
unbound_vars_is_error = 0;
! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE); /* does the right thing */
unbound_vars_is_error = global_nounset;
if (wl)
--- 3162,3166 ----
global_nounset = unbound_vars_is_error;
unbound_vars_is_error = 0;
! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE); /* does the right thing */
unbound_vars_is_error = global_nounset;
if (wl)
***************
*** 3245,3249 ****
}
! if (should_expand_dirname && directory_exists (local_dirname))
should_expand_dirname = 0;
--- 3262,3266 ----
}
! if (should_expand_dirname && directory_exists (local_dirname, 1))
should_expand_dirname = 0;
***************
*** 3251,3255 ****
{
new_dirname = savestring (local_dirname);
! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE); /* does the right thing */
if (wl)
{
--- 3268,3272 ----
{
new_dirname = savestring (local_dirname);
! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE); /* does the right thing */
if (wl)
{
*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400
--- subst.c 2017-01-19 07:09:57.000000000 -0500
***************
*** 9459,9462 ****
--- 9459,9466 ----
if (word->flags & W_COMPLETE)
tword->flags |= W_COMPLETE; /* for command substitutions */
+ if (word->flags & W_NOCOMSUB)
+ tword->flags |= W_NOCOMSUB;
+ if (word->flags & W_NOPROCSUB)
+ tword->flags |= W_NOPROCSUB;
temp = (char *)NULL;
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 6
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 7
#endif /* _PATCHLEVEL_H_ */