Development

#2145 ([Patch] set right permissions to log file at their creation time)

You must first sign up to be able to contribute.

Ticket #2145 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

[Patch] set right permissions to log file at their creation time

Reported by: Nicolas.DHOMONT Assigned to: fabien
Priority: minor Milestone: 1.0.10
Component: other Version:
Keywords: Cc:
Qualification: Design decision

Description

I made the attached patch to set 0666 permissions to log files when they are created.

In LAMP production env, usually it's the apache user that creates the log file and usually it's with rw-r--r-- permissions. Say now that the application admin wants to run some tasks (or tests, ...) and that tasks need to log some infos. The application admin doesn't log in with the apache user, he usually uses its own login. He usually neither uses root login because he's not the server admin (shared hosting, server hosted by a hosting company, ...). And then, the task fails (or throws an exception) cause it can't write into the log file. Problem is the same when the application admin runs a script that creates the log file and then the apache user tries to write into it.

In fact, a task called 'permissions' already exists to set the right permissions. But this task also fails because the user that runs it still don't have the right to change the permissions.

That's why I submit this patch that set 0666 permissions to log files when they are created.

Attachments

setPermToLogFileAtCreationTime.patch (0.8 kB) - added by Nicolas.DHOMONT on 08/29/07 18:26:20.

Change History

08/29/07 18:26:20 changed by Nicolas.DHOMONT

  • attachment setPermToLogFileAtCreationTime.patch added.

08/30/07 08:08:52 changed by Markus.Staab

took a look at your patch...

it doesn't make sense to chmod a file which doesn't exist, does it?

08/30/07 11:36:38 changed by Nicolas.DHOMONT

Sure it makes sense because fopen creates the file if it doesn't exist.

You may take a look at The official php documentation in table 90

:)

08/30/07 12:06:50 changed by Nicolas.DHOMONT

sorry : it's table 93

08/31/07 10:35:56 changed by Nicolas.DHOMONT

  • summary changed from [Patch] set right permissions so log file at their creation time to [Patch] set right permissions to log file at their creation time.

10/01/07 08:08:10 changed by dwhittle

  • qualification set to Patch rejected, quality issue.

12/01/07 08:54:06 changed by Carl.Vondrick

  • version deleted.
  • type changed from enhancement to defect.
  • milestone set to 1.1.0.

This issue is present in the trunk as of r6246. Would be great to have it fixed.

12/01/07 23:51:08 changed by dwhittle

  • qualification changed from Patch rejected, quality issue to Design decision.

I have committed to dwhittle branch in 6254.

12/09/07 19:44:53 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [6397]) added 2 options for sfFileLogger (closes #2145)

12/09/07 19:46:13 changed by fabien

  • milestone changed from 1.1.0 to 1.0.10.

in r6398