nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

opensnitch: 4 digit version breaks opensnitch-ui connection

Open chopper2000uk opened this issue 1 year ago • 2 comments

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

Is this issue important to you?

Add a :+1: reaction to issues you find important.

chopper2000uk avatar Jun 21 '25 14:06 chopper2000uk

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

GrimmTheShrimp avatar Jun 21 '25 16:06 GrimmTheShrimp

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.

chopper2000uk avatar Jun 22 '25 10:06 chopper2000uk