summaryrefslogtreecommitdiffstats
path: root/phosphor-ldap-mapper/main.cpp
blob: 15c980292f166129ad7d847343dacffd1e032c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <string>
#include <experimental/filesystem>
#include "config.h"
#include "ldap_mapper_mgr.hpp"

int main(int argc, char** argv)
{
    auto bus = sdbusplus::bus::new_default();
    sdbusplus::server::manager::manager objManager(
        bus, phosphor::user::mapperMgrRoot);

    phosphor::user::LDAPMapperMgr mapperMgr(bus, phosphor::user::mapperMgrRoot);

    // Create a directory to persist errors.
    std::experimental::filesystem::create_directories(LDAP_MAPPER_PERSIST_PATH);

    // Restore the serialized LDAP group privilege mapping.
    mapperMgr.restore();

    // Claim the bus name for the application
    bus.request_name(LDAP_MAPPER_MANAGER_BUSNAME);

    // Wait for client request
    while (true)
    {
        // Process D-Bus calls
        bus.process_discard();
        bus.wait();
    }
    return 0;
}
OpenPOWER on IntegriCloud