From: Arek Antoniak Date: Fri, 19 Feb 2016 14:17:44 +0000 (+0100) Subject: Added two prioritized configuration file paths, primary and secondary X-Git-Tag: accepted/tizen/common/20160406.143837^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F59944%2F2;p=platform%2Fcore%2Fsystem%2Flibdbuspolicy.git Added two prioritized configuration file paths, primary and secondary Change-Id: I9608d089019ce58208b8e1ead304ae353ebd31c0 --- diff --git a/src/dbuspolicy1/libdbuspolicy1.h b/src/dbuspolicy1/libdbuspolicy1.h index d135e50..846a227 100644 --- a/src/dbuspolicy1/libdbuspolicy1.h +++ b/src/dbuspolicy1/libdbuspolicy1.h @@ -23,8 +23,11 @@ extern "C" { #endif -#define SYSTEM_BUS_CONF_FILE "/etc/dbus-1/system.conf" -#define SESSION_BUS_CONF_FILE "/etc/dbus-1/session.conf" +#define SYSTEM_BUS_CONF_FILE_PRIMARY "/usr/share/dbus-1/system.conf" +#define SESSION_BUS_CONF_FILE_PRIMARY "/usr/share/dbus-1/session.conf" + +#define SYSTEM_BUS_CONF_FILE_SECONDARY "/etc/dbus-1/system.conf" +#define SESSION_BUS_CONF_FILE_SECONDARY "/etc/dbus-1/session.conf" #define SYSTEM_BUS 1 #define SESSION_BUS 2 diff --git a/src/libdbuspolicy1.c b/src/libdbuspolicy1.c index 8130368..21e1a79 100644 --- a/src/libdbuspolicy1.c +++ b/src/libdbuspolicy1.c @@ -247,7 +247,11 @@ DBUSPOLICY1_EXPORT void* dbuspolicy1_init(unsigned int bus_type) return NULL; } - r = __internal_init(bus_type, (bus_type == SYSTEM_BUS) ? SYSTEM_BUS_CONF_FILE : SESSION_BUS_CONF_FILE); + r = __internal_init(bus_type, (bus_type == SYSTEM_BUS) ? SYSTEM_BUS_CONF_FILE_PRIMARY : SESSION_BUS_CONF_FILE_PRIMARY); + if(r < 0) { + printf("Failed to parse primary config file, trying secondary config...\n"); + r = __internal_init(bus_type, (bus_type == SYSTEM_BUS) ? SYSTEM_BUS_CONF_FILE_SECONDARY : SESSION_BUS_CONF_FILE_SECONDARY); + } if(r >= 0) { p_udesc = (struct udesc*)malloc(sizeof(struct udesc)); if(p_udesc) {