[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.115, 1.115.2.1

tss-movial at dovecot.org tss-movial at dovecot.org
Fri May 12 11:13:03 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	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.115
retrieving revision 1.115.2.1
diff -u -d -r1.115 -r1.115.2.1
--- maildir-storage.c	14 Apr 2006 12:30:23 -0000	1.115
+++ maildir-storage.c	12 May 2006 08:12:59 -0000	1.115.2.1
@@ -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