Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package 
python-proton-vpn-killswitch-network-manager for openSUSE:Factory checked in at 
2024-09-02 13:14:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing 
/work/SRC/openSUSE:Factory/python-proton-vpn-killswitch-network-manager (Old)
 and      
/work/SRC/openSUSE:Factory/.python-proton-vpn-killswitch-network-manager.new.2698
 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-proton-vpn-killswitch-network-manager"

Mon Sep  2 13:14:31 2024 rev:5 rq:1198065 version:0.5.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-proton-vpn-killswitch-network-manager/python-proton-vpn-killswitch-network-manager.changes
        2024-08-06 09:08:34.938329294 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-proton-vpn-killswitch-network-manager.new.2698/python-proton-vpn-killswitch-network-manager.changes
      2024-09-02 13:14:35.614709497 +0200
@@ -1,0 +2,8 @@
+Sat Aug 31 12:22:46 UTC 2024 - Dirk Müller <[email protected]>
+
+- update to 0.5.4:
+  * Only log if kill switch backend is incompatible.
+  * Invert ipv6 detection logic.
+  * Improve error handling.
+
+-------------------------------------------------------------------

Old:
----
  v0.5.0.tar.gz

New:
----
  v0.5.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-proton-vpn-killswitch-network-manager.spec ++++++
--- /var/tmp/diff_new_pack.L21dCI/_old  2024-09-02 13:14:36.102729792 +0200
+++ /var/tmp/diff_new_pack.L21dCI/_new  2024-09-02 13:14:36.106729958 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-proton-vpn-killswitch-network-manager
-Version:        0.5.0
+Version:        0.5.4
 Release:        0
 Summary:        Proton VPN kill switch interface using NetworkManager
 License:        GPL-3.0-or-later

++++++ v0.5.0.tar.gz -> v0.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/debian/changelog 
new/python-proton-vpn-killswitch-network-manager-0.5.4/debian/changelog
--- old/python-proton-vpn-killswitch-network-manager-0.5.0/debian/changelog     
2024-07-11 17:04:53.000000000 +0200
+++ new/python-proton-vpn-killswitch-network-manager-0.5.4/debian/changelog     
2024-08-13 16:07:15.000000000 +0200
@@ -1,3 +1,27 @@
+proton-vpn-killswitch-network-manager (0.5.4) unstable; urgency=medium
+
+  * Only log if kill switch backend is incompatible.
+
+ -- Alexandru Cheltuitor <[email protected]>  Tue, 13 Aug 2024 
12:00:00 +0200
+
+proton-vpn-killswitch-network-manager (0.5.3) unstable; urgency=medium
+
+  * Invert ipv6 detection logic.
+
+ -- Alexandru Cheltuitor <[email protected]>  Mon, 12 Aug 2024 
12:00:00 +0200
+
+proton-vpn-killswitch-network-manager (0.5.2) unstable; urgency=medium
+
+  * Improve error handling.
+
+ -- Alexandru Cheltuitor <[email protected]>  Fri, 09 Aug 2024 
12:00:00 +0200
+
+proton-vpn-killswitch-network-manager (0.5.1) unstable; urgency=medium
+
+  * Change kill switch method depending on IPv6 kernel setting.
+
+ -- Alexandru Cheltuitor <[email protected]>  Tue, 06 Aug 2024 
12:00:00 +0200
+
 proton-vpn-killswitch-network-manager (0.5.0) unstable; urgency=medium
 
   * Add proton-vpn-api-core dependency
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/killswitch_connection.py
 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/killswitch_connection.py
--- 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/killswitch_connection.py
  2024-07-11 17:04:53.000000000 +0200
+++ 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/killswitch_connection.py
  2024-08-13 16:07:15.000000000 +0200
@@ -23,9 +23,9 @@
 from dataclasses import dataclass, field
 import uuid
 
-import gi
+import gi  # pylint: disable=C0411
 gi.require_version("NM", "1.0")
-from gi.repository import NM, GLib  # pylint: disable=C0413 # noqa: E402
+from gi.repository import NM, GLib  # noqa: E402 pylint: disable=C0413
 
 
 DEFAULT_METRIC = -1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/nmkillswitch.py
 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/nmkillswitch.py
--- 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/nmkillswitch.py
   2024-07-11 17:04:53.000000000 +0200
+++ 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/nmkillswitch.py
   2024-08-13 16:07:15.000000000 +0200
