News for hackers. Stuff that matters.
Re:Unix Wildcards Gone Wild (2014) by Pete_D on Friday June 22, 2018 @05:16PM (#17377439)
I didn't see this mentioned in the article, but you can protect against this in your own scripts by including a -- before user-supplied parameters, which prevents them from being treated as flags.

    $ rm -- -rf
    rm: cannot remove '-rf': No such file or directory
(see Guideline 10, http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_...)
Re:Unix Wildcards Gone Wild (2014) by Spivak on Saturday June 23, 2018 @01:25AM (#17379685)
It should be noted that you will run plenty of programs in the wild that don't respect this convention.
Re:Unix Wildcards Gone Wild (2014) by jwilk on Friday June 22, 2018 @05:52PM (#17377727)
Alternatively:

  $ rm ./-rf
Re:Unix Wildcards Gone Wild (2014) by zouhair on Saturday June 23, 2018 @04:11PM (#17383181)
That if you know such file exist in said folder.