]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: Check correctly if file is a symlink.
authorTimo Sirainen <tss@iki.fi>
Thu, 14 Oct 2010 17:20:58 +0000 (18:20 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 14 Oct 2010 17:20:58 +0000 (18:20 +0100)
Patch by Mike Abbott / Apple.

src/lib-storage/index/maildir/maildir-util.c

index 47bd1191713bdd2c36909f0063e5d8b4e11ed621..a17e41a61694b3f0ddb5b200dfc43ef3b6b0493a 100644 (file)
@@ -92,7 +92,7 @@ static int do_racecheck(struct maildir_mailbox *mbox, const char *path,
 {
        struct stat st;
 
-       if (lstat(path, &st) == 0 && (st.st_mode & S_IFLNK) != 0) {
+       if (lstat(path, &st) == 0 && (st.st_mode & S_IFMT) == S_IFLNK) {
                /* most likely a symlink pointing to a nonexistent file */
                mail_storage_set_critical(&mbox->storage->storage,
                        "Maildir: Symlink destination doesn't exist: %s", path);