[gnome-packagekit/gnome-2-32] Do not hardcode /usr/libexec as libexecdir
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit/gnome-2-32] Do not hardcode /usr/libexec as libexecdir
- Date: Thu, 7 Oct 2010 14:52:38 +0000 (UTC)
commit 0bda2382b84b7de6272fef03e244e5afd94a0de7
Author: Vincent Untz <vuntz gnome org>
Date: Thu Oct 7 16:50:41 2010 +0200
Do not hardcode /usr/libexec as libexecdir
Note that this makes the code for gpk_dbus_task_path_is_trusted() a bit
more complex since we can't assume $(libexecdir) will be /usr/libexec or
/usr/libexec/, and that will cause issues when comparing strings.
https://bugzilla.gnome.org/show_bug.cgi?id=628962
src/Makefile.am | 1 +
src/gpk-dbus-task.c | 17 +++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 3c4507d..1ca5d4d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,6 +24,7 @@ INCLUDES = \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBDIR=\""$(libdir)"\" \
+ -DLIBEXECDIR=\""$(libexecdir)"\" \
-DLOCALEDIR=\""$(localedir)"\" \
-DVERSION="\"$(VERSION)\"" \
-DGPK_DATA=\"$(pkgdatadir)\" \
diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
index e909d46..a96f08f 100644
--- a/src/gpk-dbus-task.c
+++ b/src/gpk-dbus-task.c
@@ -2956,11 +2956,20 @@ out:
static gboolean
gpk_dbus_task_path_is_trusted (const gchar *exec)
{
+ gboolean res = FALSE;
+ gchar *path;
+
/* special case the plugin helper -- it's trusted */
- if (g_strcmp0 (exec, "/usr/libexec/gst-install-plugins-helper") == 0 ||
- g_strcmp0 (exec, "/usr/libexec/pk-gstreamer-install") == 0)
- return TRUE;
- return FALSE;
+
+ path = g_build_filename (LIBEXECDIR, "gst-install-plugins-helper", NULL);
+ res = res || (g_strcmp0 (exec, path) == 0);
+ g_free (path);
+
+ path = g_build_filename (LIBEXECDIR, "pk-gstreamer-install", NULL);
+ res = res || (g_strcmp0 (exec, path) == 0);
+ g_free (path);
+
+ return res;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]