Quote Originally Posted by pingufunkybeat View Post
I think it's more to protect users from other sneaky users.

But yeah, I'm not sure whether the swap files inherit the original file's permissions and whatnot. There are likely corner cases involved. It was probably a much requested feature that finally got implemented. You don't have to use it if you don't feel the need (I don't).
It does inherit the permissions from the original file - but the problem is not the swap file permissions, but the swap file location.
E.g. open /home/testuser/bin/test.sh, vim will create a swap file in /var/tmp/test.sh.swap - alas, /var/tmp is open for all users, while /home/testuser is open only for testuser. Bingo: attack vector.

- Gilboa