forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys-apps/util-linux: Revbump fix bash-completion umount code execution
Committed straight to stable. Bug: https://bugs.gentoo.org/649812 Package-Manager: Portage-2.3.24, Repoman-2.3.6
- Loading branch information
Lars Wendler
committed
Mar 7, 2018
1 parent
c7127c9
commit da1d162
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
sys-apps/util-linux/files/util-linux-2.32_rc2-umount_completion.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 75f03badd7ed9f1dd951863d75e756883d3acc55 Mon Sep 17 00:00:00 2001 | ||
From: Karel Zak <[email protected]> | ||
Date: Thu, 16 Nov 2017 16:27:32 +0100 | ||
Subject: [PATCH] bash-completion: (umount) use findmnt, escape a space in | ||
paths | ||
|
||
# mount /dev/sdc1 /mnt/test/foo\ bar | ||
# umount <tab> | ||
|
||
has to return "/mnt/test/foo\ bar". | ||
|
||
Changes: | ||
|
||
* don't use mount | awk output, we have findmnt | ||
* force compgen use \n as entries separator | ||
|
||
Addresses: https://github.com/karelzak/util-linux/issues/539 | ||
Signed-off-by: Karel Zak <[email protected]> | ||
--- | ||
bash-completion/umount | 9 +++++---- | ||
1 file changed, 5 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/bash-completion/umount b/bash-completion/umount | ||
index d76cb9fff..98c90d61a 100644 | ||
--- a/bash-completion/umount | ||
+++ b/bash-completion/umount | ||
@@ -40,9 +40,10 @@ _umount_module() | ||
return 0 | ||
;; | ||
esac | ||
- local DEVS_MPOINTS | ||
- DEVS_MPOINTS="$(mount | awk '{print $1, $3}')" | ||
- COMPREPLY=( $(compgen -W "$DEVS_MPOINTS" -- $cur) ) | ||
- return 0 | ||
+ | ||
+ local oldifs=$IFS | ||
+ IFS=$'\n' | ||
+ COMPREPLY=( $( compgen -W '$(findmnt -lno TARGET | sed "s/\([[:blank:]]\)/\\\\\1/g")' -- "$cur" ) ) | ||
+ IFS=$oldifs | ||
} | ||
complete -F _umount_module umount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters