summaryrefslogtreecommitdiff
path: root/crypto/rand/randfile.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2018-11-20 19:01:17 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2018-11-20 19:01:17 +0000
commitf12dd99bc33eefb702280bdaed6156a57d867be1 (patch)
tree3ced903ff59efa46be0b01f4cae665cd9c974b15 /crypto/rand/randfile.c
parent43a67e02da9068b94df1c07fc6f0d70bafd9263b (diff)
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r--crypto/rand/randfile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 728fd0a721b5b..c93812cfb92b8 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -61,6 +61,7 @@
#include <stdlib.h>
#include <string.h>
+#include "cryptlib.h"
#include "e_os.h"
#include <openssl/crypto.h>
#include <openssl/rand.h>
@@ -327,14 +328,12 @@ const char *RAND_file_name(char *buf, size_t size)
struct stat sb;
#endif
- if (OPENSSL_issetugid() == 0)
- s = getenv("RANDFILE");
+ s = ossl_safe_getenv("RANDFILE");
if (s != NULL && *s && strlen(s) + 1 < size) {
if (BUF_strlcpy(buf, s, size) >= size)
return NULL;
} else {
- if (OPENSSL_issetugid() == 0)
- s = getenv("HOME");
+ s = ossl_safe_getenv("HOME");
#ifdef DEFAULT_HOME
if (s == NULL) {
s = DEFAULT_HOME;