How can a non-root (Qt5/Qt6) wayland GUI also show all root files and paths in a file chooser?

49 Views Asked by At

I am going to port an X11 GUI (running as root) using in Qt5 via PyQt5 and Python3 to a native wayland GUI and Wayland does not support GUI apps running as root for security reasons.

Since it is a backup app the user must be able to select even non-user paths and files (e.g. owned by root) to be contained in the backup/restore (after privilege escalation and asking for the root password).

How can I allow a non-root wayland GUI to show all files in a file system (even those that are only visible to root)?

Note: Technically I want to use the usual QFileDialog of Qt5...

PS: A migration to Qt6 is on its way so a Qt6 solution is preferred

Edit: In Android there is a storage.access.framework for that and I am looking for something similar on Linux

0

There are 0 best solutions below