{"version":"2.1.331","anchor":"fs-operations-pinned-to-handles-with-symlink-and-hard-lin","canonical_anchor":"fs-operations-pinned-to-handles-with-symlink-and-hard-lin","heading":"Mod file access is now protected against link tricks","tier":"internal","area":"Plugins","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.331\/e\/fs-operations-pinned-to-handles-with-symlink-and-hard-lin","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.331","markdown":"### Mod file access is now protected against link tricks\n\nThe file helper used by mods can now pin files while working on them and refuses writes to files with more than one name\n\n**Unclear.** It is not clear when these protections apply, since the helper only uses them when it is given a held file.\n\n**What**\n\nThe file helper that mods use to read, write and list files can now hold on to the file it opened instead of looking it up by name each time. With that, it:\n\n- checks again just before writing\n\n- refuses to write a file that has another name, meaning a hard link, a second name pointing at the same file\n\n- confirms that what it opened is what it expected\n\n- lists folders through the file it holds\n\nWhen a file is not held, the operation can now fail with an error saying so.\n\n**Why**\n\nThis makes it harder to trick a mod into writing somewhere else by swapping a file for a link between the moment it is checked and the moment it is used.\n\n- Area: Plugins\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}