1 --- vim62/src/configure.in.selinux 2003-12-17 11:37:19.480620103 -0500
2 +++ vim62/src/configure.in 2003-12-17 11:37:19.830641688 -0500
7 +dnl vim: set sw=2 tw=78 fo+=l:
8 +dnl Link with -lselinux for SELinux stuff; if not found
9 +AC_MSG_CHECKING(--disable-selinux argument)
10 +AC_ARG_ENABLE(selinux,
11 + [ --disable-selinux Don't check for SELinux support.],
12 + , [enable_selinux="yes"])
13 +if test "$enable_selinux" = "yes"; then
15 + AC_CHECK_LIB(selinux, is_selinux_enabled, [LIBS="$LIBS -lselinux"])
16 + AC_DEFINE(HAVE_SELINUX)
21 AC_MSG_CHECKING(--disable-gpm argument)
23 [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
24 --- vim62/src/config.h.in.selinux 2003-05-25 12:07:42.000000000 -0400
25 +++ vim62/src/config.h.in 2003-12-17 11:37:19.840642305 -0500
34 --- vim62/src/fileio.c.selinux 2003-12-17 11:37:19.120597902 -0500
35 +++ vim62/src/fileio.c 2003-12-17 12:08:00.694335982 -0500
38 /* vi:set ts=8 sts=4 sw=4:
40 * VIM - Vi IMproved by Bram Moolenaar
44 (perm & 0707) | ((perm & 07) << 3));
46 + mch_copy_sec(backup, fname);
53 mch_set_acl(backup, acl);
56 + mch_copy_sec(backup,fname);
61 @@ -3719,6 +3726,12 @@
62 mch_set_acl(wfname, acl);
66 + /* Probably need to set the security context */
68 + mch_copy_sec(backup, wfname);
72 /* When creating a new file, set its owner/group to that of the original
73 * file. Get the new device and inode number. */
74 --- vim62/src/os_unix.c.selinux 2003-12-17 11:37:18.540562133 -0500
75 +++ vim62/src/os_unix.c 2003-12-17 12:11:54.558800808 -0500
77 # include <X11/SM/SMlib.h>
81 +#include <selinux/selinux.h>
82 +static int selinux_enabled=-1;
85 * Use this prototype for select, some include files have a wrong prototype
87 @@ -2279,6 +2283,45 @@
91 +mch_copy_sec(from_file, to_file)
95 + if (from_file == NULL)
99 + if (selinux_enabled == -1)
100 + selinux_enabled = (is_selinux_enabled () > 0);
102 + if (selinux_enabled)
104 + security_context_t scontext;
105 + if (getfilecon (from_file, &scontext) < 0)
107 + /* If the filesystem doesn't support extended attributes,
108 + the original had no special security context and the
109 + target cannot have one either. */
110 + if (errno == EOPNOTSUPP)
113 + MSG_PUTS(_("\nCould not get security context for "));
114 + msg_outtrans(from_file);
118 + if (setfilecon (to_file, scontext) < 0)
120 + MSG_PUTS(_("\nCould not set security context for "));
121 + msg_outtrans(to_file);
123 + freecon (scontext);
126 + freecon (scontext);
128 +#endif /* HAVE_SELINUX */
131 * Return a pointer to the ACL of file "fname" in allocated memory.
132 * Return NULL if the ACL is not available for whatever reason.
133 ;--- vim64/src/po/pl.po.orig 2004-06-11 10:58:45.000000000 +0200
134 ;+++ vim64/src/po/pl.po 2005-10-28 23:34:15.523950872 +0200
135 ;@@ -4826,6 +4826,22 @@
136 ; msgid "Opening the X display timed out"
137 ; msgstr "Próba otwarcia ekranu X trwa³a zbyt d³ugo"
142 ;+"Could not get security context for "
145 ;+"Nie mogê pobraæ kontekstu bezpieczeñstwa dla "
150 ;+"Could not set security context for "
153 ;+"Nie mogê ustawiæ kontekstu bezpieczeñstwa dla "
155 ; #: os_unix.c:3227 os_unix.c:3907