Fix bugs in bug-fix to x509/by_dir.c [from HEAD].

PR: 1131
This commit is contained in:
Andy Polyakov 2005-07-03 13:18:47 +00:00
parent 6c8a3344b6
commit 9273be0795

View file

@ -114,7 +114,7 @@ static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
{
int ret=0;
BY_DIR *ld;
char *dir;
char *dir = NULL;
ld=(BY_DIR *)ctx->method_data;
@ -122,19 +122,18 @@ 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);
ret=add_cert_dir(ld,dir,X509_FILETYPE_PEM);
else
{
ret=add_cert_dir(ld,X509_get_default_cert_dir(),
X509_FILETYPE_PEM);
}
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
ret=add_cert_dir(ld,argp,(int)argl);
break;