File 0001-interfaces-builtin-do-not-hardcode-libexecdir-path.patch of Package snapd

From 3364bf223d5560e4d051608526d4067c429dfeaf Mon Sep 17 00:00:00 2001
Message-ID: <3364bf223d5560e4d051608526d4067c429dfeaf.1767617387.git.maciej.borzecki@canonical.com>
From: Maciej Borzecki <maciej.borzecki@canonical.com>
Date: Mon, 5 Jan 2026 13:42:08 +0100
Subject: [PATCH] interfaces/builtin: do not hardcode libexecdir path

Do not hardcode the path to libexecdir.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
---
 interfaces/builtin/dm_multipath_test.go | 5 ++++-
 interfaces/builtin/nvme_control_test.go | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/interfaces/builtin/dm_multipath_test.go b/interfaces/builtin/dm_multipath_test.go
index 94647f15f3ea53fa97df84128eadd6ca28009bf8..af316a90d2d3933bb345a1c3d1fe91543dbe754e 100644
--- a/interfaces/builtin/dm_multipath_test.go
+++ b/interfaces/builtin/dm_multipath_test.go
@@ -20,8 +20,11 @@
 package builtin_test
 
 import (
+	"fmt"
+
 	. "gopkg.in/check.v1"
 
+	"github.com/snapcore/snapd/dirs"
 	"github.com/snapcore/snapd/interfaces"
 	"github.com/snapcore/snapd/interfaces/apparmor"
 	"github.com/snapcore/snapd/interfaces/builtin"
@@ -116,7 +119,7 @@ func (s *dmMultipathInterfaceSuite) TestUDevConnectedPlug(c *C) {
 KERNEL=="device-mapper", TAG+="snap_other_app"`,
 		`# dm-multipath
 KERNEL=="dm-[0-9]*", TAG+="snap_other_app"`,
-		`TAG=="snap_other_app", SUBSYSTEM!="module", SUBSYSTEM!="subsystem", RUN+="/usr/lib/snapd/snap-device-helper $env{ACTION} snap_other_app $devpath $major:$minor"`,
+		fmt.Sprintf(`TAG=="snap_other_app", SUBSYSTEM!="module", SUBSYSTEM!="subsystem", RUN+="%s/snap-device-helper $env{ACTION} snap_other_app $devpath $major:$minor"`, dirs.DistroLibExecDir),
 	})
 }
 
diff --git a/interfaces/builtin/nvme_control_test.go b/interfaces/builtin/nvme_control_test.go
index 62237f4d926738000f2e9f21218221687bfde4e3..32c8539d2cf03d6812668b1ec2c5c7efa5783fef 100644
--- a/interfaces/builtin/nvme_control_test.go
+++ b/interfaces/builtin/nvme_control_test.go
@@ -20,8 +20,11 @@
 package builtin_test
 
 import (
+	"fmt"
+
 	. "gopkg.in/check.v1"
 
+	"github.com/snapcore/snapd/dirs"
 	"github.com/snapcore/snapd/interfaces"
 	"github.com/snapcore/snapd/interfaces/apparmor"
 	"github.com/snapcore/snapd/interfaces/builtin"
@@ -114,7 +117,7 @@ func (s *nvmeControlInterfaceSuite) TestUDevConnectedPlug(c *C) {
 KERNEL=="nvme-fabrics", TAG+="snap_other_app"`,
 		`# nvme-control
 SUBSYSTEM=="nvme", TAG+="snap_other_app"`,
-		`TAG=="snap_other_app", SUBSYSTEM!="module", SUBSYSTEM!="subsystem", RUN+="/usr/lib/snapd/snap-device-helper $env{ACTION} snap_other_app $devpath $major:$minor"`,
+		fmt.Sprintf(`TAG=="snap_other_app", SUBSYSTEM!="module", SUBSYSTEM!="subsystem", RUN+="%s/snap-device-helper $env{ACTION} snap_other_app $devpath $major:$minor"`, dirs.DistroLibExecDir),
 	})
 }
 
-- 
2.52.0

openSUSE Build Service is sponsored by