Add error information for smack 24/244924/1
authorJusung Son <jusung07.son@samsung.com>
Mon, 28 Sep 2020 02:26:11 +0000 (11:26 +0900)
committerJusung Son <jusung07.son@samsung.com>
Mon, 28 Sep 2020 02:26:11 +0000 (11:26 +0900)
Change-Id: I05016d7a1c06d427573e72d62f0f6b2cf7730816
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
notification-ex/shared_file.cc
notification/src/notification_shared_file.c

index eaef907..99f2c44 100644 (file)
@@ -190,9 +190,11 @@ bool SharedFile::IsPrivatePath(string path) const {
     return false;
   }
 
+  errno = 0;
   if (smack_new_label_from_path(path.c_str(), XATTR_NAME_SMACK, 1, &smack_label)
         <= 0) {
-    LOGE("smack_new_label_from_path failed");
+    LOGE("smack_new_label_from_path failed  : %d [%s][%s]",
+        errno, strerror(errno), path.c_str());
     return false;
   }
 
index b7ce797..0179a4c 100644 (file)
@@ -683,10 +683,12 @@ char *notification_check_file_path_is_private(const char *pkg_id,
        int size;
        uid_t uid = getuid();
 
+       errno = 0;
        size = smack_new_label_from_path(file_path, XATTR_NAME_SMACK,
                                                        TRUE, &smack_label);
        if (size <= 0) {
-               ERR("Failed to get smack info");
+               ERR("Failed to get smack info : %d [%s][%s]",
+                               errno, strerror(errno), file_path);
                return NULL;
        }