← Back to team overview

touch-packages team mailing list archive

[Bug 1381863] Re: File name beginning with a dash used as program argument

 

This is working as expected.

Some people even stick files named e.g. --interactive into their
directories to use this as some kind of defense against accidental
deletion.

Most programs provide a -- command line option that says "further
arguments should be interpreted as files". But this kind of surprising
experience is inevitable in operating systems that don't formalize
command options separately from file arguments.

** Information type changed from Private Security to Public

** Changed in: bash (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1381863

Title:
  File name beginning with a dash used as program argument

Status in “bash” package in Ubuntu:
  Invalid

Bug description:
  I mis-typed a tar command and ended up with a file with the name
  beginning "--". After a few minutes of confusion and re-typing the
  command I noticed the offending file and was given another error when
  I tried to rm the file.

  It is reproducable using any command eg.

  tim@pc1:~/test$ ls
  --bork  file1  someotherfile

  tim@pc1:~/test$ ls *
  ls: unrecognised option '--bork'
  Try 'ls --help' for more information.

  tim@pc1:~/test$ rm *
  rm: unrecognised option '--bork'
  Try 'rm ./--bork' to remove the file ‘--bork’.
  Try 'rm --help' for more information.

  tim@pc1:~/test$ tar cvzf ../test.tar.gz *
  tar: unrecognised option '--bork'
  Try 'tar --help' or 'tar --usage' for more information.

  I did notice that rm suggests a solution to the problem, but maybe
  this has security implications.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: bash 4.3-7ubuntu1.5
  ProcVersionSignature: Ubuntu 3.13.0-37.64-generic 3.13.11.7
  Uname: Linux 3.13.0-37-generic x86_64
  NonfreeKernelModules: fglrx
  ApportVersion: 2.14.1-0ubuntu3.5
  Architecture: amd64
  CurrentDesktop: LXDE
  Date: Thu Oct 16 04:52:59 2014
  EcryptfsInUse: Yes
  SourcePackage: bash
  UpgradeStatus: No upgrade log present (probably fresh install)

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