diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-06-04 15:30:40 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-06-04 15:30:40 +0000 |
commit | 6faa9e26414abde4832ec88c347435565c751e0b (patch) | |
tree | 7b29c0f45deb534b8178879faa204047c45e6607 /src/common/util.c | |
parent | 97cc48f904806157ce47fa524b4247d03d55e769 (diff) | |
download | tor-6faa9e26414abde4832ec88c347435565c751e0b.tar.gz tor-6faa9e26414abde4832ec88c347435565c751e0b.zip |
r13239@catbus: nickm | 2007-06-04 11:30:37 -0400
Fix the fix for bug 445: set umask properly. Also use open+fdopen rather than just umask+fopen, and create authority identity key with mode 400.
svn:r10485
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c index 74279cee7a..4c9370945d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1371,7 +1371,9 @@ check_private_dir(const char *dirname, cpd_check_t check) /** Create a file named <b>fname</b> with the contents <b>str</b>. Overwrite * the previous <b>fname</b> if possible. Return 0 on success, -1 on failure. * - * This function replaces the old file atomically, if possible. + * This function replaces the old file atomically, if possible. This + * function, and all other functions in util.c that create files, create them + * with mode 0600. */ int write_str_to_file(const char *fname, const char *str, int bin) |