php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61435
Patch php5.5-set-phpfpm-logs-perms-to-0644.patch revision 2013-09-07 13:52 UTC by lekensteyn at gmail dot com
Patch php5.4-set-phpfpm-logs-perms-to-0644-build-fixed.patch revision 2013-02-03 13:29 UTC by lekensteyn at gmail dot com
Patch php5.4-set-phpfpm-logs-perms-to-0644.patch revision 2013-02-03 12:03 UTC by lekensteyn at gmail dot com
Patch php5.3-set-phpfpm-logs-perms-to-0644.patch revision 2012-03-19 11:30 UTC by php at grange dot me

Patch php5.4-set-phpfpm-logs-perms-to-0644.patch for FPM related Bug #61435

Patch version 2013-02-03 12:03 UTC

Return to Bug #61435 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: lekensteyn@gmail.com

diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 25e2cc4..8fd6748 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -921,7 +921,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			if (wp->config->slowlog && *wp->config->slowlog) {
 				int fd;
 
-				fd = open(wp->config->slowlog, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
+				fd = open(wp->config->slowlog, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 				if (0 > fd) {
 					zlog(ZLOG_SYSERROR, "Unable to create or open slowlog(%s)", wp->config->slowlog);
diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c
index 6b014b5..2f30a5b 100644
--- a/sapi/fpm/fpm/fpm_log.c
+++ b/sapi/fpm/fpm/fpm_log.c
@@ -42,7 +42,7 @@ int fpm_log_open(int reopen) /* {{{ */
 		}
 		ret = 0;
 		
-		fd = open(wp->config->access_log, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
+		fd = open(wp->config->access_log, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 		if (0 > fd) {
 			zlog(ZLOG_SYSERROR, "failed to open access log (%s)", wp->config->access_log);
 			return -1;
diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c
index d95d66a..7125388 100644
--- a/sapi/fpm/fpm/fpm_php_trace.c
+++ b/sapi/fpm/fpm/fpm_php_trace.c
@@ -140,10 +140,12 @@ void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
 	TSRMLS_FETCH();
 	fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard);
 	FILE *slowlog;
+	int fd;
 
 	zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);
 
-	slowlog = fopen(child->wp->config->slowlog, "a+");
+	fd = open(wp->config->slowlog, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+	slowlog = fdopen(fd, "a");
 
 	if (!slowlog) {
 		zlog(ZLOG_SYSERROR, "unable to open slowlog (%s)", child->wp->config->slowlog);
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
index 6a587d0..44a5b76 100644
--- a/sapi/fpm/fpm/fpm_stdio.c
+++ b/sapi/fpm/fpm/fpm_stdio.c
@@ -274,7 +274,7 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
 	}
 #endif
 
-	fd = open(fpm_global_config.error_log, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
+	fd = open(fpm_global_config.error_log, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 	if (0 > fd) {
 		zlog(ZLOG_SYSERROR, "failed to open error_log (%s)", fpm_global_config.error_log);
 		return -1;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 15:01:28 2024 UTC