From 6e900f147c5cae47374928fcbfd9b587771bccc0 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Fri, 12 Mar 2021 08:51:44 +0100 Subject: [PATCH] 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 --- repos/gems/src/app/fs_query/main.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repos/gems/src/app/fs_query/main.cc b/repos/gems/src/app/fs_query/main.cc index a3e204d711..b3629736f6 100644 --- a/repos/gems/src/app/fs_query/main.cc +++ b/repos/gems/src/app/fs_query/main.cc @@ -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); }); } /*