Ok, I think the SRU is ready.
** 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. 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)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1019217
Title:
[SRU] Tab completion with tar -df, -tf, and -xf don't support spaces
in file name
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1019217/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs