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

Patch version 2012-03-19 11:30 UTC

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

Obsoleted by patches:

Patch Revisions:

Developer: php@grange.me

Index: fpm_php_trace.c
===================================================================
--- fpm_php_trace.c	(revision 324353)
+++ fpm_php_trace.c	(working copy)
@@ -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>
@@ -138,10 +139,12 @@
 {
 	TSRMLS_FETCH();
 	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);
Index: fpm_stdio.c
===================================================================
--- fpm_stdio.c	(revision 324353)
+++ fpm_stdio.c	(working copy)
@@ -274,7 +274,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;
Index: fpm_conf.c
===================================================================
--- fpm_conf.c	(revision 324353)
+++ fpm_conf.c	(working copy)
@@ -908,7 +908,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);
@@ -1171,9 +1171,7 @@
 {
 	char *filename;
 	int *error = (int *)arg;;
-#ifdef HAVE_GLOB
 	glob_t g;
-#endif
 	int i;
 
 	if (!inc || !arg) return;
Index: fpm_log.c
===================================================================
--- fpm_log.c	(revision 324353)
+++ fpm_log.c	(working copy)
@@ -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;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC