This question about Configuration: Answered

How did configure get my personal PATH

I installed 1.1.4 (the Support menus need updating :-)

When I ran configure for the first time and save, I got an error. (ref. Support/Question891 ).

I debugged the error by checking my LocalSite.cfg and, as was in the case SteveBa reported in Question891, my $Foswiki::cfg{SafeEnvPath} was bad (unsafe).

What I'm wondering is, where did configure get the info it put into $Foswiki::cfg{SafeEnvPath}? It used my personal (shell login) PATH settings, i.e. it had
$Foswiki::cfg{SafeEnvPath} = '/Users/vlb_sh/bin:/usr/local/bin:/usr/local/nib:/opt/local/bin:/usr/bin:/bin:/etc:/usr/local/mysql/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/local/games:/usr/games:.:/usr/local/apache/bin:/Users/vlb_sh/nib:/Users/rdm_sh/bin:/Users/vlb_sh/projex/ptf/bin';

but Foswiki is configured to run as user www, different uid from my own. I did authenticate as VickiBrown but that's a Foswiki user name and shouldn't connect to vlb.

... I'm Confused.

-- VickiBrown - 22 Jan 2012

that is well wicked :/

I'm as surprised as you are.

-- SvenDowideit - 22 Jan 2012

At the bottom of the Configure - Web Server Environment tab, what are the values for
  • CGI User
  • Original Path
  • Current Path

I recall seeing similar behavior on Linux, but I run my server cgi scripts under my own userid using SuexecUserGroup Of course now that I look, it's not picking up my user path. Here is the code that guesses it for configure when it's missing:

    if ( defined( $ENV{PATH} ) ) {
            $ENV{PATH} =~ /(.*)/;
            $Foswiki::cfg{SafeEnvPath} = $1;
    }

-- GeorgeClark - 22 Jan 2012

That's it George. That's the answer:


CGI user   userid = vlb_sh groups = _www, _www
Your CGI scripts are executing as this user.
Original PATH   /Users/vlb_sh/bin:/usr/local/bin:/usr/local/nib:/opt/local/bin:/usr/bin:/bin:/etc:/usr/local/mysql/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/local/games:/usr/games:.:/usr/local/apache/bin:/Users/vlb_sh/nib:/Users/rdm_sh/bin:/Users/vlb_sh/projex/ptf/bin
This is the PATH value passed in from the web server to this script - it is reset by Foswiki scripts to the PATH below, and is provided here for comparison purposes only.
Current PATH   /usr/local/bin:/usr/bin:/bin:/etc
This is the actual PATH setting that will be used by Perl to run programs. It is normally identical to {SafeEnvPath}, unless that variable is empty, in which case this will be the webserver user's standard path..

I'm thinking that Foswiki probably should not default to the current user's path when creating SafeEnvPath. smile

-- VickiBrown - 23 Jan 2012
 

QuestionForm edit

Subject Configuration
Extension
Version Foswiki 1.1.3
Status Answered
Related Topics
Topic revision: r5 - 06 Feb 2012, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy