[Bug] Connect function does not notify on nonexisting service
[Cause] N/A
[Solution] New return code SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE is used
[Problem] N/A
[Verification] build, run security-server tests
Change-Id: I1fcf9bf7ba46d02cb43585e3de6095829685d9e9
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
/*! \brief indicating the response from Security Server is malformed */
#define SECURITY_SERVER_API_ERROR_BAD_RESPONSE -3
+/*! \brief indicating the requested service does not exist */
+#define SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE -4
+
/*! \brief indicating requesting object is not exist */
#define SECURITY_SERVER_API_ERROR_NO_SUCH_OBJECT -6
if (strlen(interface) >= sizeof(clientAddr.sun_path)) {
LogError("Error: interface name " << interface << "is too long. Max len is:" << sizeof(clientAddr.sun_path));
- return SECURITY_SERVER_API_ERROR_SOCKET;
+ return SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE;
}
strcpy(clientAddr.sun_path, interface);
LogError("Error connecting socket: " << strerror(err));
if (err == EACCES)
return SECURITY_SERVER_API_ERROR_ACCESS_DENIED;
+ if (err == ENOTSOCK)
+ return SECURITY_SERVER_API_ERROR_NO_SUCH_SERVICE;
return SECURITY_SERVER_API_ERROR_SOCKET;
}