For those, unless the environment variables RANDFILE or HOME are
defined (the default case!), RAND_file_name() will return NULL.
This change adds a default HOME for those platforms.
To add a default HOME for any platform, just define DEFAULT_HOME in
the proper place, wrapped in appropriate #ifdef..#endif, in e_os.h.
{
if (OPENSSL_issetugid() == 0)
s=getenv("HOME");
+#ifdef DEFAULT_HOME
+ if (s == NULL)
+ {
+ s = DEFAULT_HOME;
+ }
+#endif
if (s != NULL && (strlen(s)+strlen(RFILE)+2 < size))
{
strcpy(buf,s);
strcat(buf,RFILE);
ret=buf;
}
- else
+ else
buf[0] = '\0'; /* no file name */
}
return(ret);
# define SSLEAY_CONF OPENSSL_CONF
# define NUL_DEV "nul"
# define RFILE ".rnd"
+# define DEFAULT_HOME "C:"
#else /* The non-microsoft world world */