<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: rm -blah</title>
	<atom:link href="http://involution.com/2006/04/21/rm-blah/feed/" rel="self" type="application/rss+xml" />
	<link>http://involution.com/2006/04/21/rm-blah/</link>
	<description>Tony Perrie's Weblog</description>
	<lastBuildDate>Sat, 17 Jul 2010 00:32:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Kost</title>
		<link>http://involution.com/2006/04/21/rm-blah/comment-page-1/#comment-105</link>
		<dc:creator>Kost</dc:creator>
		<pubDate>Mon, 24 Apr 2006 22:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://involution.com/2006/04/21/rm-blah/#comment-105</guid>
		<description>using rm ./-blah is bad practice (from security standpoint of view), rm -- &quot;-blah&quot; is better (also notice quotes around). 
Why? Imagine that you have root cron job on multiuser system doing some kind of rm through home dirs.
some evil user could do &quot;evil mkdir&quot;, like: 
mkdir -p &quot;evil /etc/passwd&quot;
it will make argument to rm like (if not using quotes): rm &quot;evil&quot; &quot;/etc/passwd&quot;. So, that will eventually delete /etc/passwd. Or even worse:
mkdir -p &quot;evil -r /etc&quot;
That will delete /etc/ (not using quotes and not using --).
In short, beware what you are doing with rm/mv/cp in your (cron/whatever) scripts as root!! &quot;--&quot; and quotes(&quot;&quot;) are must!!!

Also, if you don&#039;t like command line, you can use mc (midnight commander) for deleting such files.</description>
		<content:encoded><![CDATA[<p>using rm ./-blah is bad practice (from security standpoint of view), rm &#8212; &#8220;-blah&#8221; is better (also notice quotes around).<br />
Why? Imagine that you have root cron job on multiuser system doing some kind of rm through home dirs.<br />
some evil user could do &#8220;evil mkdir&#8221;, like:<br />
mkdir -p &#8220;evil /etc/passwd&#8221;<br />
it will make argument to rm like (if not using quotes): rm &#8220;evil&#8221; &#8220;/etc/passwd&#8221;. So, that will eventually delete /etc/passwd. Or even worse:<br />
mkdir -p &#8220;evil -r /etc&#8221;<br />
That will delete /etc/ (not using quotes and not using &#8211;).<br />
In short, beware what you are doing with rm/mv/cp in your (cron/whatever) scripts as root!! &#8220;&#8211;&#8221; and quotes(&#8220;&#8221;) are must!!!</p>
<p>Also, if you don&#8217;t like command line, you can use mc (midnight commander) for deleting such files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JTAxx</title>
		<link>http://involution.com/2006/04/21/rm-blah/comment-page-1/#comment-104</link>
		<dc:creator>JTAxx</dc:creator>
		<pubDate>Mon, 24 Apr 2006 15:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://involution.com/2006/04/21/rm-blah/#comment-104</guid>
		<description>Nope, i never got that problem before...how were they able to create such file other than a mv from blah to -blah is unlikely.

I thought using double-quotes around the filename would work (it does for other strangely named files like #emacs_scratch_save#)

It seems rm ./ and rm -- are the best solutions for this problem done by people paid more than us...well me at least.</description>
		<content:encoded><![CDATA[<p>Nope, i never got that problem before&#8230;how were they able to create such file other than a mv from blah to -blah is unlikely.</p>
<p>I thought using double-quotes around the filename would work (it does for other strangely named files like #emacs_scratch_save#)</p>
<p>It seems rm ./ and rm &#8212; are the best solutions for this problem done by people paid more than us&#8230;well me at least.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
