mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
rand/randfile.c: restore fallback to $HOME for non-setuid programs.
Reported in GH#1589, but solution is different from suggested. Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
776e15f939
commit
799c1293fc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user