git » chasquid » commit 5102007

test: Adjust docker test to msmtp being a setgid binary

author Alberto Bertogli
2019-08-04 02:31:22 UTC
committer Alberto Bertogli
2019-08-04 03:55:01 UTC
parent e8ccff749e4efc0efcb50fe37d1b360c62d329cb

test: Adjust docker test to msmtp being a setgid binary

The golang image has been updated to use Debian buster. In that version,
msmtp is now setgid, which means glibc sanitizes the environment before
forking and $HOSTALIASES will be ignored, which breaks the tests.

This patch works around the problem by removing the setgid bit from
msmtp.

test/Dockerfile +3 -0

diff --git a/test/Dockerfile b/test/Dockerfile
index a413e87..c01f4a1 100644
--- a/test/Dockerfile
+++ b/test/Dockerfile
@@ -34,6 +34,9 @@ RUN apt-get install -y -q sudo
 RUN mkdir -p test/t-02-exim/.exim4 \
 	&& ln -s /usr/sbin/exim4 test/t-02-exim/.exim4
 
+# Prepare msmtp: remove setuid, otherwise HOSTALIASES doesn't work.
+RUN chmod g-s /usr/bin/msmtp
+
 # Install binaries for the (optional) DKIM integration test.
 RUN go get github.com/driusan/dkim/... \
 	&& go install github.com/driusan/dkim/cmd/dkimsign \