aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-07-20 13:52:27 +0200
committerRiccardo Spagni <ric@spagni.net>2016-07-20 13:52:27 +0200
commit992b6cce0693f2063b1f7922333efb5c44cdcc3b (patch)
tree222cd57c1a20ffd773bf01ab4ebdc8cd1c0e3553
parentMerge pull request #896 (diff)
parentdaemonizer: posix: keep parent's working dir and umask (diff)
downloadmonero-992b6cce0693f2063b1f7922333efb5c44cdcc3b.tar.xz
Merge pull request #897
ce6b831 daemonizer: posix: keep parent's working dir and umask (redfish)
-rw-r--r--src/daemonizer/posix_fork.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/daemonizer/posix_fork.cpp b/src/daemonizer/posix_fork.cpp
index c068912ec..949c0f593 100644
--- a/src/daemonizer/posix_fork.cpp
+++ b/src/daemonizer/posix_fork.cpp
@@ -50,20 +50,6 @@ void fork()
// terminal.
setsid();
- // A process inherits its working directory from its parent. This could be
- // on a mounted filesystem, which means that the running daemon would
- // prevent this filesystem from being unmounted. Changing to the root
- // directory avoids this problem.
- if (chdir("/") < 0)
- {
- quit("Unable to change working directory to root");
- }
-
- // The file mode creation mask is also inherited from the parent process.
- // We don't want to restrict the permissions on files created by the
- // daemon, so the mask is cleared.
- umask(0);
-
// A second fork ensures the process cannot acquire a controlling terminal.
if (pid_t pid = ::fork())
{