mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
* Run the worker in a separate session to prevent terminal signals
from interfering.
This commit is contained in:
parent
e25fad691a
commit
714fa24cfb
1 changed files with 6 additions and 0 deletions
|
@ -164,6 +164,12 @@ void run(Strings args)
|
|||
if (slave) {
|
||||
FdSource source(STDIN_FILENO);
|
||||
FdSink sink(STDOUT_FILENO);
|
||||
|
||||
/* This prevents us from receiving signals from the terminal
|
||||
when we're running in setuid mode. */
|
||||
if (setsid() == -1)
|
||||
throw SysError(format("creating a new session"));
|
||||
|
||||
processConnection(source, sink);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue