Change process_type elements with additional prefix 76/316576/2
authorTomasz Swierczek <t.swierczek@samsung.com>
Fri, 13 Dec 2024 12:24:23 +0000 (13:24 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Fri, 13 Dec 2024 12:52:51 +0000 (13:52 +0100)
askuser-notification couldn't be built because of ambiguity
in the APIs/enums.

Also, added missing header.

Change-Id: I1dbc4ef6cac4cdf74db200b85b790424d3b03ee4

src/client/client-security-manager.cpp
src/include/app-runtime.h
src/include/security-manager-types.h

index 6142d08b92fc013a026760e6c2e47a1d8e990984..0b7d86f98cc161aa496042dbd16fd09044f6bc5a 100644 (file)
@@ -2284,19 +2284,19 @@ int security_manager_set_identity(
     }
     security_manager_pre_check();
     switch (type) {
-    case (process_type::SYSTEM):
+    case (process_type::SM_PROCESS_TYPE_SYSTEM):
         if (smack_set_label_for_self(SMACK_SYSTEM.c_str()) != 0) {
             LogError("Failed to set smack label" << SMACK_SYSTEM << "for current process");
             return SECURITY_MANAGER_ERROR_UNKNOWN;
         }
         return SECURITY_MANAGER_SUCCESS;
-    case (process_type::SYSTEM_PRIVILEGED):
+    case (process_type::SM_PROCESS_TYPE_SYSTEM_PRIVILEGED):
         if (smack_set_label_for_self(SMACK_SYSTEM_PRIVILEGED.c_str()) != 0) {
             LogError("Failed to set smack label" << SMACK_SYSTEM_PRIVILEGED << "for current process");
             return SECURITY_MANAGER_ERROR_UNKNOWN;
         }
         return SECURITY_MANAGER_SUCCESS;
-    case (process_type::APP):
+    case (process_type::SM_PROCESS_TYPE_APP):
         return security_manager_set_process_label_from_appid(app_id);
     }
 
index 4ce099314ee8f54793e2dfdac35dc852753ec7c6..e78038a4ec8a86d47c4467708b05e8ac1c98d5bd 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "security-manager-types.h"
 
+#include <stdbool.h>
 #include <sys/types.h>
 
 #ifdef __cplusplus
index b54f164a21854011206de0abce0070914c1b2f85..68252e0b5a15be295920bb139c7b259704878d2d 100644 (file)
@@ -137,9 +137,9 @@ typedef enum app_defined_privilege_type app_defined_privilege_type;
  * This enum defines the process type.
  */
  enum process_type {
-    SYSTEM = 0,
-    SYSTEM_PRIVILEGED,
-    APP,
+    SM_PROCESS_TYPE_SYSTEM = 0,
+    SM_PROCESS_TYPE_SYSTEM_PRIVILEGED,
+    SM_PROCESS_TYPE_APP,
  };
 typedef enum process_type process_type;