return client->subscribe<std::string, int>
(SUBSCRIBER_REGISTER, name, listener);
} catch (runtime::Exception& e) {
- std::cout << e.what() << std::endl;
return -1;
}
}
service->setPrivilegeChecker(std::bind(&Server::checkPeerPrivilege, this, _1, _2));
+ try {
+ audit.reset(new Audit());
+ } catch (runtime::Exception &e) {
+ std::cout << "Kernel has no audit feature the follows" << std::endl;
+ std::cout << " - CONFIG_AUDIT, CONFIG_AUDITSYSCALL" << std::endl;
+ // Just not initialize classes and methods if kernel has no feature
+ return;
+ }
+
service->expose(this, "", (runtime::FileDescriptor)(Server::registerNotificationSubscriber)(std::string));
service->expose(this, "", (int)(Server::unregisterNotificationSubscriber)(std::string, int));
return true;
});
- audit.reset(new Audit());
-
audit->setEnabled(1);
audit->setPID(::getpid());