@@ -21,9 +21,12 @@
 """
 from typing import Optional, TYPE_CHECKING
 
+import subprocess  # nosec B404:blacklist
+
 from proton.vpn.killswitch.interface import KillSwitch
 from 
proton.vpn.killswitch.backend.linux.networkmanager.killswitch_connection_handler\
     import KillSwitchConnectionHandler
+from proton.vpn.killswitch.backend.linux.networkmanager.util import 
is_ipv6_disabled
 from proton.vpn import logging
 
 if TYPE_CHECKING:
@@ -91,7 +94,36 @@
 
     @staticmethod
     def _validate():
+        is_libnetplan1_installed = False
+
         try:
-            return KillSwitchConnectionHandler().is_network_manager_running
+            KillSwitchConnectionHandler().is_network_manager_running
         except (ModuleNotFoundError, ImportError):
+            logger.error("NetworkManager is not running.")
             return False
+
+        # libnetplan0 is the first version that is present in Ubuntu 22.04. In 
Ubuntu 24.04
+        # the package name changes to libnetplan1, and it's not compatible 
with this kill
+        # switch implementation when IPv6 is disabled via the ipv6.disabled 
kernel option.
+        try:
+            subprocess.run(
+                ["/usr/bin/apt", "show", "libnetplan1"],
+                capture_output=True,
+                check=True, shell=False
+            )  # nosec B603:subprocess_without_shell_equals_true
+            is_libnetplan1_installed = True
+        except (FileNotFoundError, subprocess.CalledProcessError):
+            # if the apt command or the libnetplan1 package are not available 
then it's fine.
+            pass
+
+        # if libnetplan1 is installed (most probably ubuntu 24)
+        # and IPv6 is disabled then the KS backend won't work and we log it.
+        # Note: should be fixed once 
https://github.com/canonical/netplan/pull/495
+        # is merged and pushed to Ubuntu repos.
+        if is_libnetplan1_installed and is_ipv6_disabled():
+            logger.error(
+                "Kill switch does not work with libnetplan1 "
+                "while IPv6 is disabled via the ipv6.disabled=1 kernel 
parameter."
+            )
+
+        return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/util.py
 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/util.py
--- 
old/python-proton-vpn-killswitch-network-manager-0.5.0/proton/vpn/killswitch/backend/linux/networkmanager/util.py
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/python-proton-vpn-killswitch-network-manager-0.5.4/proton/vpn/killswitch/backend/linux/networkmanager/util.py
   2024-08-13 16:07:15.000000000 +0200
@@ -0,0 +1,41 @@
+"""
+Module for Kill Switch based on Network Manager.
+
+
+Copyright (c) 2023 Proton AG
+
+This file is part of Proton VPN.
+
+Proton VPN is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Proton VPN is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with ProtonVPN.  If not, see <https://www.gnu.org/licenses/>.
+"""
+from proton.vpn import logging
+
+
+logger = logging.getLogger(__name__)
+
+
+def is_ipv6_disabled() -> bool:
+    """Returns if IPv6 is disabled at kernel level or not."""
+    filepath = "/sys/module/ipv6/parameters/disable"
+    try:
+        with open(filepath, "r", encoding="utf-8") as ipv6_disabled_file:
+            if ipv6_disabled_file.read().strip() != "0":
+                return True
+    except FileNotFoundError:
+        # If flatpak then we don't have access to the file and assume
+        # IPv6 is enabled.
+        logger.error("Unable to figure if IPv6 is enabled or disabled, 
probably flatpak install.")
+        return False
+
+    return False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/rpmbuild/SPECS/package.spec
 
new/python-proton-vpn-killswitch-network-manager-0.5.4/rpmbuild/SPECS/package.spec
--- 
old/python-proton-vpn-killswitch-network-manager-0.5.0/rpmbuild/SPECS/package.spec
  2024-07-11 17:04:53.000000000 +0200
+++ 
new/python-proton-vpn-killswitch-network-manager-0.5.4/rpmbuild/SPECS/package.spec
  2024-08-13 16:07:15.000000000 +0200
@@ -1,5 +1,5 @@
 %define unmangled_name proton-vpn-killswitch-network-manager
-%define version 0.5.0
+%define version 0.5.4
 %define release 1
 
 Prefix: %{_prefix}
@@ -52,6 +52,18 @@
 %defattr(-,root,root)
 
 %changelog
+* Tue Aug 13 2024 Alexandru Cheltuitor <[email protected]> 0.5.4
+- Only log if kill switch backend is incompatible.
+
+* Mon Aug 12 2024 Alexandru Cheltuitor <[email protected]> 0.5.3
+- Invert ipv6 detection logic.
+
+* Fri Aug 09 2024 Alexandru Cheltuitor <[email protected]> 0.5.2
+- Improve error handling.
+
+* Tue Aug 06 2024 Alexandru Cheltuitor <[email protected]> 0.5.1
+- Change kill switch method depending on IPv6 kernel setting.
+
 * Thu Jul 11 2024 Josep Llaneras <[email protected]> 0.5.0
 - Add proton-vpn-api-core dependency
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/python-proton-vpn-killswitch-network-manager-0.5.0/setup.py 
new/python-proton-vpn-killswitch-network-manager-0.5.4/setup.py
--- old/python-proton-vpn-killswitch-network-manager-0.5.0/setup.py     
2024-07-11 17:04:53.000000000 +0200
+++ new/python-proton-vpn-killswitch-network-manager-0.5.4/setup.py     
2024-08-13 16:07:15.000000000 +0200
@@ -4,7 +4,7 @@
 
 setup(
     name="proton-vpn-killswitch-network-manager",
-    version="0.5.0",
+    version="0.5.4",
     description="Proton Technologies VPN connector for linux",
     author="Proton AG",
     author_email="[email protected]",

Reply via email to