diff options
46 files changed, 444 insertions, 187 deletions
@@ -1,3 +1,98 @@ +2018-09-03 Daniel Shahaf <d.s@daniel.shahaf.name> + + * unposted: Config/version.mk: Release 5.6. + +2018-09-03 Anthony Sottile <asottile@umich.edu> + + * CVE-2018-0502, CVE-2018-13259: Fix two security issues in + shebang line parsing. [With Buck Evan] + +2018-09-03 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 43367: Makefile.in: Add maintainer targets 'tarxz-src' and + 'targz-src'. + +2018-09-03 Oliver Kiddle <okiddle@yahoo.co.uk> + + * unposted: NEWS: mention Inf/NaN floating point changes + + * unposted: Makefile.in: further to 43358 use same patchlevel + form for the release file + +2018-09-03 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 43333: Etc/Makefile.in: Generate FAQ.html in the builddir, + rather than in the srcdir, and add it to the default target of + the Etc/ subdirectory. + +2018-09-03 Peter Stephenson <p.stephenson@samsung.com> + + * 43365: Src/Zle/zle_keymap.c, Src/Zle/zle_main.c, + Src/Zle/zle_misc.c, Src/Zle/zle_vi.c: Don't handle ZLE timed + functions if just reading a single key. + +2018-08-31 Oliver Kiddle <okiddle@yahoo.co.uk> + + * 43358: Src/zsh.mdd: enforce consistent patchlevel form + + * 43357: configure.ac: isinf/isnan can be macros rather + than functions so need a custom configure test + + * unposted: Completion/Unix/Command/_git: git describe's + --long and --abbrev options are not mutually exclusive + + * 43359: Completion/Unix/Command/_git: + further review of git remote set-url completion + + * 42810: pseyfert: Completion/Unix/Command/_git: + git remote set-url completion + +2018-08-30 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 43349: Completion/X/Command/_eog: new completion for eog + + * 43350: Completion/Unix/Command/_zsh: support --emulate + +2018-08-29 Oliver Kiddle <okiddle@yahoo.co.uk> + + * 43351: Completion/Unix/Type/_diff_options: handle the new + diff implementation in the pre-release version of FreeBSD 12 + + * 43346: Completion/Linux/Command/_cryptsetup, + Completion/Linux/Command/_networkmanager, + Completion/Linux/Command/_strace, Completion/Unix/Command/_attr, + Completion/Linux/Command/_sysstat, Completion/Unix/Command/_cmp, + Completion/Unix/Command/_dhclient, Completion/Unix/Command/_dig, + Completion/Unix/Command/_entr, Completion/Unix/Command/_gnutls, + Completion/Unix/Command/_env, Completion/Unix/Command/_iostat, + Completion/Unix/Command/_ln, Completion/Unix/Command/_md5sum, + Completion/Unix/Command/_ps, Completion/Unix/Command/_route, + Completion/Unix/Command/_service, Completion/Unix/Command/_sort, + Completion/Unix/Command/_split, Completion/Unix/Command/_top: + various completion option updates + + * 43348: Anton Shestakov: Completion/Unix/Command/_hg: + check for both -r and --rev + + * 43347: Anton Shestakov: Completion/Unix/Command/_hg: + use revsets for suggestions for hg merge + +2018-08-28 Oliver Kiddle <okiddle@yahoo.co.uk> + + * 43345: Completion/Unix/Command/_mount, + Completion/Unix/Type/_umountable: don't modify global variable + + * unposted: Completion/Linux/Command/_dkms: correct + completion argument order + + * unposted: Completion/Unix/Command/_strings: completion for + argument to -s was missing + + * unposted: Completion/Unix/Command/_tar: complete also for bsdtar + + * unposted: Completion/Solaris/Command/_svccfg: fix typo in + function call + 2018-08-25 Daniel Shahaf <d.s@daniel.shahaf.name> * unposted: Etc/FAQ.yo: Fix FAQ build, broken by 43184. diff --git a/Completion/Linux/Command/_cryptsetup b/Completion/Linux/Command/_cryptsetup index 351859586..ddb2ad3a9 100644 --- a/Completion/Linux/Command/_cryptsetup +++ b/Completion/Linux/Command/_cryptsetup @@ -1,8 +1,9 @@ #compdef cryptsetup -local curcontext="$curcontext" ret=1 +local curcontext="$curcontext" ign ret=1 local -a actions state line expl +(( $#words > 2 )) && ign='!' _arguments -s \ '(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \ '--debug[enable debug mode]' \ @@ -65,9 +66,10 @@ _arguments -s \ '--label=[set label for the LUKS2 device]:label' \ '--subsystem=[set subsystem label for the LUKS2 device]:subsystem' \ '--unbound[create unbound (no assigned data segment) LUKS2 keyslot]' \ - '(- : *)--version[show version information]' \ - '(- : *)'{-\?,--help}'[display help information]' \ - '(- : *)--usage[display brief usage]' \ + '--json-file=[read or write token to json file]:json file:_files -g "*.json(-.)"' \ + "${ign}(- : *)--version[show version information]" \ + "${ign}(- : *)"{-\?,--help}'[display help information]' \ + "${ign}(- : *)--usage[display brief usage]" \ ':action:->actions' \ '*::arguments:->action-arguments' && ret=0 @@ -97,6 +99,7 @@ case $state in 'luksResume:resume suspended LUKS device' 'luksHeaderBackup:store binary backup of headers' 'luksHeaderRestore:restore header backup' + 'token:manipulate auto-activation token of the device' ) _describe action actions && ret=0 ;; @@ -118,6 +121,17 @@ case $state in args=( $device ':key file:_files' ) ;; luksHeader*) args=( $device '--header-backup-file:file:_files' );; + token) + args=( + ':action:(( + add\:create\ a\ new\ keyring + remove\:remove\ any\ token\ from\ slot + import\:store\ arbitrary\ valid\ token\ json\ in\ LUKS2\ header + export\:write\ requested\ token\ json\ to\ a\ file + ))' + $device + ) + ;; *) _default && ret=0 ;; diff --git a/Completion/Linux/Command/_dkms b/Completion/Linux/Command/_dkms index 7ea34aa2e..a0a666e33 100644 --- a/Completion/Linux/Command/_dkms +++ b/Completion/Linux/Command/_dkms @@ -122,13 +122,13 @@ case $cmd in ;| add) args+=( - '2:path:_directories' - '3:tarball:_files -g "*.tar(-.)"' + '3:path:_directories' + '4:tarball:_files -g "*.tar(-.)"' ) ;; install) args+=( - '2:rpm file:_files -g "*.rpm(-.)"' + '3:rpm file:_files -g "*.rpm(-.)"' ) ;; esac diff --git a/Completion/Linux/Command/_networkmanager b/Completion/Linux/Command/_networkmanager index e38215e76..fa9301971 100644 --- a/Completion/Linux/Command/_networkmanager +++ b/Completion/Linux/Command/_networkmanager @@ -6,6 +6,7 @@ _networkmanager() { local curcontext="$curcontext" state line _arguments -C \ + '(-o -overview)-o'{,verview}'[overview mode (hide default values)]' \ '(-p -pretty -t -terse)-t'{,erse}'[terse output]' \ '(-p -pretty -t -terse)-p'{,retty}'[pretty output]' \ '(-m -mode)-m'{,ode}'[output mode]:mode:(tabular multiline)' \ diff --git a/Completion/Linux/Command/_strace b/Completion/Linux/Command/_strace index cff9a49c6..83ccc6afb 100644 --- a/Completion/Linux/Command/_strace +++ b/Completion/Linux/Command/_strace @@ -54,7 +54,9 @@ case $state in 'signal[trace only the specified subset of signals]:signal:_sequence _signals -s -M "B\:!="' \ 'read[perform a full hex and ASCII dump of all the data read from listed file descriptors]:file descriptor:_sequence _file_descriptors' \ 'write[perform a full hex and ASCII dump of all the data written to listed file descriptors]:file descriptor:_sequence _file_descriptors' \ - 'fault[perform syscall fault injection]:system call:_sys_calls -a -n' && ret=0 + 'fault[perform syscall fault injection]:system call:_sys_calls -a -n' \ + 'inject[perform syscall tampering]:system call:_sys_calls -a -n' \ + 'kvm[print the exit reason of kvm vcpu]: :(vcpu)' && ret=0 if [[ $words[CURRENT] != *=* || $state = syscalls ]]; then local dedup sets suf="-qS," compset -P '!' diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat index 8b7929ddd..e091dd3ea 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -8,6 +8,7 @@ _mpstat() { '(-A)-I[report interrupt statistics]:interrupt:(SUM CPU SCPU ALL)' \ '(-A)-N[specify NUMA nodes]:NUMA node' \ '(-A)-n[report summary CPU statistics based on NUMA node placement]' \ + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' \ '-o[display statistics in JSON]:format:(JSON)' \ '(-A)-P[specify processor number]:processor: _values -s "," processor ALL {0..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \ '-u[report CPU utilization]' \ @@ -18,6 +19,7 @@ _mpstat() { _cifsiostat() { _arguments : \ + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' \ '-h[human readable]' \ '(-m)-k[display statistics in kB/s]' \ '(-k)-m[display statistics in MB/s]' \ @@ -49,6 +51,9 @@ _sadf() { '-O[specify output options]: : _values -s , option autoscale height\:value oneday packed showidle showinfo skipempty showhints' \ '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \ + '--dev=-[specify block devices for which statistics are to be displayed]:block device:_files -g "*(-%)"' \ + '--fs=-[specify filesystems for which statistics are to be displayed]:file system:_dir_list -s ,' \ + '--iface=-[specify network interfaces for which statistics are to be displayed]:network interface:_sequence _net_interfaces' \ '-s[set starting time of report]:starting time (HH\:MM\:SS)"' \ '(-t -U)-T[display timestamp in local time]' \ '(-T -U)-t[display timestamp in file\''s original localtime]' \ @@ -81,15 +86,19 @@ _sar() { '-C[display comments from sadc]' \ '-D[use saYYYYMMDD instead of saDD as the standard system activity daily data file name]' \ '-d[report activity for each block device]' \ + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' \ + '--dev=-[specify block devices for which statistics are to be displayed]:block device:_files -g "*(-%)"' \ '-e[set ending time of report]:ending time (HH\:MM\:SS)' \ '-F[display statistics for mounted filesystems]' \ '-f[extract records from file]:record:_files' \ + '--fs=-[specify filesystems for which statistics are to be displayed]:file system:_dir_list -s ,' \ '-H[report hugepages utilization]' \ '(--human -p)-h[make output easier to read: implies --human and -p]' \ '(- 1 2)--help[display usage information]' \ '--human[print sizes in human readable format]' \ '*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \ '-i[select records as close as possible to interval]:interval' \ + '--iface=-[specify network interfaces for which statistics are to be displayed]:network interface:_sequence _net_interfaces' \ '-j[display persistent device names]:type:(ID LABEL PATH UUID)' \ '-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \ '-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 FC SOFT ALL' \ @@ -135,6 +144,7 @@ _pidstat() { '-v[display values from kernel table]' \ '-w[report task switching activity]' \ '-G[include only processes with specified name]:process name' \ + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' \ '--human[print sizes in human readable format]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' diff --git a/Completion/Solaris/Command/_svccfg b/Completion/Solaris/Command/_svccfg index d31682e77..360fc2091 100644 --- a/Completion/Solaris/Command/_svccfg +++ b/Completion/Solaris/Command/_svccfg @@ -62,7 +62,7 @@ _svccfg() { ;; (validate) - _alternative 'files:file:_files' 'fmris:fmri:_svc_fmri -c' + _alternative 'files:file:_files' 'fmris:fmri:_svcs_fmri -c' ;; (export) diff --git a/Completion/Unix/Command/_attr b/Completion/Unix/Command/_attr index 2030064dc..d8d4ed260 100644 --- a/Completion/Unix/Command/_attr +++ b/Completion/Unix/Command/_attr @@ -39,6 +39,7 @@ case $service in '(-v --value)'{-v+,--value=}'[specify value for the attribute]' \ '(-x --remove)'{-x+,--remove=}'[remove specified extended attribute]' \ '(-n --name -v --value)--restore[restore extended attributes from dump file]:dump file:_files' \ + '--raw[attribute value is not encoded]' \ '(-h --no-dereference)'{-h,--no-dereference}"[don't follow symbolic links]" \ '(* -)--version[display version information]' \ '(* -)--help[display help information]' \ diff --git a/Completion/Unix/Command/_cmp b/Completion/Unix/Command/_cmp index bcede8b0b..6d7bfb1b7 100644 --- a/Completion/Unix/Command/_cmp +++ b/Completion/Unix/Command/_cmp @@ -15,6 +15,7 @@ case $variant in '(- *)--help[display help information]' ) ;; + netbsd*) args+=( "-c[don't use mmap]" ) ;| freebsd*|openbsd*) args=( "-h[don't follow symbolic links]" diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index 57a5061c2..beaab5e2d 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -54,6 +54,7 @@ case $OSTYPE in '(--no-pid)-pf[pid file]:pid file:_files' '(-pf)--no-pid[disable writing pid files]' '-cf[config file]:config file:_files' + '-df[duid file]:duid file:_files' '-sf[script file]:script file:_files' '-4o6[DHCPv4 over DHCPv6 protocol]:port' "-nc[don't drop capabilities]" diff --git a/Completion/Unix/Command/_dig b/Completion/Unix/Command/_dig index 5feb71fef..18e9a0dbd 100644 --- a/Completion/Unix/Command/_dig +++ b/Completion/Unix/Command/_dig @@ -26,6 +26,7 @@ local -a alts args '*+noedns[clear EDNS options to be sent]' '*+'{no,}'expire[send an EDNS Expire option]' '*+'{no,}'header-only[send query without a question section]' + '*+'{no,}'idnin[set processing of IDN domain names on input]' '*+'{no,}'idnout[set conversion of IDN puny code on output]' '*+'{no,}'keepopen[keep TCP socket open between queries]' '*+'{no,}'mapped[allow mapped IPv4 over IPv6 to be used]' diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr index a8d43fc5e..e1ba7cf2b 100644 --- a/Completion/Unix/Command/_entr +++ b/Completion/Unix/Command/_entr @@ -6,6 +6,7 @@ typeset -A opt_args _arguments -s -S \ '-c[execute clear before invoking utility]' \ '-d[track directories and exit if a new file is added]' \ + "-n[non-interactive mode; don't access TTY]" \ '-p[postpone first execution of the utility]' \ '-r[reload a persistent child process]' \ '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \ diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index 96e96bd7b..99fc513d7 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -1,16 +1,19 @@ #compdef env genv -local context state line variant args ret=1 +local context state line variant args ign ret=1 _pick_variant -r variant gnu=Free\ Soft $OSTYPE --version case $variant in gnu) + (( $#words > 2 )) && ign='!' args=( '(-)'{-i,--ignore-environment}'[start with empty environment]' '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' '(-C --chdir)'{-C+,--chdir=}'[change working directory]:directory:_directories' - '(- *)--help[display help information]' - '(- *)--version[display version information]' + '(-S --split-string)'{-S+,--split-string=}'[perform word splitting]:string to split' + '(-v --debug)'{-v,--debug}'[print verbose information for each processing step]' + "${ign}(- *)--help[display help information]" + "${ign}(- *)--version[display version information]" ) ;; freebsd*) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index eac0c8476..2cae4c82f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -738,11 +738,11 @@ _git-describe () { '--all[use any ref found in "$GIT_DIR/refs/"]' \ '--tags[use any ref found in "$GIT_DIR/refs/tags"]' \ '(--tags)--contains[find the tag after the commit instead of before]' \ - '(--long)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ '( --exact-match)--candidates=[consider up to given number of candidates]: :__git_guard_number "number of candidates"' \ '(--candidates )--exact-match[only output exact matches, same as --candidates=0]' \ '--debug[display information about the searching strategy]' \ - '(--abbrev)--long[always show full format, even for exact matches]' \ + '--long[always show full format, even for exact matches]' \ '*--match=[only consider tags matching glob pattern]:pattern' \ "*--exclude=[don't consider tags matching glob pattern]:pattern" \ '--always[show uniquely abbreviated commit object as fallback]' \ @@ -3607,15 +3607,7 @@ _git-remote () { '(-m --master)'{-m,--master=}'[set HEAD of remote to point to given master branch]: :__git_branch_names' \ '--mirror[do not use separate remotes]::mirror type:(fetch pull)' \ ':name:__git_remotes' \ - ':repository:->repository' && ret=0 - case $state in - (repository) - _alternative \ - 'local-repositories::__git_local_repositories' \ - 'remote-repositories::__git_remote_repositories' \ - 'urls::_urls' && ret=0 - ;; - esac + ':repository:__git_repositories_or_urls' && ret=0 ;; (get-url) _arguments -S -s \ @@ -3644,14 +3636,13 @@ _git-remote () { '*: :__git_branch_names' && ret=0 ;; (set-url) - # TODO: Old URL should be one of those defined for the remote. - _arguments -S -s \ - '(3)--push[manipulate push URLs instead of fetch URLs]' \ - '--add[add URL to those already defined]' \ - '(3)--delete[delete all matching URLs]' \ - ': :__git_remotes' \ - ':new url:_urls' \ - ':old url:_urls' && ret=0 + _arguments -S \ + '--push[manipulate push URLs instead of fetch URLs]' \ + '(3)--add[add URL to those already defined]' \ + '(2)--delete[delete all matching URLs]' \ + '1: :__git_remotes' \ + '2:new url:__git_repositories_or_urls' \ + '3:old url: __git_current_remote_urls ${(k)opt_args[--push]} $line[1]' && ret=0 ;; (show) _arguments -S \ @@ -6971,6 +6962,21 @@ __git_local_repositories () { _wanted local-repositories expl 'local repositories' _directories } +(( $+functions[__git_repositories_or_urls] )) || +__git_repositories_or_urls () { + _alternative \ + 'repositories::__git_repositories' \ + 'urls::_urls' +} + +(( $+functions[__git_current_remote_urls] )) || +__git_current_remote_urls () { + local expl + _description remote-urls expl 'current url' + compadd "$expl[@]" -M 'r:|/=* r:|=*' - ${(f)"$(_call_program remote-urls + git remote get-url "$@" --all)"} +} + (( $+functions[__git_any_repositories] )) || __git_any_repositories () { # TODO: should also be $GIT_DIR/remotes/origin diff --git a/Completion/Unix/Command/_gnutls b/Completion/Unix/Command/_gnutls index 2cd559843..1c14de791 100644 --- a/Completion/Unix/Command/_gnutls +++ b/Completion/Unix/Command/_gnutls @@ -54,13 +54,14 @@ case "$service" in gnutls-cli) args+=( '--tofu[enable trust on first use authentication]' '!--no-tofu' - '--strict-tofu[fail to connect if a known certificate has changed]' '!--no-strict-tofu' + '--strict-tofu[fail to connect if a certificate is unknown or has changed]' '!--no-strict-tofu' '--dane[enable DANE certificate verification (DNSSEC)]' '!--no-dane' '--local-dns[use the local DNS server for DNSSEC resolving]' '!--no-local-dna' '--no-ca-verification[disable CA certificate verification]' '!--ca-verification' '--ocsp[enable OCSP certificate verification]' '!--no-oscp' '(-r --resume)'{-r,--resume}'[establish a session and resume]' '(-e --rehandshake)'{-e,--rehandshake}'[connect, establish a session and rehandshake immediately]' + "--verify-hostname-str=[specify server's hostname to use for validation]:hostname" '(-s --starttls)'{-s,--starttls}'[start TLS on EOF or SIGALRM]' '--crlf[send CR LF instead of LF]' '--fastopen[enable TCP Fast Open]' @@ -75,7 +76,6 @@ case "$service" in '--pskusername[specify PSK username to use]:username' '--pskkey[specify PSK key to use]:key' "--insecure[don't require server cert validation]" - '--ranges[use length-hiding padding to prevent traffic analysis]' '--benchmark-ciphers[benchmark individual ciphers]' '--benchmark-soft-ciphers[benchmark individual software ciphers]' '--benchmark-tls-kx[benchmark TLS key exchange methods]' @@ -84,7 +84,8 @@ case "$service" in '*--alpn=[enable application layer protocol]:string' '--recordsize=[specify maximum record size to advertize]:record size' "--disable-sni[don't send a Server Name]" - '--disable-extensions[disable all the TLS extensions]' + '--single-key-share[send a single key share under TLS1.3]' + '--post-handshake-auth[enable post-handshake authentication under TLS1.3]' '--inline-commands[inline commands of the form ^<cmd>^]' '--inline-commands-prefix=[change delimiter used for inline commands]:delimiter [^]' '--fips140-mode[report status of FIPS140-2 mode in gnutls library]' @@ -96,20 +97,22 @@ case "$service" in '--sni-hostname-fatal[send fatal alert on sni-hostname mismatch]' '*--alpn=[specify ALPN protocol to be enabled by the server]:protocol' '--alpn-fatal[send fatal alert on non-matching ALPN name]' + "--nocookie[don't require cookie on DTLS sessions]" '(-g --generate)'{-g,--generate}'[generate Diffie-Hellman parameters]' '(-q --quiet)'{-q,--quiet}'[suppress some messages]' "--nodb[don't use a resumption database]" '--http[act as an HTTP server]' '--echo[act as an Echo server]' - '(-a --disable-client-cert)'{-a,--disable-client-cert}"[don't request a client certificate]" - '(-r --require-client-cert)'{-r,--require-client-cert}'[require a client certificate]' + '(-a --disable-client-cert -r --require-client-cert)'{-a,--disable-client-cert}"[don't request a client certificate]" + '(-a --disable-client-cert -r --require-client-cert)'{-r,--require-client-cert}'[require a client certificate]' '--verify-client-cert[if a client certificate is sent then verify it]' '--dhparams=[specify DH params file to use]:file:_files' '--srppasswd=[specify SRP password file to use]:file:_files' '--srppasswdconf=[specify SRP password configuration file to use]:file:_files' '--pskpasswd=[specify PSK password file to use]:file:_files' '--pskhint=[specify PSK identity hint to use]:string' - '--ocsp-response=[specify OCSP response to send to client]:file:_files' + '*--ocsp-response=[specify OCSP response to send to client]:string:_files' + '--ignore-ocsp-response-errors[ignore any errors when setting the OCSP response]' ) ;; @@ -158,7 +161,6 @@ case "$service" in '--empty-password[enforce an empty password]' '--key-type=[specify the key type to use on key generation]:key type' '(-i --certificate-info)'{-i,--certificate-info}'[print information on a certificate]' - '--certificate-pubkey[print certificate public key]' '(-l --crl-info)'{-l,--crl-info}'[print information on a CRL]' '--crq-info[print information on a certificate request]' "--no-crq-extensions[don't use extensions in certificate requests]" diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 4b88ce4ea..7b72605b3 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -192,13 +192,9 @@ _hg_tags() { # likely merge candidates _hg_mergerevs() { typeset -a heads - local myrev - - heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) - # exclude own revision - myrev=$(_hg_cmd log -r . --template '{rev}\\n') - heads=(${heads:#$myrev}) + local revset='sort(head() and not ., -rev)' + heads=(${(f)"$(_hg_cmd log -r '$revset' --template '{rev}\\n')"}) (( $#heads )) && _describe -t heads 'heads' heads } @@ -571,7 +567,7 @@ _hg_cmd_diff() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else @@ -799,7 +795,7 @@ _hg_cmd_revert() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index e95d62f80..8909ae311 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -38,6 +38,7 @@ case $OSTYPE:l in args+=( '-D[display alternate disk statistics]' '-x[show extended disk statistics]' + '-y[report data on waiting and active requests]' '*:drives:( $(sysctl -n hw.disknames) )' ) ;; @@ -114,6 +115,7 @@ case $OSTYPE:l in args=( '-c[display CPU utilization report]' '-d[display device utilization report]' + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' '*-g[display statistics for a group of devices]:group name' '-H[only display global statistics for group]' '(--human)-h[human readable device utilization report]' diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 764dc8f99..3c1dcac76 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -52,16 +52,12 @@ else ;| darwin*|dragonfly*|freebsd*|netbsd*) args+=( - '(-f)-i[prompt before removing destination files]' - '-v[print name of each linked file]' - ) - ;| - darwin*|dragonfly*|freebsd*) - args+=( '-F[remove existing destination directories]' + '(-f)-i[prompt before removing destination files]' + '-v[print name of each linked file]' ) ;| - dragonfly*|freebsd*|openbsd*) + dragonfly*|freebsd*|netbsd*|openbsd*) args+=( '(-L)-P[create hard links directly to symbolic links]' '(-P)-L[create hard links to symbolic link references]' diff --git a/Completion/Unix/Command/_md5sum b/Completion/Unix/Command/_md5sum index 8e93fbbac..3dfcd6322 100644 --- a/Completion/Unix/Command/_md5sum +++ b/Completion/Unix/Command/_md5sum @@ -7,7 +7,7 @@ # # @todo Support BusyBox? -local type +local type ign local -a args case $service in @@ -17,16 +17,18 @@ case $service in esac # General options -args+=( +(( $#words > 2 )) && ign='!' +args=( '(: -)--help[display help information]' '(: -)--version[display version information]' ) # Summing options -args+=( +args=( ${ign}${^args} + sum '(chk)--tag[create BSD-style checksums]' '(chk -b -t --binary --text)'{-b,--binary}'[read in binary mode]' '(chk -b -t --binary --text)'{-t,--text}'[read in text mode]' + '(chk -z --zero)'{-z,--zero}'[end each output line with NUL and disable filename escaping]' ) # This is the only option that differs amongst all of these tools [[ $service == *b2* ]] && args+=( diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index 03cc01f8d..301b9e58e 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -931,7 +931,7 @@ devordir) esac ;; udevordir) - _umountable + _umountable && ret=0 ;; labels) _wanted labels expl 'disk label' compadd /dev/disk/by-label/*(:t) && ret=0 diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 72e711227..98dcd1cd0 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -110,10 +110,16 @@ case $OSTYPE in bsdarg+=( '*G[select processes by real group]' ) ;| freebsd*|dragonfly*) - bsd+=( 'f[show command and environment for swapped out processes]' ) ;| + bsd+=( 'f[show command and environment for swapped out processes]' ) + ;| netbsd*|openbsd*) bsdarg+=( 'W[extract swap information from specified file]' ) ;| + freebsd*|netbsd*) + bsd+=( + 'd[show process hierarchy]' + ) + ;| darwin*) bsd+=( 'd[select all processes except session leaders]' @@ -140,7 +146,6 @@ case $OSTYPE in ;; freebsd*) bsd+=( - 'd[show process hierarchy]' '*J[select processes by jail ID]' 'Z[show mac label]' ) diff --git a/Completion/Unix/Command/_route b/Completion/Unix/Command/_route index f8426874c..06cca8d99 100644 --- a/Completion/Unix/Command/_route +++ b/Completion/Unix/Command/_route @@ -81,7 +81,7 @@ case $OSTYPE in '-llinfo:validly translate proto addr to link addr' ) ;| - (open|free)bsd*|darwin*|dragonfly*) + (net|open|free)bsd*|darwin*|dragonfly*) args+=( "-d[debug-only mode: don't update routing table]" '-t[test-only mode: /dev/null used instead of a socket]' @@ -89,7 +89,7 @@ case $OSTYPE in ;| netbsd*|solaris*) args+=( '-f[remove all routes first]' ) - ;; + ;| (netbsd|darwin|dragonfly)*) modifiers+=( '-proxy:make entry a link level proxy' ) ;| @@ -121,8 +121,10 @@ case $OSTYPE in netbsd*) subcmds+=( flushall 'remove all routes including the default gateway' ) args+=( + "-L[don't show link layer entries in routing table]" '-S[print a space when a flag is missing to align flags]' '-s[suppress all output from get except for the gateway]' + '-T[show tags in the route display]' ) modifiers+=( '-tag' diff --git a/Completion/Unix/Command/_service b/Completion/Unix/Command/_service index 50e8607bf..1216f57a8 100644 --- a/Completion/Unix/Command/_service +++ b/Completion/Unix/Command/_service @@ -5,24 +5,28 @@ # _sub_command happy # we are interested in init service only -local args ctx="${curcontext}argument-1:" +local args actions ctx="${curcontext}argument-1:" zstyle -T ":completion:${ctx}" tag-order && \ zstyle ":completion:${ctx}" tag-order init case $OSTYPE in + freebsd<11->.*) + args=( '-j+[perform actions in specified jail]:jail:_jails' ) + ;& freebsd*|dragonfly*) - args=( - '(-)-r[show the results of boot time rcorder]' - '(-)-R[restart all enabled local services]' + actions=( + '(*)-r[show the results of boot time rcorder]' + '(*)-R[restart all enabled local services]' ) ;& netbsd*) _arguments -s $args \ - '(-)-e[show services that are enabled]' \ - '(-)-l[list all scripts in /etc/rc.d and the local startup directory]' \ '(-e -R)-v[verbose]' \ - ':service name:_services' \ - '*::service argument:_init_d' + '*::service argument:_init_d' \ + + '(actions)' $actions \ + '(*)-e[show services that are enabled]' \ + '(*)-l[list all scripts in /etc/rc.d and the local startup directory]' \ + ':service name:_services' ;; *) _arguments -s \ diff --git a/Completion/Unix/Command/_sort b/Completion/Unix/Command/_sort index c81e6f856..dfd43ce55 100644 --- a/Completion/Unix/Command/_sort +++ b/Completion/Unix/Command/_sort @@ -4,8 +4,8 @@ local args variant local ordering='(-d --dictionary-order -g --general-numeric-sort -M --month-sort -h --human-numeric-sort -n --numeric-sort --sort -V --version-sort --help --version)' args=( - "(-c --check -C)-c[check whether input is sorted; don't sort]" - '(-m --merge)'{-m,--merge}"[merge already sorted files; don't sort]" + "(-c --check -C -m --merge -s --stable)-c[check whether input is sorted; don't sort]" + '(-c --check -C -m --merge)'{-m,--merge}"[merge already sorted files; don't sort]" '(-o --output)'{-o+,--output=}'[write result to file instead of standard output]:output file:_files' \*{-T+,--temporary-directory=}'[specify directory for temporary files]:directory:_directories' '(-u --unique)'{-u,--unique}'[with -c, check for strict ordering; without -c, output only the first of an equal run]' @@ -26,7 +26,7 @@ case $variant in '(-s --stable)'{-s,--stable}'[preserve original order of lines with the same key]' ) ;| - openbsd*|freebsd*|gnu|solaris2.<11->) + netbsd*|openbsd*|freebsd*|gnu|solaris2.<11->) args+=( "(-c --check -C)-C[check whether input is sorted silently; don't sort]" ) diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split index 25b5aec2d..c5ab0dc9b 100644 --- a/Completion/Unix/Command/_split +++ b/Completion/Unix/Command/_split @@ -42,12 +42,12 @@ case $variant in (free|net)bsd*) args+=( '(-b -l -p)-n+[generate specified number of output files]:output files' ) ;| - freebsd*) + darwin*|freebsd*) args+=( - '-d[use numeric suffixes]' '(-b -l -n)-p+[split the file whenever a line matches specified pattern]:pattern' ) - ;; + ;| + freebsd*) args+=( '-d[use numeric suffixes]' ) ;; esac _arguments -s -S $args && ret=0 diff --git a/Completion/Unix/Command/_strings b/Completion/Unix/Command/_strings index b13366dd2..af95af52f 100644 --- a/Completion/Unix/Command/_strings +++ b/Completion/Unix/Command/_strings @@ -39,7 +39,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu '(-a --all -d --data)'{-d,--data}'[only print strings from file data sections]' '(-w --include-all-whitespace)'{-w,--include-all-whitespace}'[include all whitespace as valid string characters]' '(-T --target)'{-T+,--target=}'[specify binary file format]:format:compadd - ${(z)${(M)${(f)"$(_call_program targets strings --help)"}##* supported targets*}##*\: }' - '(-s --output-separator)'{-s+,--output-separator=}'[specify string used to separate strings in output]' + '(-s --output-separator)'{-s+,--output-separator=}'[specify string used to separate strings in output]:separator' ) ;; elfutils) diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index 3e44b98f7..727fbd6b5 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -1,4 +1,4 @@ -#compdef tar gtar star +#compdef tar gtar star bsdtar # Tar completion. Features: # - Tries to collect tar commands from second position, single letter diff --git a/Completion/Unix/Command/_top b/Completion/Unix/Command/_top index 8f81e9526..f9d2733fc 100644 --- a/Completion/Unix/Command/_top +++ b/Completion/Unix/Command/_top @@ -72,7 +72,8 @@ case $OSTYPE in '-m+[specify statistic type]:type:(( cpu\:default io ))' '-P[per-cpu CPU usage statistics]' '(1 -)-v[write version number and exit]' - '-z[do not display system idle process]' + '-w[display approximate swap usage]' + "-z[don't display system idle process]" '-J+[show processes owned by the specified jail]:jail:_jails -0' '-U+[show processes owned by the specified username]: :_users' );; diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh index a5414670b..e6292a636 100644 --- a/Completion/Unix/Command/_zsh +++ b/Completion/Unix/Command/_zsh @@ -1,9 +1,12 @@ #compdef zsh -local curcontext=$curcontext state state_descr line expl +local curcontext=$curcontext state state_descr line expl not='!' typeset -A opt_args +[[ $CURRENT = 2 ]] && not='' + _arguments -S -s : \ + ${not}'--emulate[specify emulation mode]:mode:(zsh sh ksh csh)' \ '*-o+[set named option]:option:_options' \ '*+o+[unset named option]:option:_options' \ '(1 -s --shinstdin)'{-s,--shinstdin}'[read commands from standard input]' \ diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 55ddecd2a..4fd27442e 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -1,6 +1,6 @@ #autoload -local of ofwuc ouc oss ofwy ofwg ofwl cmd +local of ofwuc ouc oss ofwy ofwg ofwl cmd variant local -a args cmd="$1" @@ -25,16 +25,16 @@ _diff_palette() { return ret } -if _pick_variant -c $cmd gnu=GNU unix -v; then +if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then # output formats of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ --unified --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format --line-format --old-line-format --new-line-format \ - --unchanged-line-format --normal -D --ifdef" + --unchanged-line-format -D --ifdef" # output formats w/o unified and context ofwuc="-y --side-by-side -n --rcs -e -f --ed -q --brief --old-group-format \ - --new-group-format --changed-group-format --unchanged-group-format --normal \ + --new-group-format --changed-group-format --unchanged-group-format \ --line-format --old-line-format --new-line-format --unchanged-line-format \ -D --ifdef" @@ -48,26 +48,50 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then ofwy="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format --line-format --old-line-format \ - --new-line-format --unchanged-line-format --normal -D --ifdef" + --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o group format - ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified --normal \ + ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --line-format --old-line-format --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o line format ofwl="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ - --old-group-format --new-group-format --changed-group-format --normal \ + --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format" - _arguments -s \ + if [[ $variant = gnu ]]; then + (( $#words > 2 )) || args+=( + '(-v --version)'{-v,--version}'[display version information]' + '--help[display usage information]' + ) + args+=( + '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' + '(-E --ignore-tab-expansion)'{-E,--ignore-tab-expansion}'[ignore changes due to tab expansion]' + '(-Z --ignore-trailing-space)'{-Z,--ignore-trailing-space}'[ignore white space at line end]' + "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' + "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' + "($ofwy $ouc)--left-column[output only left column of common lines]" + "($ofwy $ouc)--suppress-common-lines[do not output common lines]" + "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" + "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" + "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" + '(--to-file)--from-file=[compare specified file to all operands]:from file:_files' \ + '(--from-file)--to-file=[compare all operands to specified file]:to file:_files' \ + '--color=-[use colors in output]::when [auto]:(never always auto)' + '--palette=[specify colors to use]:color:_diff_palette' + "($of $ouc)--side-by-side[output in two columns]" + "($of $ouc)-y[output in two columns]" + ) + else + args+=( '!--speed-large-files' ) + fi + + _arguments -s $args \ '(-i --ignore-case)'{-i,--ignore-case}'[case insensitive]' \ - '(--no-ignore-file-name-case)--ignore-file-name-case[ignore case when comparing file names]' \ - '(--ignore-file-name-case)--no-ignore-file-name-case[consider case when comparing file names]' \ - '(-E --ignore-tab-expansion)'{-E,--ignore-tab-expansion}'[ignore changes due to tab expansion]' \ - '(-Z --ignore-trailing-space)'{-Z,--ignore-trailing-space}'[ignore white space at line end]' \ + '--ignore-file-name-case[ignore case when comparing file names]' \ + '!(--ignore-file-name-case)--no-ignore-file-name-case' \ '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ - '(--ignore-all-space -w)'{--ignore-all-space,-w}'[ignore all white space]' \ '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore lines that are all blank]' \ '(-I --ignore-matching-lines)'{-I+,--ignore-matching-lines=}'[ignore lines that match regex]:line exclusion regex:' \ '--strip-trailing-cr[strip trailing carriage return on input]' \ @@ -78,30 +102,18 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then "($of $oss)-u[output a unified diff]" \ "($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name and timestamp]:label' \ "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \ - "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' \ - "($of $ouc $oss)--brief[output only whether files differ]" \ - "($of $ouc $oss)-q[output only whether files differ]" \ + "($of $ouc $oss)"{-q,--brief}'[output only whether files differ]' \ "($of $ouc $oss -e --ed)"{--ed,-e}'[output an ed script]' \ - "($of $ouc $oss)--normal[output a normal diff]" \ - "($of $ouc $oss)--forward-ed[output a reversed ed script]" \ - "($of $ouc $oss)-f[output a reversed ed script]" \ - "($of $ouc $oss)--rcs[RCS format diff]" \ - "($of $ouc $oss)-n[RCS format diff]" \ - "($of $ouc)--side-by-side[output in two columns]" \ - "($of $ouc)-y[output in two columns]" \ - "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' \ - "($ofwy $ouc)--left-column[output only left column of common lines]" \ - "($ofwy $ouc)--suppress-common-lines[do not output common lines]" \ - "($of $oss)"{-D,--ifdef=}'[output merged file with preprocessor directives]:preprocessor symbol' \ - "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" \ - "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" \ + "!($of $ouc $oss)--normal" \ + "($of $ouc $oss)"{-f,--forward-ed}'[output a reversed ed script]' \ + "($of $ouc $oss)"{-n,--rcs}'[output an RCS format diff]' \ + "($of $oss)"{-D+,--ifdef=}'[output merged file with preprocessor directives]:preprocessor symbol' \ "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format" \ "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format" \ "($ofwl $ouc $oss)--line-format=[set line format]:line format" \ "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format" \ "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format" \ - "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" \ - '(-l --paginate)'{-l,--paginate}'[output through pr]' \ + '(-l --paginate)'{-l,--paginate}'[long output format (paginate with pr(1))]' \ '(-t --expand-tabs)'{-t,--expand-tabs}'[expand tabs to spaces]' \ '(-T --initial-tab)'{-T,--initial-tab}'[prepend a tab]' \ '--tabsize=[specify width of tab]:width [8]' \ @@ -111,66 +123,55 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then '(-P --unidirectional-new-file)'{-P,--unidirectional-new-file}'[treat absent first files as empty]' \ '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \ \*{-x+,--exclude=}'[exclude files matching pattern]:exclusion pattern' \ - '(-X --exclude-from)'{-X+,--exclude-from=}'[exclude files matching pattern in file]:exclude file:_files' \ + \*{-X+,--exclude-from=}'[exclude files matching pattern in file]:exclude file:_files' \ '(-S --starting-file)'{-S+,--starting-file=}'[set first file in comparison]:start with file:_files' \ - '(--to-file)--from-file=[compare specified file to all operands]:from file:_files' \ - '(--from-file)--to-file=[compare all operands to specified file]:to file:_files' \ '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \ '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \ - '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' \ - '--color=-[use colors in output]::when [auto]:(never always auto)' \ - '--palette=[specify colors to use]:color:_diff_palette' \ - '(-v --version)'{-v,--version}'[display version info]' \ - '--help[display help info]' \ "$@" else of='-c -e -f' case $OSTYPE in - solaris2.<9->) + openbsd*|solaris2.<9->) of+=' -u -U' - args=( + args+=( "($of)-u[output a unified diff]" - "($of)-U[output a unified diff]:lines of context" + "($of)-U+[output a unified diff]:lines of context" ) - ;& - solaris*) - of+=' -C -h -n -D' + ;| + openbsd*|solaris*) args+=( + "($of)-C+[output a context diff]:lines of context" + "($of)-D+[output merged file with preprocessor directives]:preprocessor symbol" '-i[case insensitive]' - '-t[expand tabs to spaces]' + '-l[long output format (paginate with pr(1))]' + '-s[report on identical files]' + '-t[expand tabs in output lines]' + ) + ;| + solaris*) + of+=' -h -n' + args+=( '-w[ignore all white space]' - "($of)-C+[output a context diff]:lines of context" "($of)-h[do a fast, half-hearted job]" - "($of)-n[reversed ed script]" - "($of)-D[output merged file with preprocessor directives]:preprocessor symbol" - '-l[output through pr]' - '-s[report on identical files]' + "($of)-n[output a reversed ed script]" '-S+[set first file in comparison]:start with file:_files' ) ;; openbsd*) of+=' -n -q -u -C -D -U' args=( - "($of)-n[produce an rcsdiff(1)-compatible diff]" + "($of)-n[output an rcsdiff(1)-compatible diff]" "($of)-q[only print a line when the files differ; does not produce a list of changes]" - "($of)-u[produce a unified diff with 3 lines of context]" - "($of)-C+[produce a context diff]:number of lines of context" - "($of)-D[produce a merged file with preprocessor directives]:preprocessor symbol" - "($of)-U+[produce a unified diff]:number of lines of context" '-a[treat all files as ASCII text]' '-d[try to produce the smallest diff possible]' '-I[ignore changes whose lines match the extended regular expression]:extended regular expression pattern' - '-i[ignore case]' '*-L[print a label instead of the file name and time]:label' - '-l[long output format (paginate with pr(1))]' '-p[show characters from the last line before the context]' '-T[consistently align tabs]' - '-t[expand tabs in output lines]' '-w[like -b, but totally ignore whitespace]' '-N[treat absent files in either directory as if they were empty]' '-P[treat absent files in the second directory as if they were empty]' '-S[start a directory diff from a file name]:file name:_files' - '-s[report files that are the same]' '*-X[exclude files and subdirectories whose basenames match lines in a file]:file name:_files' '-x[exclude files and subdirectories whose basenames match a pattern]:pattern' ) diff --git a/Completion/Unix/Type/_umountable b/Completion/Unix/Type/_umountable index 2b2567478..7ffce5bb4 100644 --- a/Completion/Unix/Type/_umountable +++ b/Completion/Unix/Type/_umountable @@ -41,4 +41,4 @@ dev_tmp=( "${(@)dev_tmp:#/*}" ) _alternative \ 'device-labels:device label:compadd -a dev_tmp' \ 'device-paths: device path:_canonical_paths -A dpath_tmp -N -M "r:|/=* r:|=*" device-paths device\ path' \ - 'directories:mount point:_canonical_paths -A mp_tmp -N -M "r:|/=* r:|=*" directories mount\ point' && ret=0 + 'directories:mount point:_canonical_paths -A mp_tmp -N -M "r:|/=* r:|=*" directories mount\ point' diff --git a/Completion/X/Command/_eog b/Completion/X/Command/_eog new file mode 100644 index 000000000..6a737a79d --- /dev/null +++ b/Completion/X/Command/_eog @@ -0,0 +1,24 @@ +#compdef eog + +_arguments -s -S \ + - '(help)' \ + '--version[display version information]' \ + {-h,--help}'[display help information]' \ + '--help-all[display help on all options]' \ + '--help-gtk[display help on GTK+ options]' \ + - normal \ + '--class=[specify program class as used by the window manager]:class' \ + '--name=[program name as used by the window manager]:name:_x_name' \ + '--gdk-debug=[specify GDK debugging flags to set]:flag' \ + '--gdk-no-debug=[specify GDK debugging flags to unset]:flag' \ + '--gtk-module=[load additional GTK+ modules]:module' \ + '--g-fatal-warnings[make all warnings fatal]' \ + '--gtk-debug=[specify GTK+ debugging flags to set]:flag' \ + '--gtk-no-debug=[specify GTK+ debugging flags to unset]:flag' \ + '(-f --fullscreen)'{-f,--fullscreen}'[open in fullscreen mode]' \ + '(-s --slide-show -f --fullscreen)'{-s,--slide-show}'[open in slideshow mode]' \ + '(-g --disable-gallery)'{-g,--disable-gallery}'[disable image gallery]' \ + '(-n --new-instance)'{-n,--new-instance}'[start a new instance]' \ + '(-w --single-window)'{-w,--single-window}'[open in single window]' \ + '--display=[specify X display]:display:_x_display' \ + '*:image file:_files -g "*.(#i)(ani|bmp|gif|ico|jpeg|jpg|pcx|png|pnm|ras|svg|tga|tiff||tif|wbmp|wbm|xbm|xpm)(-.)"' diff --git a/Config/version.mk b/Config/version.mk index 0bea45b5b..6bd5734bf 100644 --- a/Config/version.mk +++ b/Config/version.mk @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=5.5.1-test-2 -VERSION_DATE='August 26, 2018' +VERSION=5.6 +VERSION_DATE='September 3, 2018' diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 12bd4eb3d..d4dc8a150 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -306,7 +306,7 @@ sect(On what machines will it run?) sect(What's the latest version?) - Zsh 5.5.1 is the latest production version. For details of all the + Zsh 5.6 is the latest production version. For details of all the changes, see the NEWS file in the source distribution. A beta of the next version is sometimes available. Development of zsh is diff --git a/Etc/Makefile.in b/Etc/Makefile.in index b6743a7ec..9adba95db 100644 --- a/Etc/Makefile.in +++ b/Etc/Makefile.in @@ -40,13 +40,13 @@ INSTALL = @INSTALL@ # ========== DEPENDENCIES FOR BUILDING ========== -all: FAQ +all: FAQ FAQ.html -FAQ: FAQ.yo - cd $(sdir) && $(YODL2TXT) FAQ.yo && mv -f FAQ.txt FAQ +FAQ: $(sdir)/FAQ.yo + $(YODL2TXT) -o FAQ.txt $< && mv FAQ.txt $@ -FAQ.html: FAQ.yo - $(YODL2HTML) $(sdir)/FAQ.yo +FAQ.html: $(sdir)/FAQ.yo + $(YODL2HTML) -o $@ $< # ========== DEPENDENCIES FOR CLEANUP ========== diff --git a/Makefile.in b/Makefile.in index ae18855ff..00d74b7f2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -163,7 +163,7 @@ targz-src: $(DISTNAME).tar.gz $(DISTNAME).tar.gz: FORCE @$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \ $(MAKE) $(MAKEDEFS) - echo '#define ZSH_PATCHLEVEL "'`cd $(sdir_top) && git describe --tags --long`'"' >$(DISTNAME)/Src/patchlevel.h.release + echo '#define ZSH_PATCHLEVEL "'`cd $(sdir_top) && git describe --tags --long --abbrev=7`'"' >$(DISTNAME)/Src/patchlevel.h.release tar cf - $(DISTNAME) | gzip -9 > $@ rm -rf $(DISTNAME) @@ -175,3 +175,12 @@ $(DISTNAME)-doc.tar.gz: FORCE rm -rf $(DISTNAME) FORCE: + +tarxz-src: $(DISTNAME).tar.xz +$(DISTNAME).tar.xz: $(DISTNAME).tar.gz + < $< zcat | xz -9 > $@ + +tarxz-doc: $(DISTNAME)-doc.tar.xz +$(DISTNAME)-doc.tar.xz: $(DISTNAME)-doc.tar.gz + < $< zcat | xz -9 > $@ + @@ -4,13 +4,41 @@ CHANGES FROM PREVIOUS VERSIONS OF ZSH Note also the list of incompatibilities in the README file. +Changes from 5.5.1-test-2 to 5.6 +-------------------------------- + +CVE-2018-0502: Data from the second line of a #! script file might be passed to +execve(). For example, in the following situation - +. + printf '#!foo\nbar' > baz + ./baz +. +the shell might take "bar" rather than "foo" for the argv[0] to be passed to +execve(). [ Reported by Anthony Sottile and Buck Evan. ] + +CVE-2018-13259: A shebang line longer than 64 characters would be truncated. +For example, in the following situation: +. + ( printf '#!'; repeat 64 printf 'x'; printf 'y' ) > foo + ./foo +. +the shell might execute x...x (64 repetitions) rather than x...xy (64 x's, +one y). [ Reported by Daniel Shahaf. ] + Changes from 5.5.1 to 5.5.1-test-2 ---------------------------------- +Non-stop IEEE 754 arithmetic support - Inf and NaN are now returned +from floating point operations where errors were printed before. +Inf and NaN are also recognised in arithmetic expressions. + In shell patterns, [[:blank:]] now honours the locale instead of matching exclusively on space and tab, like for the other POSIX character classes or for extended regular expressions. +Nanosecond precision on file times is supported in the module +zsh/stat. + Changes from 5.5 to 5.5.1 ------------------------- @@ -5,9 +5,9 @@ THE Z SHELL (ZSH) Version ------- -This is version 5.5.1-test-2 of the shell. This is a test release. There -are some significant bug fixes and a few user visible additions since -5.5.1. All zsh installations are encouraged to upgrade. +This is version 5.6 of the shell. This is a security and feature release. +There are some significant bug fixes and a few user visible additions since +5.5.1. All zsh installations are encouraged to upgrade as soon as possible. Note in particular the changes highlighted under "Incompatibilities since 5.5.1" below. See NEWS for more information. diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 2e96ac780..a5cf1011b 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -1518,7 +1518,7 @@ getrestchar_keybuf(void) * arrive together. If we don't do this the input can * get stuck if an invalid byte sequence arrives. */ - inchar = getbyte(1L, &timeout); + inchar = getbyte(1L, &timeout, 1); /* getbyte deliberately resets lastchar_wide_valid */ lastchar_wide_valid = 1; if (inchar == EOF) { @@ -1673,7 +1673,7 @@ addkeybuf(int c) static int getkeybuf(int w) { - int c = getbyte((long)w, NULL); + int c = getbyte((long)w, NULL, 1); if(c < 0) return EOF; diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index db70e7d7e..3487b5d9f 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -452,7 +452,7 @@ struct ztmout { */ static void -calc_timeout(struct ztmout *tmoutp, long do_keytmout) +calc_timeout(struct ztmout *tmoutp, long do_keytmout, int full) { if (do_keytmout && (keytimeout > 0 || do_keytmout < 0)) { if (do_keytmout < 0) @@ -465,7 +465,7 @@ calc_timeout(struct ztmout *tmoutp, long do_keytmout) } else tmoutp->tp = ZTM_NONE; - if (timedfns) { + if (full && timedfns) { for (;;) { LinkNode tfnode = firstnode(timedfns); Timedfn tfdat; @@ -504,7 +504,7 @@ calc_timeout(struct ztmout *tmoutp, long do_keytmout) /* see calc_timeout for use of do_keytmout */ static int -raw_getbyte(long do_keytmout, char *cptr) +raw_getbyte(long do_keytmout, char *cptr, int full) { int ret; struct ztmout tmout; @@ -519,7 +519,7 @@ raw_getbyte(long do_keytmout, char *cptr) # endif #endif - calc_timeout(&tmout, do_keytmout); + calc_timeout(&tmout, do_keytmout, full); /* * Handle timeouts and watched fd's. If a watched fd or a function @@ -684,7 +684,7 @@ raw_getbyte(long do_keytmout, char *cptr) * reconsider the key timeout from scratch. * The effect of this is microscopic. */ - calc_timeout(&tmout, do_keytmout); + calc_timeout(&tmout, do_keytmout, full); break; } /* @@ -810,7 +810,7 @@ raw_getbyte(long do_keytmout, char *cptr) # endif } /* If looping, need to recalculate timeout */ - calc_timeout(&tmout, do_keytmout); + calc_timeout(&tmout, do_keytmout, full); } # ifdef HAVE_POLL zfree(fds, sizeof(struct pollfd) * nfds); @@ -852,7 +852,7 @@ raw_getbyte(long do_keytmout, char *cptr) /**/ mod_export int -getbyte(long do_keytmout, int *timeout) +getbyte(long do_keytmout, int *timeout, int full) { char cc; unsigned int ret; @@ -877,7 +877,7 @@ getbyte(long do_keytmout, int *timeout) for (;;) { int q = queue_signal_level(); dont_queue_signals(); - r = raw_getbyte(do_keytmout, &cc); + r = raw_getbyte(do_keytmout, &cc, full); restore_queue_signals(q); if (r == -2) { /* timeout */ @@ -956,7 +956,7 @@ getbyte(long do_keytmout, int *timeout) mod_export ZLE_INT_T getfullchar(int do_keytmout) { - int inchar = getbyte((long)do_keytmout, NULL); + int inchar = getbyte((long)do_keytmout, NULL, 1); #ifdef MULTIBYTE_SUPPORT return getrestchar(inchar, NULL, NULL); @@ -1021,7 +1021,7 @@ getrestchar(int inchar, char *outstr, int *outcount) * arrive together. If we don't do this the input can * get stuck if an invalid byte sequence arrives. */ - inchar = getbyte(1L, &timeout); + inchar = getbyte(1L, &timeout, 1); /* getbyte deliberately resets lastchar_wide_valid */ lastchar_wide_valid = 1; if (inchar == EOF) { @@ -2139,7 +2139,7 @@ zle_main_entry(int cmd, va_list ap) do_keytmout = va_arg(ap, long); timeout = va_arg(ap, int *); chrp = va_arg(ap, int *); - *chrp = getbyte(do_keytmout, timeout); + *chrp = getbyte(do_keytmout, timeout, 0); break; } diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 898b552de..612ac2138 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -756,7 +756,7 @@ bracketedstring(void) while (endesc[endpos]) { if (current + 1 >= psize) pbuf = zrealloc(pbuf, psize *= 2); - if ((next = getbyte(1L, &timeout)) == EOF) + if ((next = getbyte(1L, &timeout, 1)) == EOF) break; if (!endpos || next != endesc[endpos++]) endpos = (next == *endesc); @@ -970,7 +970,7 @@ universalargument(char **args) * * Hence for now this remains byte-by-byte. */ - while ((gotk = getbyte(0L, NULL)) != EOF) { + while ((gotk = getbyte(0L, NULL, 1)) != EOF) { if (gotk == '-' && !digcnt) { minus = -1; digcnt++; diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index e0923db3e..a5ff9200c 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -131,7 +131,7 @@ vigetkey(void) char m[3], *str; Thingy cmd; - if (getbyte(0L, NULL) == EOF) + if (getbyte(0L, NULL, 1) == EOF) return ZLEEOF; m[0] = lastchar; diff --git a/Src/exec.c b/Src/exec.c index 615a5086f..09ee13209 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -458,7 +458,7 @@ execcursh(Estate state, int do_exec) /* execve after handling $_ and #! */ -#define POUNDBANGLIMIT 64 +#define POUNDBANGLIMIT 128 /**/ static int @@ -499,18 +499,20 @@ zexecve(char *pth, char **argv, char **newenvp) if ((fd = open(pth, O_RDONLY|O_NOCTTY)) >= 0) { argv0 = *argv; *argv = pth; - execvebuf[0] = '\0'; + memset(execvebuf, '\0', POUNDBANGLIMIT + 1); ct = read(fd, execvebuf, POUNDBANGLIMIT); close(fd); if (ct >= 0) { - if (execvebuf[0] == '#') { - if (execvebuf[1] == '!') { - for (t0 = 0; t0 != ct; t0++) - if (execvebuf[t0] == '\n') - break; + if (ct >= 2 && execvebuf[0] == '#' && execvebuf[1] == '!') { + for (t0 = 0; t0 != ct; t0++) + if (execvebuf[t0] == '\n') + break; + if (t0 == ct) + zerr("%s: bad interpreter: %s: %e", pth, + execvebuf + 2, eno); + else { while (inblank(execvebuf[t0])) execvebuf[t0--] = '\0'; - execvebuf[POUNDBANGLIMIT] = '\0'; for (ptr = execvebuf + 2; *ptr && *ptr == ' '; ptr++); for (ptr2 = ptr; *ptr && *ptr != ' '; ptr++); if (eno == ENOENT) { @@ -519,10 +521,16 @@ zexecve(char *pth, char **argv, char **newenvp) *ptr = '\0'; if (*ptr2 != '/' && (pprog = pathprog(ptr2, NULL))) { - argv[-2] = ptr2; - argv[-1] = ptr + 1; - winch_unblock(); - execve(pprog, argv - 2, newenvp); + if (ptr == execvebuf + t0 + 1) { + argv[-1] = ptr2; + winch_unblock(); + execve(pprog, argv - 1, newenvp); + } else { + argv[-2] = ptr2; + argv[-1] = ptr + 1; + winch_unblock(); + execve(pprog, argv - 2, newenvp); + } } zerr("%s: bad interpreter: %s: %e", pth, ptr2, eno); @@ -537,10 +545,6 @@ zexecve(char *pth, char **argv, char **newenvp) winch_unblock(); execve(ptr2, argv - 1, newenvp); } - } else if (eno == ENOEXEC) { - argv[-1] = "sh"; - winch_unblock(); - execve("/bin/sh", argv - 1, newenvp); } } else if (eno == ENOEXEC) { for (t0 = 0; t0 != ct; t0++) diff --git a/Src/zsh.mdd b/Src/zsh.mdd index 324435d62..3e5788af5 100644 --- a/Src/zsh.mdd +++ b/Src/zsh.mdd @@ -53,8 +53,8 @@ patchlevel.h: FORCE @if [ -f $(sdir)/$@.release ]; then \ cp -f $(sdir)/$@.release $@; \ else \ - echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long`'"' > $@.tmp; \ - cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv $@.tmp $@; \ + echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long --abbrev=7`'"' > $@.tmp; \ + cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv -f $@.tmp $@; \ fi FORCE: diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index 0804691a7..fb39d0589 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -12,7 +12,14 @@ print '#!/bin/sh\necho This is dir2' >dir2/tstcmd + print -n '#!sh\necho This is slashless' >tstcmd-slashless + print -n '#!echo foo\necho This is arg' >tstcmd-arg + print '#!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnyyy' >tstcmd-interp-too-long + print '#!/bin/sh\necho should not execute; exit 1' >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn + chmod 755 tstcmd dir1/tstcmd dir2/tstcmd + chmod 755 tstcmd-slashless tstcmd-arg tstcmd-interp-too-long + chmod 755 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn %test ./tstcmd @@ -33,6 +40,21 @@ 0:path (2) >This is top + PATH=/bin:${ZTST_testdir}/command.tmp/ tstcmd-slashless +0:path (3) +>This is slashless + + PATH=/bin:${ZTST_testdir}/command.tmp tstcmd-arg +0:path (4) +*>foo */command.tmp/tstcmd-arg + + path=(/bin ${ZTST_testdir}/command.tmp/) + tstcmd-interp-too-long 2>&1; echo "status $?" + path=($storepath) +0:path (5) +*>*tstcmd-interp-too-long: bad interpreter: x*xn: no such file or directory +>status 127 + functst() { print $# arguments:; print -l $*; } functst "Eines Morgens" "als Gregor Samsa" functst "" diff --git a/configure.ac b/configure.ac index 5e13c0f11..5513e25f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1278,7 +1278,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ erand48 open_memstream \ posix_openpt \ wctomb iconv \ - isinf isnan \ grantpt unlockpt ptsname \ htons ntohs \ regcomp regexec regerror regfree \ @@ -1291,6 +1290,27 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ setutxent getutxent endutxent getutent) AC_FUNC_STRCOLL +# isinf() and isnan() can exist as either functions or macros. +AH_TEMPLATE([HAVE_ISINF], + [Define to 1 if you have the `isinf' macro or function.]) +AC_MSG_CHECKING([for isinf]) +AC_LINK_IFELSE([AC_LANG_SOURCE( +[[#include <math.h> +int main () { return (isinf(1.0) != 0); }]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ISINF])], + [AC_MSG_RESULT([no])]) + +AH_TEMPLATE([HAVE_ISNAN], + [Define to 1 if you have the `isnan' macro or function.]) +AC_MSG_CHECKING([for isnan]) +AC_LINK_IFELSE([AC_LANG_SOURCE([[ +#include <math.h> +int main () { return (isnan(1.0) != 0); }]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ISNAN])], + [AC_MSG_RESULT([no])]) + AH_TEMPLATE([REALPATH_ACCEPTS_NULL], [Define if realpath() accepts NULL as its second argument.]) AC_CACHE_CHECK([if realpath accepts NULL], |