Bug 189968 - vim does not create swap files with the correct SE Linux context.
Summary: vim does not create swap files with the correct SE Linux context.
Alias: None
Product: Fedora
Classification: Fedora
Component: vim (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2006-04-26 10:55 UTC by Russell Coker
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-08 11:17:58 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

Note You need to log in before you can comment on or make changes to this bug.