diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-08-19 14:45:55 +0100 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-08-27 16:39:31 +0100 |
commit | e25a025f9ed15f37c114e84484df3d77d392c09a (patch) | |
tree | fedba4f58018fbaedf21b604a60d1546adc24b55 /meta-webserver/recipes-httpd/apache2/apache2-2.4.6 | |
parent | b7a91f226ac6f6138a0d975117d37488886b9f38 (diff) | |
download | meta-openembedded-e25a025f9ed15f37c114e84484df3d77d392c09a.tar.gz |
apache2: update to 2.4.6
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-webserver/recipes-httpd/apache2/apache2-2.4.6')
9 files changed, 613 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-configure_perlbin.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-configure_perlbin.patch new file mode 100644 index 000000000..baa739fd4 --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-configure_perlbin.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | # Author: echo <fei.geng@windriver.com> | ||
2 | # Date: April 28 2009 | ||
3 | # Summary:Fix perl install directory to /usr/bin | ||
4 | # | ||
5 | # Upstream-Status: Inappropriate [configuration] | ||
6 | |||
7 | --- a/configure | ||
8 | +++ b/configure | ||
9 | @@ -22365,13 +22365,7 @@ | ||
10 | #define APACHE_MPM_DIR "$MPM_DIR" | ||
11 | _ACEOF | ||
12 | |||
13 | - | ||
14 | -perlbin=`$ac_aux_dir/PrintPath perl` | ||
15 | -if test "x$perlbin" = "x"; then | ||
16 | - perlbin="/replace/with/path/to/perl/interpreter" | ||
17 | -fi | ||
18 | - | ||
19 | - | ||
20 | +perlbin='/usr/bin/perl' | ||
21 | |||
22 | BSD_MAKEFILE=no | ||
23 | ap_make_include=include | ||
24 | --- a/configure.in | ||
25 | +++ b/configure.in | ||
26 | @@ -638,10 +638,7 @@ | ||
27 | AC_DEFINE_UNQUOTED(APACHE_MPM_DIR, "$MPM_DIR", | ||
28 | [Location of the source for the current MPM]) | ||
29 | |||
30 | -perlbin=`$ac_aux_dir/PrintPath perl` | ||
31 | -if test "x$perlbin" = "x"; then | ||
32 | - perlbin="/replace/with/path/to/perl/interpreter" | ||
33 | -fi | ||
34 | +perlbin='/usr/bin/perl' | ||
35 | AC_SUBST(perlbin) | ||
36 | |||
37 | dnl If we are running on BSD/OS, we need to use the BSD .include syntax. | ||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-ssl-ltmain-rpath.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-ssl-ltmain-rpath.patch new file mode 100644 index 000000000..3a59fb079 --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/apache-ssl-ltmain-rpath.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | --- httpd-2.2.8.orig/build/ltmain.sh | ||
2 | +++ httpd-2.2.8/build/ltmain.sh | ||
3 | @@ -1515,7 +1515,7 @@ EOF | ||
4 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` | ||
5 | # We need an absolute path. | ||
6 | case $dir in | ||
7 | - [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
8 | + =* | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
9 | *) | ||
10 | absdir=`cd "$dir" && pwd` | ||
11 | if test -z "$absdir"; then | ||
12 | @@ -2558,7 +2558,7 @@ EOF | ||
13 | $echo "*** $linklib is not portable!" | ||
14 | fi | ||
15 | if test "$linkmode" = lib && | ||
16 | - test "$hardcode_into_libs" = yes; then | ||
17 | + test "x$wrs_use_rpaths" = "xyes" && test "$hardcode_into_libs" = yes; then | ||
18 | # Hardcode the library path. | ||
19 | # Skip directories that are in the system default run-time | ||
20 | # search path. | ||
21 | @@ -2832,7 +2832,7 @@ EOF | ||
22 | |||
23 | if test "$linkmode" = lib; then | ||
24 | if test -n "$dependency_libs" && | ||
25 | - { test "$hardcode_into_libs" != yes || | ||
26 | + { test "$hardcode_into_libs" != yes || test "x$wrs_use_rpaths" != "xyes" || | ||
27 | test "$build_old_libs" = yes || | ||
28 | test "$link_static" = yes; }; then | ||
29 | # Extract -R from dependency_libs | ||
30 | @@ -3426,7 +3426,8 @@ EOF | ||
31 | *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
32 | esac | ||
33 | done | ||
34 | - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then | ||
35 | + if test "$hardcode_into_libs" != yes || test "x$wrs_use_rpaths" != "xyes" || | ||
36 | + test "$build_old_libs" = yes; then | ||
37 | dependency_libs="$temp_xrpath $dependency_libs" | ||
38 | fi | ||
39 | fi | ||
40 | @@ -3843,7 +3844,7 @@ EOF | ||
41 | case $archive_cmds in | ||
42 | *\$LD\ *) wl= ;; | ||
43 | esac | ||
44 | - if test "$hardcode_into_libs" = yes; then | ||
45 | + if test "$hardcode_into_libs" = yes && test "x$wrs_use_rpaths" = "xyes" ; then | ||
46 | # Hardcode the library paths | ||
47 | hardcode_libdirs= | ||
48 | dep_rpath= | ||
49 | @@ -4397,6 +4398,27 @@ EOF | ||
50 | # Now hardcode the library paths | ||
51 | rpath= | ||
52 | hardcode_libdirs= | ||
53 | + | ||
54 | + # short circuit putting rpaths in executables | ||
55 | + # | ||
56 | + if test "x$wrs_use_rpaths" != "xyes" ; then | ||
57 | + flag= | ||
58 | + for libdir in $compile_rpath; do | ||
59 | + case $(echo $libdir | ${SED} 's,/[/]*,/,g') in | ||
60 | + /usr/lib/* | /usr/lib32/* | /usr/lib64/* ) flag="$flag $libdir" ;; | ||
61 | + esac | ||
62 | + done | ||
63 | + compile_rpath="$flag" | ||
64 | + | ||
65 | + flag= | ||
66 | + for libdir in $finalize_rpath; do | ||
67 | + case $(echo $libdir | ${SED} 's,/[/]*,/,g') in | ||
68 | + /usr/lib/* | /usr/lib32/* | /usr/lib64/* ) flag="$flag $libdir" ;; | ||
69 | + esac | ||
70 | + done | ||
71 | + finalize_rpath="$flag" | ||
72 | + fi | ||
73 | + | ||
74 | for libdir in $compile_rpath $finalize_rpath; do | ||
75 | if test -n "$hardcode_libdir_flag_spec"; then | ||
76 | if test -n "$hardcode_libdir_separator"; then | ||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/fix-libtool-name.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/fix-libtool-name.patch new file mode 100644 index 000000000..027af04c3 --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/fix-libtool-name.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | Fix build scripts to use correct libtool filename | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | --- | ||
6 | httpd-2.4.2/build/config_vars.sh.in | 2 +- | ||
7 | httpd-2.4.2/configure | 2 +- | ||
8 | httpd-2.4.2/configure.in | 2 +- | ||
9 | httpd-2.4.2/support/apxs.in | 2 +- | ||
10 | 4 files changed, 4 insertions(+), 4 deletions(-) | ||
11 | |||
12 | --- a/build/config_vars.sh.in | ||
13 | +++ b/build/config_vars.sh.in | ||
14 | @@ -35,7 +35,7 @@ else | ||
15 | APU_CONFIG=@APU_CONFIG@ | ||
16 | fi | ||
17 | |||
18 | -APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`" | ||
19 | +APR_LIBTOOL="`${APR_CONFIG} --apr-libtool | sed -e s,libtool,${host_alias}-libtool,`" | ||
20 | APR_INCLUDEDIR="`${APR_CONFIG} --includedir`" | ||
21 | test -n "@APU_CONFIG@" && APU_INCLUDEDIR="`${APU_CONFIG} --includedir`" | ||
22 | |||
23 | --- a/configure | ||
24 | +++ b/configure | ||
25 | @@ -6205,7 +6205,7 @@ case $host in | ||
26 | if test "x$LTFLAGS" = "x"; then | ||
27 | LTFLAGS='--silent' | ||
28 | fi | ||
29 | - my_libtool=`$apr_config --apr-libtool` | ||
30 | + my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,` | ||
31 | LIBTOOL="$my_libtool \$(LTFLAGS)" | ||
32 | libtoolversion=`$my_libtool --version` | ||
33 | case $libtoolversion in | ||
34 | --- a/configure.in | ||
35 | +++ b/configure.in | ||
36 | @@ -264,7 +264,7 @@ case $host in | ||
37 | if test "x$LTFLAGS" = "x"; then | ||
38 | LTFLAGS='--silent' | ||
39 | fi | ||
40 | - my_libtool=`$apr_config --apr-libtool` | ||
41 | + my_libtool=`$apr_config --apr-libtool | sed -e s,libtool,${host_alias}-libtool,` | ||
42 | LIBTOOL="$my_libtool \$(LTFLAGS)" | ||
43 | libtoolversion=`$my_libtool --version` | ||
44 | case $libtoolversion in | ||
45 | --- a/support/apxs.in | ||
46 | +++ b/support/apxs.in | ||
47 | @@ -352,7 +352,7 @@ if ($apr_major_version < 2) { | ||
48 | } | ||
49 | } | ||
50 | |||
51 | -my $libtool = `$apr_config --apr-libtool`; | ||
52 | +my $libtool = `$apr_config --apr-libtool| sed -e s,libtool,${host_alias}-libtool,`; | ||
53 | chomp($libtool); | ||
54 | |||
55 | my $apr_includedir = `$apr_config --includes`; | ||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-corelimit.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-corelimit.patch new file mode 100644 index 000000000..18e4107ec --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-corelimit.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | |||
2 | Bump up the core size limit if CoreDumpDirectory is | ||
3 | configured. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Note: upstreaming was discussed but there are competing desires; | ||
8 | there are portability oddities here too. | ||
9 | |||
10 | --- httpd-2.4.1/server/core.c.corelimit | ||
11 | +++ httpd-2.4.1/server/core.c | ||
12 | @@ -4433,6 +4433,25 @@ static int core_post_config(apr_pool_t * | ||
13 | } | ||
14 | apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper, | ||
15 | apr_pool_cleanup_null); | ||
16 | + | ||
17 | +#ifdef RLIMIT_CORE | ||
18 | + if (ap_coredumpdir_configured) { | ||
19 | + struct rlimit lim; | ||
20 | + | ||
21 | + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) { | ||
22 | + lim.rlim_cur = lim.rlim_max; | ||
23 | + if (setrlimit(RLIMIT_CORE, &lim) == 0) { | ||
24 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, | ||
25 | + "core dump file size limit raised to %lu bytes", | ||
26 | + lim.rlim_cur); | ||
27 | + } else { | ||
28 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL, | ||
29 | + "core dump file size is zero, setrlimit failed"); | ||
30 | + } | ||
31 | + } | ||
32 | + } | ||
33 | +#endif | ||
34 | + | ||
35 | return OK; | ||
36 | } | ||
37 | |||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-selinux.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-selinux.patch new file mode 100644 index 000000000..873328d9b --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.1-selinux.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | |||
2 | Log the SELinux context at startup. | ||
3 | |||
4 | Upstream-Status: Inappropriate [other] | ||
5 | |||
6 | Note: unlikely to be any interest in this upstream | ||
7 | |||
8 | --- httpd-2.4.1/configure.in.selinux | ||
9 | +++ httpd-2.4.1/configure.in | ||
10 | @@ -458,6 +458,11 @@ fopen64 | ||
11 | dnl confirm that a void pointer is large enough to store a long integer | ||
12 | APACHE_CHECK_VOID_PTR_LEN | ||
13 | |||
14 | +AC_CHECK_LIB(selinux, is_selinux_enabled, [ | ||
15 | + AC_DEFINE(HAVE_SELINUX, 1, [Defined if SELinux is supported]) | ||
16 | + APR_ADDTO(AP_LIBS, [-lselinux]) | ||
17 | +]) | ||
18 | + | ||
19 | AC_CACHE_CHECK([for gettid()], ac_cv_gettid, | ||
20 | [AC_TRY_RUN(#define _GNU_SOURCE | ||
21 | #include <unistd.h> | ||
22 | --- httpd-2.4.1/server/core.c.selinux | ||
23 | +++ httpd-2.4.1/server/core.c | ||
24 | @@ -58,6 +58,10 @@ | ||
25 | #include <unistd.h> | ||
26 | #endif | ||
27 | |||
28 | +#ifdef HAVE_SELINUX | ||
29 | +#include <selinux/selinux.h> | ||
30 | +#endif | ||
31 | + | ||
32 | /* LimitRequestBody handling */ | ||
33 | #define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1) | ||
34 | #define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0) | ||
35 | @@ -4452,6 +4456,28 @@ static int core_post_config(apr_pool_t * | ||
36 | } | ||
37 | #endif | ||
38 | |||
39 | +#ifdef HAVE_SELINUX | ||
40 | + { | ||
41 | + static int already_warned = 0; | ||
42 | + int is_enabled = is_selinux_enabled() > 0; | ||
43 | + | ||
44 | + if (is_enabled && !already_warned) { | ||
45 | + security_context_t con; | ||
46 | + | ||
47 | + if (getcon(&con) == 0) { | ||
48 | + | ||
49 | + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, | ||
50 | + "SELinux policy enabled; " | ||
51 | + "httpd running as context %s", con); | ||
52 | + | ||
53 | + already_warned = 1; | ||
54 | + | ||
55 | + freecon(con); | ||
56 | + } | ||
57 | + } | ||
58 | + } | ||
59 | +#endif | ||
60 | + | ||
61 | return OK; | ||
62 | } | ||
63 | |||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-export.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-export.patch new file mode 100644 index 000000000..afbed8e55 --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-export.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | |||
2 | There is no need to "suck in" the apr/apr-util symbols when using | ||
3 | a shared libapr{,util}, it just bloats the symbol table; so don't. | ||
4 | |||
5 | Upstream-HEAD: needed | ||
6 | Upstream-2.0: omit | ||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Note: EXPORT_DIRS change is conditional on using shared apr | ||
10 | |||
11 | --- httpd-2.4.4/server/Makefile.in.export | ||
12 | +++ httpd-2.4.4/server/Makefile.in | ||
13 | @@ -57,9 +57,6 @@ export_files: | ||
14 | ( for dir in $(EXPORT_DIRS); do \ | ||
15 | ls $$dir/*.h ; \ | ||
16 | done; \ | ||
17 | - for dir in $(EXPORT_DIRS_APR); do \ | ||
18 | - ls $$dir/ap[ru].h $$dir/ap[ru]_*.h 2>/dev/null; \ | ||
19 | - done; \ | ||
20 | ) | sed -e s,//,/,g | sort -u > $@ | ||
21 | |||
22 | exports.c: export_files | ||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-r1332643.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-r1332643.patch new file mode 100644 index 000000000..ba282319d --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/httpd-2.4.4-r1332643.patch | |||
@@ -0,0 +1,260 @@ | |||
1 | Add support for TLS Next Protocol Negotiation: | ||
2 | |||
3 | * modules/ssl/mod_ssl.c, modules/ssl/mod_ssl.h: Add and implement new | ||
4 | hooks for next protocol advertisement/discovery. | ||
5 | |||
6 | * modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks): Enable | ||
7 | NPN advertisement callback in handshake. | ||
8 | |||
9 | * modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Invoke | ||
10 | next-protocol discovery hook. | ||
11 | |||
12 | * modules/ssl/ssl_engine_kernel.c (ssl_callback_AdvertiseNextProtos): | ||
13 | New callback. | ||
14 | |||
15 | * modules/ssl/ssl_private.h: Add prototype. | ||
16 | |||
17 | Submitted by: Matthew Steele <mdsteele google.com> | ||
18 | with slight tweaks by jorton | ||
19 | |||
20 | https://bugzilla.redhat.com//show_bug.cgi?id=809599 | ||
21 | |||
22 | http://svn.apache.org/viewvc?view=revision&revision=1332643 | ||
23 | |||
24 | Upstream-Status: Backport | ||
25 | |||
26 | --- httpd-2.4.4/modules/ssl/ssl_private.h | ||
27 | +++ httpd-2.4.4/modules/ssl/ssl_private.h | ||
28 | @@ -139,6 +139,11 @@ | ||
29 | #define HAVE_FIPS | ||
30 | #endif | ||
31 | |||
32 | +#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_NEXTPROTONEG) \ | ||
33 | + && !defined(OPENSSL_NO_TLSEXT) | ||
34 | +#define HAVE_TLS_NPN | ||
35 | +#endif | ||
36 | + | ||
37 | #if (OPENSSL_VERSION_NUMBER >= 0x10000000) | ||
38 | #define MODSSL_SSL_CIPHER_CONST const | ||
39 | #define MODSSL_SSL_METHOD_CONST const | ||
40 | @@ -840,6 +845,7 @@ int ssl_callback_ServerNameIndication(SSL *, int *, modssl_ctx_t *); | ||
41 | int ssl_callback_SessionTicket(SSL *, unsigned char *, unsigned char *, | ||
42 | EVP_CIPHER_CTX *, HMAC_CTX *, int); | ||
43 | #endif | ||
44 | +int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data, unsigned int *len, void *arg); | ||
45 | |||
46 | /** Session Cache Support */ | ||
47 | void ssl_scache_init(server_rec *, apr_pool_t *); | ||
48 | --- httpd-2.4.4/modules/ssl/mod_ssl.c | ||
49 | +++ httpd-2.4.4/modules/ssl/mod_ssl.c | ||
50 | @@ -272,6 +272,18 @@ static const command_rec ssl_config_cmds[] = { | ||
51 | AP_END_CMD | ||
52 | }; | ||
53 | |||
54 | +/* Implement 'modssl_run_npn_advertise_protos_hook'. */ | ||
55 | +APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( | ||
56 | + modssl, AP, int, npn_advertise_protos_hook, | ||
57 | + (conn_rec *connection, apr_array_header_t *protos), | ||
58 | + (connection, protos), OK, DECLINED); | ||
59 | + | ||
60 | +/* Implement 'modssl_run_npn_proto_negotiated_hook'. */ | ||
61 | +APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( | ||
62 | + modssl, AP, int, npn_proto_negotiated_hook, | ||
63 | + (conn_rec *connection, const char *proto_name, apr_size_t proto_name_len), | ||
64 | + (connection, proto_name, proto_name_len), OK, DECLINED); | ||
65 | + | ||
66 | /* | ||
67 | * the various processing hooks | ||
68 | */ | ||
69 | --- httpd-2.4.4/modules/ssl/mod_ssl.h | ||
70 | +++ httpd-2.4.4/modules/ssl/mod_ssl.h | ||
71 | @@ -63,5 +63,26 @@ APR_DECLARE_OPTIONAL_FN(int, ssl_proxy_enable, (conn_rec *)); | ||
72 | |||
73 | APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *)); | ||
74 | |||
75 | +/** The npn_advertise_protos optional hook allows other modules to add entries | ||
76 | + * to the list of protocol names advertised by the server during the Next | ||
77 | + * Protocol Negotiation (NPN) portion of the SSL handshake. The hook callee is | ||
78 | + * given the connection and an APR array; it should push one or more char*'s | ||
79 | + * pointing to null-terminated strings (such as "http/1.1" or "spdy/2") onto | ||
80 | + * the array and return OK, or do nothing and return DECLINED. */ | ||
81 | +APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_advertise_protos_hook, | ||
82 | + (conn_rec *connection, apr_array_header_t *protos)); | ||
83 | + | ||
84 | +/** The npn_proto_negotiated optional hook allows other modules to discover the | ||
85 | + * name of the protocol that was chosen during the Next Protocol Negotiation | ||
86 | + * (NPN) portion of the SSL handshake. Note that this may be the empty string | ||
87 | + * (in which case modules should probably assume HTTP), or it may be a protocol | ||
88 | + * that was never even advertised by the server. The hook callee is given the | ||
89 | + * connection, a non-null-terminated string containing the protocol name, and | ||
90 | + * the length of the string; it should do something appropriate (i.e. insert or | ||
91 | + * remove filters) and return OK, or do nothing and return DECLINED. */ | ||
92 | +APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_proto_negotiated_hook, | ||
93 | + (conn_rec *connection, const char *proto_name, | ||
94 | + apr_size_t proto_name_len)); | ||
95 | + | ||
96 | #endif /* __MOD_SSL_H__ */ | ||
97 | /** @} */ | ||
98 | --- httpd-2.4.4/modules/ssl/ssl_engine_init.c | ||
99 | +++ httpd-2.4.4/modules/ssl/ssl_engine_init.c | ||
100 | @@ -725,6 +725,11 @@ static void ssl_init_ctx_callbacks(server_rec *s, | ||
101 | #endif | ||
102 | |||
103 | SSL_CTX_set_info_callback(ctx, ssl_callback_Info); | ||
104 | + | ||
105 | +#ifdef HAVE_TLS_NPN | ||
106 | + SSL_CTX_set_next_protos_advertised_cb( | ||
107 | + ctx, ssl_callback_AdvertiseNextProtos, NULL); | ||
108 | +#endif | ||
109 | } | ||
110 | |||
111 | static void ssl_init_ctx_verify(server_rec *s, | ||
112 | --- httpd-2.4.4/modules/ssl/ssl_engine_io.c | ||
113 | +++ httpd-2.4.4/modules/ssl/ssl_engine_io.c | ||
114 | @@ -28,6 +28,7 @@ | ||
115 | core keeps dumping.'' | ||
116 | -- Unknown */ | ||
117 | #include "ssl_private.h" | ||
118 | +#include "mod_ssl.h" | ||
119 | #include "apr_date.h" | ||
120 | |||
121 | /* _________________________________________________________________ | ||
122 | @@ -297,6 +298,7 @@ typedef struct { | ||
123 | apr_pool_t *pool; | ||
124 | char buffer[AP_IOBUFSIZE]; | ||
125 | ssl_filter_ctx_t *filter_ctx; | ||
126 | + int npn_finished; /* 1 if NPN has finished, 0 otherwise */ | ||
127 | } bio_filter_in_ctx_t; | ||
128 | |||
129 | /* | ||
130 | @@ -1385,6 +1387,27 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f, | ||
131 | APR_BRIGADE_INSERT_TAIL(bb, bucket); | ||
132 | } | ||
133 | |||
134 | +#ifdef HAVE_TLS_NPN | ||
135 | + /* By this point, Next Protocol Negotiation (NPN) should be completed (if | ||
136 | + * our version of OpenSSL supports it). If we haven't already, find out | ||
137 | + * which protocol was decided upon and inform other modules by calling | ||
138 | + * npn_proto_negotiated_hook. */ | ||
139 | + if (!inctx->npn_finished) { | ||
140 | + const unsigned char *next_proto = NULL; | ||
141 | + unsigned next_proto_len = 0; | ||
142 | + | ||
143 | + SSL_get0_next_proto_negotiated( | ||
144 | + inctx->ssl, &next_proto, &next_proto_len); | ||
145 | + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, f->c, | ||
146 | + "SSL NPN negotiated protocol: '%s'", | ||
147 | + apr_pstrmemdup(f->c->pool, (const char*)next_proto, | ||
148 | + next_proto_len)); | ||
149 | + modssl_run_npn_proto_negotiated_hook( | ||
150 | + f->c, (const char*)next_proto, next_proto_len); | ||
151 | + inctx->npn_finished = 1; | ||
152 | + } | ||
153 | +#endif | ||
154 | + | ||
155 | return APR_SUCCESS; | ||
156 | } | ||
157 | |||
158 | @@ -1866,6 +1889,7 @@ static void ssl_io_input_add_filter(ssl_filter_ctx_t *filter_ctx, conn_rec *c, | ||
159 | inctx->block = APR_BLOCK_READ; | ||
160 | inctx->pool = c->pool; | ||
161 | inctx->filter_ctx = filter_ctx; | ||
162 | + inctx->npn_finished = 0; | ||
163 | } | ||
164 | |||
165 | /* The request_rec pointer is passed in here only to ensure that the | ||
166 | --- httpd-2.4.4/modules/ssl/ssl_engine_kernel.c | ||
167 | +++ httpd-2.4.4/modules/ssl/ssl_engine_kernel.c | ||
168 | @@ -29,6 +29,7 @@ | ||
169 | time I was too famous.'' | ||
170 | -- Unknown */ | ||
171 | #include "ssl_private.h" | ||
172 | +#include "mod_ssl.h" | ||
173 | #include "util_md5.h" | ||
174 | |||
175 | static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn); | ||
176 | @@ -2186,3 +2187,84 @@ int ssl_callback_SRPServerParams(SSL *ssl, int *ad, void *arg) | ||
177 | } | ||
178 | |||
179 | #endif /* OPENSSL_NO_SRP */ | ||
180 | + | ||
181 | +#ifdef HAVE_TLS_NPN | ||
182 | +/* | ||
183 | + * This callback function is executed when SSL needs to decide what protocols | ||
184 | + * to advertise during Next Protocol Negotiation (NPN). It must produce a | ||
185 | + * string in wire format -- a sequence of length-prefixed strings -- indicating | ||
186 | + * the advertised protocols. Refer to SSL_CTX_set_next_protos_advertised_cb | ||
187 | + * in OpenSSL for reference. | ||
188 | + */ | ||
189 | +int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data_out, | ||
190 | + unsigned int *size_out, void *arg) | ||
191 | +{ | ||
192 | + conn_rec *c = (conn_rec*)SSL_get_app_data(ssl); | ||
193 | + apr_array_header_t *protos; | ||
194 | + int num_protos; | ||
195 | + unsigned int size; | ||
196 | + int i; | ||
197 | + unsigned char *data; | ||
198 | + unsigned char *start; | ||
199 | + | ||
200 | + *data_out = NULL; | ||
201 | + *size_out = 0; | ||
202 | + | ||
203 | + /* If the connection object is not available, then there's nothing for us | ||
204 | + * to do. */ | ||
205 | + if (c == NULL) { | ||
206 | + return SSL_TLSEXT_ERR_OK; | ||
207 | + } | ||
208 | + | ||
209 | + /* Invoke our npn_advertise_protos hook, giving other modules a chance to | ||
210 | + * add alternate protocol names to advertise. */ | ||
211 | + protos = apr_array_make(c->pool, 0, sizeof(char*)); | ||
212 | + modssl_run_npn_advertise_protos_hook(c, protos); | ||
213 | + num_protos = protos->nelts; | ||
214 | + | ||
215 | + /* We now have a list of null-terminated strings; we need to concatenate | ||
216 | + * them together into a single string, where each protocol name is prefixed | ||
217 | + * by its length. First, calculate how long that string will be. */ | ||
218 | + size = 0; | ||
219 | + for (i = 0; i < num_protos; ++i) { | ||
220 | + const char *string = APR_ARRAY_IDX(protos, i, const char*); | ||
221 | + unsigned int length = strlen(string); | ||
222 | + /* If the protocol name is too long (the length must fit in one byte), | ||
223 | + * then log an error and skip it. */ | ||
224 | + if (length > 255) { | ||
225 | + ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, | ||
226 | + "SSL NPN protocol name too long (length=%u): %s", | ||
227 | + length, string); | ||
228 | + continue; | ||
229 | + } | ||
230 | + /* Leave room for the length prefix (one byte) plus the protocol name | ||
231 | + * itself. */ | ||
232 | + size += 1 + length; | ||
233 | + } | ||
234 | + | ||
235 | + /* If there is nothing to advertise (either because no modules added | ||
236 | + * anything to the protos array, or because all strings added to the array | ||
237 | + * were skipped), then we're done. */ | ||
238 | + if (size == 0) { | ||
239 | + return SSL_TLSEXT_ERR_OK; | ||
240 | + } | ||
241 | + | ||
242 | + /* Now we can build the string. Copy each protocol name string into the | ||
243 | + * larger string, prefixed by its length. */ | ||
244 | + data = apr_palloc(c->pool, size * sizeof(unsigned char)); | ||
245 | + start = data; | ||
246 | + for (i = 0; i < num_protos; ++i) { | ||
247 | + const char *string = APR_ARRAY_IDX(protos, i, const char*); | ||
248 | + apr_size_t length = strlen(string); | ||
249 | + *start = (unsigned char)length; | ||
250 | + ++start; | ||
251 | + memcpy(start, string, length * sizeof(unsigned char)); | ||
252 | + start += length; | ||
253 | + } | ||
254 | + | ||
255 | + /* Success. */ | ||
256 | + *data_out = data; | ||
257 | + *size_out = size; | ||
258 | + return SSL_TLSEXT_ERR_OK; | ||
259 | +} | ||
260 | +#endif | ||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/replace-lynx-to-curl-in-apachectl-script.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/replace-lynx-to-curl-in-apachectl-script.patch new file mode 100644 index 000000000..584ddc8d9 --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/replace-lynx-to-curl-in-apachectl-script.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 760ccbb2fb046621a2aeaecabb2b1ef9aa280cf1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yulong Pei <Yulong.pei@windriver.com> | ||
3 | Date: Thu, 1 Sep 2011 01:03:14 +0800 | ||
4 | Subject: [PATCH] replace lynx to curl in apachectl script | ||
5 | |||
6 | Upstream-Status: Inappropriate [configuration] | ||
7 | |||
8 | Signed-off-by: Yulong Pei <Yulong.pei@windriver.com> | ||
9 | --- | ||
10 | support/apachectl.in | 14 ++++++++++---- | ||
11 | 1 files changed, 10 insertions(+), 4 deletions(-) | ||
12 | |||
13 | diff --git a/support/apachectl.in b/support/apachectl.in | ||
14 | index d4dff38..109ea13 100644 | ||
15 | --- a/support/apachectl.in | ||
16 | +++ b/support/apachectl.in | ||
17 | @@ -51,11 +51,11 @@ fi | ||
18 | # a command that outputs a formatted text version of the HTML at the | ||
19 | # url given on the command line. Designed for lynx, however other | ||
20 | # programs may work. | ||
21 | -LYNX="@LYNX_PATH@ -dump" | ||
22 | +CURL="/usr/bin/curl" | ||
23 | # | ||
24 | # the URL to your server's mod_status status page. If you do not | ||
25 | # have one, then status and fullstatus will not work. | ||
26 | -STATUSURL="http://localhost:@PORT@/server-status" | ||
27 | +STATUSURL="http://localhost:@PORT@/" | ||
28 | # | ||
29 | # Set this variable to a command that increases the maximum | ||
30 | # number of file descriptors allowed per child process. This is | ||
31 | @@ -91,10 +91,16 @@ configtest) | ||
32 | ERROR=$? | ||
33 | ;; | ||
34 | status) | ||
35 | - $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } ' | ||
36 | + $CURL -s $STATUSURL | grep -o "It works!" | ||
37 | + if [ $? != 0 ] ; then | ||
38 | + echo The httpd server does not work! | ||
39 | + fi | ||
40 | ;; | ||
41 | fullstatus) | ||
42 | - $LYNX $STATUSURL | ||
43 | + $CURL -s $STATUSURL | grep -o "It works!" | ||
44 | + if [ $? != 0 ] ; then | ||
45 | + echo The httpd server does not work! | ||
46 | + fi | ||
47 | ;; | ||
48 | *) | ||
49 | $HTTPD $ARGV | ||
50 | -- | ||
51 | 1.6.4 | ||
52 | |||
diff --git a/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/server-makefile.patch b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/server-makefile.patch new file mode 100644 index 000000000..f1349cb6a --- /dev/null +++ b/meta-webserver/recipes-httpd/apache2/apache2-2.4.6/server-makefile.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- http-2.0.54/server/Makefile.in-old 2005-12-20 13:26:56.000000000 -0500 | ||
2 | +++ http-2.0.54/server/Makefile.in 2005-12-20 13:27:22.000000000 -0500 | ||
3 | @@ -27,7 +27,7 @@ | ||
4 | $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS) | ||
5 | |||
6 | test_char.h: gen_test_char | ||
7 | - ./gen_test_char > test_char.h | ||
8 | + gen_test_char > test_char.h | ||
9 | |||
10 | util.lo: test_char.h | ||
11 | |||