Browse Source

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.
master
Riyyi 3 years ago
parent
commit
5ec1272172
  1. 2
      src/dotfile.cpp

2
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

Loading…
Cancel
Save