]> diplodocus.org Git - nmh/commitdiff
Use stat(3) instead of lstat(3), to dereference symbolic links.
authorDavid Levine <levinedl@acm.org>
Mon, 17 Apr 2017 22:06:05 +0000 (18:06 -0400)
committerDavid Levine <levinedl@acm.org>
Mon, 17 Apr 2017 22:06:05 +0000 (18:06 -0400)
Fix to commit 4318012376e06229307c0ed4f62a00faae9edc63.

uip/mhparse.c

index 03d7ae3..c17bd78 100644 (file)
@@ -245,8 +245,8 @@ parse_mime (char *file)
            return NULL;
        }
        fseek (fp, 0L, SEEK_SET);
            return NULL;
        }
        fseek (fp, 0L, SEEK_SET);
-    } else if (lstat (file, &statbuf) == NOTOK) {
-       advise (file, "unable to lstat");
+    } else if (stat (file, &statbuf) == NOTOK) {
+       advise (file, "unable to stat");
        return NULL;
     } else if (S_ISDIR(statbuf.st_mode)) {
        /* Don't try to parse a directory. */
        return NULL;
     } else if (S_ISDIR(statbuf.st_mode)) {
        /* Don't try to parse a directory. */