Re: Re: exec returns no output?

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

 



* 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" nick@xxxxxxxxxxxxxxxx:/var/www/images/
> 
> 
> And then in apache:
> exec("sudo -u nick /usr/bin/transfer_image.sh $file");
> 
> (obviously escape $file with the escape_shell_cmd() func.)
> 
> /etc/sudoers should contain something like:
> apache ALL = (/usr/bin/transfer_image.sh) NOPASSWD: ALL

Success!

After lots of messing around with visudo, i got this line working right:

apache ALL=(user2runAs) NOPASSWD: /usr/bin/scp-image.sh


Thanks for the help Col, seems it all turned out good -- shame to spend
the whole damn day on something so small though heh..

-- 
Nick Wilson
http://performancing.com/user/1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux