unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob da9f4034f4bc691c0b7eae4be51156eb39770c37 5419 bytes (raw)
name: gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch 	 # note: path name is non-authoritative(*)

  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
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
 
Subject: [PATCH] Use static path for moduledir.

Patch was taken from NixOS repo. Make dovecot look for plugins in
/etc/dovecot/modules so we can symlink plugins from several packages
there.

The rational behind the patch can be found here:
https://dovecot.org/pipermail/dovecot/2013-April/089931.html

---
 src/auth/main.c                         | 4 ++--
 src/config/config-parser.c              | 2 +-
 src/config/config-parser.h              | 2 +-
 src/dict/main.c                         | 2 +-
 src/doveadm/doveadm-util.c              | 4 ++--
 src/lib-fs/fs-api.c                     | 2 +-
 src/lib-ssl-iostream/iostream-ssl.c     | 4 ++--
 src/lib-storage/mail-storage-settings.c | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/auth/main.c b/src/auth/main.c
index 2dbf9e176..b1e778ab7 100644
--- a/src/auth/main.c
+++ b/src/auth/main.c
@@ -192,7 +192,7 @@ static void main_preinit(void)
 	mod_set.debug = global_auth_settings->debug;
 	mod_set.filter_callback = auth_module_filter;

-	modules = module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set);
+	modules = module_dir_load("/etc/dovecot/modules/auth", NULL, &mod_set);
 	module_dir_init(modules);

 	if (!worker)
@@ -223,7 +223,7 @@ void auth_module_load(const char *names)
 	mod_set.debug = global_auth_settings->debug;
 	mod_set.ignore_missing = TRUE;

-	modules = module_dir_load_missing(modules, AUTH_MODULE_DIR, names,
+	modules = module_dir_load_missing(modules, "/etc/dovecot/modules/auth", names,
 					  &mod_set);
 	module_dir_init(modules);
 }
diff --git a/src/config/config-parser.c b/src/config/config-parser.c
index 6894123ea..07e9fecb4 100644
--- a/src/config/config-parser.c
+++ b/src/config/config-parser.c
@@ -1077,7 +1077,7 @@ void config_parse_load_modules(void)

 	i_zero(&mod_set);
 	mod_set.abi_version = DOVECOT_ABI_VERSION;
-	modules = module_dir_load(CONFIG_MODULE_DIR, NULL, &mod_set);
+	modules = module_dir_load("/etc/dovecot/modules/settings", NULL, &mod_set);
 	module_dir_init(modules);

 	i_array_init(&new_roots, 64);
diff --git a/src/config/config-parser.h b/src/config/config-parser.h
index e0a0a5bea..32bd76804 100644
--- a/src/config/config-parser.h
+++ b/src/config/config-parser.h
@@ -1,7 +1,7 @@
 #ifndef CONFIG_PARSER_H
 #define CONFIG_PARSER_H

-#define CONFIG_MODULE_DIR MODULEDIR"/settings"
+#define CONFIG_MODULE_DIR "/etc/dovecot/modules/settings"

 #define IS_WHITE(c) ((c) == ' ' || (c) == '\t')

diff --git a/src/dict/main.c b/src/dict/main.c
index 722ed025f..4ed12ae5e 100644
--- a/src/dict/main.c
+++ b/src/dict/main.c
@@ -104,7 +104,7 @@ static void main_init(void)
 	mod_set.abi_version = DOVECOT_ABI_VERSION;
 	mod_set.require_init_funcs = TRUE;

