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.5-set-phpfpm-logs-perms-to-0644.patch for FPM related Bug #61435

Patch version 2013-09-07 13:52 UTC

Return to Bug #61435 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: lekensteyn@gmail.com

diff -ur php-5.5.3.orig/sapi/fpm/fpm/fpm_conf.c php-5.5.3/sapi/fpm/fpm/fpm_conf.c
--- php-5.5.3.orig/sapi/fpm/fpm/fpm_conf.c	2013-08-20 06:46:43.000000000 +0200
+++ php-5.5.3/sapi/fpm/fpm/fpm_conf.c	2013-09-07 15:30:40.588637773 +0200
@@ -939,7 +939,7 @@
 			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 -ur php-5.5.3.orig/sapi/fpm/fpm/fpm_log.c php-5.5.3/sapi/fpm/fpm/fpm_log.c
--- php-5.5.3.orig/sapi/fpm/fpm/fpm_log.c	2013-08-20 06:46:43.000000000 +0200
+++ php-5.5.3/sapi/fpm/fpm/fpm_log.c	2013-09-07 15:30:40.588637773 +0200
@@ -42,7 +42,7 @@
 		}
 		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 -ur php-5.5.3.orig/sapi/fpm/fpm/fpm_php_trace.c php-5.5.3/sapi/fpm/fpm/fpm_php_trace.c
--- php-5.5.3.orig/sapi/fpm/fpm/fpm_php_trace.c	2013-08-20 06:46:43.000000000 +0200
+++ php-5.5.3/sapi/fpm/fpm/fpm_php_trace.c	2013-09-07 15:30:40.588637773 +0200
@@ -17,6 +17,7 @@
 # include <stdint.h>
 #endif
 #include <unistd.h>
+#include <fcntl.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <errno.h>
@@ -140,10 +141,12 @@
 	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(child->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 -ur php-5.5.3.orig/sapi/fpm/fpm/fpm_stdio.c php-5.5.3/sapi/fpm/fpm/fpm_stdio.c
--- php-5.5.3.orig/sapi/fpm/fpm/fpm_stdio.c	2013-08-20 06:46:43.000000000 +0200
+++ php-5.5.3/sapi/fpm/fpm/fpm_stdio.c	2013-09-07 15:30:40.588637773 +0200
@@ -275,7 +275,7 @@
 	}
 #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-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 22:01:23 2020 UTC