[Gllug] /usr/bin/env and the web server user account

Steve Parker steve at steve-parker.org
Thu May 19 23:23:39 UTC 2011


On 19/05/11 22:21, gvim wrote:
> I've read that:
>
> /usr/bin/env perl
>
> .... rather than:
>
> /usr/bin/perl
>
> .... is the way to go as it solves portability problems but it seems 
> to introduce new problems. If my perl script is running as a CGI the 
> owner of that process will be the owner of the web server process, 
> typically 'www' or 'apache'. Since these system user accounts are 
> non-login $PATH is non-configurable, defeating the purpose of 
> /usr/bin/env, surely?
I would say so, yes. If there is no environment, why bother changing (or 
unsetting) it with env?
I've never used this syntax, but have seen it used enough times, and my 
understanding is (as you say) that it is to provide a clean environment: 
/usr/bin/env FOO=bar myapp.
 From info:
23.2 `env': Run a command in a modified environment
===================================================

`env' runs a command with a modified environment.

All I can think of is that /etc/security/pam_env.conf could possibly 
come into play here... - man pam_env.conf for more

Steve
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list