summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-util-unix.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-09-30 16:35:49 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-10-05 16:29:29 +0100
commitf830e14d3030c580bd2856f72bcffc0261387216 (patch)
treec0c5dd8af192f1749b89f226c22fff0d35ea6e44 /dbus/dbus-sysdeps-util-unix.c
parenta52034266a60fb471e759a6c3349b11ce6494fdf (diff)
downloaddbus-f830e14d3030c580bd2856f72bcffc0261387216.tar.gz
Use DBusString for all relocation and install-root code
This means we handle OOM correctly, and makes it obvious that we are not overflowing buffers. This change does not affect the actual content of the strings. Instead of redefining DBUS_DATADIR to be a function call (which hides the fact that DBUS_DATADIR is used), this patch makes each use explicit: DBUS_DATADIR is always the #define from configure or cmake, before replacing the prefix. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539 Tested-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r--dbus/dbus-sysdeps-util-unix.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 06a790a8..9d220696 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -1272,17 +1272,18 @@ fail:
return FALSE;
}
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
+/**
+ * Replace the DBUS_PREFIX in the given path, in-place, by the
+ * current D-Bus installation directory. On Unix this function
+ * does nothing, successfully.
*
- * @param configure_time_path
- * @return real path
+ * @param path path to edit
+ * @return #FALSE on OOM
*/
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path)
+dbus_bool_t
+_dbus_replace_install_prefix (DBusString *path)
{
- return configure_time_path;
+ return TRUE;
}
#define DBUS_UNIX_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"