Bram Moolenaar schrieb:
> 
> Patch 7.1.296
> Problem:    SELinux is not supported.
> Solution:   Detect the selinux library and use mch_copy_sec(). (James Vega)
> Files:            src/auto/configure, src/config.h.in, src/configure.in,
>           src/fileio.c, src/memfile.c, src/os_unix.c, src/proto/os_unix.pro
> 
.....

This looks like the patch we currently have in Fedora. There's one minor patch 
missing, though.
When editing a file with a security context the .swp file should have the same 
context. It
currently looks like this while editing a file in /tmp:
$ 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. I think the attached patch 
fixes this.

   Karsten



--
  Karsten Hopp        | Mail: [EMAIL PROTECTED]
  Red Hat Deutschland | Tel: +49-711-96437-0
  Hauptstaetterstr.58 | Fax: +49-711-613590
  D-70178 Stuttgart   | http://www.redhat.de

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

diff -up vim71/src/memfile.c.selinux vim71/src/memfile.c
--- vim71/src/memfile.c.selinux 2008-05-08 12:48:58.000000000 +0200
+++ vim71/src/memfile.c 2008-05-08 12:48:41.000000000 +0200
@@ -1346,5 +1346,8 @@ mf_do_open(mfp, fname, flags)
        mfp->mf_ffname = NULL;
     }
     else
+#ifdef HAVE_SELINUX
+        mch_copy_sec(fname, mfp->mf_fname);
+#endif
        mch_hide(mfp->mf_fname);    /* try setting the 'hidden' flag */
 }

Raspunde prin e-mail lui