Hi,
I have some legacy code where I use passthru to execute a line which creates a graph using gnuplot and it saves it in a place my php can access. I recently moved from RH enterprise version 3 to 4 and the new server uses selinux policies. After the upgrade my passthru code has broken. The error I get seems to suggest that the command I send thru passthru is unable to access a file in '/tmp'.
I send a command like
passthru("echo 'misc gnuplot parameters; plot "/tmp/tempdata/in.234513' | gnuplot > /var/www/html/tempdata/temp.png")...
and when it is executed, I get the following error in /var/log/httpd/error_log
gnuplot> plot "/tmp/tempdata/in.716311" with lines 1, "/tmp/tempdata/out.716311" with lines 3
^
can't read data file "/tmp/tempdata/in.716311"
line 0: util.c: Permission denied
Now that file is in /tmp and its permissions are:
76 -rw-r--r-- 1 apache apache 68652 Sep 20 00:40 out.716311
and should be able to be read by 'u,g, or o'.
I am wondering if it might be selinux related. Its settings are
-rw-r--r-- apache apache root:object_r:httpd_tmp_t out.716311
Also, I can run the command by hand from a shell and it works nicely.
Any ideas where I can learn about how passthru and/or exec interact / function with selinux?
Redhat ES 4, Apache 2.0.52, php 4.3.9, kernel 2.6.9-11
I have been trying google with no luck.
Thanks,
Dean W.