Someone wrote: > Another option would be to copy the user and other permissions from the > original file, but reset the group permissions to 0. For example, if a > user goes to edit a file with permissions 754, the .swp file would have > the permissions 704. This prevents the security problem with .swp files > while still allowing anyone to recover changes for files that were world > readable to begin with. This might be a good compromise.
To cover the case that the user has his configuration wrong and has a primary group that gives too many users access, we can attempt to change the group of the swap file to that of the original file. If that works then we can keep using the same permissions. If that fails, the group is now different, we can set the group bits to zero. We can OR them with the world bits (some systems have the weird behavior that when the group matches it ignores the world bits, restricting permission if you happen to be in the lucky group). > Still I think the least problematic solution though is to use a separate > directory for the .swp files. Also, what happens if a user goes to edit > a file that he has write access to in a directory that he doesn't have > write access to? Where does the .swp file get placed then? With the > approach separate directory approach this becomes a nonissue. Read the docs, it's covered. -- bashian roulette: $ ((RANDOM%6)) || rm -rf ~ /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
