Re: Permission problem

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

 



On Tue, April 25, 2006 11:16 am, tedd wrote:
> A while back I was persuaded by this illustrious group into thinking
> that placing images in a file system was superior to placing them in
> mySQL -- after all, what could go wrong with a file system solution,
> right?
>
> So I did.
>
> Now, I have a small problem. Unfortunately, most of the images I've
> uploaded have permissions set at chmod 600 (rx- --- ---). Interesting
> enough, considering that all the images were all uploaded with the
> same script, not all of the images have the same permission problem
> -- that's odd.
>
> In any event, I can't back-up, download, copy, change permissions, or
> do anything with the chmod 600 group. Any suggestions as to what I
> can do with these files?

You may not be able to do anything with those files logged in as
'tedd' (or whatever) but the PHP script you wrote ran as a specific
user (probably 'www' or 'nobody') and THAT user can do whatever it
wants to the files, because that user 'owns' them.

So you can write a PHP admin script to copy or change permissions on
the existing files.  You'll have to surf to it for the same user to be
running that script as uploaded the files.

You could also ALTER your upload script for future uploads to change
the http://php.net/umask before you upload files, and
http://php.net/chmod the files after they are uploaded, to provide
access to the 'w'orld or a 'g'roup if your webhost (or you) can put
the PHP user and 'tedd' in the same group.

As far as some of the files being different, those are probably files
you uploaded "by hand" during testing, or your script had, at some
point, calls to umask and or chmod in it, that you altered, or only
called under certain circumstances.

It's also possible that you changed the permissions on the containing
directory at some point, which change "trickled down" to the new files
created within that directory after that point in time.

Once you understand how/why the Unix permissions are what they are,
it's pretty trivial to figure out how to get the files to do what you
want.

-- 
Like Music?
http://l-i-e.com/artists.htm

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