From ac06ff7afcb9ef2f844545b565452f91ab763529 Mon Sep 17 00:00:00 2001 From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics" Date: Fri, 10 Jan 2025 17:03:08 +0100 Subject: [PATCH] [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 --- src/common/tools.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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(); -- 2.34.1