On Thu, Sep 23, 2010 at 2:12 PM, euromark <dereurom...@googlemail.com> wrote:
> i have a related problem
> using exec('rm xyz') i can delete any (own) file (www-data/apache)
> but how i can i delete a file which has been uploaded with ftp and
> under a different username (e.g. "ftpaccount")?
>
> i tried everything
> from "sudo rm xyz" to "password | sudo -S rm xyz"
>
> i also tried writing a bash script. same result
>
> nothing seemed to work
> the problem is that you are usually prompted for the password
> but with php and exec() you usually can't insert this into the shell
>

You could write a shell script to deal with the file and allow apache
to run it without a password.

Using visudo to update /etc/sudoers:

-- snip --
User_Alias APACHE = www-data
Cmnd_Alias FOO = /path/to/script

APACHE ALL = (ALL) NOPASSWD: FOO
-- snip --

Replace www-data with httpd/apache/nobody as required.

I think that'd work. YMMV. Personally, I'd think about this very carefully.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to