diff options
author | Joe Orton <jorton@redhat.com> | 2012-03-13 09:55:18 +0000 |
---|---|---|
committer | Joe Orton <jorton@redhat.com> | 2012-03-13 09:55:18 +0000 |
commit | 3a44ff765502ac564b64b4958239d30e8566dcaf (patch) | |
tree | 24433e423b88c4319e138caa4d0e3c94a8458b30 /httpd-2.4.1-selinux.patch | |
parent | 61679dd90cf1ebd9e9342223ce5344346a9142ce (diff) | |
download | httpd-3a44ff765502ac564b64b4958239d30e8566dcaf.tar.gz httpd-3a44ff765502ac564b64b4958239d30e8566dcaf.tar.xz httpd-3a44ff765502ac564b64b4958239d30e8566dcaf.zip |
update to 2.4.1
- adopt upstream default httpd.conf (almost verbatim)
- split all LoadModules to conf.modules.d/*.conf
- include conf.d/*.conf at end of httpd.conf
- trim %changelog
Diffstat (limited to 'httpd-2.4.1-selinux.patch')
-rw-r--r-- | httpd-2.4.1-selinux.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/httpd-2.4.1-selinux.patch b/httpd-2.4.1-selinux.patch new file mode 100644 index 0000000..e97c5a4 --- /dev/null +++ b/httpd-2.4.1-selinux.patch @@ -0,0 +1,61 @@ + +Log the SELinux context at startup. + +Upstream-Status: unlikely to be any interest in this upstream + +--- httpd-2.4.1/configure.in.selinux ++++ httpd-2.4.1/configure.in +@@ -458,6 +458,11 @@ fopen64 + dnl confirm that a void pointer is large enough to store a long integer + APACHE_CHECK_VOID_PTR_LEN + ++AC_CHECK_LIB(selinux, is_selinux_enabled, [ ++ AC_DEFINE(HAVE_SELINUX, 1, [Defined if SELinux is supported]) ++ APR_ADDTO(AP_LIBS, [-lselinux]) ++]) ++ + AC_CACHE_CHECK([for gettid()], ac_cv_gettid, + [AC_TRY_RUN(#define _GNU_SOURCE + #include <unistd.h> +--- httpd-2.4.1/server/core.c.selinux ++++ httpd-2.4.1/server/core.c +@@ -58,6 +58,10 @@ + #include <unistd.h> + #endif + ++#ifdef HAVE_SELINUX ++#include <selinux/selinux.h> ++#endif ++ + /* LimitRequestBody handling */ + #define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1) + #define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0) +@@ -4452,6 +4456,28 @@ static int core_post_config(apr_pool_t * + } + #endif + ++#ifdef HAVE_SELINUX ++ { ++ static int already_warned = 0; ++ int is_enabled = is_selinux_enabled() > 0; ++ ++ if (is_enabled && !already_warned) { ++ security_context_t con; ++ ++ if (getcon(&con) == 0) { ++ ++ ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, ++ "SELinux policy enabled; " ++ "httpd running as context %s", con); ++ ++ already_warned = 1; ++ ++ freecon(con); ++ } ++ } ++ } ++#endif ++ + return OK; + } + |