aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-06-04 15:30:40 +0000
committerNick Mathewson <nickm@torproject.org>2007-06-04 15:30:40 +0000
commit6faa9e26414abde4832ec88c347435565c751e0b (patch)
tree7b29c0f45deb534b8178879faa204047c45e6607 /src/common/util.c
parent97cc48f904806157ce47fa524b4247d03d55e769 (diff)
downloadtor-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.c4
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)