<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title>running a shell script via cgi web interface in All Things Unix</title>
<link>http://www.dslreports.com/forum/r22479675</link>
<description></description>
<language>en</language>
<pubDate>Tue, 01 Dec 2009 11:57:56 EDT</pubDate>
<lastBuildDate>Tue, 01 Dec 2009 11:57:56 EDT</lastBuildDate>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22489842</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : <div class="bquote"><small>said by  nwrickert <A HREF="/useremail/u/1070900"><IMG SRC="http://i.dslr.net/bb/profile.gif" ALT="See Profile" BORDER=0 WIDTH=16 HEIGHT=11></A> :</small><br><br><div class="bquote">The above however did not work...</div>You should be using<br><tt>echo "$input" &gt; /tmp/router.txt</tt><br>The quoting prevents reparsing of <tt>"$input"</tt>.<br><br>If you just want to write all of stdin to a file, then<br><tt>cat - &gt; /tmp/router.txt</tt><br>should accomplish that.<br> </div>Sure why not...when in doubt quotes won't hurt eh? :)<br><br>oh and btw a much better way of doing what I did above is this:<br><br><textarea name="code" class="text" cols=50 rows=10>read "email" &lt; /tmp/email2.txt&#012;</textarea><!--end code block--><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22489842</guid>
<pubDate>Wed, 03 Jun 2009 14:07:54 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22485295</link>
<description><![CDATA[<A HREF="/useremail/u/1070900"><b>nwrickert</b></A> : <div class="bquote">The above however did not work...</div>You should be using<br><tt>echo "$input" &gt; /tmp/router.txt</tt><br>The quoting prevents reparsing of <tt>"$input"</tt>.<br><br>If you just want to write all of stdin to a file, then<br><tt>cat - &gt; /tmp/router.txt</tt><br>should accomplish that.<br><small>--<br>AT&T dsl; Westell 327w modem/router; openSuSE 11.0; firefox 3.0.10</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22485295</guid>
<pubDate>Tue, 02 Jun 2009 18:58:32 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22485152</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : woo hoo....successs. I was able to import a text file as a variable in a test script (not at my work computer right now)<br><br><textarea name="code" class="text" cols=50 rows=10>imacs-imac-2:~ imac$ cat foo.txt&#012;connor&#012;imacs-imac-2:~ imac$ cat foo.sh&#012;#!/bin/sh&#012;read input | cat foo.txt&#012;echo $input&#012;imacs-imac-2:~ imac$ sh foo.sh&#012;connor&#012;^C&#012;</textarea><!--end code block--><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22485152</guid>
<pubDate>Tue, 02 Jun 2009 18:30:11 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22485014</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : If only there was some way for me to read that text file back into a variable....<br><br><textarea name="code" class="text" cols=50 rows=10>read input&#012;#echo "Content-type: text/plain"&#012;echo $input &gt; /tmp/router.txt&#012;cut -d= -f2 /tmp/router.txt &gt; /tmp/router2.txt &#012;cat /tmp/router2.txt &gt; $1&#012;</textarea><!--end code block--><br>The above however did not work....:(<br><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22485014</guid>
<pubDate>Tue, 02 Jun 2009 18:07:15 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22484709</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : well I tried changing the variables, but got these errors <br><br>/usr/local/apache/dennis.sh: -n: is not an identifier<br>[Tue Jun  2 16:07:20 2009] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /usr/local/apache/dennis.sh<br><br>tried to echo it out into a test file but no joy so the syntax must be off<br><br><textarea name="code" class="text" cols=50 rows=10>#!/bin/sh&#012;#Read HTTP POST contents into $HTTP_POST&#012;read -n $CONTENT_LENGTH HTTP_POST&#012;echo $HTTP_POST &gt; /tmp/test.txt&#012;</textarea><!--end code block--><br>update:<br>I did just get this to work....<br><br><textarea name="code" class="text" cols=50 rows=10>read  input&#012;echo "Content-type: text/plain"   &#012;echo $input &gt; /tmp/echo.txt  &#012; &#012;gave me...&#012; &#012;25# cat /tmp/echo.txt&#012;NAME=router2.clli&#012;</textarea><!--end code block--><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22484709</guid>
<pubDate>Tue, 02 Jun 2009 17:09:00 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22483545</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : You also want to make sure you do input validation on user-supplied data.  Something like:<br><br>die unless ($input =~ m/[a-z0-9/i);<br><br>The above is PERL that only allows alpha-numeric characters.  Nothing like OS command injection to get your web server 0wned.]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22483545</guid>
<pubDate>Tue, 02 Jun 2009 14:01:46 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22483323</link>
<description><![CDATA[<A HREF="/useremail/u/830709"><b>pablo2525</b></A> : Howdy,<br><br>Ugh, my writing wasn't especially clear.  I'm sorry.  Let me try again.<br><br>In /etc/apache2/vhosts.d, my `conf' file has the above entry.  :)  In my case, I created a random file named `hostname`.conf baseed on `vhost.template'<br><br>My distribution is openSUSE but I figure the above is true in most (all?) apache installations.  Of course the root pathing may be different.<br><br>I hope the above helps.<br><br>Cheers,<br><small>--<br>pablo<br>openSUSE 11.0;KDE<br>ISP:  TekSavvy DSL; backhauled  via a 6KM wireless link</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22483323</guid>
<pubDate>Tue, 02 Jun 2009 13:27:01 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482492</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : s/and it's delimited with a QUERY_STRING/and it's <b>not</b> delimited with a QUERY_STRING/g]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482492</guid>
<pubDate>Tue, 02 Jun 2009 11:08:48 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482489</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : Dennis - Glad to help, please post a picture (kidding) ;)<br><br>I've not done CGI in a VERY long time, so you might want to do some testing to ensure that $HTTP_POST only contains the content of the POST itself and it's delimited with a QUERY_STRING style syntax.  Ideally, your new code would be similar to below, assuming additional parsing of $HTTP_POST isn't necessary:<br><br><textarea name="code" class="text" cols=50 rows=10>#!/bin/sh&#012;echo "Content-type: text/plain"&#012; &#012;#Read HTTP POST contents into $HTTP_POST&#012;read -n $CONTENT_LENGTH HTTP_POST&#012; &#012;echo&#012;touch /tmp/$HTTP_POST_log.txt&#012;chmod 777 /tmp/$HTTP_POST_log.txt&#012;touch /tmp/$HTTP_POST_cmd.txt&#012;chmod 777 /tmp/$HTTP_POST_cmd.txt&#012;echo copy run $HTTP_POST.cnf force &gt; /tmp/$HTTP_POST_cmd.txt&#012;echo copy $HTTP_POST.cnf binconfs:/$HTTP_POST.cnf force &gt;&gt; /tmp/$HTTP_POST_cmd.txt&#012;echo sh conf exclu int atm \&gt; $HTTP_POST_base.scr &gt;&gt; /tmp/$HTTP_POST_cmd.txt&#012;echo copy $HTTP_POST_base.scr binconfs:/$HTTP_POST_base.scr force &gt;&gt; /tmp/$HTTP_POST_cmd.txt&#012;echo sh conf cat int exclu int gig exclu int fa  \&gt; $HTTP_POST_atm.scr &gt;&gt; /tmp/$HTTP_POST_cmd.txt&#012;echo copy $HTTP_POST_atm.scr binconfs:/$HTTP_POST_atm.scr force &gt;&gt; /tmp/$HTTP_POST_cmd.txt&#012;</textarea><!--end code block-->]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482489</guid>
<pubDate>Tue, 02 Jun 2009 11:07:37 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482467</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : <div class="bquote"><small>said by Sir Meowmix III :</small><br><br>$HTTP_POST is arbitrary, it was a declared variable from the 'read' statement I posted earlier.  If you're going to use $HTTP_POST be sure to use the 'read' statement as well.<br> </div>Ok, you mean to make sure I use it in the shell script...right?<br><br>I should have mentioned that I know nothing earlier :) I'm trying to learn but really I'm trying to learn to run before walking....<br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482467</guid>
<pubDate>Tue, 02 Jun 2009 11:02:35 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482413</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : $HTTP_POST is arbitrary, it was a declared variable from the 'read' statement I posted earlier.  If you're going to use $HTTP_POST be sure to use the 'read' statement as well.]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482413</guid>
<pubDate>Tue, 02 Jun 2009 10:52:38 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482325</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : <div class="bquote"><small>said by  nwrickert <A HREF="/useremail/u/1070900"><IMG SRC="http://i.dslr.net/bb/profile.gif" ALT="See Profile" BORDER=0 WIDTH=16 HEIGHT=11></A> :</small><br><br><div class="bquote">Those touches in the beginning....never happen.</div>That's probably because "$1" is undefined.<br> </div>....ok well so if that's the case then if the touches are indeed happening, there must be frament files in the /tmp directory...<br><br><textarea name="code" class="text" cols=50 rows=10>49# ls -las /tmp/*.txt&#012;  16 -rwxrwxrwx   1 nobody   nogroup      219 Jun  2 09:28 /tmp/_cmd.txt&#012;   0 -rwxrwxrwx   1 nobody   nogroup        0 Jun  2 09:28 /tmp/_log.txt&#012;</textarea><!--end code block--><br>so yeah, ok.....the variable must not be passing. So $1 is just a cli variable, and $HTTP_POST would be necessary in its stead.<br><br>I'll try that and see what happens.<br><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482325</guid>
<pubDate>Tue, 02 Jun 2009 10:31:03 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482175</link>
<description><![CDATA[<A HREF="/useremail/u/1070900"><b>nwrickert</b></A> : <div class="bquote">Those touches in the beginning....never happen.</div>That's probably because "$1" is undefined.<br><small>--<br>AT&T dsl; Westell 327w modem/router; openSuSE 11.0; firefox 3.0.10</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482175</guid>
<pubDate>Tue, 02 Jun 2009 10:02:38 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482168</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : Something like:<br><br><textarea name="code" class="text" cols=50 rows=10>read -n $CONTENT_LENGTH HTTP_POST&#012;</textarea><!--end code block--><br>Where $HTTP_POST needs to be used instead of $1 in your code.<br>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482168</guid>
<pubDate>Tue, 02 Jun 2009 10:00:56 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482149</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : I think the issue is that the value you're passing via HTTP post is not inserted into $1, like it would be if it were called from the CLI.<br><br>You need to accept the HTTP POST in a different way.<br><br> <blockquote><small>quote:</small><hr>For forms that use METHOD="POST", CGI specifications say that the data is passed to the script or program in the standard input stream (stdin), and the length (in bytes, i.e. characters) of the data is passed in an environment variable called CONTENT_LENGTH. <hr></blockquote><br><br>So you need to read from STDIN, assign it to a variable, and use it instead of $1.  See &raquo;<A HREF="http://www.tcl.tk/man/aolserver3.0/cgi-ch4.htm" >www.tcl.tk/man/aolserver3.0/cgi-ch4.htm</A>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482149</guid>
<pubDate>Tue, 02 Jun 2009 09:55:51 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22482112</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : <div class="bquote"><small>said by  pablo2525 <A HREF="/useremail/u/830709"><IMG SRC="http://i.dslr.net/bb/profile.gif" ALT="See Profile" BORDER=0 WIDTH=16 HEIGHT=11></A> :</small><br><br>I made the following modification to my `vhosts.d' `conf' file:<br> </div>I don't have a "vhosts.d" file...only a httpd.conf one which seems to have something similar<br><textarea name="code" class="text" cols=50 rows=10>    # To use CGI scripts:&#012;    #&#012;    #AddHandler cgi-script .cgi&#012; &#012;    #&#012;</textarea><!--end code block--><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22482112</guid>
<pubDate>Tue, 02 Jun 2009 09:46:01 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22481990</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : well, here is the jist of the code...at least the part I am having problems with. I have to remove some bits of it since it's for work and all...<br><br>here's teh cgi:<br><textarea name="code" class="text" cols=50 rows=10>#!/usr/local/bin/perl&#012;print "Content-type: text/html\n\n" ;&#012;print &lt;&lt;EOF ;&#012;&lt;html&gt;&#012;&lt;FORM METHOD=POST ACTION="dennis.sh"&gt;&#012;&lt;P&gt;&lt;FONT COLOR="#ddd20f" FACE="Trebuchet MS"&gt;&lt;B&gt;Enter data to pass to script below &lt;/B&gt;&lt;/FONT&gt;&lt;BR&gt;&#012;&lt;INPUT NAME="NAME" TYPE="text" SIZE="25" VALUE="enter your data here"&gt;&lt;BR&gt;&#012;&lt;/FONT&lt;/P&gt;&#012;&lt;P&gt;&#012;&lt;center&gt;&lt;INPUT TYPE=submit VALUE="Send"&gt;&#012;&lt;/center&gt;&#012;&lt;/p&gt;&#012;&lt;/FORM&gt;&#012;&lt;/html&gt;&#012;EOF&#012; &#012;exit ;&#012;</textarea><!--end code block--><br>and here is the shell script called dennis.sh<br><br><textarea name="code" class="text" cols=50 rows=10>cat dennis.sh&#012;#!/bin/sh&#012;echo "Content-type: text/plain"&#012;echo&#012;touch /tmp/$1_log.txt&#012;chmod 777 /tmp/$1_log.txt&#012;touch /tmp/$1_cmd.txt&#012;chmod 777 /tmp/$1_cmd.txt&#012;echo copy run $1.cnf force &gt; /tmp/$1_cmd.txt&#012;echo copy $1.cnf binconfs:/$1.cnf force &gt;&gt; /tmp/$1_cmd.txt&#012;echo sh conf exclu int atm \&gt; $1_base.scr &gt;&gt; /tmp/$1_cmd.txt&#012;echo copy $1_base.scr binconfs:/$1_base.scr force &gt;&gt; /tmp/$1_cmd.txt&#012;echo sh conf cat int exclu int gig exclu int fa  \&gt; $1_atm.scr &gt;&gt; /tmp/$1_cmd.txt&#012;echo copy $1_atm.scr binconfs:/$1_atm.scr force &gt;&gt; /tmp/$1_cmd.txt&#012;</textarea><!--end code block--><br>Those touches in the beginning....never happen. I works just fine when I do it from the cli of course...but not via apache. I originally added them in order try and fix this problem but tit seems they don't. And of course the $1 is the variable I'm passing.<br><br>When I have it use a pre-existing file (which won't work for me, was only for testing) then this is the ownership I get.<br><textarea name="code" class="text" cols=50 rows=10>ls -las /tmp/status_out.txt&#012;  16 -rwxrwxrwx   1 nobody   nogroup     7287 Jun  1 17:04 /tmp/status_out.txt&#012;</textarea><!--end code block--><br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22481990</guid>
<pubDate>Tue, 02 Jun 2009 09:18:39 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22480536</link>
<description><![CDATA[<A HREF="/useremail/u/830709"><b>pablo2525</b></A> : I'm running `sh' scripts as CGI's without any issue.<br><br>I made the following modification to my `vhosts.d' `conf' file:<br><br><small>apache code</small>:<div class="syntax"><pre><span class="codetext"><font color="#FFFFFF">        ...<br>          AddHandler cgi-script sh<br>         &lt;/Directory&gt;<br></font></span></pre></div><br>and my shell scripts have to end with `.sh'  To get around having to parse input, I symlink to the actual script as follows:  base name + _ +  switch<br><br>The shell script itself tears $0 apart to find out the switch to use.<br><br>Cheers,<br><br><small>--<br>pablo<br>openSUSE 11.0;KDE<br>ISP:  TekSavvy DSL; backhauled  via a 6KM wireless link</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22480536</guid>
<pubDate>Mon, 01 Jun 2009 22:34:07 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22480064</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : I believe that 'nobody' should be able to write to /tmp without issue, would you mind sharing the code here?  I'm assuming it's written in Bash?<br><br>How are you handling, in the code, the HTTP POST/GET?  How are you sure it's working correctly, are you able to echo it back and see it?  Are you correctly reading the CGI input from stdin?]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22480064</guid>
<pubDate>Mon, 01 Jun 2009 21:16:03 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22479864</link>
<description><![CDATA[<A HREF="/useremail/u/1070900"><b>nwrickert</b></A> : I am not aware of any problem with that.  I'm pretty sure I am using some shell scripts for cgi, though I don't recall whether they write to files.<br><br>Do your web server logs provide any useful information?<br><small>--<br>AT&T dsl; Westell 327w modem/router; openSuSE 11.0; firefox 3.0.10</small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22479864</guid>
<pubDate>Mon, 01 Jun 2009 20:33:20 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22479785</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : well i was doing the output to the /tmp/ directory which is not the CWD...but I do think that the file ownership is "nobody". If that's the case and "nobody" can never create a file even with a shell script then am I pretty much SOL?<br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22479785</guid>
<pubDate>Mon, 01 Jun 2009 20:18:12 EDT</pubDate>
</item>

<item>
<title>Re: running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22479727</link>
<description><![CDATA[<A HREF="/useremail/u/0"><b>anon</b></A> : Could it be that the CWD is not what you expect it to be, essentially, the CGI code should be running under the Apache users (often it's either http or nobody) and Apache does not have permissions to write in the CWD (current working directory).]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22479727</guid>
<pubDate>Mon, 01 Jun 2009 20:09:56 EDT</pubDate>
</item>

<item>
<title>running a shell script via cgi web interface</title>
<link>http://www.dslreports.com/forum/remark,22479675</link>
<description><![CDATA[<A HREF="/useremail/u/296798"><b>Dennis</b></A> : Does anyone know of any pitfalls that could be biting me in the rear in a scenario like this?<br><br>I know running a shell script via cgi is frowned upon, but the server in question is a work based one behind multiple firewalls and also requiring a login. My real problem seems to be getting it to execute a shell script where creation of a local file is required.<br><br>I'm passing a variable, let's use "router1.clli" as an example, via the cgi script and it seems to work fine. If i was at the cli I'd type "sh script.sh router1.clli" but then it gets to the part of the script like "echo router config >> /tmp/router_command.txt" it just never does it.<br><br>Is there a native security feature that apache has configured to prevent it from working? I've even tried putting a "touch router_command.txt" and a "chmod 777 router_command.txt" in the script. I'm just not sure if apache by default can create any type of file even if it's via shell script.<br><small>--<br><A HREF="http://www.dennisjudd.com">My Blog. Because I desperately need the acknowledgement of others.</a><br><br><A HREF="http://www.dennisjudd.com/juddfamily">Visit the Judd Family website to see my kids!</a></small>]]></description>
<guid isPermaLink="true">http://www.dslreports.com/forum/remark,22479675</guid>
<pubDate>Mon, 01 Jun 2009 20:02:04 EDT</pubDate>
</item>

</channel>
</rss>
