lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Nick Trout wrote:
> Its just a PHP script so I assume the Lua script has the same priviledges as
> the PHP script. So assumed if SF are prepared to let joe public set up
> projects and give them root access this script would be okay as well. How
> would I go about changing this?

Well, as explained in the mail of Christian, it's probably a false
You can use PHP's geteuid() to check whether the PGP
script runs as root or not. 

> Incidently - a bit off topic - I can only seem to capture output from the
> exec or system commands in PHP if I call the command directly. I cant seem
> to create a bash script and capture out from this.
> eg. rl:
> #!/bin/bash
> ulimit -t 1
> lua -f makesafe.lua $1
> I can't "rl script.lua > file" in PHP and collect the output. Is there a
> trick here or have can you not collect the output of bash scripts in PHP?
> Nick

Normally, exec("rl script.lua 2>&1 > file"); should work fine.
I must admit that I have not tested it, though. 
Maybe this link helps?

"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer