From b8037f407f66f75aff1fa9ecc0b249c98e6d7f93 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 2 Nov 2015 13:15:11 +0100 Subject: [PATCH] Fix bus-test parser check error caused by using wrong runtime path of DBUS_DATADIR. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721 --- bus/config-parser.c | 9 +++------ dbus/dbus-sysdeps-util-win.c | 2 +- dbus/dbus-sysdeps-win.h | 4 ++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bus/config-parser.c b/bus/config-parser.c index 3f59730..791fc57 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3407,12 +3407,9 @@ test_default_session_servicedirs (void) const char *common_progs; char buffer[1024]; - if (_dbus_get_install_root(buffer, sizeof(buffer))) - { - strcat(buffer,DBUS_DATADIR); - strcat(buffer,"/dbus-1/services"); - test_session_service_dir_matches[0] = buffer; - } + strncpy(buffer, _dbus_windows_get_datadir (), sizeof (buffer)); + strncat(buffer, "/dbus-1/services", sizeof (buffer)); + test_session_service_dir_matches[0] = buffer; #endif /* On Unix we don't actually use this variable, but it's easier to handle the diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c index 3b754db..da0abe1 100644 --- a/dbus/dbus-sysdeps-util-win.c +++ b/dbus/dbus-sysdeps-util-win.c @@ -1527,7 +1527,7 @@ _dbus_replace_install_prefix (const char *configure_time_path) * @returns relocated DATADIR static string */ -static const char * +const char * _dbus_windows_get_datadir (void) { return _dbus_replace_install_prefix(DBUS_DATADIR); diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index e9b30d7..7741ca1 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -92,6 +92,10 @@ void _dbus_threads_windows_ensure_ctor_linked (void); DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_getsid(char **sid, dbus_pid_t process_id); + +const char* +_dbus_windows_get_datadir (); #endif + /** @} end of sysdeps-win.h */ -- 1.8.4.5