Also, fallocate+chmod is racy: between the two calls, an attacker could open the file, and then keep it open until next reboot. OTOH, mkswap creates the swap file with the correct permissions straight away.
The --size and --file options are relatively new, though: they were added in util-linux v2.40, released in 2024.
> As soft keywords, their use in the grammar is possible while still preserving compatibility with existing code that uses these names as identifier names.
https://news.ycombinator.com/item?id=48290881 ("Unicode 18.0.0 Beta", 3 months ago, 66 comments)
reply