mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-02-05 05:59:18 +00:00
swtpm: Do not chdir(/) when using --daemon
With relative paths being used the chdir("/") in daemonize_finish() will
cause file access errors.
Fixes: 98d1d12 ("swtpm: Make --daemon not racy")
Resolves: https://github.com/stefanberger/swtpm/issues/671
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
8a05e8fd52
commit
646cf413b1
@ -274,12 +274,6 @@ daemonize_finish(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (chdir("/") == -1) {
|
||||
fprintf(stderr, "Failed to change directory to /: %s\n",
|
||||
strerror(errno));
|
||||
fflush(stderr);
|
||||
exit(1);
|
||||
}
|
||||
if (dup2(devnullfd, STDOUT_FILENO) == -1) {
|
||||
fprintf(stderr, "Failed to redirect output stream to /dev/null: %s\n",
|
||||
strerror(errno));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user