mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-23 20:53:19 -05:00
Regain root privileges to unlink PID file at exit
This commit is contained in:
parent
1ac46983b9
commit
207e85c6c0
@ -598,10 +598,16 @@ main(int argc, char **argv)
|
||||
mdns_fail:
|
||||
daemon_fail:
|
||||
if (background)
|
||||
{
|
||||
ret = seteuid(0);
|
||||
if (ret < 0)
|
||||
DPRINTF(E_LOG, L_MAIN, "seteuid() failed: %s\n", strerror(errno));
|
||||
else
|
||||
{
|
||||
ret = unlink(pidfile);
|
||||
if (ret < 0)
|
||||
DPRINTF(E_WARN, L_MAIN, "Could not unlink PID file %s: %s\n", pidfile, strerror(errno));
|
||||
DPRINTF(E_LOG, L_MAIN, "Could not unlink PID file %s: %s\n", pidfile, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
signal_block_fail:
|
||||
|
Loading…
x
Reference in New Issue
Block a user