mirror of
https://github.com/openssl/openssl.git
synced 2025-03-01 19:28:10 +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
|
#else
|
||||||
if (OPENSSL_issetugid() == 0) {
|
if (OPENSSL_issetugid() != 0) {
|
||||||
s = getenv("RANDFILE");
|
|
||||||
} else {
|
|
||||||
use_randfile = 0;
|
use_randfile = 0;
|
||||||
if (OPENSSL_issetugid() == 0)
|
} else {
|
||||||
|
s = getenv("RANDFILE");
|
||||||
|
if (s == NULL || *s == '\0') {
|
||||||
|
use_randfile = 0;
|
||||||
s = getenv("HOME");
|
s = getenv("HOME");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEFAULT_HOME
|
#ifdef DEFAULT_HOME
|
||||||
|
Loading…
Reference in New Issue
Block a user