]>
Commit | Line | Data |
---|---|---|
cf37c885 SS |
1 | diff -up joe-3.7/configure.selinux joe-3.7/configure |
2 | --- joe-3.7/configure.selinux 2008-10-30 04:07:22.000000000 +0100 | |
3 | +++ joe-3.7/configure 2009-02-02 11:13:50.000000000 +0100 | |
4 | @@ -6531,7 +6531,7 @@ if test "$ac_cv_header_selinux_selinux_h | |
5 | cat >>confdefs.h <<\_ACEOF | |
6 | #define HAVE_SELINUX 1 | |
7 | _ACEOF | |
8 | - | |
9 | +LIBS="$LIBS -lselinux" | |
10 | fi | |
11 | ||
12 | # Checks for typedefs, structures, and compiler characteristics. | |
13 | diff -up joe-3.7/selinux.c.selinux joe-3.7/selinux.c | |
14 | --- joe-3.7/selinux.c.selinux 2006-05-22 06:15:41.000000000 +0200 | |
15 | +++ joe-3.7/selinux.c 2009-02-02 11:13:50.000000000 +0100 | |
16 | @@ -4,7 +4,9 @@ | |
17 | */ | |
18 | #include "types.h" | |
19 | ||
20 | -#ifdef WITH_SELINUX | |
21 | +#include "config.h" | |
22 | + | |
23 | +#ifdef HAVE_SELINUX | |
24 | #include <selinux/selinux.h> | |
25 | static int selinux_enabled = -1; | |
26 | #endif | |
27 | @@ -13,7 +15,7 @@ int | |
28 | copy_security_context(const char *from_file, const char *to_file) | |
29 | { | |
30 | int status = 0; | |
31 | -#ifdef WITH_SELINUX | |
32 | +#ifdef HAVE_SELINUX | |
33 | security_context_t from_context; | |
34 | security_context_t to_context; | |
35 | ||
36 | @@ -38,9 +40,7 @@ copy_security_context(const char *from_f | |
37 | } | |
38 | ||
39 | if (getfilecon(to_file, &to_context) < 0) { | |
40 | - MSG_PUTS(_(joe_gettext(_("\nCould not get security context for ")))); | |
41 | - msg_outtrans(to_file); | |
42 | - msg_putchar('\n'); | |
43 | + error(0, errno, "Could not get security context for %s", to_file); | |
44 | freecon(from_context); | |
45 | return 1; | |
46 | } | |
47 | @@ -63,7 +63,7 @@ copy_security_context(const char *from_f | |
48 | int | |
49 | match_default_security_context(const char *from_file) | |
50 | { | |
51 | -#ifdef WITH_SELINUX | |
52 | +#ifdef HAVE_SELINUX | |
53 | security_context_t scontext; | |
54 | ||
55 | if (selinux_enabled == -1) | |
56 | @@ -102,7 +102,7 @@ match_default_security_context(const cha | |
57 | int | |
58 | reset_default_security_context() | |
59 | { | |
60 | -#ifdef WITH_SELINUX | |
61 | +#ifdef HAVE_SELINUX | |
62 | if (selinux_enabled == -1) | |
63 | selinux_enabled = (is_selinux_enabled() > 0); | |
64 | ||
65 | @@ -121,7 +121,7 @@ reset_default_security_context() | |
66 | int | |
67 | output_security_context(char *from_file) | |
68 | { | |
69 | -#ifdef WITH_SELINUX | |
70 | +#ifdef HAVE_SELINUX | |
71 | security_context_t scontext; | |
72 | ||
73 | if (selinux_enabled == -1) | |
74 | @@ -153,7 +153,7 @@ output_security_context(char *from_file) | |
75 | ||
76 | /* | |
77 | Test program compile using the following command | |
78 | - cc -o t t.c -DWITH_SELINUX -DTEST -lselinux | |
79 | + cc -o t t.c -DHAVE_SELINUX -DTEST -lselinux | |
80 | */ | |
81 | ||
82 | #include <stdio.h> | |
83 | diff -up joe-3.7/ufile.c.selinux joe-3.7/ufile.c | |
84 | --- joe-3.7/ufile.c.selinux 2008-11-02 21:39:52.000000000 +0100 | |
85 | +++ joe-3.7/ufile.c 2009-02-02 11:13:50.000000000 +0100 | |
86 | @@ -15,7 +15,7 @@ | |
87 | #endif | |
88 | #endif | |
89 | ||
90 | -#ifdef WITH_SELINUX | |
91 | +#ifdef HAVE_SELINUX | |
92 | int copy_security_context(const char *from_file, const char *to_file); | |
93 | #endif | |
94 | ||
95 | @@ -157,7 +157,7 @@ static int cp(unsigned char *from, unsig | |
96 | utime((char *)to, &utbuf); | |
97 | #endif | |
98 | ||
99 | -#ifdef WITH_SELINUX | |
100 | +#ifdef HAVE_SELINUX | |
101 | copy_security_context(from,to); | |
102 | #endif | |
103 |