3 ms·
If there are adversaries on the machine right now that can exploit this order, then touch+chmod is not enough. If somebody opens the file between those two oper
by nh2 1y ago
If there are adversaries on the machine right now that can exploit this order, then touch+chmod is not enough. If somebody opens the file between those two operations, they can still read the file contents written to it later. It only makes a bit harder by shortening that time.
Use e.g. a current version of `install` to create files atomically with the correct permissions.