summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorJakub Wilk <jwilk@debian.org>2014-06-07 14:37:17 +0200
committerMatt Caswell <matt@openssl.org>2014-06-08 21:25:43 +0100
commit5c52c046508d0c99e235800c8d86eebfae8c85c8 (patch)
tree613690119503fda656bde8d8a6fda6869104f38b /crypto/rand
parent6c86bf7a1e68a2dd2bac7c8c4169a15c65f8b5f3 (diff)
Create ~/.rnd with mode 0600 instead of 0666
Because of a missing include <fcntl.h> we don't have O_CREATE and don't create the file with open() using mode 0600 but fall back to using fopen() with the default umask followed by a chmod(). Problem found by Jakub Wilk <jwilk@debian.org>.
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/randfile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 7f1428072d..14ba69d4c6 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -79,6 +79,7 @@
#endif
#ifndef OPENSSL_NO_POSIX_IO
# include <sys/stat.h>
+# include <fcntl.h>
#endif
#ifdef _WIN32