igo95862 / bubblejail

Bubblewrap based sandboxing for desktop applications
261 stars 17 forks source link

Crash if /etc/bubblejail does not exists. #63

Closed rusty-snake closed 1 year ago

rusty-snake commented 1 year ago

Output of bubblejail --version

0.8.0

Your distro name and version

Fedora 38

Description

STR

Traceback (most recent call last):
  File "/usr/lib64/bubblejail/python_packages/bubblejail/bubblejail_gui_qt.py", line 698, in switch_to_create_instance
    container = CreateInstanceWidget(self)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/bubblejail/python_packages/bubblejail/bubblejail_gui_qt.py", line 574, in __init__
    for profiles_directory in \
  File "/usr/lib64/bubblejail/python_packages/bubblejail/bubblejail_directories.py", line 109, in iter_profile_directories
    profiles_dir.mkdir(exist_ok=True)
  File "/usr/lib64/python3.11/pathlib.py", line 1116, in mkdir
    os.mkdir(self, mode)
FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/etc/bubblejail/profiles'

Expected behaviour

  1. Does not crash because of a missing directory.
  2. Does not crash when it fails to create a system directory (if running as regular user).
igo95862 commented 1 year ago

Hello @rusty-snake

The issue is that if a profiles directory is missing bubblejail will try to recreate it. This was first added when there only was user config directory (under ~/.config) but later a system wide configuration directory was added. This is normally not an issue because the /etc directory exists on most installs but I guess Fedora strips empty directories.

igo95862 commented 1 year ago

Should be fixed in 75c24c3060f53ab27fbac65c0bb3d9ca6b911bdf. The missing directories should now be skipped. Can you give it a try?

rusty-snake commented 1 year ago

Works, Thanks.