]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
reentrant fixes for gnutls_x509_trust_list_add_trust_dir() handle unknown file types
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 5 Sep 2014 12:29:28 +0000 (14:29 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 5 Sep 2014 12:29:28 +0000 (14:29 +0200)
lib/x509/verify-high2.c

index fd90a99c053ec9b8520a53ac1331e35a3bcb1686..058746ca54e5613dbe56ce75e3dc350a3b86a6fd 100644 (file)
@@ -303,12 +303,14 @@ int load_dir_certs(const char *dirname,
        dirp = opendir(dirname);
        if (dirp != NULL) {
                do {
+#ifdef _WIN32
                        d = readdir(dirp);
-                       if (d != NULL
-#ifndef _WIN32
-                               && d->d_type == DT_REG
+                       if (d != NULL) {
+#else
+                       struct dirent e;
+                       ret = readdir_r(dirp, &e, &d);
+                       if (ret == 0 && (d->d_type == DT_REG || d->d_type == DT_LNK || d->d_type == DT_UNKNOWN)) {
 #endif
-                               ) {
                                snprintf(path, sizeof(path), "%s/%s",
                                         dirname, d->d_name);