You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Dave Stahr <da...@stahr.com> on 1999/08/30 19:57:14 UTC

general/4932: PATH variable intermittently lost in CGI scripts

>Number:         4932
>Category:       general
>Synopsis:       PATH variable intermittently lost in CGI scripts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Aug 30 12:10:00 PDT 1999
>Last-Modified:
>Originator:     dave@stahr.com
>Organization:
apache
>Release:        1.3.9
>Environment:
Linux 2.0.36 #1 Sun Mar 7 16:48:12 CST 1999 i686 unknown

Running on a dual PII/450, pretty much standard 5.2 install
>Description:
I never experienced this problem under 1.3.6, which was running for a few months before I upgraded to 1.3.9.  When using simple shell-script CGI, the server seems to occasionally lose track of of the PATH variable.  I noticed this both under shell CGI and perl CGI using backtiks to shell a `sort` or `grep` on something.

The error log shows:
/home/www/www.apartmenthunt.com/cgi/vlist2.cgi: sort: command not found
/home/www/www.apartmenthunt.com/cgi/vlist2.cgi: grep: command not found
/home/www/www.apartmenthunt.com/cgi/vlist2.cgi: sh: command not found
/home/www/www.apartmenthunt.com/cgi/vlist2.cgi: cat: command not found

As mentioned, it only happens intermittently, and can fix by fully qualifying the commands (/bin/grep, etc)
>How-To-Repeat:
bugged version:
http://www.apartmenthunt.com/cgi/bug_vlist2.cgi?19

fixed version:
http://www.apartmenthunt.com/cgi/vlist2.cgi?19
>Fix:
... by fully qualifying the commands (/bin/grep, etc) inside shell scripts and perl scripts
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]