From 8011fe8a582bd3c018a98e0e2c08f65233bcf0fc Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 11 Sep 2016 13:22:35 +0200 Subject: 39261 (tweaked cf. Daniel: 39275): don't unconditionally elevate privileges with sudo in completion functions A new gain-privileges style enables it and a _comp_priv_prefix array added for tracking how to match privileges for the current command --- Completion/Solaris/Command/_pfexec | 2 +- Completion/Solaris/Command/_zlogin | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'Completion/Solaris') diff --git a/Completion/Solaris/Command/_pfexec b/Completion/Solaris/Command/_pfexec index 227336223..3f1f3e733 100644 --- a/Completion/Solaris/Command/_pfexec +++ b/Completion/Solaris/Command/_pfexec @@ -25,7 +25,7 @@ _pfexec() { _arguments \ '-P[privileges to acquire]:privspec:_privset' \ '(-):command name: _command_names -e' \ - '*::arguments: _normal' + '*::arguments:{ _comp_priv_prefix=( $words[1] ${(kv)opt_args[-P]} ) ; _normal }' } _pfexec "$@" diff --git a/Completion/Solaris/Command/_zlogin b/Completion/Solaris/Command/_zlogin index 04018eb87..065f55b03 100644 --- a/Completion/Solaris/Command/_zlogin +++ b/Completion/Solaris/Command/_zlogin @@ -1,6 +1,8 @@ #compdef zlogin # Synced with the Nevada build 162 man page +local -a _comp_priv_prefix + _zlogin() { _arguments -s \ '-E[Disable escape character]' \ -- cgit 1.4.1