1 |
commit: 1a07d157d19dbd400d27946f89adb67c149ddf52 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 21 14:59:41 2016 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 3 12:46:26 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=1a07d157 |
7 |
|
8 |
apache2.initd: remove config file readability check. |
9 |
|
10 |
In checkconfd(), the apache2 init script checks to make sure that |
11 |
$CONFIGFILE is readable. To do this, it needs to reimplement the |
12 |
relative path handling that apache2 already does. If we remove the |
13 |
relative path handling from checkconfd(), then apache2 continues to do |
14 |
the right thing when $CONFIGFILE is relative. However, our custom |
15 |
readability check fails, since it is looking for an absolute path |
16 |
that doesn't exist. |
17 |
|
18 |
Fortunately, apache2 already checks to ensure that the configuration |
19 |
file exists and is readable. If we remove the custom readability check |
20 |
entirely, then we get an error like, |
21 |
|
22 |
* apache2 has detected an error in your setup: |
23 |
apache2: Could not open configuration file |
24 |
/usr/lib/apache2/example.conf: No such file or directory |
25 |
|
26 |
This is not sufficiently worse than the custom error: |
27 |
|
28 |
Unable to read configuration file: example.conf |
29 |
|
30 |
Therefore the custom readability check is removed in this commit, and |
31 |
we can avoid reimplementing the relative path handling as well. |
32 |
|
33 |
2.4/init/apache2.initd | 5 ----- |
34 |
1 file changed, 5 deletions(-) |
35 |
|
36 |
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd |
37 |
index f49245c..0a1e6a0 100755 |
38 |
--- a/2.4/init/apache2.initd |
39 |
+++ b/2.4/init/apache2.initd |
40 |
@@ -38,11 +38,6 @@ checkconfd() { |
41 |
fi |
42 |
|
43 |
CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}" |
44 |
- [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}" |
45 |
- if [ ! -r "${CONFIGFILE}" ]; then |
46 |
- eerror "Unable to read configuration file: ${CONFIGFILE}" |
47 |
- return 1 |
48 |
- fi |
49 |
|
50 |
APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}" |
51 |
APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}" |