From 9e1768ae1bca3e88770c60921994bb6d6084d2ac Mon Sep 17 00:00:00 2001 From: Jussi Lind Date: Tue, 24 Aug 2010 15:41:24 +0300 Subject: [PATCH] Changes: Two temp variables eliminated. --- src/launcher/booster.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/launcher/booster.cpp b/src/launcher/booster.cpp index 100c265..52035bf 100644 --- a/src/launcher/booster.cpp +++ b/src/launcher/booster.cpp @@ -174,17 +174,15 @@ int Booster::launchProcess() if (!errno && cur_prio < m_app.priority()) setpriority(PRIO_PROCESS, 0, m_app.priority()); - // Possible set user ID and group ID of calling process - uid_t uid = getuid(); - gid_t gid = getgid(); + // Set user ID and group ID of calling process if differing + // from the ones we got from invoker - if (uid != m_app.userId()) + if (getuid() != m_app.userId()) setuid(m_app.userId()); - if (gid != m_app.groupId()) + if (getgid() != m_app.groupId()) setgid(m_app.groupId()); - // Load the application and find out the address of main() void* handle = loadMain();