提交 799c1293 编写于 作者: A Andy Polyakov

rand/randfile.c: restore fallback to $HOME for non-setuid programs.

Reported in GH#1589, but solution is different from suggested.
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 776e15f9
......@@ -316,12 +316,14 @@ const char *RAND_file_name(char *buf, size_t size)
}
}
#else
if (OPENSSL_issetugid() == 0) {
s = getenv("RANDFILE");
} else {
if (OPENSSL_issetugid() != 0) {
use_randfile = 0;
if (OPENSSL_issetugid() == 0)
} else {
s = getenv("RANDFILE");
if (s == NULL || *s == '\0') {
use_randfile = 0;
s = getenv("HOME");
}
}
#endif
#ifdef DEFAULT_HOME
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册