Permissions on created files

This is a discussion on Permissions on created files within the Apache Web Server forums, part of the Web Server and Related Forums category; Server: RH 9 Apache 2.0 PHP When i create a file thru PHP with something like: $fp = fopen ("/...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-13-2004
Sorry Confidential
 
Posts: n/a
Default Permissions on created files

Server: RH 9
Apache 2.0
PHP

When i create a file thru PHP with something like: $fp = fopen ("/tmp/file",
'a+') permissions are -rw-r--r-- 1 apache apache.

How do i change the default permissions or better how to specify permissions
at file creation ?

Regards,


  #2 (permalink)  
Old 01-13-2004
Davide Bianchi
 
Posts: n/a
Default Re: Permissions on created files

Sorry Confidential <sorry_confidential@hotmail.com> wrote:
> How do i change the default permissions or better how to specify permissions
> at file creation ?


Those permissions are correct for the file to be retrived later
by Apache itself. Anyway, setting umask for ther user will fix
the problem.
Davide

--
| A fool and his money are soon using Windows.
|
|
|
|
|
  #3 (permalink)  
Old 01-13-2004
Sorry Confidential
 
Posts: n/a
Default Re: Permissions on created files

umask will allow me to create a file with different permissions fine.

but i still cannot achieve what i want.

Thru a web page a "lock" file is created.
Thru a scheduled process (not root nor apache) i need to delete the log file

Doing the rm i get Operation not permitted.

I added my user to the apache group to no avail, i still cannot delete the
"lock" file

Any ideas ?

Regards,
"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:bu1i2q$c8pqu$1@ID-18487.news.uni-berlin.de...
> Sorry Confidential <sorry_confidential@hotmail.com> wrote:
> > How do i change the default permissions or better how to specify

permissions
> > at file creation ?

>
> Those permissions are correct for the file to be retrived later
> by Apache itself. Anyway, setting umask for ther user will fix
> the problem.
> Davide
>
> --
> | A fool and his money are soon using Windows.
> |
> |
> |
> |
> |



  #4 (permalink)  
Old 01-14-2004
Davide Bianchi
 
Posts: n/a
Default Re: Permissions on created files

Sorry Confidential <sorry_confidential@hotmail.com> wrote:
> Thru a scheduled process (not root nor apache) i need to delete the log filE


You need to run the process with enough permission to delete the
files, note: you can delete a file no matter what the permission on
the file are if you can WRITE in the directory the file is in. So
it doesn't matter the file in itself, but the directory.

Davide

--
| Linux - It is now safe to turn on your computer. -- From a
| Slashdot.org post
  #5 (permalink)  
Old 01-18-2004
Sorry Confidential
 
Posts: n/a
Default Re: Permissions on created files

My temporary files are created in /tmp (since this is a 'special' directory,
i'll change the logic to create temp files in another location where both
users (Apache and my cron user) have write access.

Regards,

"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:bu2nbr$bqqqd$3@ID-18487.news.uni-berlin.de...
> Sorry Confidential <sorry_confidential@hotmail.com> wrote:
> > Thru a scheduled process (not root nor apache) i need to delete the log

filE
>
> You need to run the process with enough permission to delete the
> files, note: you can delete a file no matter what the permission on
> the file are if you can WRITE in the directory the file is in. So
> it doesn't matter the file in itself, but the directory.
>
> Davide
>
> --
> | Linux - It is now safe to turn on your computer. -- From a
> | Slashdot.org post



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:45 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0