1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

test: Work around msmtp having setgid permissions

In some distributions, including newer Debian versions, msmtp is
installed as setgid.

That prevents $HOSTALIASES from being honoured, which breaks the tests.

This patch works around the problem by creating a copy of the binary,
which will not have the setgid bit set.
This commit is contained in:
Alberto Bertogli
2019-08-31 01:27:19 +01:00
parent f63e5bf0b2
commit 34ade50374

View File

@@ -79,8 +79,13 @@ function run_msmtp() {
# msmtp will check that the rc file is only user readable. # msmtp will check that the rc file is only user readable.
chmod 600 msmtprc chmod 600 msmtprc
# msmtp binary is often g+s, which causes $HOSTALIASES to not be
# honoured, which breaks the tests. Copy the binary to remove the
# setgid bit as a workaround.
cp -u "`which msmtp`" "${UTILDIR}/.msmtp-bin"
HOSTALIASES=${TBASE}/hosts \ HOSTALIASES=${TBASE}/hosts \
msmtp -C msmtprc "$@" ${UTILDIR}/.msmtp-bin -C msmtprc "$@"
} }
function smtpc.py() { function smtpc.py() {