[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-storage.c,1.19,1.20 mbox-storage.h,1.8,1.9

cras at procontrol.fi cras at procontrol.fi
Wed Dec 4 01:29:11 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv20915/src/lib-storage/index/mbox

Modified Files:
	mbox-storage.c mbox-storage.h 
Log Message:
Forgot to commit.



Index: mbox-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- mbox-storage.c	25 Nov 2002 19:02:50 -0000	1.19
+++ mbox-storage.c	3 Dec 2002 23:29:09 -0000	1.20
@@ -88,19 +88,14 @@
 	i_free(storage);
 }
 
-static int mbox_is_valid_name(MailStorage *storage, const char *name)
+int mbox_is_valid_mask(const char *mask)
 {
 	const char *p;
 	int newdir;
 
-	if (name[0] == '\0' || name[0] == storage->hierarchy_sep ||
-	    name[strlen(name)-1] == storage->hierarchy_sep ||
-	    strchr(name, '*') != NULL || strchr(name, '%') != NULL)
-		return FALSE;
-
 	/* make sure there's no "../" or "..\" stuff */
 	newdir = TRUE;
-	for (p = name; *p != '\0'; p++) {
+	for (p = mask; *p != '\0'; p++) {
 		if (newdir && p[0] == '.' && p[1] == '.' &&
 		    (p[2] == '/' || p[2] == '\\'))
 			return FALSE;
@@ -108,6 +103,16 @@
 	}
 
 	return TRUE;
+}
+
+static int mbox_is_valid_name(MailStorage *storage, const char *name)
+{
+	if (name[0] == '\0' || name[0] == storage->hierarchy_sep ||
+	    name[strlen(name)-1] == storage->hierarchy_sep ||
+	    strchr(name, '*') != NULL || strchr(name, '%') != NULL)
+		return FALSE;
+
+	return mbox_is_valid_mask(name);
 }
 
 static const char *mbox_get_index_dir(const char *mbox_path)

Index: mbox-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- mbox-storage.h	2 Nov 2002 20:10:21 -0000	1.8
+++ mbox-storage.h	3 Dec 2002 23:29:09 -0000	1.9
@@ -16,4 +16,6 @@
 
 int mbox_expunge_locked(IndexMailbox *ibox, int notify);
 
+int mbox_is_valid_mask(const char *mask);
+
 #endif




More information about the dovecot-cvs mailing list