[asterisk-users] Access rights between AGI and Web server?

Mojo with Horan & Company, LLC mojo at horanappraisals.com
Mon Mar 24 15:09:00 CDT 2008


Vincent wrote:
> On Mon, 24 Mar 2008 11:05:32 -0800, "Mojo with Horan & Company, LLC"
> <mojo at horanappraisals.com> wrote:
>   
>> <?php
>>        $u = posix_getpwuid(posix_getuid());
>>        $g = posix_getgrgid(posix_getgid());
>>        echo "This script is running as ".$u['name'].":".$g['name'];
>> ?>
>>     
>
> 1. Here's the output:
>
> echo exec('id') . "<hr>";
> $u = posix_getpwuid(posix_getuid());
> $g = posix_getgrgid(posix_getgid());
> echo "This script is running as ".$u['name'].":".$g['name'];
> =>
> uid=80(www) gid=80(www) groups=80(www)
> This script is running as www:www
>   
Now, that was run under a webserver. right? not under asterisk as an 
AGI?  I thought we were expecting to see root:wheel :)

I understand that it shouldn't matter WHERE you run it from...

Does -w perms on a dir mean you can't modify files within the dir?  
Means you can't CREATE new files in the dir, but you can modify existing 
files, right?  I guess what I'm wondering is if sqlite does something 
like this, to keep the transaction atomic:

1.  load test.sqlite to memory
2.  add the record
3.  dump it to disk in a tmp file, test.sqlite.asdfasdf
4.  rm test.sqlite && mv test.sqlite.asdfasdf test.sqlite
So I'm wondering if step 3 is breaking because go-w (and group is wheel) 
on agi-bin dir?

Did you follow me?
Moj




More information about the asterisk-users mailing list