~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101901

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Author: Joel Johnson <mrjoel@lixil.net>
Description: Change default Debian value in accordance with Debian Policy

Index: dovecot-1.2.8/dovecot-example.conf
===================================================================
--- dovecot-1.2.8.orig/dovecot-example.conf	2009-11-24 14:54:19.098525043 +0100
+++ dovecot-1.2.8/dovecot-example.conf	2009-11-24 14:54:57.578538078 +0100
@@ -488,8 +488,14 @@
 # in is important to avoid deadlocks if other MTAs/MUAs are using multiple
 # locking methods as well. Some operating systems don't allow using some of
 # them simultaneously.
+#
+# The Debian value for mbox_write_locks differs from upstream Dovecot. It is
+# changed to be compliant with Debian Policy (section 11.6) for NFS safety.
+#       Dovecot: mbox_write_locks = dotlock fcntl
+#       Debian:  mbox_write_locks = fcntl dotlock
+#
 #mbox_read_locks = fcntl
-#mbox_write_locks = dotlock fcntl
+#mbox_write_locks = fcntl dotlock
 
 # Maximum time in seconds to wait for lock (all of them) before aborting.
 #mbox_lock_timeout = 300
Index: dovecot-1.2.8/src/master/master-settings.c
===================================================================
--- dovecot-1.2.8.orig/src/master/master-settings.c	2009-11-24 14:54:43.207545777 +0100
+++ dovecot-1.2.8/src/master/master-settings.c	2009-11-24 14:54:57.598541833 +0100
@@ -255,7 +255,7 @@
 	MEMBER(maildir_copy_preserve_filename) FALSE,
 	MEMBER(maildir_very_dirty_syncs) FALSE,
 	MEMBER(mbox_read_locks) "fcntl",
-	MEMBER(mbox_write_locks) "dotlock fcntl",
+	MEMBER(mbox_write_locks) "fcntl dotlock",
 	MEMBER(mbox_lock_timeout) 300,
 	MEMBER(mbox_dotlock_change_timeout) 120,
 	MEMBER(mbox_min_index_size) 0,
@@ -1944,7 +1944,15 @@
 	const char *set_names[5];
 	unsigned int count;
 
-	sets[0] = &default_settings;
+	/* Debian change - the Debian default for mbox_write_lock differs from
+		upstream Dovecot, however we still want 'dovecot -n' to report
+		based on Dovecot defaults to make it clear that the setting is
+		different, so we make a copy of the default_settings and force
+		it to report based on strict Dovecot defaults
+	*/
+	struct settings dovecot_default_settings = default_settings;
+	dovecot_default_settings.mbox_write_locks = "dotlock fcntl";
+	sets[0] = &dovecot_default_settings;
 	sets[1] = set->defaults;
 
 	set_names[0] = NULL;