From 42eaa08044fbb134cdc7b342355d8f6772f647fb Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 14 Oct 2010 18:20:58 +0100 Subject: [PATCH] maildir: Check correctly if file is a symlink. Patch by Mike Abbott / Apple. --- src/lib-storage/index/maildir/maildir-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib-storage/index/maildir/maildir-util.c b/src/lib-storage/index/maildir/maildir-util.c index 47bd119171..a17e41a616 100644 --- a/src/lib-storage/index/maildir/maildir-util.c +++ b/src/lib-storage/index/maildir/maildir-util.c @@ -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); -- 2.47.3