Bug 189968 - vim does not create swap files with the correct SE Linux context.
vim does not create swap files with the correct SE Linux context.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: vim (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-26 06:55 EDT by Russell Coker
Modified: 2007-11-30 17:11 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Russell Coker 2006-04-26 06:55:16 EDT
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 07:17:58 EDT
fixed in vim-7.0.000-1

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