int uid this- uid std thread item uid if fork if fork setresuid uid ui

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
int uid = this->uid;
std::thread([item, uid]{
if (fork() == 0) {
if (fork() == 0) {
setresuid(uid, uid, uid);
setresgid(uid, uid, uid);
execve(item.getExecPath().c_str(), (char *const *)item.getArgsForExecve().data(), (char *const *)item.getEnvpForExecve().data());
exit(0);
}
exit(0);
}
}).detach();