opensnitch: 4 digit version breaks opensnitch-ui connection
Nixpkgs version
- Unstable (25.11)
Describe the bug
The opensnitch package version 1.7.0.0 with 4 numbers used for both the git tag and the daemon/ui version number breaks the check_versions in opensintch-ui which expects 3 (major, minor, patch).
https://github.com/evilsocket/opensnitch/blob/5bf02e6f706a9ffccc2206cff26a64b328496042/ui/opensnitch/service.py#L801
https://github.com/evilsocket/opensnitch/blob/5bf02e6f706a9ffccc2206cff26a64b328496042/ui/opensnitch/utils/init.py#L285-L287
Also noticed the opensitch-ui package might be missing a small change:
https://github.com/NixOS/nixpkgs/blob/08f22084e6085d19bcfb4be30d1ca76ecb96fe54/pkgs/by-name/op/opensnitch-ui/package.nix#L44
https://github.com/evilsocket/opensnitch/blob/5bf02e6f706a9ffccc2206cff26a64b328496042/ui/Makefile#L8
Steps to reproduce
Run opensnitch-ui --debug
No values are shown in status bar, i.e. Daemon version and all tabs are empty, except any loaded rules.
Reported as:
Ping exception: too many values to unpack (expected 3)
Expected behaviour
Show the information retrieved from opensnitchd.
Screenshots
No response
Relevant log output
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.12.34, NixOS, 25.11 (Xantusia), 25.11.19700101.dirty - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.28.3 - nixpkgs:
/nix/store/dxc2swd4dhdxnxjiji62b1z0nb5sms0x-source
Notify maintainers
@onny @LordGrimmauld
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- [x] I assert that this is a bug and not a support request.
- [x] I assert that this is not a duplicate of an existing issue.
- [x] I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a :+1: reaction to issues you find important.
Hmm, i'll see whether the following patch fixes that:
diff --git a/ui/opensnitch/utils/__init__.py b/ui/opensnitch/utils/__init__.py
index ce5ae608..2000c0d6 100644
--- a/ui/opensnitch/utils/__init__.py
+++ b/ui/opensnitch/utils/__init__.py
@@ -283,8 +283,8 @@ class QuickHelp():
class Utils():
@staticmethod
def check_versions(daemon_version):
- lMayor, lMinor, lPatch = gui_version.split(".")
- rMayor, rMinor, rPatch = daemon_version.split(".")
+ lMayor, lMinor, lPatch = gui_version.split(".")[:3]
+ rMayor, rMinor, rPatch = daemon_version.split(".")[:3]
return lMayor != rMayor or (lMayor == rMayor and lMinor != rMinor)
@staticmethod
A bit on the naive side, but it should work
I assume the version numbers isn't expected to be changed, or correlate with the release tag versions, which is where this issue has sprung from. I wonder if upstream should be a little more robust, or flexible maybe, at least on point releases as your patch does.