Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 1 | #include "config.h" |
Patrick Williams | 9638afb | 2021-02-22 17:16:24 -0600 | [diff] [blame] | 2 | |
Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 3 | #include "ldap_mapper_mgr.hpp" |
| 4 | |
Patrick Williams | 9638afb | 2021-02-22 17:16:24 -0600 | [diff] [blame] | 5 | #include <filesystem> |
| 6 | #include <string> |
| 7 | |
Ratan Gupta | 0b1ad3d | 2022-01-09 14:09:35 +0530 | [diff] [blame^] | 8 | int main(int /*argc*/, char** /*argv*/) |
Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 9 | { |
| 10 | auto bus = sdbusplus::bus::new_default(); |
| 11 | sdbusplus::server::manager::manager objManager( |
| 12 | bus, phosphor::user::mapperMgrRoot); |
| 13 | |
Tom Joseph | f5bd891 | 2018-11-19 09:49:21 +0530 | [diff] [blame] | 14 | phosphor::user::LDAPMapperMgr mapperMgr(bus, phosphor::user::mapperMgrRoot, |
| 15 | LDAP_MAPPER_PERSIST_PATH); |
Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 16 | |
Tom Joseph | 0b14c47 | 2018-09-30 01:42:59 +0530 | [diff] [blame] | 17 | // Create a directory to persist errors. |
Gunnar Mills | 703131f | 2020-10-28 14:26:33 -0500 | [diff] [blame] | 18 | std::filesystem::create_directories(LDAP_MAPPER_PERSIST_PATH); |
Tom Joseph | 0b14c47 | 2018-09-30 01:42:59 +0530 | [diff] [blame] | 19 | |
| 20 | // Restore the serialized LDAP group privilege mapping. |
| 21 | mapperMgr.restore(); |
| 22 | |
Tom Joseph | 536ea32 | 2018-09-14 10:02:20 +0530 | [diff] [blame] | 23 | // Claim the bus name for the application |
| 24 | bus.request_name(LDAP_MAPPER_MANAGER_BUSNAME); |
| 25 | |
| 26 | // Wait for client request |
| 27 | while (true) |
| 28 | { |
| 29 | // Process D-Bus calls |
| 30 | bus.process_discard(); |
| 31 | bus.wait(); |
| 32 | } |
| 33 | return 0; |
| 34 | } |