Remove smack application labeling code 44/46944/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Mon, 24 Aug 2015 05:17:01 +0000 (14:17 +0900)
committerSungmin Kwak <sungmin.kwak@samsung.com>
Thu, 27 Aug 2015 10:24:17 +0000 (19:24 +0900)
Change-Id: Iffb8cd9386a0fb6b806f2eab01bd385f180ae4ac

ism/src/ise_preexec.cpp

index 8f932a02bf4ac8401057126f486079f4ce68d909..450eca341b47f2d16ece06ea4c47c1bde8914cf2 100644 (file)
@@ -312,34 +312,6 @@ static inline int __set_dac ()
 #endif
 }
 
-static inline int __set_smack (char* path)
-{
-    /*
-     * This is additional option.
-     * Though such a application fails in this function, that error is ignored.
-     */
-    char label[LABEL_LEN + 1] = {0, };
-    int fd = 0;
-    int result = -1;
-
-    result = lgetxattr (path, "security.SMACK64EXEC", label, LABEL_LEN);
-    if (result < 0)  // fail to get extended attribute
-        return 0;   // ignore error
-
-    fd = open ("/proc/self/attr/current", O_RDWR);
-    if (fd < 0)      // fail to open file
-        return 0;   // ignore error
-
-    result = write (fd, label, strlen (label));
-    if (result < 0) {    // fail to write label
-        close (fd);
-        return 0;   // ignore error
-    }
-
-    close (fd);
-    return 0;
-}
-
 typedef struct {
     std::string package_type;
     std::string package_name;
@@ -452,9 +424,6 @@ int ise_preexec (const char *helper, const char *uuid)
     /* SET OOM*/
     __set_oom ();
 
-    /* SET SMACK LABEL */
-    __set_smack (const_cast<char*>(info.app_path.c_str ()));
-
     /* SET DAC*/
     if (__set_dac() != PC_OPERATION_SUCCESS) {
         LOGW ("fail to set DAC - check your package's credential\n");