diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-04-14 16:21:29 +0900 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-04-14 16:21:29 +0900 |
commit | a299e5269b4a46f80a340940ec21f707e8dc8c7c (patch) | |
tree | 40e88484567b12235b1632faf759fc8788f07355 /src/common/util.cpp | |
parent | Merge pull request #800 (diff) | |
parent | simplewallet: set strict umask at start (diff) | |
download | monero-a299e5269b4a46f80a340940ec21f707e8dc8c7c.tar.xz |
Merge pull request #801
ed61a2c simplewallet: set strict umask at start (moneromooo-monero)
7385c03 util: add a function to set umask to 077 (moneromooo-monero)
Diffstat (limited to 'src/common/util.cpp')
-rw-r--r-- | src/common/util.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp index 6f75e5bad..2337f5766 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -413,4 +413,13 @@ std::string get_nix_version_display_string() } return false; } + void set_strict_default_file_permissions(bool strict) + { +#if defined(__MINGW32__) || defined(__MINGW__) + // no clue about the odd one out +#else + mode_t mode = strict ? 077 : 0; + umask(mode); +#endif + } } |