Data control must return SUCCESS on images without smack.
[Issue#] SSDWSSP-277
[Bug] security-server_app_give_access returns error on image
without smack.
[Cause] On image without smack user passed "" as a client label.
"" is not acceptable smack label.
[Solution] Function security_server_app_give_access returns SUCCESS
when smack is turn off.
[Verification] Build. Run all tests. No changes in result should be
noticed on smack image.
Change-Id: I0c740ecda07e3ed97f1d409c8e597bc3b1f0b773
int sockfd = -1, retval;
response_header hdr;
+ if (1 != smack_check())
+ return SECURITY_SERVER_SUCCESS;
+
retval = connect_to_server(&sockfd);
if(retval != SECURITY_SERVER_SUCCESS)
{
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
+#include <sys/smack.h>
#include <security-server-common.h>
#include <smack-check.h>
{
static int smack_present = -1;
if (-1 == smack_present) {
- int fd = open("/smack/load2", O_WRONLY);
- if (-1 == fd) {
+ if (NULL == smack_smackfs_path()) {
SEC_SVR_DBG("%s","security-server: no smack found on device");
smack_present = 0;
} else {
SEC_SVR_DBG("%s","security-server: found smack on device");
- close(fd);
smack_present = 1;
}
}