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.
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. On 11/03/2017 09:07 AM, Marvin Renich wrote: > * [email protected] <[email protected]> [171103 03:45]: >>> Another solution would be to always use the editing user's user:group >>> and perm 0600. >> I agree with this solution. And IMO the best way would be to create >> option for configure script+create option for vimrc configuration >> file, which can turn on/off this behavior (IMHO it's good to have >> option for users, who doesn't want this behavior). > I think having this behavior configurable is overkill and unnecessary in > practice. > > After thinking about it, I like my second solution (the one above) best. > My first solution has the advantage that anyone who has permission to > edit the file will be able to recover a crashed editing session. But I > don't see this as a real-world scenario. The above solution is simpler > to implement, simpler to understand, and makes it easier to identify > security implications. > > I also think my first solution might cause problems if the containing > directory has the restricted deletion flag permission bit. > > ...Marvin > -- -- 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.
signature.asc
Description: OpenPGP digital signature
