Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running sys_exec/sys_eval without results under Ubuntu 64 #2

Open
cassianotartari opened this issue Jun 30, 2014 · 0 comments
Open

Comments

@cassianotartari
Copy link
Contributor

I would like to understand what is going on here. I've compiled and created the functions inside my database but for my propose it is not working. I would like to trigger a function to run a php script but it won't work here. Running my php script over terminal it works but calling sys_eval or sys_exec not.

For example:

$ psql -h 127.0.0.1 -p 5432 -U root

root-# select sys_exec('/usr/bin/php5 -e "/var/www/html/project/web/do_jobs.php" "/bin/cp /home/cassiano/Desktop/index.html /home/cassiano/"');
 sys_exec 
----------
        0
(1 row)

And my test don't work, the php receive a parameter to run a system command and do others stuff. Running in shell the script works well.

When I run:

root=# select sys_eval('echo $UID');
 sys_eval 
----------

(1 row)

But in shell:

$ echo $UID
1000

It returns '1000'.

Another example: in shell and in sys_eval it returns the same result:

$ id
uid=1000(cassiano) gid=1000(cassiano) groups=1000(cassiano),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare)
root=# select sys_eval('id');
                                sys_eval                                
------------------------------------------------------------------------
 uid=118(postgres) gid=128(postgres) groups=128(postgres),107(ssl-cert)
(1 row)

Is it something that I'm doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant