Red Hat Bugzilla – Bug 189968
vim does not create swap files with the correct SE Linux context.
Last modified: 2007-11-30 17:11:31 EST
Description of problem:
vim version 7.0.d001-1 does not preserve the SE Linux context for the
For example I have edited a file named "test.c" in my /tmp directory, and I
display the SE Linux context while it's running:
$ ls -lZ test.c .test.c.swp
-rw------- rjc rjc rjc:object_r:src_t test.c
-rw------- rjc rjc rjc:object_r:tmp_t .test.c.swp
The file .test.c.swp should have the type src_t. This is a more serious issue
with Fedora Core 5 as the SE Linux context is used more for MCS.
I tried to write a patch to fix this but had to give up. The code in vim is
too difficult to manage.
If I was going to patch this I would prefer to do it by writing functions to
copy the security data from one file to another and to store the security data
to a memory region and to copy it from the memory region to a file. Then such
functions could be used for SE Linux security contexts, ACLs (Posix or NT -
whichever is appropriate), and of course Unix permissions.
fixed in vim-7.0.000-1