On Thu, 2009-01-29 at 03:49 +1030, Michael Kubler wrote:
> http://au2.php.net/cli
> 
> PHP via command line.
> 
> Michael Kubler
> *G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>
> 
> 
> 
> Shawn McKenzie wrote:
> > Merlin Morgenstern wrote:
> >   
> >> Hi there,
> >>
> >> I am trying to unlink a file which is inside a folder that is not
> >> writable to phps user "www". Of course this failes, but I need to find a
> >> solution for it.
> >>
> >> Backgroud is following:
> >> I have pure-ftpd installed where user directories get created by
> >> pure-ftpd. Unfortunatelly there seems to be a bug and pure-ftpd does
> >> only create the homedirectory folder in 750 mod.
> >> My PHP-Script scans this directories every x minutes and processes those
> >> files. Upon completinon those files should get deleted, but as the dir
> >> is not writable by the user www this failes.
> >>
> >> The dir looks like this:
> >> drwxr-x--- 2 ftpuser ftpgroup 4096 Jan 28 10:18 merlin/
> >>
> >> files inside look like this:
> >> -rwxrwx--- 1 ftpuser ftpgroup 16868 Jan 28 10:20 test.xml*
> >>
> >> User www which executes php via cron is inside the group "ftpgroup".
> >>
> >> Any ideas? I am kind of lost with this one. Thank you for any help!
> >>
> >> Best regards, Merlin
> >>     
> >
> > Why not run the cron as root, or ftpuser?
> >
> >   
I was doing a similar thing with VSFTP, but I had that set the user mask
to allow rw rights to both the owner and the group. If that's not
possible because of your bug, then can you exec out to a shell script to
deal with this? Sudo has an -S parameter which allows the root password
to be given to it over the same command line without prompting, so you
could essentially keep the root password very separate from the PHP.
Obviously, there are various security flaws you would have to try and
tackle with this, but if you really tighten down your scripts this
should not be a problem.


Ash
www.ashleysheridan.co.uk


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

Reply via email to