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

kroq-gar78 1019217 at bugs.launchpad.net
Thu Jul 19 20:52:27 UTC 2012


** Description changed:

+ [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.
+ 
+ -df: lists the differences between archives
+ -tf: lists contents of archive
+ -xf: extracts archive
+ 
+ [Test Case]
+ 1. Create the file 'test file': touch test\ file
+ 2. Press tab after typing this: tar -cf te
+    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
+ 
+ [Regression Potential]
+ 
  This works:
  
  $ touch test\ file
  $ tar -cf te<tab>
  $ tar -cf test\ file
  
  But this does not:
  
  $ touch test\ file
  $ tar -xf te<tab>
  $ tar -xf test file
  
  (No backslash.)
  
  Even:
  
  $ touch test\ file
  $ tar -xf test\ file<tab>
  $ tar -xf test file
  
  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
+  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)

-- 
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:
  Confirmed
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.

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

  [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