blob: e0d2255ff5fcffe9405548777dfc6dba20dad726 [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
Tom Josephf5bd8912018-11-19 09:49:21 +053012 phosphor::user::LDAPMapperMgr mapperMgr(bus, phosphor::user::mapperMgrRoot,
13 LDAP_MAPPER_PERSIST_PATH);
Tom Joseph536ea322018-09-14 10:02:20 +053014
Tom Joseph0b14c472018-09-30 01:42:59 +053015 // Create a directory to persist errors.
16 std::experimental::filesystem::create_directories(LDAP_MAPPER_PERSIST_PATH);
17
18 // Restore the serialized LDAP group privilege mapping.
19 mapperMgr.restore();
20
Tom Joseph536ea322018-09-14 10:02:20 +053021 // Claim the bus name for the application
22 bus.request_name(LDAP_MAPPER_MANAGER_BUSNAME);
23
24 // Wait for client request
25 while (true)
26 {
27 // Process D-Bus calls
28 bus.process_discard();
29 bus.wait();
30 }
31 return 0;
32}