From: Richard Levitte Date: Thu, 23 Jun 2005 21:14:15 +0000 (+0000) Subject: Change dir_ctrl to check for the environment variable before using the default X-Git-Tag: OpenSSL_0_9_8k^2~1985 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0e441bc2beea904654a9cf2df11875a920d66fd7;p=oweals%2Fopenssl.git Change dir_ctrl to check for the environment variable before using the default directory instead of the other way around. PR: 1131 --- diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 6207340472..d56679177b 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -122,19 +122,19 @@ static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, { case X509_L_ADD_DIR: if (argl == X509_FILETYPE_DEFAULT) + dir=(char *)Getenv(X509_get_default_cert_dir_env()); + if (dir) + ret=add_cert_dir(ld,dir,X509_FILETYPE_PEM); + else { ret=add_cert_dir(ld,X509_get_default_cert_dir(), X509_FILETYPE_PEM); + } if (!ret) { X509err(X509_F_DIR_CTRL,X509_R_LOADING_CERT_DIR); } - else - { - dir=(char *)Getenv(X509_get_default_cert_dir_env()); - ret=add_cert_dir(ld,dir,X509_FILETYPE_PEM); - } - } + else ret=add_cert_dir(ld,argp,(int)argl); break;