summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/randfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rand/randfile.c')
-rw-r--r--src/lib/libcrypto/rand/randfile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index c7fba496a8..d88ee0d780 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -166,7 +166,6 @@ int RAND_write_file(const char *file)
166 } 166 }
167 167
168#if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) 168#if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32)
169 {
170 /* For some reason Win32 can't write to files created this way */ 169 /* For some reason Win32 can't write to files created this way */
171 170
172 /* chmod(..., 0600) is too late to protect the file, 171 /* chmod(..., 0600) is too late to protect the file,
@@ -174,7 +173,6 @@ int RAND_write_file(const char *file)
174 int fd = open(file, O_CREAT, 0600); 173 int fd = open(file, O_CREAT, 0600);
175 if (fd != -1) 174 if (fd != -1)
176 out = fdopen(fd, "wb"); 175 out = fdopen(fd, "wb");
177 }
178#endif 176#endif
179 if (out == NULL) 177 if (out == NULL)
180 out = fopen(file,"wb"); 178 out = fopen(file,"wb");
@@ -233,7 +231,7 @@ const char *RAND_file_name(char *buf, size_t size)
233 struct stat sb; 231 struct stat sb;
234#endif 232#endif
235 233
236 if (OPENSSL_issetugid() == 0) 234 if (issetugid() == 0)
237 s=getenv("RANDFILE"); 235 s=getenv("RANDFILE");
238 if (s != NULL && *s && strlen(s) + 1 < size) 236 if (s != NULL && *s && strlen(s) + 1 < size)
239 { 237 {
@@ -242,7 +240,7 @@ const char *RAND_file_name(char *buf, size_t size)
242 } 240 }
243 else 241 else
244 { 242 {
245 if (OPENSSL_issetugid() == 0) 243 if (issetugid() == 0)
246 s=getenv("HOME"); 244 s=getenv("HOME");
247#ifdef DEFAULT_HOME 245#ifdef DEFAULT_HOME
248 if (s == NULL) 246 if (s == NULL)