1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00
phorge-phorge/src/infrastructure
epriestley 80643d63a8 Detect empty $PATH environmental var
Summary:
By default, PHP-FMP (an alternate PHP FCGI SAPI) cleans the entire environment
for child processes. This means we have no $PATH.

This causes some confusing failures for reasons I don't fully understand. If you
do these things:

  exec_manual('env');
  exec_manual('export');

...they show no $PATH, as expected. If you do this:

  exec_manual('echo $PATH');

...it shows a path. And this works (i.e., it finds the executable):

  exec_manual('ls');

...but this fails (it says "no ls in ((null))"):

  exec_manual('which ls');

So, basically, the sh -c process itself gets a default PATH somehow, but its
children don't. I don't realllly get why this happens, but clearly an empty
$PATH is a misconfiguration, and can easily be remedied.

See discussion here: https://github.com/facebook/libphutil/issues/7

Test Plan: Applied patch to Centos6 + nginx + PHP-FPM machine, ran setup, the
configuration issue was detected and I was given information on resolving it.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D1413
2012-01-16 11:49:19 -08:00
..
__tests__ Add test to check all symbols can be loaded 2011-10-20 16:43:13 -07:00
celerity Include added reviewers and ccs in preview 2012-01-04 17:08:13 -08:00
daemon Improve phabot handling of private messages 2012-01-10 15:11:45 -08:00
diff/engine Fix Diffusion rendering of SVN files which did not change 2011-07-20 11:54:33 -07:00
env Lock down accepted next URI values for redirect after login 2012-01-13 11:58:45 -08:00
events Add a "maniphest.update" Conduit method 2012-01-06 11:52:00 -08:00
javelin Prevent CSRF uploads via /file/dropupload/ 2011-08-16 13:19:10 -07:00
lint Add a custom lint name hook to Phabricator 2011-08-31 13:49:30 -07:00
markup/remarkup/markuprule Kill PhabricatorFileURI 2012-01-10 15:21:39 -08:00
setup Detect empty $PATH environmental var 2012-01-16 11:49:19 -08:00
testing/testcase Merge __init_env__.php into __init_script__.php 2011-10-02 11:48:09 -07:00
util/hash Move most remaining sha1() calls to HMAC 2011-12-19 08:56:53 -08:00