LogDebug("security_server_request_cookie() called");
- try {
+ return try_catch([&] {
//checking parameters
if (bufferSize < COOKIE_SIZE) {
LogDebug("Buffer for cookie too small");
memcpy(cookie, &receivedCookie[0], receivedCookie.size());
return retval;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}
SECURITY_SERVER_API
//preprae cookie to send
std::vector<char> key(cookie, cookie + COOKIE_SIZE);
- try {
+ return try_catch([&] {
//put data into buffer
Serialization::Serialize(send, (int)CookieCall::CHECK_PID);
Serialization::Serialize(send, key);
Deserialization::Deserialize(recv, pid);
return pid;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}
SECURITY_SERVER_API
//preprae cookie to send
std::vector<char> key(cookie, cookie + COOKIE_SIZE);
- try {
+ return try_catch([&] {
//put data into buffer
Serialization::Serialize(send, (int)CookieCall::CHECK_PRIVILEGE_GID);
Serialization::Serialize(send, key);
//receive response from server
Deserialization::Deserialize(recv, retval);
return retval;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}
SECURITY_SERVER_API
std::string obj(object);
std::string access(access_rights);
- try {
+ return try_catch([&] {
//put data into buffer
Serialization::Serialize(send, (int)CookieCall::CHECK_PRIVILEGE);
Serialization::Serialize(send, key);
//receive response from server
Deserialization::Deserialize(recv, retval);
return retval;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}
SECURITY_SERVER_API
//preprae cookie to send
std::vector<char> key(cookie, cookie + COOKIE_SIZE);
- try {
+ return try_catch([&] {
//put data into buffer
Serialization::Serialize(send, (int)CookieCall::CHECK_UID);
Serialization::Serialize(send, key);
}
return retval;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}
SECURITY_SERVER_API
//preprae cookie to send
std::vector<char> key(cookie, cookie + COOKIE_SIZE);
- try {
+ return try_catch([&] {
//put data into buffer
Serialization::Serialize(send, (int)CookieCall::CHECK_GID);
Serialization::Serialize(send, key);
}
return retval;
-
- } catch (MessageBuffer::Exception::Base &e) {
- LogDebug("SecurityServer::MessageBuffer::Exception " << e.DumpToString());
- } catch (std::exception &e) {
- LogDebug("STD exception " << e.what());
- } catch (...) {
- LogDebug("Unknown exception occured");
- }
-
- return SECURITY_SERVER_API_ERROR_UNKNOWN;
+ });
}