From: Timo Sirainen Date: Thu, 14 Oct 2010 17:20:58 +0000 (+0100) Subject: maildir: Check correctly if file is a symlink. X-Git-Tag: 2.0.6~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42eaa08044fbb134cdc7b342355d8f6772f647fb;p=thirdparty%2Fdovecot%2Fcore.git maildir: Check correctly if file is a symlink. Patch by Mike Abbott / Apple. --- 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);