On Mon, Jul 18, 2022 at 8:18 AM Edward Welbourne <edward.welbou...@qt.io> wrote: > > Alejandro Colomar (Monday, July 18, 2022 14:07) > > MacOS seems to be setting TMPDIR (or at least some script run at > > startup seems to be setting it in my system), and it's set to something > > really weird that I don't trust will exist after reboot. > > Then I think the way you're using tmpdir doesn't match its usual > semantics, namely that it's exactly a directory that's routinely blown > away and recreated, at least as often as boot-time and ideally more > often. If what you need is a place to store (even semi-) persistent > state for a program, that should survive reboots, then you want > $prefix/var/, not /tmp/ (which may well be a tmpfs partition, indeed).
I believe MacOS maps /etc and /tmp to a private area for the user. They are not world readable/writable. I believe Apple did it for hardening. Here's from a MacOS X 10.5 machine I have: $ ls -l /etc /tmp lrwxr-xr-x@ 1 root wheel 11 Feb 10 2015 /etc -> private/etc lrwxr-xr-x@ 1 root wheel 11 Feb 10 2015 /tmp -> private/tmp Jeff