projects
/
platform
/
core
/
security
/
ode.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix logger usage according to KLAY API changed
[platform/core/security/ode.git]
/
server
/
server.cpp
diff --git
a/server/server.cpp
b/server/server.cpp
index
5d6ab6b
..
dc4b51c
100644
(file)
--- a/
server/server.cpp
+++ b/
server/server.cpp
@@
-16,9
+16,9
@@
#include <cynara-client.h>
#include <cynara-session.h>
#include <cynara-client.h>
#include <cynara-session.h>
-#include <klay/audit/logger.h>
#include <klay/audit/dlog-sink.h>
#include <klay/audit/dlog-sink.h>
+#include "logger.h"
#include "rmi/secure-erase.h"
#include "rmi/internal-encryption.h"
#include "rmi/external-encryption.h"
#include "rmi/secure-erase.h"
#include "rmi/internal-encryption.h"
#include "rmi/external-encryption.h"
@@
-37,15
+37,18
@@
std::unique_ptr<ode::SecureErase> secureErase;
std::unique_ptr<ode::InternalEncryption> internalEncryption;
std::unique_ptr<ode::ExternalEncryption> externalEncryption;
std::unique_ptr<ode::ExtensionEncryption> extensionEncryption;
std::unique_ptr<ode::InternalEncryption> internalEncryption;
std::unique_ptr<ode::ExternalEncryption> externalEncryption;
std::unique_ptr<ode::ExtensionEncryption> extensionEncryption;
+std::unique_ptr<audit::DlogLogSink> _sink = nullptr;
} // namespace
} // namespace
+audit::LogSink *SINK = nullptr;
+
Server::Server()
{
Server::Server()
{
-
audit::Logger::setBackend(new audit::DlogLogSink(
));
-
audit::Logger::setTag("ODE"
);
+
_sink.reset(new audit::DlogLogSink("ODE"
));
+
SINK = dynamic_cast<audit::LogSink*>((_sink).get()
);
- INFO("ODE server starting.");
+ INFO(
SINK,
"ODE server starting.");
service.reset(new rmi::Service(ODE_MANAGER_ADDRESS));
service.reset(new rmi::Service(ODE_MANAGER_ADDRESS));
@@
-87,7
+90,7
@@
bool Server::checkPeerPrivilege(const rmi::Credentials& cred, const std::string&
}
if (::cynara_initialize(&p_cynara, NULL) != CYNARA_API_SUCCESS) {
}
if (::cynara_initialize(&p_cynara, NULL) != CYNARA_API_SUCCESS) {
- ERROR("Failure in cynara API");
+ ERROR(
SINK,
"Failure in cynara API");
return false;
}
return false;
}
@@
-95,7
+98,7
@@
bool Server::checkPeerPrivilege(const rmi::Credentials& cred, const std::string&
std::to_string(cred.uid).c_str(),
privilege.c_str()) != CYNARA_API_ACCESS_ALLOWED) {
::cynara_finish(p_cynara);
std::to_string(cred.uid).c_str(),
privilege.c_str()) != CYNARA_API_ACCESS_ALLOWED) {
::cynara_finish(p_cynara);
- ERROR("Access denied: " + cred.security + " : " + privilege);
+ ERROR(
SINK,
"Access denied: " + cred.security + " : " + privilege);
return false;
}
return false;
}
@@
-106,8
+109,8
@@
bool Server::checkPeerPrivilege(const rmi::Credentials& cred, const std::string&
runtime::FileDescriptor Server::registerNotificationSubscriber(const std::string& name)
{
runtime::FileDescriptor Server::registerNotificationSubscriber(const std::string& name)
{
- INFO("registerNotificationSubscriber");
- INFO(name);
+ INFO(
SINK,
"registerNotificationSubscriber");
+ INFO(
SINK,
name);
return runtime::FileDescriptor(service->subscribeNotification(name), true);
}
return runtime::FileDescriptor(service->subscribeNotification(name), true);
}