FS#49392 - [tt-rss] symlinks to data directories at /var/lib/tt-rss/... do not work
Attached to Project:
Community Packages
Opened by Volker Tanger (vtanger) - Wednesday, 18 May 2016, 22:18 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 13 September 2020, 17:43 GMT
Opened by Volker Tanger (vtanger) - Wednesday, 18 May 2016, 22:18 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 13 September 2020, 17:43 GMT
|
Details
Description:
The PHP scripts themselves test the read-write attributes of various directories used for storing temporary and cached files, namely * cache/export * cache/images * cache/js * cache/upload * feed-icons * lock Checking those permissions on symlinks fails with current PHP libraries. Thus TTRSS refuses work unless the "problem" is "fixed". A primitive workaround is to create these directories (with proper permissions) in /usr/share/webapps/tt-rss/ instead of /var/lib/tt-rss/ |
This task depends upon
Closed by Jelle van der Waa (jelly)
Sunday, 13 September 2020, 17:43 GMT
Reason for closing: No response
Sunday, 13 September 2020, 17:43 GMT
Reason for closing: No response
Just create /var/lib/tt-rss/ with proper permissions (like http:http) it works perfectly fine.
It just did not work.
I just debugged the source: it's not a file permission problem but a programming error: in PHP the IS_WRITABLE function checks on real path only and is allergic to symbolic links (likewise for tilde and dotdot parts in the file-to-be-checked-name). This is why the functionality breaks even if the permissions are set correctly.
Thus in
include/sanity_check.php
instead of
if (!is_writable(CACHE_DIR . "/images")) {
it should read
if (!is_writable(realpath(CACHE_DIR . "/images"))) {
The same applies to similar !is_writable tests in this file.
The problem exists upstream, too.
https://tt-rss.org/gitlab/fox/tt-rss/blob/master/include/sanity_check.php
I also agree that it makes more sense to use 'realpath()' functional call. Could you please send a patch upstream?
define('CACHE_DIR', 'cache');
(as is default and coming with the package) or
define('CACHE_DIR', '/var/lib/tt-rss/cache');
The latter will run properly but ignore the symlinks within the /usr tree - and is not the one distributed in the package.
$ grep CACHE_DIR /etc/webapps/tt-rss/config.php
define('CACHE_DIR', 'cache');