summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-06-26 08:27:48 -0400
committerVictor Kareh <[email protected]>2026-06-26 10:36:47 -0400
commitc2bd5842c77915ab31a986e4fe032870755b2fd4 (patch)
tree2f126666994a3c95bc945819fc98e86ff17334fd
parent5d57ff70a38801c26f77b71d0db86cb530252022 (diff)
downloadmate-power-manager-backlight-helper-usrmerge-path.tar.bz2
mate-power-manager-backlight-helper-usrmerge-path.tar.xz
backlight: move helper from sbindir to libexecdirbacklight-helper-usrmerge-path
On systems that symlink /usr/sbin to /usr/bin, pkexec resolves the mate-power-backlight-helper path canonically to /usr/bin but the polkit annotation references /usr/sbin. This causes pkexec to require authentication every time the brightness is changed. This moves mate-power-backlight-helper to libexecdir and update the polkit policy annotation and command call accordingly. Fixes #411
-rw-r--r--meson.build1
-rw-r--r--policy/Makefile.am2
-rw-r--r--policy/meson.build2
-rw-r--r--policy/org.mate.power.policy.in22
-rw-r--r--src/Makefile.am4
-rw-r--r--src/gpm-brightness.c4
-rw-r--r--src/meson.build4
7 files changed, 9 insertions, 10 deletions
diff --git a/meson.build b/meson.build
index 4b2b940..e6efa96 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,6 @@ mateexecdir = join_paths(prefix, get_option('libexecdir'))
matedatadir = join_paths(prefix, get_option('datadir'))
matelocaledir = join_paths(prefix, get_option('localedir'))
matebindir = join_paths(prefix, get_option('bindir'))
-matesbindir = join_paths(prefix, get_option('sbindir'))
matemandir = join_paths(prefix, get_option('mandir'))
pkgdatadir = join_paths(matedatadir, meson.project_name())
mateicons = join_paths(pkgdatadir, 'icons')
diff --git a/policy/Makefile.am b/policy/Makefile.am
index 0e1f8b9..19025df 100644
--- a/policy/Makefile.am
+++ b/policy/Makefile.am
@@ -6,7 +6,7 @@ $(polkit_policy_DATA): $(polkit_policy_in_files)
$(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
.in2.in:
- sed "s|[@]sbindir@|${sbindir}|" $< > $@
+ sed "s|[@]libexecdir@|${libexecdir}|" $< > $@
EXTRA_DIST = org.mate.power.policy.in2
DISTCLEANFILES = $(polkit_policy_DATA) $(polkit_policy_in_files)
diff --git a/policy/meson.build b/policy/meson.build
index 0c55ae8..eac1db8 100644
--- a/policy/meson.build
+++ b/policy/meson.build
@@ -1,6 +1,6 @@
po_dir = join_paths(meson.source_root(), 'po')
dataconf = configuration_data()
-dataconf.set('sbindir', matesbindir)
+dataconf.set('libexecdir', mateexecdir)
i18n.merge_file(
input : configure_file(
diff --git a/policy/org.mate.power.policy.in2 b/policy/org.mate.power.policy.in2
index c1c81d6..bf3e6a2 100644
--- a/policy/org.mate.power.policy.in2
+++ b/policy/org.mate.power.policy.in2
@@ -26,7 +26,7 @@
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
- <annotate key="org.freedesktop.policykit.exec.path">@sbindir@/mate-power-backlight-helper</annotate>
+ <annotate key="org.freedesktop.policykit.exec.path">@libexecdir@/mate-power-backlight-helper</annotate>
</action>
</policyconfig>
diff --git a/src/Makefile.am b/src/Makefile.am
index da49dab..c130d54 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,7 @@ AM_CPPFLAGS = \
-DI_KNOW_THE_DEVICEKIT_POWER_API_IS_SUBJECT_TO_CHANGE \
$(UPOWER_CFLAGS) \
-DBINDIR=\"$(bindir)\" \
- -DSBINDIR=\"$(sbindir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
-DMATELOCALEDIR=\""$(datadir)/locale"\" \
-DDATADIR=\"$(datadir)\" \
-DPREFIX=\""$(prefix)"\" \
@@ -46,7 +46,7 @@ bin_PROGRAMS = \
mate-power-statistics \
$(NULL)
-sbin_PROGRAMS = \
+libexec_PROGRAMS = \
mate-power-backlight-helper \
$(NULL)
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index a3a0589..36c2f0f 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -127,7 +127,7 @@ gpm_brightness_helper_get_value (const gchar *argument)
gchar *command = NULL;
/* get the data */
- command = g_strdup_printf (SBINDIR "/mate-power-backlight-helper --%s", argument);
+ command = g_strdup_printf (LIBEXECDIR "/mate-power-backlight-helper --%s", argument);
ret = g_spawn_command_line_sync (command,
&stdout_data, NULL, &exit_status, &error);
if (!ret) {
@@ -159,7 +159,7 @@ gpm_brightness_helper_set_value (const gchar *argument, gint value)
gchar *command = NULL;
/* get the data */
- command = g_strdup_printf ("pkexec " SBINDIR "/mate-power-backlight-helper --%s %i", argument, value);
+ command = g_strdup_printf ("pkexec " LIBEXECDIR "/mate-power-backlight-helper --%s %i", argument, value);
ret = g_spawn_command_line_sync (command, NULL, NULL, &exit_status, &error);
if (!ret) {
g_error ("failed to get value: %s", error->message);
diff --git a/src/meson.build b/src/meson.build
index 35a0b88..e8b6c2e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -24,7 +24,7 @@ cflags = [
'-DG_LOG_DOMAIN="PowerManager"',
'-DGPM_ICONS_DATA="@0@"'.format(mateicons),
'-DINHIBIT_MENU_UI_DIR="@0@"'.format(mateui),
- '-DSBINDIR="@0@"'.format(matesbindir),
+ '-DLIBEXECDIR="@0@"'.format(mateexecdir),
'-DBINDIR="@0@"'.format(matebindir),
'-DGTKBUILDERDIR="@0@"'.format(pkgdatadir),
'-DEGG_VERBOSE="GPM_VERBOSE"',
@@ -85,7 +85,7 @@ executable(
link_with :libmpm_shared,
c_args : cflags,
install : true,
- install_dir : get_option('sbindir')
+ install_dir : get_option('libexecdir')
)
mate_power_statistics_resources = gnome.compile_resources(