socket-manager: removes tizen specific call 31/90531/1
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 8 Jan 2016 15:53:46 +0000 (16:53 +0100)
committerRafal Krypa <r.krypa@samsung.com>
Fri, 30 Sep 2016 10:43:58 +0000 (12:43 +0200)
The function 'smack_fgetlabel' is specific to Tizen
and is no more maintained upstream.

Change-Id: Ic405743f73109fae8d0d000394c542e491b7d953
Signed-off-by: José Bollo <jobol@nonadev.net>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
src/server/main/socket-manager.cpp

index 06c47907f8d52c06f69e2bd9394570d878b39b6e..6bd63df82111f9120c444f979eda11b2e93dd7a9 100644 (file)
@@ -30,6 +30,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/smack.h>
+#include <linux/xattr.h>
 #include <sys/un.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -526,9 +527,9 @@ int SocketManager::CreateDomainSocketHelp(
        if (smack_check()) {
                LogInfo("Set up smack label: " << desc.smackLabel);
 
-               if (0 != smack_fsetlabel(sockfd, desc.smackLabel.c_str(), SMACK_LABEL_IPIN)) {
-                       LogError("Error in smack_fsetlabel");
-                       ThrowMsg(Exception::InitFailed, "Error in smack_fsetlabel");
+               if (0 != smack_set_label_for_file(sockfd, XATTR_NAME_SMACKIPIN, desc.smackLabel.c_str())) {
+                       LogError("Error in smack_set_label_for_file");
+                       ThrowMsg(Exception::InitFailed, "Error in smack_set_label_for_file");
                }
        } else
                LogInfo("No smack on platform. Socket won't be securied with smack label!");