Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 445550

Summary: www-apps/rutorrent-3.4-r1: outputs garbage to Apache error.log if PHP is running in strict mode
Product: Gentoo Linux Reporter: Jay Carter <jay>
Component: Current packagesAssignee: Gentoo Web Application Packages Maintainers <web-apps>
Status: RESOLVED FIXED    
Severity: normal CC: creffett, kensington
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: http://code.google.com/p/rutorrent/issues/detail?id=750
Whiteboard:
Package list:
Runtime testing required: ---

Description Jay Carter 2012-12-02 03:02:28 UTC
After successfully installing rutorrent 3.4-r1 and ensuring it was working properly, I went about further securing my server and went directly to editing /etc/php/apache2-php5.4/php.ini to for further hardening. Upon restarting Apache and checking to see rutorrent was still working properly, I found it spitting out PHP Strict errors to the log.add the following directives:

disable_functions = exec,system,shell_exec,passthru
register_globals = Off
expose_php = Off
magic_quotes_gpc = On

Upon restarting Apache and checking to see if my installation of rutorrent was still working, I checked out the Apache error log (/var/log/apache/error.log) and saw the following was being spammed to it:



Reproducible: Always

Steps to Reproduce:
1. Install rutorrent, ensure it is working properly.
2. Edit /etc/php/apache2-php5.4/php.ini and add the following directives:

disable_functions = exec,system,shell_exec,passthru
register_globals = Off
expose_php = Off
magic_quotes_gpc = On

3. Restart Apache, attempt to connect to rutorrent again, ensuring it is still working.
4. Look at the Apache error log (/var/log/apache2/error.log) for the errors being spammed out.
Actual Results:  
Upon following the reproduction steps, the following was being written several times to the Apache error log:

[Sat Dec 01 22:26:38 2012] [error] [client 24.222.139.109] PHP Strict Standards:  Declaration of ABTorrentsEngine::action() should be compatible with commonEngine::action($what, $cat, $arr, $limit, $useGlobalCats) in /var/www/localhost/htdocs/rutorrent/plugins/extsearch/engines/ABTorrents.php on line 71, referer: http://sitenamehere.com/rutorrent/

This same line would repeat about 40 times, once for each search engine found in  /rutorrent/plugins/extsearch/engines/ with the only difference being the search engine name and the line it was called from.

Expected Results:  
The software shouldn't have been spitting out any sort of error messages under PHP Strict mode.

The last release of rutorrent for Gentoo was quite a few months ago and I know their codebase is quite active, so I searched for a bug on the issue to see if there was already a fix. Someone else already had run into the same issue and the bug was marked as fixed. The log here is almost exactly what I have myself: http://code.google.com/p/rutorrent/issues/detail?id=750

The fix is in r2083 from June 29th, 2012 and is the latest revision made to the file. No reports of it returning have surfaced and in testing out this minor change manually, the bug is indeed fixed for me as well.

Here is the diff of the change that needs to be made to fix this bug, a simple one-liner: http://code.google.com/p/rutorrent/source/diff?spec=svn2083&r=2083&format=side&path=/trunk/plugins/extsearch/engines.php

While I have selected the AMD64 hardware platform, I believe that this bug is actually also found in x86 as well.
Comment 1 sebaFlame 2013-03-23 19:16:07 UTC
I can confirm this bug. I made no changes to php.ini though.

Linux jupiter 3.7.5-hardened-r1 #1 SMP Sun Mar 10 06:39:07 CET 2013 x86_64 Intel(R) Pentium(R) D CPU 3.00GHz GenuineIntel GNU/Linux

www-servers/apache-2.2.24
dev-lang/php-5.4.13
www-apps/rutorrent-3.4-r1
Comment 2 Michael Palimaka (kensington) gentoo-dev 2018-01-10 08:50:27 UTC
This should be fixed in 3.8