Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/apache:master commit in: 2.2/init/, 2.2/patches/
Date: Sat, 09 Nov 2013 15:33:16
Message-Id: 1314891232.df64223f01c249b50b63c8de78de07dbe139ac47.polynomial-c@gentoo
1 commit: df64223f01c249b50b63c8de78de07dbe139ac47
2 Author: Peter Volkov <pva <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 1 15:33:52 2011 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 1 15:33:52 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=df64223f
7
8 Prepare 2.2.20: update init script to respect return status of stop, bug #357585 wrt Robert Trace; update itk patch, thank Denis Kaganovich for report in bug 368743#c2.
9
10 ---
11 2.2/init/apache2.initd | 2 +-
12 2.2/patches/03_all_gentoo_apache-tools.patch | 34 +++--
13 2.2/patches/20_all_peruser_0.4.0-rc2.patch | 4 +-
14 ...tk_20090114.patch => 21_all-itk-20110321.patch} | 166 +++++++++++++--------
15 4 files changed, 128 insertions(+), 78 deletions(-)
16
17 diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
18 index 56f4391..df7374e 100755
19 --- a/2.2/init/apache2.initd
20 +++ b/2.2/init/apache2.initd
21 @@ -91,7 +91,7 @@ stop() {
22 sleep 1 && i=$(expr $i + 1)
23 done
24
25 - test $i -le ${TIMEOUT}
26 + test $i -lt ${TIMEOUT}
27 eend $?
28 }
29
30
31 diff --git a/2.2/patches/03_all_gentoo_apache-tools.patch b/2.2/patches/03_all_gentoo_apache-tools.patch
32 index f4b6612..4ac4253 100644
33 --- a/2.2/patches/03_all_gentoo_apache-tools.patch
34 +++ b/2.2/patches/03_all_gentoo_apache-tools.patch
35 @@ -1,13 +1,16 @@
36 ----
37 - Makefile.in | 10 ++++++++--
38 - support/Makefile.in | 18 ++++--------------
39 - 2 files changed, 12 insertions(+), 16 deletions(-)
40 -
41 -Index: httpd-2.2.6/Makefile.in
42 -===================================================================
43 ---- httpd-2.2.6.orig/Makefile.in
44 -+++ httpd-2.2.6/Makefile.in
45 -@@ -198,14 +198,20 @@ install-include:
46 +diff -pruN a/Makefile.in b/Makefile.in
47 +--- a/Makefile.in 2011-08-24 00:34:55.000000000 +0300
48 ++++ b/Makefile.in 2011-08-24 00:29:01.000000000 +0300
49 +@@ -14,7 +14,7 @@ PROGRAM_DEPENDENCIES = \
50 +
51 + PROGRAMS = $(PROGRAM_NAME)
52 + TARGETS = $(PROGRAMS) $(shared_build) $(other_targets)
53 +-INSTALL_TARGETS = install-htdocs install-error install-icons \
54 ++INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
55 + install-other install-cgi install-include install-suexec install-build \
56 + install-man
57 +
58 +@@ -202,14 +202,20 @@ install-include:
59 $(INSTALL_DATA) $$hdr $(DESTDIR)$(includedir); \
60 done
61
62 @@ -30,10 +33,9 @@ Index: httpd-2.2.6/Makefile.in
63 @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
64 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(top_srcdir)/docs/manual/ $(DESTDIR)$(manualdir)/; \
65 else \
66 -Index: httpd-2.2.6/support/Makefile.in
67 -===================================================================
68 ---- httpd-2.2.6.orig/support/Makefile.in
69 -+++ httpd-2.2.6/support/Makefile.in
70 +diff -pruN a/support/Makefile.in b/support/Makefile.in
71 +--- a/support/Makefile.in 2011-04-16 22:09:47.000000000 +0300
72 ++++ b/support/Makefile.in 2011-08-24 00:33:10.000000000 +0300
73 @@ -1,9 +1,8 @@
74 -DISTCLEAN_TARGETS = apxs apachectl dbmmanage log_server_status \
75 - logresolve.pl phf_abuse_log.cgi split-logfile envvars-std
76 @@ -41,12 +43,12 @@ Index: httpd-2.2.6/support/Makefile.in
77
78 CLEAN_TARGETS = suexec
79
80 --PROGRAMS = htpasswd htdigest rotatelogs logresolve ab checkgid htdbm htcacheclean httxt2dbm
81 +-PROGRAMS = htpasswd htdigest rotatelogs logresolve ab htdbm htcacheclean httxt2dbm $(NONPORTABLE_SUPPORT)
82 +PROGRAMS = apxs
83 TARGETS = $(PROGRAMS)
84
85 PROGRAM_LDADD = $(UTIL_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS)
86 -@@ -12,22 +11,13 @@ PROGRAM_DEPENDENCIES =
87 +@@ -12,22 +11,13 @@ PROGRAM_DEPENDENCIES =
88 include $(top_builddir)/build/rules.mk
89
90 install:
91
92 diff --git a/2.2/patches/20_all_peruser_0.4.0-rc2.patch b/2.2/patches/20_all_peruser_0.4.0-rc2.patch
93 index 3ad18bc..6784c78 100644
94 --- a/2.2/patches/20_all_peruser_0.4.0-rc2.patch
95 +++ b/2.2/patches/20_all_peruser_0.4.0-rc2.patch
96 @@ -123,8 +123,8 @@ diff -Nur httpd-2.2.16/server/mpm/config.m4 httpd-2.2.16-peruser/server/mpm/conf
97 AC_MSG_CHECKING(which MPM to use)
98 AC_ARG_WITH(mpm,
99 APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
100 -- MPM={beos|event|worker|prefork|mpmt_os2}),[
101 -+ MPM={beos|event|worker|prefork|mpmt_os2|peruser}),[
102 +- MPM={beos|event|worker|prefork|mpmt_os2|winnt}),[
103 ++ MPM={beos|event|worker|prefork|mpmt_os2|winnt|peruser}),[
104 APACHE_MPM=$withval
105 ],[
106 if test "x$APACHE_MPM" = "x"; then
107
108 diff --git a/2.2/patches/21_all_itk_20090114.patch b/2.2/patches/21_all-itk-20110321.patch
109 similarity index 93%
110 rename from 2.2/patches/21_all_itk_20090114.patch
111 rename to 2.2/patches/21_all-itk-20110321.patch
112 index 3a346cc..e9835d9 100644
113 --- a/2.2/patches/21_all_itk_20090114.patch
114 +++ b/2.2/patches/21_all-itk-20110321.patch
115 @@ -1,26 +1,23 @@
116 -Index: httpd-2.2.11/server/mpm/experimental/itk/Makefile.in
117 -===================================================================
118 ---- /dev/null
119 -+++ httpd-2.2.11/server/mpm/experimental/itk/Makefile.in
120 +unchanged:
121 +--- httpd-2.2.17/server/mpm/experimental/itk/Makefile.in
122 ++++ httpd-2.2.17/server/mpm/experimental/itk/Makefile.in
123 @@ -0,0 +1,5 @@
124 +
125 +LTLIBRARY_NAME = libitk.la
126 +LTLIBRARY_SOURCES = itk.c
127 +
128 +include $(top_srcdir)/build/ltlib.mk
129 -Index: httpd-2.2.11/server/mpm/experimental/itk/config.m4
130 -===================================================================
131 ---- /dev/null
132 -+++ httpd-2.2.11/server/mpm/experimental/itk/config.m4
133 +unchanged:
134 +--- httpd-2.2.17/server/mpm/experimental/itk/config.m4
135 ++++ httpd-2.2.17/server/mpm/experimental/itk/config.m4
136 @@ -0,0 +1,3 @@
137 +if test "$MPM_NAME" = "itk" ; then
138 + APACHE_FAST_OUTPUT(server/mpm/$MPM_SUBDIR_NAME/Makefile)
139 +fi
140 -Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
141 -===================================================================
142 ---- /dev/null
143 -+++ httpd-2.2.11/server/mpm/experimental/itk/itk.c
144 -@@ -0,0 +1,1740 @@
145 +unchanged:
146 +--- httpd-2.2.17/server/mpm/experimental/itk/itk.c
147 ++++ httpd-2.2.17/server/mpm/experimental/itk/itk.c
148 +@@ -0,0 +1,1757 @@
149 +/* Licensed to the Apache Software Foundation (ASF) under one or more
150 + * contributor license agreements. See the NOTICE file distributed with
151 + * this work for additional information regarding copyright ownership.
152 @@ -579,8 +576,12 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
153 + (void) ap_update_child_status(sbh, SERVER_READY, (request_rec *) NULL);
154 +
155 + /* Set up the pollfd array */
156 -+ /* ### check the status */
157 -+ (void) apr_pollset_create(&pollset, num_listensocks, pchild, 0);
158 ++ status = apr_pollset_create(&pollset, num_listensocks, pchild, 0);
159 ++ if (status != APR_SUCCESS) {
160 ++ ap_log_error(APLOG_MARK, APLOG_EMERG, status, ap_server_conf,
161 ++ "Couldn't create pollset in child; check system or user limits");
162 ++ clean_child_exit(APEXIT_CHILDSICK); /* assume temporary resource issue */
163 ++ }
164 +
165 + for (lr = ap_listeners, i = num_listensocks; i--; lr = lr->next) {
166 + apr_pollfd_t pfd = { 0 };
167 @@ -651,19 +652,27 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
168 + apr_int32_t numdesc;
169 + const apr_pollfd_t *pdesc;
170 +
171 -+ /* timeout == -1 == wait forever */
172 -+ status = apr_pollset_poll(pollset, -1, &numdesc, &pdesc);
173 ++ /* check for termination first so we don't sleep for a while in
174 ++ * poll if already signalled
175 ++ */
176 ++ if (one_process && shutdown_pending) {
177 ++ SAFE_ACCEPT(accept_mutex_off());
178 ++ return;
179 ++ }
180 ++ else if (die_now) {
181 ++ /* In graceful stop/restart; drop the mutex
182 ++ * and terminate the child. */
183 ++ SAFE_ACCEPT(accept_mutex_off());
184 ++ clean_child_exit(0);
185 ++ }
186 ++ /* timeout == 10 seconds to avoid a hang at graceful restart/stop
187 ++ * caused by the closing of sockets by the signal handler
188 ++ */
189 ++ status = apr_pollset_poll(pollset, apr_time_from_sec(10),
190 ++ &numdesc, &pdesc);
191 + if (status != APR_SUCCESS) {
192 -+ if (APR_STATUS_IS_EINTR(status)) {
193 -+ if (one_process && shutdown_pending) {
194 -+ return;
195 -+ }
196 -+ else if (die_now) {
197 -+ /* In graceful stop/restart; drop the mutex
198 -+ * and terminate the child. */
199 -+ SAFE_ACCEPT(accept_mutex_off());
200 -+ clean_child_exit(0);
201 -+ }
202 ++ if (APR_STATUS_IS_TIMEUP(status) ||
203 ++ APR_STATUS_IS_EINTR(status)) {
204 + continue;
205 + }
206 + /* Single Unix documents select as returning errnos
207 @@ -777,6 +786,11 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
208 + if (getuid())
209 + die_now = 1;
210 + }
211 ++ /* This apr_pool_clear call is redundant, should be redundant, but compensates
212 ++ * a flaw in the apr reslist code. This should be removed once that flaw has
213 ++ * been addressed.
214 ++ */
215 ++ apr_pool_clear(ptrans);
216 + clean_child_exit(0);
217 +}
218 +
219 @@ -1721,16 +1735,16 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
220 +static void *itk_merge_dir_config(apr_pool_t *p, void *parent_ptr, void *child_ptr)
221 +{
222 + itk_per_dir_conf *c = (itk_per_dir_conf *)
223 -+ apr_pcalloc(p, sizeof(itk_per_dir_conf));
224 ++ itk_create_dir_config(p, NULL);
225 + itk_per_dir_conf *parent = (itk_per_dir_conf *) parent_ptr;
226 + itk_per_dir_conf *child = (itk_per_dir_conf *) child_ptr;
227 +
228 + if (child->username != NULL) {
229 -+ c->username = apr_pstrdup(p, child->username);
230 ++ c->username = child->username;
231 + c->uid = child->uid;
232 + c->gid = child->gid;
233 -+ } else if (parent->username != NULL) {
234 -+ c->username = apr_pstrdup(p, parent->username);
235 ++ } else {
236 ++ c->username = parent->username;
237 + c->uid = parent->uid;
238 + c->gid = parent->gid;
239 + }
240 @@ -1761,10 +1775,9 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/itk.c
241 + itk_cmds, /* command apr_table_t */
242 + itk_hooks, /* register hooks */
243 +};
244 -Index: httpd-2.2.11/server/mpm/experimental/itk/mpm.h
245 -===================================================================
246 ---- /dev/null
247 -+++ httpd-2.2.11/server/mpm/experimental/itk/mpm.h
248 +unchanged:
249 +--- httpd-2.2.17/server/mpm/experimental/itk/mpm.h
250 ++++ httpd-2.2.17/server/mpm/experimental/itk/mpm.h
251 @@ -0,0 +1,68 @@
252 +/* Licensed to the Apache Software Foundation (ASF) under one or more
253 + * contributor license agreements. See the NOTICE file distributed with
254 @@ -1834,10 +1847,9 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/mpm.h
255 +extern server_rec *ap_server_conf;
256 +#endif /* APACHE_MPM_ITK_H */
257 +/** @} */
258 -Index: httpd-2.2.11/server/mpm/experimental/itk/mpm_default.h
259 -===================================================================
260 ---- /dev/null
261 -+++ httpd-2.2.11/server/mpm/experimental/itk/mpm_default.h
262 +unchanged:
263 +--- httpd-2.2.17/server/mpm/experimental/itk/mpm_default.h
264 ++++ httpd-2.2.17/server/mpm/experimental/itk/mpm_default.h
265 @@ -0,0 +1,80 @@
266 +/* Licensed to the Apache Software Foundation (ASF) under one or more
267 + * contributor license agreements. See the NOTICE file distributed with
268 @@ -1919,20 +1931,19 @@ Index: httpd-2.2.11/server/mpm/experimental/itk/mpm_default.h
269 +
270 +#endif /* AP_MPM_DEFAULT_H */
271 +/** @} */
272 -Index: httpd-2.2.11/server/mpm/config.m4
273 -===================================================================
274 ---- httpd-2.2.11.orig/server/mpm/config.m4
275 -+++ httpd-2.2.11/server/mpm/config.m4
276 +unchanged:
277 +--- httpd-2.2.17/server/mpm/config.m4
278 ++++ httpd-2.2.17/server/mpm/config.m4
279 @@ -1,7 +1,7 @@
280 AC_MSG_CHECKING(which MPM to use)
281 AC_ARG_WITH(mpm,
282 APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
283 -- MPM={beos|event|worker|prefork|mpmt_os2|peruser}),[
284 -+ MPM={beos|event|worker|prefork|mpmt_os2|peruser|itk}),[
285 +- MPM={beos|event|worker|prefork|mpmt_os2|winnt|peruser}),[
286 ++ MPM={beos|event|worker|prefork|mpmt_os2|winnt|peruser|itk}),[
287 APACHE_MPM=$withval
288 ],[
289 if test "x$APACHE_MPM" = "x"; then
290 -@@ -23,7 +23,7 @@ ap_mpm_is_threaded ()
291 +@@ -23,7 +23,7 @@
292
293 ap_mpm_is_experimental ()
294 {
295 @@ -1941,7 +1952,7 @@ Index: httpd-2.2.11/server/mpm/config.m4
296 return 0
297 else
298 return 1
299 -@@ -66,6 +66,11 @@ if ap_mpm_is_experimental; then
300 +@@ -66,6 +66,11 @@
301 else
302 MPM_SUBDIR_NAME=$MPM_NAME
303 fi
304 @@ -1953,10 +1964,9 @@ Index: httpd-2.2.11/server/mpm/config.m4
305 MPM_DIR=server/mpm/$MPM_SUBDIR_NAME
306 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
307
308 -Index: httpd-2.2.11/include/http_request.h
309 -===================================================================
310 ---- httpd-2.2.11.orig/include/http_request.h
311 -+++ httpd-2.2.11/include/http_request.h
312 +unchanged:
313 +--- httpd-2.2.17/include/http_request.h
314 ++++ httpd-2.2.17/include/http_request.h
315 @@ -12,6 +12,12 @@
316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
317 * See the License for the specific language governing permissions and
318 @@ -1970,7 +1980,7 @@ Index: httpd-2.2.11/include/http_request.h
319 */
320
321 /**
322 -@@ -350,6 +356,15 @@ AP_DECLARE_HOOK(int,auth_checker,(reques
323 +@@ -350,6 +356,15 @@
324 */
325 AP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
326
327 @@ -1986,10 +1996,9 @@ Index: httpd-2.2.11/include/http_request.h
328 AP_DECLARE(int) ap_location_walk(request_rec *r);
329 AP_DECLARE(int) ap_directory_walk(request_rec *r);
330 AP_DECLARE(int) ap_file_walk(request_rec *r);
331 -Index: httpd-2.2.11/server/request.c
332 -===================================================================
333 ---- httpd-2.2.11.orig/server/request.c
334 -+++ httpd-2.2.11/server/request.c
335 +unchanged:
336 +--- httpd-2.2.17/server/request.c
337 ++++ httpd-2.2.17/server/request.c
338 @@ -12,6 +12,12 @@
339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340 * See the License for the specific language governing permissions and
341 @@ -2003,7 +2012,7 @@ Index: httpd-2.2.11/server/request.c
342 */
343
344 /*
345 -@@ -61,6 +67,7 @@ APR_HOOK_STRUCT(
346 +@@ -61,6 +67,7 @@
347 APR_HOOK_LINK(auth_checker)
348 APR_HOOK_LINK(insert_filter)
349 APR_HOOK_LINK(create_request)
350 @@ -2011,7 +2020,7 @@ Index: httpd-2.2.11/server/request.c
351 )
352
353 AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,
354 -@@ -80,6 +87,8 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(int,auth_che
355 +@@ -80,6 +87,8 @@
356 AP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
357 AP_IMPLEMENT_HOOK_RUN_ALL(int, create_request,
358 (request_rec *r), (r), OK, DECLINED)
359 @@ -2020,7 +2029,7 @@ Index: httpd-2.2.11/server/request.c
360
361
362 static int decl_die(int status, char *phase, request_rec *r)
363 -@@ -158,6 +167,13 @@ AP_DECLARE(int) ap_process_request_inter
364 +@@ -158,6 +167,13 @@
365 return access_status;
366 }
367
368 @@ -2034,3 +2043,42 @@ Index: httpd-2.2.11/server/request.c
369 /* Only on the main request! */
370 if (r->main == NULL) {
371 if ((access_status = ap_run_header_parser(r))) {
372 +only in patch2:
373 +unchanged:
374 +--- httpd-2.2.17.orig/server/config.c
375 ++++ httpd-2.2.17/server/config.c
376 +@@ -1840,6 +1840,34 @@ AP_CORE_DECLARE(int) ap_parse_htaccess(a
377 + else {
378 + if (!APR_STATUS_IS_ENOENT(status)
379 + && !APR_STATUS_IS_ENOTDIR(status)) {
380 ++#ifdef ITK_MPM
381 ++ /*
382 ++ * If we are in a persistent connection, we might end up in a state
383 ++ * where we can no longer read .htaccess files because we have already
384 ++ * setuid(). This can either be because the previous request was for
385 ++ * another vhost (basically the same problem as when setuid() fails in
386 ++ * itk.c), or it can be because a .htaccess file is readable only by
387 ++ * root.
388 ++ *
389 ++ * In any case, we don't want to give out a 403, since the request has
390 ++ * a very real chance of succeeding on a fresh connection (where
391 ++ * presumably uid=0). Thus, we give up serving the request on this
392 ++ * TCP connection, and do a hard close of the socket. As long as we're
393 ++ * in a persistent connection (and there _should_ not be a way this
394 ++ * would happen on the first request in a connection, save for subrequests,
395 ++ * which we special-case), this is allowed, as it is what happens on
396 ++ * a timeout. The browser will simply open a new connection and try
397 ++ * again (there's of course a performance hit, though, both due to
398 ++ * the new connection setup and the fork() of a new server child).
399 ++ */
400 ++ if (r->main == NULL && getuid() != 0) {
401 ++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, status, r,
402 ++ "Couldn't read %s, closing connection.",
403 ++ filename);
404 ++ ap_lingering_close(r->connection);
405 ++ exit(0);
406 ++ }
407 ++#endif
408 + ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r,
409 + "%s pcfg_openfile: unable to check htaccess file, "
410 + "ensure it is readable",