On Mon, Jun 30, 2025 at 07:26:37PM +0100, Richard Lewis wrote:
I have 2 thoughts, one is that we set ProtectSystem=strict so /tmp is read-only when the unit runs: However, we set Environment=TMPDIR=/run/chkrootkit which should mean things dont write
to /tmp --- maybe your email sending setup ignores TMPDIR? are you
using something non-standard?
I can send mail on these machines using this command:
$ date| mail -s test root
--- does running /sbin/chkrootkit-daily directly work? (just in case)yes
On Sun, 6 Jul 2025 at 12:01, Holger Levsen <holger@layer-acht.org> wrote:
--- what provides mail(1) --is it mailx or mailutils etc? (probably doesnt
matter, but.)
bsd-mailx
i'm not sure, but i think this may be the problem --- looking at https://salsa.debian.org/debian/bsd-mailx/-/blob/master/send.c and https://salsa.debian.org/debian/bsd-mailx/-/blob/master/debian/patches/02-Base-fixes-1.patch
it seems debian has patched bsd-mailx to hardcode /tmp (im not sure
about this, i only read the code on salsa, and couldnt spot where the directory was set)?
does it work to use mailutils instead?
does editing /sbin/chkrootkit-daily to use sendmail fix it (something
like this):
On Sun, Jul 06, 2025 at 12:47:36PM +0100, Richard Lewis wrote:
On Sun, 6 Jul 2025 at 12:01, Holger Levsen <holger@layer-acht.org> wrote:
bsd-mailx
i'm not sure, but i think this may be the problem --- looking at https://salsa.debian.org/debian/bsd-mailx/-/blob/master/send.c and https://salsa.debian.org/debian/bsd-mailx/-/blob/master/debian/patches/02-Base-fixes-1.patch
it seems debian has patched bsd-mailx to hardcode /tmp (im not sure
about this, i only read the code on salsa, and couldnt spot where the directory was set)?
ic!
Hi everyone,
On Sun, Jul 06, 2025 at 12:32:09PM +0000, Holger Levsen wrote:
On Sun, Jul 06, 2025 at 12:47:36PM +0100, Richard Lewis wrote:
On Sun, 6 Jul 2025 at 12:01, Holger Levsen <holger@layer-acht.org> wrote:
bsd-mailx
i'm not sure, but i think this may be the problem --- looking at https://salsa.debian.org/debian/bsd-mailx/-/blob/master/send.c and https://salsa.debian.org/debian/bsd-mailx/-/blob/master/debian/patches/02-Base-fixes-1.patch
it seems debian has patched bsd-mailx to hardcode /tmp (im not sure
about this, i only read the code on salsa, and couldnt spot where the directory was set)?
ic!
I've come along and done the easy bit... the attached patch causes mailx
to honour the TMPDIR environment variable, if set.
Does this do enough to fix your originally-failing scenario?
(I don't see that Debian overrode anything so much as setting an
otherwise undefined but required build-time definition for the default.)
On Wed, 9 Jul 2025 at 23:02, Andrew Bower <andrew@bower.uk> wrote:
On Sun, Jul 06, 2025 at 12:32:09PM +0000, Holger Levsen wrote:
On Sun, Jul 06, 2025 at 12:47:36PM +0100, Richard Lewis wrote:
On Sun, 6 Jul 2025 at 12:01, Holger Levsen <holger@layer-acht.org> wrote:
bsd-mailx
i'm not sure, but i think this may be the problem --- looking at https://salsa.debian.org/debian/bsd-mailx/-/blob/master/send.c and https://salsa.debian.org/debian/bsd-mailx/-/blob/master/debian/patches/02-Base-fixes-1.patch
it seems debian has patched bsd-mailx to hardcode /tmp (im not sure about this, i only read the code on salsa, and couldnt spot where the directory was set)?
ic!
I've come along and done the easy bit... the attached patch causes mailx
to honour the TMPDIR environment variable, if set.
Thanks - this looks a good solution to me
Does this do enough to fix your originally-failing scenario?
I tested a bsd-mailx with your patch applied in a systemd-nspawn
container (unstable), with exim, and it fixed the original issue
(which i could reproduce)
(I don't see that Debian overrode anything so much as setting an
otherwise undefined but required build-time definition for the default.)
ah yes!
I tested a bsd-mailx with your patch applied in a systemd-nspawn
container (unstable), with exim, and it fixed the original issue
(which i could reproduce)
i also installed postfix and it continued to work (but i didnt try
this with the unpatched bsd-mailx).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 04:14:31 |
Calls: | 10,386 |
Calls today: | 1 |
Files: | 14,057 |
Messages: | 6,416,605 |