Remove direct access to /proc/xxx/attr/current 05/318805/1 accepted/tizen_unified_x_asan accepted/tizen/unified/20250204.110450 accepted/tizen/unified/x/20250212.043745 accepted/tizen/unified/x/asan/20250211.003300
authorJaehyun Kim <jeik01.kim@samsung.com>
Fri, 24 Jan 2025 07:31:08 +0000 (16:31 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Fri, 24 Jan 2025 07:31:08 +0000 (16:31 +0900)
Direct access to /proc/xxx/attr/current file is no longer permitted,
so the relevant code has been removed.
The function containing the code is now unused
and will be implemented in a different way in the future if needed.

Change-Id: I4a30ee2208f0275bba671ea768368dcd49fb19f6
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
manager/helper/helper-procfs.c

index f68dc00953d31c5fe739f7c71ae9d5f593c1cdc8..3ebfe454d3af4196dc3a70f9fa1bb7b2c2cdc84f 100644 (file)
@@ -149,20 +149,7 @@ API void proc_foreach_pid(proc_pid_cb cb, void *user_data)
 
 int proc_get_label(pid_t pid, char *label)
 {
-       char buf[PROC_BUF_MAX];
-       FILE *fp;
-
-       snprintf(buf, sizeof(buf), "/proc/%d/attr/current", pid);
-       fp = fopen(buf, "r");
-       if (fp == NULL)
-               return STC_ERROR_FAIL;
-
-       if (fgets(label, PROC_NAME_MAX-1, fp) == NULL) {
-               fclose(fp);
-               return STC_ERROR_FAIL;
-       }
-       fclose(fp);
-       return STC_ERROR_NONE;
+       return STC_ERROR_NOTIMPL;
 }
 
 int proc_get_exepath(pid_t pid, char *buf, int len)