summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_su
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Completion/Unix/Command/_su
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Completion/Unix/Command/_su')
-rw-r--r--Completion/Unix/Command/_su8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su
index 032f867f4..1af751a17 100644
--- a/Completion/Unix/Command/_su
+++ b/Completion/Unix/Command/_su
@@ -35,7 +35,7 @@ case $OSTYPE in
;|
*bsd*|dragonfly*)
args+=(
- '-c+[use settings from specified login class]:class'
+ '-c+[use settings from specified login class]:class:_login_classes'
)
;|
freebsd*) args+=( '-s[set the MAC label]' ) ;;
@@ -63,6 +63,12 @@ if (( $words[(i)-] < CURRENT )); then
norm=2
fi
+# This is set so that _command_names will understand that we're completing for
+# a privileged command, but _call_program won't actually prepend anything to
+# commands if gain-privileges is enabled (which would be undesirable here since
+# su always prompts for a password). We delay setting it until this point so it
+# doesn't cause issues for the check above
+local -a _comp_priv_prefix=( '' )
_arguments $args ${(e)first} "*:shell arguments:= ->rest" && return
usr=${${(Q)line[norm]}/--/root}