From: Stefan Schantl Date: Sat, 8 Jan 2011 14:52:10 +0000 (+0100) Subject: joe: Enable support for selinux. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf37c8854f26d6cfadeb2da7c004ef14a12a193a;p=ipfire-3.x.git joe: Enable support for selinux. Reference #85. --- diff --git a/pkgs/core/joe/joe.nm b/pkgs/core/joe/joe.nm index d5366eb65..970cd33c9 100644 --- a/pkgs/core/joe/joe.nm +++ b/pkgs/core/joe/joe.nm @@ -26,7 +26,9 @@ include $(PKGROOT)/Include PKG_NAME = joe PKG_VER = 3.7 -PKG_REL = 0 +PKG_REL = 1 + +PKG_BUILD_DEPS+= libselinux-devel PKG_MAINTAINER = PKG_GROUP = Applications/Editors diff --git a/pkgs/core/joe/patches/joe-3.4-selinux.patch b/pkgs/core/joe/patches/joe-3.4-selinux.patch new file mode 100644 index 000000000..e9a9709ce --- /dev/null +++ b/pkgs/core/joe/patches/joe-3.4-selinux.patch @@ -0,0 +1,103 @@ +diff -up joe-3.7/configure.selinux joe-3.7/configure +--- joe-3.7/configure.selinux 2008-10-30 04:07:22.000000000 +0100 ++++ joe-3.7/configure 2009-02-02 11:13:50.000000000 +0100 +@@ -6531,7 +6531,7 @@ if test "$ac_cv_header_selinux_selinux_h + cat >>confdefs.h <<\_ACEOF + #define HAVE_SELINUX 1 + _ACEOF +- ++LIBS="$LIBS -lselinux" + fi + + # Checks for typedefs, structures, and compiler characteristics. +diff -up joe-3.7/selinux.c.selinux joe-3.7/selinux.c +--- joe-3.7/selinux.c.selinux 2006-05-22 06:15:41.000000000 +0200 ++++ joe-3.7/selinux.c 2009-02-02 11:13:50.000000000 +0100 +@@ -4,7 +4,9 @@ + */ + #include "types.h" + +-#ifdef WITH_SELINUX ++#include "config.h" ++ ++#ifdef HAVE_SELINUX + #include + static int selinux_enabled = -1; + #endif +@@ -13,7 +15,7 @@ int + copy_security_context(const char *from_file, const char *to_file) + { + int status = 0; +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + security_context_t from_context; + security_context_t to_context; + +@@ -38,9 +40,7 @@ copy_security_context(const char *from_f + } + + if (getfilecon(to_file, &to_context) < 0) { +- MSG_PUTS(_(joe_gettext(_("\nCould not get security context for ")))); +- msg_outtrans(to_file); +- msg_putchar('\n'); ++ error(0, errno, "Could not get security context for %s", to_file); + freecon(from_context); + return 1; + } +@@ -63,7 +63,7 @@ copy_security_context(const char *from_f + int + match_default_security_context(const char *from_file) + { +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + security_context_t scontext; + + if (selinux_enabled == -1) +@@ -102,7 +102,7 @@ match_default_security_context(const cha + int + reset_default_security_context() + { +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + if (selinux_enabled == -1) + selinux_enabled = (is_selinux_enabled() > 0); + +@@ -121,7 +121,7 @@ reset_default_security_context() + int + output_security_context(char *from_file) + { +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + security_context_t scontext; + + if (selinux_enabled == -1) +@@ -153,7 +153,7 @@ output_security_context(char *from_file) + + /* + Test program compile using the following command +- cc -o t t.c -DWITH_SELINUX -DTEST -lselinux ++ cc -o t t.c -DHAVE_SELINUX -DTEST -lselinux + */ + + #include +diff -up joe-3.7/ufile.c.selinux joe-3.7/ufile.c +--- joe-3.7/ufile.c.selinux 2008-11-02 21:39:52.000000000 +0100 ++++ joe-3.7/ufile.c 2009-02-02 11:13:50.000000000 +0100 +@@ -15,7 +15,7 @@ + #endif + #endif + +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + int copy_security_context(const char *from_file, const char *to_file); + #endif + +@@ -157,7 +157,7 @@ static int cp(unsigned char *from, unsig + utime((char *)to, &utbuf); + #endif + +-#ifdef WITH_SELINUX ++#ifdef HAVE_SELINUX + copy_security_context(from,to); + #endif +