-	modules = module_dir_load(DICT_MODULE_DIR, NULL, &mod_set);
+	modules = module_dir_load("/etc/dovecot/modules/dict", NULL, &mod_set);
 	module_dir_init(modules);

 	/* Register only after loading modules. They may contain SQL drivers,
diff --git a/src/doveadm/doveadm-util.c b/src/doveadm/doveadm-util.c
index a65ef7f72..c19eba06c 100644
--- a/src/doveadm/doveadm-util.c
+++ b/src/doveadm/doveadm-util.c
@@ -33,7 +33,7 @@ void doveadm_load_modules(void)
 	mod_set.debug = doveadm_debug;
 	mod_set.ignore_dlopen_errors = TRUE;

-	modules = module_dir_load_missing(modules, DOVEADM_MODULEDIR,
+	modules = module_dir_load_missing(modules, "/etc/dovecot/modules/doveadm",
 					  NULL, &mod_set);
 	module_dir_init(modules);
 }
@@ -58,7 +58,7 @@ bool doveadm_has_unloaded_plugin(const char *name)
 			return FALSE;
 	}

-	dir = opendir(DOVEADM_MODULEDIR);
+	dir = opendir("/etc/dovecot/modules/doveadm");
 	if (dir == NULL)
 		return FALSE;

diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c
index a939f612d..846cf86e6 100644
--- a/src/lib-fs/fs-api.c
+++ b/src/lib-fs/fs-api.c
@@ -114,7 +114,7 @@ static void fs_class_try_load_plugin(const char *driver)
 	mod_set.abi_version = DOVECOT_ABI_VERSION;
 	mod_set.ignore_missing = TRUE;

-	fs_modules = module_dir_load_missing(fs_modules, MODULE_DIR,
+	fs_modules = module_dir_load_missing(fs_modules, "/etc/dovecot/modules",
 					     module_name, &mod_set);
 	module_dir_init(fs_modules);

diff --git a/src/lib-ssl-iostream/iostream-ssl.c b/src/lib-ssl-iostream/iostream-ssl.c
index f62c80d37..900ab46c4 100644
--- a/src/lib-ssl-iostream/iostream-ssl.c
+++ b/src/lib-ssl-iostream/iostream-ssl.c
@@ -54,8 +54,8 @@ int ssl_module_load(const char **error_r)
 	mod_set.abi_version = DOVECOT_ABI_VERSION;
 	mod_set.setting_name = "<built-in lib-ssl-iostream lookup>";
 	mod_set.require_init_funcs = TRUE;
-	ssl_module = module_dir_load(MODULE_DIR, plugin_name, &mod_set);
-	if (module_dir_try_load_missing(&ssl_module, MODULE_DIR, plugin_name,
+	ssl_module = module_dir_load("/etc/dovecot/modules", plugin_name, &mod_set);
+	if (module_dir_try_load_missing(&ssl_module, "/etc/dovecot/modules", plugin_name,
 					&mod_set, error_r) < 0)
 		return -1;
 	module_dir_init(ssl_module);
diff --git a/src/lib-storage/mail-storage-settings.c b/src/lib-storage/mail-storage-settings.c
index b314b529c..705509456 100644
--- a/src/lib-storage/mail-storage-settings.c
+++ b/src/lib-storage/mail-storage-settings.c
@@ -337,7 +337,7 @@ static const struct mail_user_settings mail_user_default_settings = {
 	.last_valid_gid = 0,

 	.mail_plugins = "",
-	.mail_plugin_dir = MODULEDIR,
+	.mail_plugin_dir = "/etc/dovecot/modules",

 	.mail_log_prefix = "%s(%u)<%{pid}><%{session}>: ",

--
2.27.0

debug log:

solving da9f4034f4 ...
found da9f4034f4 in https://yhetil.org/guix-patches/20200817093124.30611-2-levenson@mmer.org/ ||
	https://yhetil.org/guix-patches/20200818120037.30722-2-levenson@mmer.org/

applying [1/1] https://yhetil.org/guix-patches/20200817093124.30611-2-levenson@mmer.org/
diff --git a/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch b/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch
new file mode 100644
index 0000000000..da9f4034f4

1:32: space before tab in indent.
 	mod_set.debug = global_auth_settings->debug;
1:33: space before tab in indent.
 	mod_set.filter_callback = auth_module_filter;
1:37: space before tab in indent.
 	module_dir_init(modules);
1:39: space before tab in indent.
 	if (!worker)
1:41: space before tab in indent.
 	mod_set.debug = global_auth_settings->debug;
Checking patch gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch...
Applied patch gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch cleanly.
warning: squelched 32 whitespace errors
warning: 37 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/20200818120037.30722-2-levenson@mmer.org/ for da9f4034f4
index at:
100644 da9f4034f4bc691c0b7eae4be51156eb39770c37	gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).