[program-l] Re: Apache/linux server dynamically changing file/folder permissions?

  • From: "Jacob Kruger" <jacob@xxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Tue, 3 Sep 2013 15:45:33 +0200

Like said in other mail, don't think apache's file permissions are really 
related to file system's permissions as such, but, more to do with apache's 
allowing you, as a user accessing files via it's serving channels to perform 
certain actions via the access of a file - you can read/retrieve it, execute 
the script/code within it, or make changes to it, and thus you can possibly 
create a new file in a folder, but, issue is since am not really letting web 
browsing identity create an image file, but am using code to copy it out of 
temporary upload location to another location, apache is then suddenly telling 
me that it doesn't like the fact that I had told it to allow at least 
read/retrieval permissions on an image file, or something.

Strangely enough it seemed prepared to let me create .htm files in almost the 
same place, from scratch, and retrieve them, but, wouldn't let me copy uploaded 
image files to a sub-directory, and then try retrieve them just for reading 
thereafter - unless it's something to do with the server having at some stage 
assigned some form of executing/processing to image file types, and that's why 
it's ow blocking them - I'm not the server administrator as such, but anyway.

Maybe I should test/try out combination of file_get_contents(), followed by 
file_put_contents() to virtually create the image files from scratch, adn see 
if that's not something triggering this in that I am copying uploaded files 
over to serving area of site, or something..?

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

  ----- Original Message ----- 
  From: Andy B. 
  To: program-l@xxxxxxxxxxxxx 
  Sent: Tuesday, September 03, 2013 3:10 PM
  Subject: [program-l] Re: Apache/linux server dynamically changing file/folder 
permissions?


  The .htaccess file is not for changing filesystem permissions (if apache can 
even do that). At least on my f19 setup, apache doesn't have the right to do 
anything except use the files in the folder tree it was assigned to. Otherwise 
it is treated as a rebel process out for no good.

   

   

  From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx] 
On Behalf Of David Reynolds
  Sent: Tuesday, September 3, 2013 9:06 AM
  To: program-l@xxxxxxxxxxxxx
  Subject: [program-l] Re: Apache/linux server dynamically changing file/folder 
permissions?

   

  Jacob,

   

  Off the top of my head, can't you make the change permanent using the 
.htaccess file?

   

  Best regards,

   

  David.

   

  E: dkreynolds@xxxxxxxxxxxx

  P: 01628 529218

  M: 07548689154

  From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx] 
On Behalf Of Homme, James
  Sent: 03 September 2013 13:22
  To: program-l@xxxxxxxxxxxxx
  Subject: [program-l] Re: Apache/linux server dynamically changing file/folder 
permissions?

   

  Hi Jacob,

  My memory tells me that Apache runs as a user called nobody. That user has 
very little permissions. That is for security reasons. I'm not sure what the 
best solution for this is in your scase.

   

  Thanks.

   

  Jim

   

   

  From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx] 
On Behalf Of Jacob Kruger
  Sent: Saturday, August 31, 2013 7:09 PM
  To: Program-l
  Subject: [program-l] Apache/linux server dynamically changing file/folder 
permissions?

   

  Just posting this here in case someone has an idea about how to 'fix' 
this/work around it - since haven't managed to find anything via 'net, or other 
PHP specific mailing lists as of yet.

   

  In that small/simple content-management-system posted about other day, issue 
seems to be that while am continually/consistently setting output file and 
folder permissions to 0776 - owner and group rwx, and public rw - for now - 
using PHP's chmod() function, before and after trying to copy/generate any 
output content for it, the server seems to be 
consistently/dynamically/immediately resetting the permissions to something 
slightly different, which won't let me then view/browse all the content.

   

  Silly/simple example is that I will handle image file upload, and copy 
uploaded image to a folder in a script, but, sort of immediately, that image, 
and the folder it's in, and that one's parent folder are 
invisible/unavailable/inaccessible.

   

  Before I then run a sort of recursive script to again reset all content 
permissions, I can't even browse the content via FTP interface - for example.

   

  When generating output/static content, I am also then 
consistently/continually resetting path permissions just before/after creating 
folders and files, if necessary, and that seems to work, some of the time, but, 
not for everything.

   

  Am going to try it out on another server, just to try figure/find out if it's 
a specific issue for this server/part of file structure, or something, but, bit 
irritating thus far...<smile>

   

  Stay well


  Jacob Kruger
  Blind Biker
  Skype: BlindZA
  '...fate had broken his body, but not his spirit...'

   


------------------------------------------------------------------------------


  This e-mail and any attachments to it are confidential and are intended 
solely for use of the individual or entity to whom they are addressed. If you 
have received this e-mail in error, please notify the sender immediately and 
then delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark, its diversified business, or affiliates.

Other related posts: