mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Security review: make privilege dropping-restoring optional.
This is/was necessary only on macOS, because you needed root in order to read the process list. This was never necessary on Linux, and it also raises security concerns, so now it needs to be enabled explicitly at build time.
This commit is contained in:
@ -96,7 +96,7 @@ bool TraceScreen_forkTracer(TraceScreen* this) {
|
||||
this->child = fork();
|
||||
if (this->child == -1) return false;
|
||||
if (this->child == 0) {
|
||||
(void) seteuid(getuid());
|
||||
CRT_dropPrivileges();
|
||||
dup2(this->fdpair[1], STDERR_FILENO);
|
||||
int ok = fcntl(this->fdpair[1], F_SETFL, O_NONBLOCK);
|
||||
if (ok != -1) {
|
||||
|
Reference in New Issue
Block a user