correct error signalling for opendir() failure
authorBodo Möller <bodo@openssl.org>
Fri, 30 Jul 1999 10:43:34 +0000 (10:43 +0000)
committerBodo Möller <bodo@openssl.org>
Fri, 30 Jul 1999 10:43:34 +0000 (10:43 +0000)
crypto/err/err.c
crypto/err/err.h
ssl/ssl_cert.c

index b3ac5ba21b717d082bdb4abe8f0eb3d5431054cd..8810d838c64f02a270c7bdba8ab21248b833633a 100644 (file)
@@ -116,6 +116,7 @@ static ERR_STRING_DATA ERR_str_functs[]=
 #ifdef WINDOWS
        {ERR_PACK(0,SYS_F_WSASTARTUP,0),        "WSAstartup"},
 #endif
+       {ERR_PACK(0,SYS_F_OPENDIR,0),           "opendir"},
        {0,NULL},
        };
 
index 0ef83d5ead95390b397eb3a4319d82684804e82f..9411fb3568e5c4cd33b3549484abb04dcd4dd89e 100644 (file)
@@ -170,6 +170,7 @@ typedef struct err_state_st
 #define SYS_F_LISTEN           7
 #define SYS_F_ACCEPT           8
 #define SYS_F_WSASTARTUP       9 /* Winsock stuff */
+#define SYS_F_OPENDIR          10
 
 #define ERR_R_FATAL            32      
 /* reasons */
index 19ade2fa4ecd21abb15c78b95a8d5588c4e69fec..b33658f017b1e21862c33e08abb6a3162dfbf5f2 100644 (file)
@@ -685,7 +685,9 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
     /* Note that a side effect is that the CAs will be sorted by name */
     if(!d)
        {
-       SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,ERR_R_MALLOC_FAILURE);
+       SYSerr(SYS_F_OPENDIR, get_last_sys_error());
+       ERR_add_error_data(3, "opendir('", dir, "')");
+       SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB);
        goto err;
        }