From 5ec1272172ad8b52f14785f16378cd55db16341f Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sun, 23 Jan 2022 23:51:15 +0100 Subject: [PATCH] Manager: Set process group ID before user ID setegid() needs to be called before seteuid(); otherwise, the setegid() call will fail because the process no longer has root privileges. --- src/dotfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotfile.cpp b/src/dotfile.cpp index 9c0b328..fa57a22 100644 --- a/src/dotfile.cpp +++ b/src/dotfile.cpp @@ -190,8 +190,8 @@ void Dotfile::sync(SyncType type, auto copy = [&root, &printError](const std::filesystem::path& from, const std::filesystem::path& to, bool homePath) -> void { if (homePath && root) { - seteuid(Machine::the().uid()); setegid(Machine::the().gid()); + seteuid(Machine::the().uid()); } // Create directory for the file