Complete capabilites with and without "CAP_" prefix.

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 015cb98846)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Harald Albers 2020-09-04 11:09:16 +02:00 committed by Sebastiaan van Stijn
parent cd8016b6bc
commit 75411a2233
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 43 additions and 41 deletions

View File

@ -831,55 +831,57 @@ __docker_complete_local_ips() {
# not granted by default and may be added. # not granted by default and may be added.
# see https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities # see https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities
__docker_complete_capabilities_addable() { __docker_complete_capabilities_addable() {
COMPREPLY=( $( compgen -W " local capabilities=(
ALL ALL
AUDIT_CONTROL CAP_AUDIT_CONTROL
BLOCK_SUSPEND CAP_BLOCK_SUSPEND
DAC_READ_SEARCH CAP_DAC_READ_SEARCH
IPC_LOCK CAP_IPC_LOCK
IPC_OWNER CAP_IPC_OWNER
LEASE CAP_LEASE
LINUX_IMMUTABLE CAP_LINUX_IMMUTABLE
MAC_ADMIN CAP_MAC_ADMIN
MAC_OVERRIDE CAP_MAC_OVERRIDE
NET_ADMIN CAP_NET_ADMIN
NET_BROADCAST CAP_NET_BROADCAST
SYS_ADMIN CAP_SYS_ADMIN
SYS_BOOT CAP_SYS_BOOT
SYSLOG CAP_SYSLOG
SYS_MODULE CAP_SYS_MODULE
SYS_NICE CAP_SYS_NICE
SYS_PACCT CAP_SYS_PACCT
SYS_PTRACE CAP_SYS_PTRACE
SYS_RAWIO CAP_SYS_RAWIO
SYS_RESOURCE CAP_SYS_RESOURCE
SYS_TIME CAP_SYS_TIME
SYS_TTY_CONFIG CAP_SYS_TTY_CONFIG
WAKE_ALARM CAP_WAKE_ALARM
" -- "$cur" ) ) )
COMPREPLY=( $( compgen -W "${capabilities[*]} ${capabilities[*]#CAP_}" -- "$cur" ) )
} }
# __docker_complete_capabilities_droppable completes Linux capability options which are # __docker_complete_capabilities_droppable completes Linux capability options which are
# allowed by default and can be dropped. # allowed by default and can be dropped.
# see https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities # see https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities
__docker_complete_capabilities_droppable() { __docker_complete_capabilities_droppable() {
COMPREPLY=( $( compgen -W " local capabilities=(
ALL ALL
AUDIT_WRITE CAP_AUDIT_WRITE
CHOWN CAP_CHOWN
DAC_OVERRIDE CAP_DAC_OVERRIDE
FOWNER CAP_FOWNER
FSETID CAP_FSETID
KILL CAP_KILL
MKNOD CAP_MKNOD
NET_BIND_SERVICE CAP_NET_BIND_SERVICE
NET_RAW CAP_NET_RAW
SETFCAP CAP_SETFCAP
SETGID CAP_SETGID
SETPCAP CAP_SETPCAP
SETUID CAP_SETUID
SYS_CHROOT CAP_SYS_CHROOT
" -- "$cur" ) ) )
COMPREPLY=( $( compgen -W "${capabilities[*]} ${capabilities[*]#CAP_}" -- "$cur" ) )
} }
__docker_complete_detach_keys() { __docker_complete_detach_keys() {