Bug 189968

Summary: vim does not create swap files with the correct SE Linux context.
Product: [Fedora] Fedora Reporter: Russell Coker <rcoker>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-08 11:17:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Russell Coker 2006-04-26 10:55:16 UTC
Description of problem:

vim version 7.0.d001-1 does not preserve the SE Linux context for the 
temporary file.

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.

Comment 1 Karsten Hopp 2006-05-08 11:17:58 UTC
fixed in vim-7.0.000-1