diff options
author | 2019-03-24 17:00:05 +0100 | |
---|---|---|
committer | 2019-03-24 17:43:16 +0100 | |
commit | 9f261121abac849dcdc923d4d391b5ec83ca2652 (patch) | |
tree | 30b5aec15246b14df89bc8a32fd8dc9cab14682a | |
parent | Gentoo: Disable test nptl/tst-tss-basic; fails due to sandbox (diff) | |
download | glibc-9f261121abac849dcdc923d4d391b5ec83ca2652.tar.gz glibc-9f261121abac849dcdc923d4d391b5ec83ca2652.tar.bz2 glibc-9f261121abac849dcdc923d4d391b5ec83ca2652.zip |
Gentoo: Adapt nss/tst-nss-files-alias-leak to Gentoo aliases file location
Bug: https://bugs.gentoo.org/680230
Bug: https://bugs.gentoo.org/496510
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r-- | nss/tst-nss-files-alias-leak.c | 20 | ||||
-rw-r--r-- | support/support_chroot.c | 6 |
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 26d38e2dba..210cb94ad5 100644 --- a/nss/tst-nss-files-alias-leak.c +++ b/nss/tst-nss-files-alias-leak.c @@ -45,37 +45,37 @@ 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, /* The line must be longer than the line with the :include: - directive in /etc/aliases. */ + directive in /etc/mail/aliases. */ "# Long line. ##############################################\n" "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 6356b1af6c..c62167371a 100644 --- a/support/support_chroot.c +++ b/support/support_chroot.c @@ -52,12 +52,18 @@ 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); free (path_etc); + free (path_etc_mail); /* valgrind needs a temporary directory in the chroot. */ { |