Re: error_log binary unsafe
| From: | Joe Watkins | Date: | Sat, 26 Oct 2013 05:43:25 +0000 |
| Subject: | Re: error_log binary unsafe | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69874@lists.php.net to get a copy of this message | ||
On 10/26/2013 12:25 AM, Yasuo Ohgaki wrote:
Hi Joe, On Sat, Oct 26, 2013 at 3:40 AM, Joe Watkins <krakjoe@php.net> wrote:Like laruence said, error logs are written to various places. Handling only by SAPI will not solve issue, but introduces more confusion. (i.e. double escape/conversion) I also updated manual page that logs are written to various places. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.nethttps://bugs.php.net/bug.php?**id=64439<https://bugs.php.net/bug.php?id=64439>What do we think of the following approach:https://github.com/php/php-**src/pull/505<https://github.com/php/php-src/pull/505>
4713 case 1: /*send an email */
4714 if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
4715 return FAILURE;
4716 }
4717 break;
4718
4719 case 2: /*send to an address */ 4720 php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!"); 4721 return FAILURE; 4722 break;4723
4724 case 3: /*save to a file */
4725 stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | REPORT_ERRORS, NULL);
4726 if (!stream) {
4727 return FAILURE;
4728 }
4729 php_stream_write(stream, message, message_len);
4730 php_stream_close(stream);
4731 break;
4732
4733 case 4: /* send to SAPI */
4734 if (sapi_module.log_message) {
4735 sapi_module.log_message(message TSRMLS_CC);
4736 } else {
4737 return FAILURE;
4738 }
4739 break;
4740
4741 default: 4742 php_log_err(message TSRMLS_CC); 4743 break;Mail is not yet handled, TCP/IP is not supported any more, streams are binary safe. The SAPI and default error logging mechanism are all that require attention. The patch is not final and doesn't include a fix for every implementation of SAPI. I don't see the need for confusion ?? I don't see the need to ignore the problem either. Cheers Joe