[Bug 1019217] Re: [SRU] Tab completion with tar -df, -tf, and -xf don't support spaces in file name

Dave Walker davewalker at ubuntu.com
Fri May 10 19:06:32 UTC 2013


Hello Otus, or anyone else affected,

Accepted bash-completion into precise-proposed. The package will build
now and be available at http://launchpad.net/ubuntu/+source/bash-
completion/1:1.3-1ubuntu8.1 in a few hours, and then in the -proposed
repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
enable and use -proposed.  Your feedback will aid us getting this update
out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, and change the tag
from verification-needed to verification-done. If it does not fix the
bug for you, please add a comment stating that, and change the tag to
verification-failed.  In either case, details of your testing will help
us make a better decision.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance!

** Changed in: bash-completion (Ubuntu Precise)
       Status: Confirmed => Fix Committed

** Tags added: verification-needed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/1019217

Title:
  [SRU] Tab completion with tar -df, -tf, and -xf  don't support spaces
  in file name

Status in “bash-completion” package in Ubuntu:
  Fix Released
Status in “bash-completion” source package in Precise:
  Fix Committed
Status in “bash-completion” package in Debian:
  New

Bug description:
  [Impact]
  If a file has a space in its name and either -df, -tf, or -xf are used on the file while the user is using tab completion, it fails to add an escape character, so 'tar' treats it as two separate files. Because of this, tab-completion can't properly be used with the options -cf, -df, or -tf with tar. This can be a very large problem for inexperienced users, as some won't know that escape characters are supposed to be used, if they even know what they are.

  -df: lists the differences between archives
  -tf: lists contents of archive
  -xf: extracts archive

  [Stable Fix]
  Running this command will fix the problem: "sed -i 's/\?(\-)\[cr\]\*f/\?(\-)\[cdrtx\]\*f/g' /etc/bash_completion.d/tar" (run without quotes)

  [Development Fix]
  In the file "completions/tar", the characters 'd', 't', and 'x' were added to the regex (?) checking for the options passed to tar.

  [Test Case]
  1. Create the file 'test file': touch test\ file
  2. Press tab after typing this: tar -cf test
     It should show a "\" as an escape character preceding the space, allowing tar to correctly interpret the name as one file, not two
     Result: tar -cf test\ file

  3. Press tab after typing this: tar -df test
     It should then show "tar -df test file", making tar interpret the archive as 'test' and 'file' as another argument.
     Intended result (after applying patch): tar -df test\ file
  4. Press tab after typing this: tar -tf test
     It should then show "tar -tf test file", making tar interpret the archive as 'test' and 'file' as another argument.
     Intended result (after applying patch): tar -tf test\ file
  5. Press tab after typing this: tar -xf test
     It should then show "tar -xf test file", making tar interpret the archive as 'test' and 'file' as another argument.
     Intended result (after applying patch): tar -xf test\ file

  Note that even pressing tab after "tar -xf test\ file" will result in
  "tar -xf test file"

  [Regression Potential]
  Small, as only one lines was changed, and only three characters were added to it ('d','t', and 'x' - each of the arguments that weren't working).

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: bash-completion 1:1.3-1ubuntu8
  ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
  Uname: Linux 3.2.0-26-generic x86_64
  ApportVersion: 2.0.1-0ubuntu10
  Architecture: amd64
  Date: Fri Jun 29 12:55:34 2012
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120319)
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: bash-completion
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1019217/+subscriptions




More information about the foundations-bugs mailing list