* 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 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

Reply via email to