<?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: Avoid hard-coding the path to the interpreter in your scripts</title>
	<atom:link href="http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts/feed" rel="self" type="application/rss+xml" />
	<link>http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts</link>
	<description>Anecdotes on Java, Ruby, Sysadmin, SEO, Design, and Management</description>
	<pubDate>Tue, 06 Jan 2009 07:37:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Todd Huss</title>
		<link>http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts/comment-page-1#comment-885</link>
		<dc:creator>Todd Huss</dc:creator>
		<pubDate>Fri, 19 May 2006 21:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts#comment-885</guid>
		<description>William: you are correct that /bin/sh is "the most portable" way to write but I was speaking more generally about using more feature rich interpreters which can be found all over the system.

Kurin: On our FreeBSD 4 systems at work it's in /usr/bin but I didn't install the systems so it could have been a mistake. Regardless the point is really that it varies from system to system.

UmberGryphon: Once you take in all the user written perl, python, and ruby scripts that run under non-priveleged accounts on production system they well outweight the volume of /bin/sh scripts being run by root. If you're a sysadmin this tip doesn't really apply, hence the caveat, but if you're a programmer at an ISV then scripts running under non-priveleged accounts are pretty much your world and that's where the advice applies.</description>
		<content:encoded><![CDATA[<p>William: you are correct that /bin/sh is &#8220;the most portable&#8221; way to write but I was speaking more generally about using more feature rich interpreters which can be found all over the system.</p>
<p>Kurin: On our FreeBSD 4 systems at work it&#8217;s in /usr/bin but I didn&#8217;t install the systems so it could have been a mistake. Regardless the point is really that it varies from system to system.</p>
<p>UmberGryphon: Once you take in all the user written perl, python, and ruby scripts that run under non-priveleged accounts on production system they well outweight the volume of /bin/sh scripts being run by root. If you&#8217;re a sysadmin this tip doesn&#8217;t really apply, hence the caveat, but if you&#8217;re a programmer at an ISV then scripts running under non-priveleged accounts are pretty much your world and that&#8217;s where the advice applies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UmberGryphon</title>
		<link>http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts/comment-page-1#comment-883</link>
		<dc:creator>UmberGryphon</dc:creator>
		<pubDate>Fri, 19 May 2006 20:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts#comment-883</guid>
		<description>"The only caveat is that you DO NOT want to do this for critical security scripts because it opens you up to path based exploits."

I would extend this to say "The only caveat is that you DO NOT want to do this for any script that root or any user that is in a critical group might ever run."  And what does that leave, exactly?

Things going wrong with differing paths to bash/perl/ruby/etc. are a problem, but things going wrong with path based exploits are several orders of magnitude worse.</description>
		<content:encoded><![CDATA[<p>&#8220;The only caveat is that you DO NOT want to do this for critical security scripts because it opens you up to path based exploits.&#8221;</p>
<p>I would extend this to say &#8220;The only caveat is that you DO NOT want to do this for any script that root or any user that is in a critical group might ever run.&#8221;  And what does that leave, exactly?</p>
<p>Things going wrong with differing paths to bash/perl/ruby/etc. are a problem, but things going wrong with path based exploits are several orders of magnitude worse.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kurin</title>
		<link>http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts/comment-page-1#comment-881</link>
		<dc:creator>Kurin</dc:creator>
		<pubDate>Fri, 19 May 2006 18:54:37 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts#comment-881</guid>
		<description>On FreeBSD it's never /usr/bin/bash unless your admin is doing something wrong (like trying to get a script to run that's hardcoded to /usr/bin/bash).  It's /usr/local/bin/bash, if it's there at all, which it isn't by default.</description>
		<content:encoded><![CDATA[<p>On FreeBSD it&#8217;s never /usr/bin/bash unless your admin is doing something wrong (like trying to get a script to run that&#8217;s hardcoded to /usr/bin/bash).  It&#8217;s /usr/local/bin/bash, if it&#8217;s there at all, which it isn&#8217;t by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts/comment-page-1#comment-879</link>
		<dc:creator>William</dc:creator>
		<pubDate>Fri, 19 May 2006 17:35:52 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/avoid-hard-coding-the-path-to-the-interpreter-in-your-scripts#comment-879</guid>
		<description>There is no way you can reasonably assert that the path to 'env' is any more stable than the path to bash or bourne shell on a Linux system. I'll fully agree with you on the issue with regard to python, perl, ruby, tcl, but for shell scripts /bin/sh is *the* way to ensure portability.</description>
		<content:encoded><![CDATA[<p>There is no way you can reasonably assert that the path to &#8216;env&#8217; is any more stable than the path to bash or bourne shell on a Linux system. I&#8217;ll fully agree with you on the issue with regard to python, perl, ruby, tcl, but for shell scripts /bin/sh is *the* way to ensure portability.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
