From f8509ab76ca9fc3469ab8a9752223c6462213e00 Mon Sep 17 00:00:00 2001 From: David Steele Date: Thu, 7 May 2020 07:38:28 -0400 Subject: [PATCH] Don't allow sudo to disable core dumps in test containers. Newer versions of sudo output this message to stderr when run in a container: sudo: setrlimit(RLIMIT_CORE): Operation not permitted See https://github.com/sudo-project/sudo/issues/42 for details. A simple workaround is to prevent sudo from disabling core dumps. This seems safe enough because if sudo is segfaulting then core files are the least of our worries. --- test/lib/pgBackRestTest/Common/ContainerTest.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index b3d754e6d..252898be0 100755 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -593,6 +593,8 @@ sub containerBuild if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL) { $strScript .= + # Don't allow sudo to disable core dump (suppresses errors, see https://github.com/sudo-project/sudo/issues/42) + " echo \"Set disable_coredump false\" >> /etc/sudo.conf && \\\n" . " echo '%" . TEST_GROUP . " ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/" . TEST_GROUP . " && \\\n" . " sed -i 's/^Defaults requiretty\$/\\# Defaults requiretty/' /etc/sudoers"; }