forked from mirrors/tftp-hpa-google
When running in secure mode (-s), we must not chdir while daemonizing
When running in secure mode (-s), we must not chdir while daemonizing. Thanks to Adrian Urquhart for spotting this bug.
This commit is contained in:
parent
077eac1fd6
commit
c7ecc59f86
1 changed files with 3 additions and 1 deletions
|
@ -502,7 +502,9 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Daemonize this process */
|
/* Daemonize this process */
|
||||||
if (!nodaemon && daemon(0, 0) < 0) {
|
/* Note: when running in secure mode (-s), we must not chroot, since
|
||||||
|
we are already in the proper directory. */
|
||||||
|
if (!nodaemon && daemon(secure, 0) < 0) {
|
||||||
syslog(LOG_ERR, "cannot daemonize: %m");
|
syslog(LOG_ERR, "cannot daemonize: %m");
|
||||||
exit(EX_OSERR);
|
exit(EX_OSERR);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue