xwmario / rutorrent

Automatically exported from code.google.com/p/rutorrent
0 stars 0 forks source link

Plugin will not work. rTorrent user can't access #782

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
[08.11.2012 23:14:37] mediainfo: Plugin will not work. rTorrent user can't 
access external program (mediainfo).
[08.11.2012 23:14:37] ratio: Some functionality will be unavailable. rTorrent 
user can't access external program (php).
[08.11.2012 23:14:37] rss: Plugin will not work. rTorrent user can't access 
external program (php).
[08.11.2012 23:14:37] autotools: Plugin will not work. rTorrent user can't 
access external program (php).
[08.11.2012 23:14:37] scheduler: Plugin will not work. rTorrent user can't 
access external program (php).
[08.11.2012 23:14:37] create: Plugin will not work. rTorrent user can't access 
external program (php).
[08.11.2012 23:14:37] rss: Some functionality will be unavailable. rTorrent 
user can't access external program (curl).
[08.11.2012 23:14:37] _task: Some functionality will be unavailable. rTorrent 
user can't access external program (pgrep).
[08.11.2012 23:14:37] create: Some functionality will be unavailable. rTorrent 
user can't access external program (pgrep).
[08.11.2012 23:14:40] DataDir plugin: rTorrent user can't access php 
interpreter. Plugin will not work.

What environment are you using?
1. My ruTorrent version is 3.4
2. My rTorrent version is 0.8.9
3. I use web-server nginx with php-fpm per user (rtorent user is this same that 
php user)

In config.php i have:
$pathToExternals = array(
                "php"   => '/usr/bin/php',
                "curl"  => '/usr/bin/curl',
                "gzip"  => '/bin/gzip',
                "id"    => '/usr/bin/id',
                "stat"  => '/usr/bin/stat'
        );

root@dev:/usr/share/rutorrent/php# which php curl gzip id stat
/usr/bin/php
/usr/bin/curl
/bin/gzip
/usr/bin/id
/usr/bin/stat
root@dev:/usr/share/rutorrent/php# ls -la /usr/bin/php /usr/bin/curl /bin/gzip 
/usr/bin/id /usr/bin/stat
-rwxr-xr-x 1 root root  92720 Feb  9  2012 /bin/gzip
-rwxr-xr-x 1 root root 129696 Mar 23  2012 /usr/bin/curl
-rwxr-xr-x 1 root root  31232 Oct  2 05:23 /usr/bin/id
lrwxrwxrwx 1 root root     21 Nov  6 14:28 /usr/bin/php -> /etc/alternatives/php
-rwxr-xr-x 1 root root  72480 Oct  2 05:23 /usr/bin/stat

wmp1@dev:/usr/share/rutorrent/php$ php --version
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
wmp1@dev:/usr/share/rutorrent/php$ curl --version
curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 
libidn/1.23 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp 
rtsp smtp smtps telnet tftp 
Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 
wmp1@dev:/usr/share/rutorrent/php$ id --version
id (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Arnold Robbins and David MacKenzie.
wmp1@dev:/usr/share/rutorrent/php$ gzip --version
gzip 1.4
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.
wmp1@dev:/usr/share/rutorrent/php$ stat --version
stat (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Michael Meskes.
wmp1@dev:/usr/share/rutorrent/php$ which php curl gzip id stat
/usr/bin/php
/usr/bin/curl
/bin/gzip
/usr/bin/id
/usr/bin/stat
wmp1@dev:/usr/share/rutorrent/php$ cat test.php 
<?php
system('which php');
system('php -i');
?>
wmp1@dev:/usr/share/rutorrent/php$

Output from tets.php:
/usr/bin/php phpinfo() PHP Version => 5.3.10-1ubuntu3.4 System => Linux ...
So all is good, but rutorrent won't work with this exec :(

Original issue reported on code.google.com by janowsk...@gmail.com on 8 Nov 2012 at 10:21

GoogleCodeExporter commented 8 years ago
check open_basedir directive in the php.ini.

Original comment by novik65 on 12 Nov 2012 at 4:09

GoogleCodeExporter commented 8 years ago
Ok, i have restricted grsecurity.

Original comment by janowsk...@gmail.com on 12 Nov 2012 at 8:05

GoogleCodeExporter commented 8 years ago

Original comment by novik65 on 14 Nov 2012 at 4:46