dovecot-2.0: unlink_directory(): Return ELOOP for unexpected sym...

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 30 13:41:13 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/c67f4a2a2253
changeset: 12533:c67f4a2a2253
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Dec 30 13:41:10 2010 +0200
description:
unlink_directory(): Return ELOOP for unexpected symlinks also when O_NOFOLLOW isn't supported.

diffstat:

 src/lib/unlink-directory.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r a293626e09e2 -r c67f4a2a2253 src/lib/unlink-directory.c
--- a/src/lib/unlink-directory.c	Thu Dec 30 12:45:52 2010 +0200
+++ b/src/lib/unlink-directory.c	Thu Dec 30 13:41:10 2010 +0200
@@ -59,7 +59,12 @@
 		return -1;
 
 	if (!S_ISDIR(st.st_mode)) {
-		errno = ENOTDIR;
+		if ((st.st_mode & S_IFMT) != S_IFLNK)
+			errno = ENOTDIR;
+		else {
+			/* be compatible with O_NOFOLLOW */
+			errno = ELOOP;
+		}
 		return -1;
 	}
 


More information about the dovecot-cvs mailing list