O_DIRECTORY|O_TMPFILE - sample code
O_DIRECTORY|O_TMPFILE - sample code
Posted Aug 13, 2026 1:47 UTC (Thu) by neilbrown (subscriber, #359)In reply to: O_DIRECTORY|O_TMPFILE - sample code by donald.buczek
Parent article: Reconsidering O_CREAT|O_DIRECTORY
You can avoid the bash warnings by setting the PWD environment variable to ...
You can also avoid the bash warnings by actually mounting the directory. You would want to do that in a private namespace to keep the directory private. The namespace would be torn down on exit which would clean up the mount and the temp directory.
Where to mount it? I would designate a place which is otherwise unused where anyone can mount a private directory in a private namespace. Maybe /run/scratch ??
I've pushed out some changes to github which you can experiment with.
