fs_query: read content only from readable files

When configuring fs_query to print the content of files it used to try so for
all files it found resulting in errors on files that are not readable. Now,
fs_query will check first whether a file is readable and skip printing the
content of those that are not.

Ref #4032
This commit is contained in:
Martin Stein 2021-03-12 08:51:44 +01:00 committed by Christian Helmuth
parent 0507d3f44b
commit 6e900f147c

View File

@ -86,8 +86,9 @@ struct Fs_query::Watched_file
if (_rwx.writeable)
xml.attribute("writeable", "yes");
if (query.attribute_value("content", false))
_gen_content(xml, alloc, dir);
if (_rwx.readable)
if (query.attribute_value("content", false))
_gen_content(xml, alloc, dir);
});
}
/*