From 93b02dcec4d55b406f1cdd127577e3ca1df58c28 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 29 Mar 2019 17:43:03 -0500 Subject: [PATCH] Don't use camcontrol in FreeBSD zpool completions It requires root/su privileges to list devices, and we have a great alternative that already produces the desired results. --- share/completions/zpool.fish | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/share/completions/zpool.fish b/share/completions/zpool.fish index 933660100..fc93826c6 100644 --- a/share/completions/zpool.fish +++ b/share/completions/zpool.fish @@ -46,10 +46,7 @@ function __fish_zpool_list_available_vdevs if test $OS = 'Linux' find /dev -type b | string replace '/dev/' '' else if test $OS = 'FreeBSD' - for i in (camcontrol devlist | cut -d "(" -f 2 | cut -d "," -f 1) - set -l files /dev/* - string replace /dev/ '' -- $files | string match -r "^$i" - end + sysctl -an kern.disks | string split ' ' else if test $OS = 'SunOS' find /dev/dsk -type b | string replace '/dev/' '' end