Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Nick Wilson
* and then Stut declared > Nick Wilson wrote: > >That makes a lot of sense. I wasnt aware sudoers could be used for > >individual tasks. im not having much luck with it, I suspect it's cos > >what apache really needs permission to do is to 'sudo -u nick' right? > > Is it important that the tr

Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Nick Wilson
* and then Colin Guthrie declared > /usr/bin/transfer_image.sh: > #!/bin/bash > > if [ -z "$1" ]; then > echo "No input file." > exit 1 > fi > scp "$1" [EMAIL PROTECTED]:/var/www/images/ > > > And then in apache: > exec("sudo -u nick /usr/bin/transfer_image.sh $file"); > > (obviously e

Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Stut
Nick Wilson wrote: That makes a lot of sense. I wasnt aware sudoers could be used for individual tasks. im not having much luck with it, I suspect it's cos what apache really needs permission to do is to 'sudo -u nick' right? Is it important that the transfer happens immediately? If not then a

Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Nick Wilson
* and then Colin Guthrie declared > Nick Wilson wrote: > > I think you're on the right track Col. I did a whole bunch more > > searching and the one thing I kept hearing was that no matter what you > > try, you just cant get the webserver to exec the script as another user > > -- so even if im

[PHP] Re: exec returns no output?

2006-09-30 Thread Colin Guthrie
Nick Wilson wrote: > I think you're on the right track Col. I did a whole bunch more > searching and the one thing I kept hearing was that no matter what you > try, you just cant get the webserver to exec the script as another user > -- so even if im saying '[EMAIL PROTECTED]' in both parts of the

Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Nick Wilson
* and then Colin Guthrie declared > Nick Wilson wrote: > > Right, im with you. The keyfile is mine though, and i know i can ssh > > from this box to that without any problem. > > > > I've made a test script for htis and it's returning some very weird > > stuff now. The actual file it outputs

[PHP] Re: exec returns no output?

2006-09-30 Thread Colin Guthrie
Nick Wilson wrote: > Right, im with you. The keyfile is mine though, and i know i can ssh > from this box to that without any problem. > > I've made a test script for htis and it's returning some very weird > stuff now. The actual file it outputs (stdout and stderr) is the actual > image im tryin

Re: [PHP] Re: exec returns no output?

2006-09-30 Thread Nick Wilson
* and then Colin Guthrie declared > Nick Wilson wrote: > >> Do you use generated keys without a password for logging in? Otherwise > >> exec() > >> is just going to sit there while the scp command waits for a password. > > > > Tha'ts exactly what i think it's doing. The -i specifies an ide

[PHP] Re: exec returns no output?

2006-09-30 Thread Colin Guthrie
Nick Wilson wrote: >> Do you use generated keys without a password for logging in? Otherwise >> exec() >> is just going to sit there while the scp command waits for a password. > > Tha'ts exactly what i think it's doing. The -i specifies an identity > file according to the man page for scp so i