Use effective ids in ScopedAppContext 10/323710/6
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 6 May 2025 11:35:57 +0000 (13:35 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 14 May 2025 13:29:57 +0000 (13:29 +0000)
Change-Id: I3742af42218e924e0a99ddcf64595d227b9d55b4

src/ckm/privileged/scoped-app-context.cpp

index 80f0df9100cc4e6df24f58dc22040069ad09161d..f19ac9e5aa27be3b17a0c913cdba3a9b7953a2e0 100644 (file)
@@ -30,8 +30,8 @@
 
 ScopedAppContext::ScopedAppContext(const std::string& owner, uid_t user, gid_t group)
     : m_context(SMACK_USER_APP_PREFIX + owner)
-    , m_oldUser(getuid())
-    , m_oldGroup(getgid())
+    , m_oldUser(geteuid())
+    , m_oldGroup(getegid())
 {
     m_context.allowAccessFrom("System", "w");
     m_context.allowAccessTo("System", "w");