From: Jusung Son Date: Mon, 28 Sep 2020 02:26:11 +0000 (+0900) Subject: Add error information for smack X-Git-Tag: submit/tizen/20201028.051031~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31c4d4cc29e5a0e8ddeb0f7723607b608c48e4d5;p=platform%2Fcore%2Fapi%2Fnotification.git Add error information for smack Change-Id: I05016d7a1c06d427573e72d62f0f6b2cf7730816 Signed-off-by: Jusung Son --- diff --git a/notification-ex/shared_file.cc b/notification-ex/shared_file.cc index eaef907..99f2c44 100644 --- a/notification-ex/shared_file.cc +++ b/notification-ex/shared_file.cc @@ -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; } diff --git a/notification/src/notification_shared_file.c b/notification/src/notification_shared_file.c index b7ce797..0179a4c 100644 --- a/notification/src/notification_shared_file.c +++ b/notification/src/notification_shared_file.c @@ -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; }