php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch php5.3-set-phpfpm-logs-perms-to-0644.patch for FPM related Bug #61435Patch version 2012-03-19 11:30 UTC Return to Bug #61435 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: php@grange.meIndex: 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; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Nov 21 19:01:29 2024 UTC |