Bug 475781 - Prompt the encountered permission problems after scanning with non-root user
Summary: Prompt the encountered permission problems after scanning with non-root user
Status: CONFIRMED
Alias: None
Product: filelight
Classification: Applications
Component: general (show other bugs)
Version: 22.08.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2023-10-18 07:18 UTC by Xinhui Yang
Modified: 2023-10-20 16:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
filelight showing access deined messages in the terminal during a root filesystem scan with normal user (364.57 KB, image/png)
2023-10-18 07:18 UTC, Xinhui Yang
Details
filelight showing access deined messages in the terminal during a root filesystem scan as root (594.33 KB, image/png)
2023-10-18 07:21 UTC, Xinhui Yang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xinhui Yang 2023-10-18 07:18:25 UTC
Created attachment 162401 [details]
filelight showing access deined messages in the terminal during a root filesystem scan with normal user

SUMMARY

When running as the normal user, if we are scanning the entire root directory, any permission problems are ignored and never shown to the user after collecting usage information. The error message is only visible in the stdout if running from a terminal.

Besides that, the result might be inaccurate if those directories contain any files, which is always less than the actual usage.

STEPS TO REPRODUCE
1. Make a directory as root, with permission 0700 (makes it unreadable to other users)
2. Put some large files in it (in order to make some difference between scans with and without root)
2. Start filelight as the normal user
3. Start scan

OBSERVED RESULT

No error window is shown, and the scan is performed as the directories and files that have insufficient permissions do not exist, thus generating an inaccurate result.
If run in a terminal, permission errors are printed to stdout, as shown in the attachment.

EXPECTED RESULT

There are two possible ways to improve this behavior:
1. Filelight shows a warning window, which contains the directories it can not read, and tells the user that the result might be inaccurate.
2. Filelight prompts the user to run filelight as the superuser if such file or directory is encountered.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: AOSC OS 11.0.1
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION

Here are some examples of possible directories unreadable or unexecutable to normal users, and may have significant disk space usage:
- Some directories in /var/log
- /var/lib/machines (systemd-nspawn(1) containers)
- /var/lib/docker
- /var/lib/libvirt
Comment 1 Xinhui Yang 2023-10-18 07:21:32 UTC
Created attachment 162402 [details]
filelight showing access deined messages in the terminal during a root filesystem scan as root

If run as root, no permission problems are printed in the terminal.
The total disk usage is significantly larger than the scan performed as a normal user.