evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
10.74k stars 498 forks source link

Fails to run - Arch Linux #227

Closed parkerlreed closed 3 years ago

parkerlreed commented 5 years ago

opensnitch-git 20181122.363_61cf3d1-1 python-grpcio 1.16.1-1 python-grpcio-tools 1.14.0-1 python-unicode-slugify-git r41.8a9c3dc-2 go-pie 2:1.11.2-2

Enabled the service and then tried running the UI.

[parker@e55 ~]$ opensnitch-ui 
Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 40, in <module>
    service = UIService(app, on_exit, args.config)
  File "/usr/lib/python3.7/site-packages/opensnitch/service.py", line 42, in __init__
    self._prompt_dialog = PromptDialog()
  File "/usr/lib/python3.7/site-packages/opensnitch/dialogs/prompt.py", line 44, in __init__
    self._apps_parser = LinuxDesktopParser()
  File "/usr/lib/python3.7/site-packages/opensnitch/desktop_parser.py", line 35, in __init__
    self._parse_desktop_file(desktop_file)
  File "/usr/lib/python3.7/site-packages/opensnitch/desktop_parser.py", line 60, in _parse_desktop_file
    parser.read(desktop_path, 'utf8')
  File "/usr/lib/python3.7/configparser.py", line 696, in read
    self._read(fp, filename)
  File "/usr/lib/python3.7/configparser.py", line 1014, in _read
    for lineno, line in enumerate(fp, start=1):
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 24: invalid continuation byte
jpic commented 5 years ago

Just did a manual build (without aur pkg) and it works for me on arch.

felikcat commented 5 years ago
Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 40, in <module>
    service = UIService(app, on_exit, args.config)
  File "/usr/lib/python3.7/site-packages/opensnitch/service.py", line 42, in __init__
    self._prompt_dialog = PromptDialog()
  File "/usr/lib/python3.7/site-packages/opensnitch/dialogs/prompt.py", line 44, in __init__
    self._apps_parser = LinuxDesktopParser()
  File "/usr/lib/python3.7/site-packages/opensnitch/desktop_parser.py", line 35, in __init__
    self._parse_desktop_file(desktop_file)
  File "/usr/lib/python3.7/site-packages/opensnitch/desktop_parser.py", line 60, in _parse_desktop_file
    parser.read(desktop_path, 'utf8')
  File "/usr/lib/python3.7/configparser.py", line 696, in read
    self._read(fp, filename)
  File "/usr/lib/python3.7/configparser.py", line 1110, in _read
    raise e
configparser.ParsingError: Source contains parsing errors: '/home/arch/.local/share/applications/wine-extension-vmp.desktop'
        [line  4]: '\x01FileVersion\n'

Similar issue using opensnitch-git from the AUR.

lsfxz commented 5 years ago

Maintainer of the AUR package here: Seems like opensnitch sometimes crashes when parsing invalid .desktop files, ie. when those are missing some fields ore have an invalid encoding. I could, for example, reproduce the error @parkerlreed had with recoll installed; changing the encoding of /usr/share/applications/recoll-searchgui.desktop to utf8 fixed it. (I pretty much just put a print statement in line 60 in desktop_parser.py to show me the file that was parsed before the error to find the culprit).

It might help to put some try/catch-thing around parser.read(desktop_path, 'utf8') , but as my python-fu is rather limited I'll leave that to someone who knows how to do it.

OderDochNicht commented 5 years ago

Confirm lsfxz! As soon as I deleted the two [ru] lines Name and Comment in that file the error was gone and opensnitch compiled without further problems.

gustavo-iniguez-goya commented 3 years ago

This should be fixed with latest AUR package.