summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch')
-rw-r--r--9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch b/9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch
new file mode 100644
index 0000000..bcf87ab
--- /dev/null
+++ b/9999/0010-Gentoo-Adapt-tests-to-etc-mail-alias-location.patch
@@ -0,0 +1,89 @@
+From 96f7387cdee162005d2373cbdcd1f7b65dfccd2c Mon Sep 17 00:00:00 2001
+From: "Andreas K. Huettel" <dilfridge@gentoo.org>
+Date: Sat, 21 Mar 2020 15:54:14 +0100
+Subject: [PATCH 10/12] Gentoo: Adapt tests to /etc/mail/alias location
+
+Signed-off-by: Andreas K. Huettel <dilfridge@gentoo.org>
+(cherry picked from commit 03fb405d759b9806fa150813f04dfe1aaa658ac6)
+---
+ nss/tst-nss-files-alias-leak.c | 18 +++++++++---------
+ support/support_chroot.c | 8 +++++++-
+ 2 files changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/nss/tst-nss-files-alias-leak.c b/nss/tst-nss-files-alias-leak.c
+index daebbf4ed4..095bb753a6 100644
+--- a/nss/tst-nss-files-alias-leak.c
++++ b/nss/tst-nss-files-alias-leak.c
+@@ -45,27 +45,27 @@ prepare (int argc, char **argv)
+ chroot_env = support_chroot_create
+ ((struct support_chroot_configuration) { } );
+
+- char *path = xasprintf ("%s/etc/aliases", chroot_env->path_chroot);
++ char *path = xasprintf ("%s/etc/mail/aliases", chroot_env->path_chroot);
+ add_temp_file (path);
+ support_write_file_string
+ (path,
+- "user1: :include:/etc/aliases.user1\n"
+- "user2: :include:/etc/aliases.user2\n"
+- "comment: comment1, :include:/etc/aliases.comment\n"
+- "many: :include:/etc/aliases.many\n");
++ "user1: :include:/etc/mail/aliases.user1\n"
++ "user2: :include:/etc/mail/aliases.user2\n"
++ "comment: comment1, :include:/etc/mail/aliases.comment\n"
++ "many: :include:/etc/mail/aliases.many\n");
+ free (path);
+
+- path = xasprintf ("%s/etc/aliases.user1", chroot_env->path_chroot);
++ path = xasprintf ("%s/etc/mail/aliases.user1", chroot_env->path_chroot);
+ add_temp_file (path);
+ support_write_file_string (path, "alias1\n");
+ free (path);
+
+- path = xasprintf ("%s/etc/aliases.user2", chroot_env->path_chroot);
++ path = xasprintf ("%s/etc/mail/aliases.user2", chroot_env->path_chroot);
+ add_temp_file (path);
+ support_write_file_string (path, "alias1a, alias2\n");
+ free (path);
+
+- path = xasprintf ("%s/etc/aliases.comment", chroot_env->path_chroot);
++ path = xasprintf ("%s/etc/mail/aliases.comment", chroot_env->path_chroot);
+ add_temp_file (path);
+ support_write_file_string
+ (path,
+@@ -75,7 +75,7 @@ prepare (int argc, char **argv)
+ "comment2\n");
+ free (path);
+
+- path = xasprintf ("%s/etc/aliases.many", chroot_env->path_chroot);
++ path = xasprintf ("%s/etc/mail/aliases.many", chroot_env->path_chroot);
+ add_temp_file (path);
+ FILE *fp = xfopen (path, "w");
+ for (int i = 0; i < many_aliases; ++i)
+diff --git a/support/support_chroot.c b/support/support_chroot.c
+index 4f435c1ac1..e7ca2c714b 100644
+--- a/support/support_chroot.c
++++ b/support/support_chroot.c
+@@ -52,13 +52,19 @@ support_chroot_create (struct support_chroot_configuration conf)
+ xmkdir (path_etc, 0777);
+ add_temp_file (path_etc);
+
++ /* Create the /etc/mail directory in the chroot environment. */
++ char *path_etc_mail = xasprintf ("%s/etc/mail", chroot->path_chroot);
++ xmkdir (path_etc_mail, 0777);
++ add_temp_file (path_etc_mail);
++
+ write_file (path_etc, "resolv.conf", conf.resolv_conf,
+ &chroot->path_resolv_conf);
+ write_file (path_etc, "hosts", conf.hosts, &chroot->path_hosts);
+ write_file (path_etc, "host.conf", conf.host_conf, &chroot->path_host_conf);
+- write_file (path_etc, "aliases", conf.aliases, &chroot->path_aliases);
++ write_file (path_etc_mail, "aliases", conf.aliases, &chroot->path_aliases);
+
+ free (path_etc);
++ free (path_etc_mail);
+
+ /* valgrind needs a temporary directory in the chroot. */
+ {
+--
+2.26.2
+