bash completion not working: uses deprecated have()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ufw |
Fix Released
|
Medium
|
Jamie Strandboge | ||
ufw (Ubuntu) |
Fix Released
|
Medium
|
Jamie Strandboge | ||
Bionic |
Fix Released
|
Medium
|
Jamie Strandboge | ||
Cosmic |
Fix Released
|
Medium
|
Jamie Strandboge | ||
Disco |
Fix Released
|
Medium
|
Jamie Strandboge |
Bug Description
[Impact]
Tab completion is currently broken.
[Test Case]
$ ufw <tab><tab>
allow delete --dry-run --help logging reset status
app deny enable insert reject route version
default disable --force limit reload show
With an unpatched ufw, tab completion only shows the files in the current directory, which is meaningless for ufw.
[Regression Potential]
Risk of regression is considered very low since tab completion is totally broken and correct functionality is easily tested.
= Original description =
bash completion, defined in /usr/share/
According to /usr/share/
# Backwards compatibility for compat completions that use have().
# @deprecated should no longer be used; generally not needed with dynamically
# loaded completions, and _have is suitable for runtime use.
and at the end of the file:
unset -f have
unset have
which means: function have() is not available for usage. The bash completion for ufw conditionally defines _ufw and the comspec:
have ufw &&
_ufw()
...
[ "$have" ] && complete -F _ufw ufw
These should be changed to:
_have ufw &&
_ufw()
...
_have ufw && complete -F _ufw ufw
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ufw 0.35-5
ProcVersionSign
Uname: Linux 4.15.0-22-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Mon Jun 4 14:34:11 2018
InstallationDate: Installed on 2018-04-28 (37 days ago)
InstallationMedia: Xubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
PackageArchitec
SourcePackage: ufw
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in ufw: | |
importance: | Undecided → Medium |
Changed in ufw (Ubuntu Disco): | |
status: | Triaged → In Progress |
importance: | Undecided → Medium |
Changed in ufw (Ubuntu Cosmic): | |
importance: | Undecided → Medium |
Changed in ufw (Ubuntu Bionic): | |
importance: | Undecided → Medium |
description: | updated |
Changed in ufw (Ubuntu Bionic): | |
status: | Triaged → In Progress |
Changed in ufw (Ubuntu Cosmic): | |
status: | Triaged → In Progress |
Thank you for reporting this. I'll get it fixed in upstream ufw, Debian and Ubuntu 18.10. I'll then do an SRU for 18.04 LTS.