From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mOiTNgvYPF9iJAAA0tVLHw (envelope-from ) for ; Wed, 19 Aug 2020 07:43:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id WHRRMgvYPF8dQQAAB5/wlQ (envelope-from ) for ; Wed, 19 Aug 2020 07:43:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1AFC0940656 for ; Wed, 19 Aug 2020 07:43:07 +0000 (UTC) Received: from localhost ([::1]:53848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8IkT-0006oL-6N for larch@yhetil.org; Wed, 19 Aug 2020 03:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8IkQ-0006o1-8k for guix-patches@gnu.org; Wed, 19 Aug 2020 03:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8IkP-0004G7-Vk for guix-patches@gnu.org; Wed, 19 Aug 2020 03:43:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8IkP-0008Em-To for guix-patches@gnu.org; Wed, 19 Aug 2020 03:43:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42899] [PATCH v2 02/10] gnu: dovecot: Patch and provide a static path for module directory. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Aug 2020 07:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Alexey Abramov Cc: 42899@debbugs.gnu.org Received: via spool by 42899-submit@debbugs.gnu.org id=B42899.159782294031608 (code B ref 42899); Wed, 19 Aug 2020 07:43:01 +0000 Received: (at 42899) by debbugs.gnu.org; 19 Aug 2020 07:42:20 +0000 Received: from localhost ([127.0.0.1]:37693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8Ijg-0008Dh-Hx for submit@debbugs.gnu.org; Wed, 19 Aug 2020 03:42:20 -0400 Received: from flashner.co.il ([178.62.234.194]:44762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8Ijb-0008DO-PO for 42899@debbugs.gnu.org; Wed, 19 Aug 2020 03:42:15 -0400 Received: from localhost (unknown [31.210.181.177]) by flashner.co.il (Postfix) with ESMTPSA id 52C8240148; Wed, 19 Aug 2020 07:42:05 +0000 (UTC) Date: Wed, 19 Aug 2020 10:41:32 +0300 From: Efraim Flashner Message-ID: <20200819074132.GE10528@E5400> References: <20200818120037.30722-1-levenson@mmer.org> <20200818120037.30722-2-levenson@mmer.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IU5/I01NYhRvwH70" Content-Disposition: inline In-Reply-To: <20200818120037.30722-2-levenson@mmer.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -2.61 X-TUID: h3YQH8Mfvbox --IU5/I01NYhRvwH70 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable How are all the XXX_MODULE_DIR variables set? Would it be possible to just set MODULE_DIR to /etc/dovecot/modules and leave the others as-is? They seem to just use a file/folder under MODULE_DIR. On Tue, Aug 18, 2020 at 02:00:30PM +0200, Alexey Abramov wrote: > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch: New f= ile. > * gnu/packages/mail.scm (dovecot)[source]: Use it. >=20 > Signed-off-by: Alexey Abramov > --- > gnu/local.mk | 1 + > gnu/packages/mail.scm | 3 +- > ...ovecot-use-static-path-for-moduledir.patch | 146 ++++++++++++++++++ > 3 files changed, 149 insertions(+), 1 deletion(-) > create mode 100644 gnu/packages/patches/dovecot-use-static-path-for-modu= ledir.patch >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index 87bd7094bf..2817deb01f 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -900,6 +900,7 @@ dist_patch_DATA =3D \ > %D%/packages/patches/doc++-include-directives.patch \ > %D%/packages/patches/doc++-segfault-fix.patch \ > %D%/packages/patches/docker-fix-tests.patch \ > + %D%/packages/patches/dovecot-use-static-path-for-moduledir.patch \ > %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch \ > %D%/packages/patches/doxygen-test.patch \ > %D%/packages/patches/doxygen-1.8.17-runtests.patch \ > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm > index 98e75fa90f..8e7d5b2fc1 100644 > --- a/gnu/packages/mail.scm > +++ b/gnu/packages/mail.scm > @@ -1411,7 +1411,8 @@ facilities for checking incoming mail.") > (version-major+minor version) "/" > "dovecot-" version ".tar.gz")) > (sha256 > - (base32 "1p5gp8jbavcsaara5mfn5cbrnlxssajnchczbgmmfzr7228fmnfk"))= )) > + (base32 "1p5gp8jbavcsaara5mfn5cbrnlxssajnchczbgmmfzr7228fmnfk")) > + (patches (search-patches "dovecot-use-static-path-for-moduledir.p= atch")))) > (build-system gnu-build-system) > (native-inputs > `(("pkg-config" ,pkg-config))) > diff --git a/gnu/packages/patches/dovecot-use-static-path-for-moduledir.p= atch b/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch > new file mode 100644 > index 0000000000..da9f4034f4 > --- /dev/null > +++ b/gnu/packages/patches/dovecot-use-static-path-for-moduledir.patch > @@ -0,0 +1,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 =3D global_auth_settings->debug; > + mod_set.filter_callback =3D auth_module_filter; > + > +- modules =3D module_dir_load(AUTH_MODULE_DIR, NULL, &mod_set); > ++ modules =3D module_dir_load("/etc/dovecot/modules/auth", NULL, &mod_se= t); > + module_dir_init(modules); > + > + if (!worker) > +@@ -223,7 +223,7 @@ void auth_module_load(const char *names) > + mod_set.debug =3D global_auth_settings->debug; > + mod_set.ignore_missing =3D TRUE; > + > +- modules =3D module_dir_load_missing(modules, AUTH_MODULE_DIR, names, > ++ modules =3D module_dir_load_missing(modules, "/etc/dovecot/modules/aut= h", 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 =3D DOVECOT_ABI_VERSION; > +- modules =3D module_dir_load(CONFIG_MODULE_DIR, NULL, &mod_set); > ++ modules =3D module_dir_load("/etc/dovecot/modules/settings", NULL, &mo= d_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) =3D=3D ' ' || (c) =3D=3D '\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 =3D DOVECOT_ABI_VERSION; > + mod_set.require_init_funcs =3D TRUE; > + > +- modules =3D module_dir_load(DICT_MODULE_DIR, NULL, &mod_set); > ++ modules =3D module_dir_load("/etc/dovecot/modules/dict", NULL, &mod_se= t); > + 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 =3D doveadm_debug; > + mod_set.ignore_dlopen_errors =3D TRUE; > + > +- modules =3D module_dir_load_missing(modules, DOVEADM_MODULEDIR, > ++ modules =3D module_dir_load_missing(modules, "/etc/dovecot/modules/dov= eadm", > + NULL, &mod_set); > + module_dir_init(modules); > + } > +@@ -58,7 +58,7 @@ bool doveadm_has_unloaded_plugin(const char *name) > + return FALSE; > + } > + > +- dir =3D opendir(DOVEADM_MODULEDIR); > ++ dir =3D opendir("/etc/dovecot/modules/doveadm"); > + if (dir =3D=3D 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 *dri= ver) > + mod_set.abi_version =3D DOVECOT_ABI_VERSION; > + mod_set.ignore_missing =3D TRUE; > + > +- fs_modules =3D module_dir_load_missing(fs_modules, MODULE_DIR, > ++ fs_modules =3D module_dir_load_missing(fs_modules, "/etc/dovecot/modul= es", > + 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 =3D DOVECOT_ABI_VERSION; > + mod_set.setting_name =3D ""; > + mod_set.require_init_funcs =3D TRUE; > +- ssl_module =3D module_dir_load(MODULE_DIR, plugin_name, &mod_set); > +- if (module_dir_try_load_missing(&ssl_module, MODULE_DIR, plugin_name, > ++ ssl_module =3D module_dir_load("/etc/dovecot/modules", plugin_name, &m= od_set); > ++ if (module_dir_try_load_missing(&ssl_module, "/etc/dovecot/modules", p= lugin_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/m= ail-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_def= ault_settings =3D { > + .last_valid_gid =3D 0, > + > + .mail_plugins =3D "", > +- .mail_plugin_dir =3D MODULEDIR, > ++ .mail_plugin_dir =3D "/etc/dovecot/modules", > + > + .mail_log_prefix =3D "%s(%u)<%{pid}><%{session}>: ", > + > +-- > +2.27.0 > --=20 > 2.27.0 >=20 >=20 >=20 >=20 --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --IU5/I01NYhRvwH70 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl8816kACgkQQarn3Mo9 g1G8gg//el7x8zTGlew7YpJsC3oUvk8+O94dlsdyNR9Px1QPjVgEUxPCSwLTwMt2 okQiQiTxtR60pw0RVHQS3YfBVDuDJqCvwfkjZzrt3/AthlG68rh99okEYs5Dh3kJ SyO7gtNezxm/+nhmhB6f41PlZZF+hT/lR6v5QW745owQyumI7Rj/sp/0Mgy90+81 Wp+65qUoe3Rc/YcPWGOTBeBYTSPaswzK5pXWENiqxGQZ4U2sIHHViwMdVwsH6Jtr BHNkkm4rQIz+8AqBUiSlHagrEeJrz6n6X9FOg+CnqfIgtrZulxJJyc1+6MoJLgNe Phc4oa1AlkZyvUFO6zfovsWirI0QnjlHJjkivWZZfIi4yMaEHsoQuSmtajLYt/cD 4xT8F364ix9wEOtmKdYKY0MlGzOMGaos/lyygM/sDUPWbqNLm+ahEhK0fSuAJN5w 0zmOPtgnFUriJvEx69SZhLLhqEe3cgvgGHNggiQgcSxU6Hepzz9fTfx2cNjalpFK q3+QBLcHjTaDHAOrDL7B7XLwyMM8zJDm7IjF1xJ7K+CxFO8zbYi8S5HOyEmBZu5J uKI67CDgf6Ail4G6oL87O6i3RIikBStKHAIGt9u98yLBJQgCv8H5twMi0r2wf39y yQi1LsUWUjVvfyt6zaRurufpi2idWCMaYCjz37ThM5ajsGJg2ig= =y/Zt -----END PGP SIGNATURE----- --IU5/I01NYhRvwH70--