Bugfix. libdbuspolicy should load only files with names ending with ".conf",
as dbus-daemon does. Added an incorrect configuration file as regression test.
Change-Id: I868c04d6475101abfe2ffcd551b8eb9ce9bf4305
#define _XML_PARSER_HPP
#include <set>
+#include <boost/algorithm/string/predicate.hpp>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
if ((dir = opendir(dname.c_str())) != NULL) {
while ((ent = readdir(dir)) != NULL) {
std::string s(ent->d_name);
- if (s.find(".conf") != std::string::npos) {
+ if (boost::algorithm::ends_with(s, ".conf")) {
files.push_back(dname + std::string("/") + s);
}
}
--- /dev/null
+<!DOCTYPE busconfig PUBLIC
+ "-//tizen//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.tizen.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <!-- this file shouldn't be loaded. The rule below interferes with other rules -->
+ <policy user="root">
+ <allow own="*"/>
+ </policy>
+</busconfig>