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)
336336{
337337 DestGenerate (sock);
338338
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.
340340 if (!WriteBinaryFile (m_private_key_file,
341341 std::string (m_private_key.begin (), m_private_key.end ()))) {
342342 throw std::runtime_error (
Original file line number Diff line number Diff line change @@ -816,8 +816,6 @@ bool AppInitBasicSetup(const ArgsManager& args)
816816 }
817817
818818#ifndef WIN32
819- umask (077 );
820-
821819 // Clean shutdown on SIGTERM
822820 registerSignalHandler (SIGTERM, HandleSIGTERM);
823821 registerSignalHandler (SIGINT, HandleSIGTERM);
Original file line number Diff line number Diff 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.
89+ * these are set to 0077 in util/system .cpp.
9090 */
9191 std::ofstream file;
9292 fs::path filepath_tmp = GetAuthCookieFile (true );
Original file line number Diff line number Diff line change @@ -1360,6 +1360,11 @@ void SetupEnvironment()
13601360 SetConsoleCP (CP_UTF8);
13611361 SetConsoleOutputCP (CP_UTF8);
13621362#endif
1363+
1364+ #ifndef WIN32
1365+ constexpr mode_t private_umask = 0077 ;
1366+ umask (private_umask);
1367+ #endif
13631368}
13641369
13651370bool SetupNetworking ()
You can’t perform that action at this time.
0 commit comments