File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ void Session::GenerateAndSavePrivateKey(const Sock& sock)
336
336
{
337
337
DestGenerate (sock);
338
338
339
- // umask is set to 077 in init .cpp, which is ok.
339
+ // umask is set to 0077 in util/system .cpp, which is ok.
340
340
if (!WriteBinaryFile (m_private_key_file,
341
341
std::string (m_private_key.begin (), m_private_key.end ()))) {
342
342
throw std::runtime_error (
Original file line number Diff line number Diff line change @@ -816,8 +816,6 @@ bool AppInitBasicSetup(const ArgsManager& args)
816
816
}
817
817
818
818
#ifndef WIN32
819
- umask (077 );
820
-
821
819
// Clean shutdown on SIGTERM
822
820
registerSignalHandler (SIGTERM, HandleSIGTERM);
823
821
registerSignalHandler (SIGINT, HandleSIGTERM);
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ bool GenerateAuthCookie(std::string *cookie_out)
86
86
std::string cookie = COOKIEAUTH_USER + " :" + HexStr (rand_pwd);
87
87
88
88
/* * the umask determines what permissions are used to create this file -
89
- * these are set to 077 in init .cpp.
89
+ * these are set to 0077 in util/system .cpp.
90
90
*/
91
91
std::ofstream file;
92
92
fs::path filepath_tmp = GetAuthCookieFile (true );
Original file line number Diff line number Diff line change @@ -1360,6 +1360,11 @@ void SetupEnvironment()
1360
1360
SetConsoleCP (CP_UTF8);
1361
1361
SetConsoleOutputCP (CP_UTF8);
1362
1362
#endif
1363
+
1364
+ #ifndef WIN32
1365
+ constexpr mode_t private_umask = 0077 ;
1366
+ umask (private_umask);
1367
+ #endif
1363
1368
}
1364
1369
1365
1370
bool SetupNetworking ()
You can’t perform that action at this time.
0 commit comments