aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRune K. Svendsen <runesvend@gmail.com>2014-06-04 13:16:07 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-14 13:58:57 +0200
commitbdd5b587fc7fd1b4dda479c4aad15c874b22e8f3 (patch)
treebddcd2f1d83a572548380a48157b7e1f10547d6c
parentd5a6b785e3673f89bae6424fbf43ba9c3c3073b4 (diff)
downloadbitcoin-bdd5b587fc7fd1b4dda479c4aad15c874b22e8f3.tar.xz
Add option to disable 077 umask (create new files with system default umask)
The option is only effective for either wallet-less builds or if -disablewallet is specified as well. Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com> Rebased-From: 34d5fc0 4e1a196 bd4307b d53a33b 7e09b36 Github-Pull: #4286
-rw-r--r--src/init.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 99df237b2a..07960ee37b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -224,8 +224,12 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -par=<n> " + strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS) + "\n";
strUsage += " -pid=<file> " + _("Specify pid file (default: bitcoind.pid)") + "\n";
strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n";
+#if !defined(WIN32)
+ strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n";
+#endif
strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n";
+
strUsage += "\n" + _("Connection options:") + "\n";
strUsage += " -addnode=<ip> " + _("Add a node to connect to and attempt to keep the connection open") + "\n";
strUsage += " -banscore=<n> " + _("Threshold for disconnecting misbehaving peers (default: 100)") + "\n";
@@ -484,7 +488,15 @@ bool AppInit2(boost::thread_group& threadGroup)
}
#endif
#ifndef WIN32
- umask(077);
+
+ if (GetBoolArg("-sysperms", false)) {
+#ifdef ENABLE_WALLET
+ if (!GetBoolArg("-disablewallet", false))
+ return InitError("Error: -sysperms is not allowed in combination with enabled wallet functionality");
+#endif
+ } else {
+ umask(077);
+ }
// Clean shutdown on SIGTERM
struct sigaction sa;