Skip to content

Commit 8a6219e

Browse files
committed
Remove -sysperms option
This change effectively reverts commits from bitcoin/bitcoin#4286. Users, who rely on non-default access permissions, should use `chmod` command.
1 parent d71b0e7 commit 8a6219e

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

doc/init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ NOTE: When using the systemd .service file, the creation of the aforementioned
7070
directories and the setting of their permissions is automatically handled by
7171
systemd. Directories are given a permission of 710, giving the bitcoin group
7272
access to files under it _if_ the files themselves give permission to the
73-
bitcoin group to do so (e.g. when `-sysperms` is specified). This does not allow
73+
bitcoin group to do so. This does not allow
7474
for the listing of files under the directory.
7575

7676
NOTE: It is not currently possible to override `datadir` in

src/i2p.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void Session::GenerateAndSavePrivateKey(const Sock& sock)
336336
{
337337
DestGenerate(sock);
338338

339-
// umask is set to 077 in init.cpp, which is ok (unless -sysperms is given)
339+
// umask is set to 077 in init.cpp, which is ok.
340340
if (!WriteBinaryFile(m_private_key_file,
341341
std::string(m_private_key.begin(), m_private_key.end()))) {
342342
throw std::runtime_error(

src/init.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,6 @@ void SetupServerArgs(ArgsManager& argsman)
458458
#if HAVE_SYSTEM
459459
argsman.AddArg("-startupnotify=<cmd>", "Execute command on startup.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
460460
argsman.AddArg("-shutdownnotify=<cmd>", "Execute command immediately before beginning shutdown. The need for shutdown may be urgent, so be careful not to delay it long (if the command doesn't require interaction with the server, consider having it fork into the background).", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
461-
#endif
462-
#ifndef WIN32
463-
argsman.AddArg("-sysperms", "Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
464-
#else
465-
hidden_args.emplace_back("-sysperms");
466461
#endif
467462
argsman.AddArg("-txindex", strprintf("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)", DEFAULT_TXINDEX), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
468463
argsman.AddArg("-blockfilterindex=<type>",
@@ -821,9 +816,7 @@ bool AppInitBasicSetup(const ArgsManager& args)
821816
}
822817

823818
#ifndef WIN32
824-
if (!args.GetBoolArg("-sysperms", false)) {
825-
umask(077);
826-
}
819+
umask(077);
827820

828821
// Clean shutdown on SIGTERM
829822
registerSignalHandler(SIGTERM, HandleSIGTERM);

src/rpc/request.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ bool GenerateAuthCookie(std::string *cookie_out)
8686
std::string cookie = COOKIEAUTH_USER + ":" + HexStr(rand_pwd);
8787

8888
/** the umask determines what permissions are used to create this file -
89-
* these are set to 077 in init.cpp unless overridden with -sysperms.
89+
* these are set to 077 in init.cpp.
9090
*/
9191
std::ofstream file;
9292
fs::path filepath_tmp = GetAuthCookieFile(true);

src/wallet/init.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ bool WalletInit::ParameterInteraction() const
122122
return InitError(Untranslated("-zapwallettxes has been removed. If you are attempting to remove a stuck transaction from your wallet, please use abandontransaction instead."));
123123
}
124124

125-
if (gArgs.GetBoolArg("-sysperms", false))
126-
return InitError(Untranslated("-sysperms is not allowed in combination with enabled wallet functionality"));
127-
128125
return true;
129126
}
130127

0 commit comments

Comments
 (0)