blob: 15c980292f166129ad7d847343dacffd1e032c7f [file] [log] [blame]
Tom Joseph536ea322018-09-14 10:02:20 +05301#include <string>
2#include <experimental/filesystem>
3#include "config.h"
4#include "ldap_mapper_mgr.hpp"
5
6int main(int argc, char** argv)
7{
8 auto bus = sdbusplus::bus::new_default();
9 sdbusplus::server::manager::manager objManager(
10 bus, phosphor::user::mapperMgrRoot);
11
12 phosphor::user::LDAPMapperMgr mapperMgr(bus, phosphor::user::mapperMgrRoot);
13
Tom Joseph0b14c472018-09-30 01:42:59 +053014 // Create a directory to persist errors.
15 std::experimental::filesystem::create_directories(LDAP_MAPPER_PERSIST_PATH);
16
17 // Restore the serialized LDAP group privilege mapping.
18 mapperMgr.restore();
19
Tom Joseph536ea322018-09-14 10:02:20 +053020 // Claim the bus name for the application
21 bus.request_name(LDAP_MAPPER_MANAGER_BUSNAME);
22
23 // Wait for client request
24 while (true)
25 {
26 // Process D-Bus calls
27 bus.process_discard();
28 bus.wait();
29 }
30 return 0;
31}