[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.118, 1.119

cras at dovecot.org cras at dovecot.org
Thu Jun 8 19:56:48 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv30643/maildir

Modified Files:
	maildir-storage.c 
Log Message:
Don't allow "." and ".." mailbox names/masks.



Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- maildir-storage.c	8 Jun 2006 12:49:38 -0000	1.118
+++ maildir-storage.c	8 Jun 2006 16:56:45 -0000	1.119
@@ -201,6 +201,12 @@
 	if (*name == '~' || strchr(name, '/') != NULL)
 		return FALSE;
 
+	if (name[0] == '.' && (name[1] == '\0' ||
+			       (name[1] == '.' && name[2] == '\0'))) {
+		/* "." and ".." aren't allowed. */
+		return FALSE;
+	}
+
 	return TRUE;
 }
 
@@ -216,6 +222,12 @@
 	if (*name == '~' || strchr(name, '/') != NULL)
 		return FALSE;
 
+	if (name[0] == '.' && (name[1] == '\0' ||
+			       (name[1] == '.' && name[2] == '\0'))) {
+		/* "." and ".." aren't allowed. */
+		return FALSE;
+	}
+
 	return TRUE;
 }
 



More information about the dovecot-cvs mailing list