From: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics
Date: Fri, 10 Jan 2025 16:03:08 +0000 (+0100)
Subject: [Common] Replace access to /proc/xxx/attr/current with cynara API
X-Git-Tag: accepted/tizen/unified/20250113.133509^0
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac06ff7afcb9ef2f844545b565452f91ab763529;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Common] Replace access to /proc/xxx/attr/current with cynara API
[Verification] Code compiles without errors.
TCT passrate on RPI4 auto tests - 100% for Tizen Web Device API.
Change-Id: Ifc41d55a310bd3f8f393d23ea189ef10f6c3d630
---
diff --git a/src/common/tools.cc b/src/common/tools.cc
index bc29a1be..0f9fdd50 100644
--- a/src/common/tools.cc
+++ b/src/common/tools.cc
@@ -31,6 +31,7 @@
#include
#include
+#include
#include
#endif
@@ -224,11 +225,7 @@ class AccessControlImpl {
free(smack_label);
};
- char path[1024] = {
- 0,
- };
- snprintf(path, sizeof(path), "/proc/%lu/attr/current", static_cast(gettid()));
- int ret = smack_getlabel(path, &smack_label, SMACK_LABEL_ACCESS);
+ int ret = cynara_creds_pid_get_client(gettid(), CLIENT_METHOD_DEFAULT, &smack_label);
if (0 == ret && nullptr != smack_label && 0 < strlen(smack_label)) {
auto uid = getuid();