with icon indicating copy to clipboard operation
with copied to clipboard

Do not source /* if BASH_COMPLETION_COMPAT_DIR is unset

Open Syphdias opened this issue 4 years ago • 2 comments

If BASH_COMPLETION_COMPAT_DIR was unset it tried to source /* wich lead to repl not showing up if there were files in / that lead no termination of sourcing. This could potentially do harm if there is a harmful script in /.

$BASH_COMPLETION_DEFAULT_DIR/* will now only be sourced if BASH_COMPLETION_DEFAULT_DIR is set and is not empty.

Syphdias avatar May 10 '20 10:05 Syphdias

Pinging @dragonator since he original implemented these lines

Syphdias avatar May 10 '20 10:05 Syphdias

Example what cause the problem for me:

❯ ls /*(.) -l
-rw-r--r-- 1 root root 19004 Sep 12  2019 /desktopfs-pkgs.txt
-rw-r--r-- 1 root root  4069 Sep 12  2019 /rootfs-pkgs.txt
❯ head /*(.)
==> /desktopfs-pkgs.txt <==
a52dec 0.7.4-10
aalib 1.4rc5-13
accountsservice 0.6.55-1
acl 2.2.53-1
acpi 1.7-2
acpid 2.0.31-1
adapta-maia-theme 3.94.0.149-2
adobe-source-code-pro-fonts 2.030ro+1.050it-5
adwaita-icon-theme 3.32.0-1
alsa-firmware 1.0.29-2

==> /rootfs-pkgs.txt <==
acl 2.2.53-1
acpi 1.7-2
acpid 2.0.31-1
amd-ucode 20190815.07b925b-1
archlinux-keyring 20190827-1
argon2 20190702-1
attr 2.4.48-1
audit 2.8.5-3
b43-fwcutter 019-2
bash 5.0.009-1

PS: This uses zsh globbing, ignore it.

Syphdias avatar May 10 '20 10:05 Syphdias