Skip to content

Commit 7f64990

Browse files
author
Ryan Bloom
committed
Clean up a big chunk of ap_config.h. This basically stops ap_config.h from
including any files. Because of this change, other files must include their own headers. I also cleaned up a couple of other bugs in some modules because I had to compile them all. I expect this to break multiple platforms, but this will be fixed over time. The massive configure cleanup is almost done. I will go through the files one more time after this commit. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85553 13f79535-47bb-0310-9956-ffa450edef68
1 parent a249334 commit 7f64990

24 files changed

Lines changed: 81 additions & 97 deletions

STATUS

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache 2.0 STATUS:
2-
Last modified at [$Date: 2000/06/12 17:28:48 $]
2+
Last modified at [$Date: 2000/06/12 21:46:35 $]
33

44
Release:
55

@@ -31,10 +31,6 @@ RELEASE SHOWSTOPPERS:
3131
to -ldl which is wrong).
3232
Status:
3333

34-
- reduce number of configuration items, which in turn reduces the
35-
amount of stuff in ap_config_auto.h.in
36-
Status: Ryan +1 (working on it), Greg +1
37-
3834
* suEXEC doesn't work
3935
Status: Manoj has posted an patch to fix this.
4036
<19991103003605.A20612@samosa.mindspring.com>

include/ap_config.h

Lines changed: 9 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -104,48 +104,6 @@ extern "C" {
104104
#include <string.h>
105105
#endif
106106

107-
#ifdef HAVE_SYS_TYPES_H
108-
#include <sys/types.h>
109-
#endif
110-
111-
#ifdef HAVE_UNISTD_H
112-
#include <unistd.h>
113-
#endif
114-
115-
#ifdef HAVE_SYS_TIME_H
116-
#include <sys/time.h>
117-
#endif
118-
119-
#ifdef HAVE_SYS_RESOURCE_H
120-
#include <sys/resource.h>
121-
#endif
122-
123-
#ifdef HAVE_NETDB_H
124-
#include <netdb.h>
125-
#endif
126-
127-
/* The next three are for inet_*() */
128-
129-
#ifdef HAVE_SYS_SOCKET_H
130-
#include <sys/socket.h>
131-
#endif
132-
133-
#ifdef HAVE_NETINET_IN_H
134-
#include <netinet/in.h>
135-
#endif
136-
137-
#ifdef HAVE_ARPA_INET_H
138-
#include <arpa/inet.h>
139-
#endif
140-
141-
#ifdef HAVE_PWD_H /* XXX - For getpw*. This should be moved to unixd */
142-
#include <pwd.h>
143-
#endif
144-
145-
#ifdef HAVE_GRP_H /* XXX - For getgr*. This should be moved to unixd */
146-
#include <grp.h>
147-
#endif
148-
149107
/* ap_ versions of ctype macros to make sure they deal with 8-bit chars */
150108
#include "ap_ctype.h"
151109

@@ -166,29 +124,6 @@ extern "C" {
166124
#define ap_sigwait(a,b) sigwait((a),(b))
167125
#endif
168126

169-
/* So that we can use inline on some critical functions, and use
170-
* GNUC attributes (such as to get -Wall warnings for printf-like
171-
* functions). Only do this in gcc 2.7 or later ... it may work
172-
* on earlier stuff, but why chance it.
173-
*
174-
* We've since discovered that the gcc shipped with NeXT systems
175-
* as "cc" is completely broken. It claims to be __GNUC__ and so
176-
* on, but it doesn't implement half of the things that __GNUC__
177-
* means. In particular it's missing inline and the __attribute__
178-
* stuff. So we hack around it. PR#1613. -djg
179-
*/
180-
#if !defined(__GNUC__) || __GNUC__ < 2 || \
181-
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
182-
defined(NEXT)
183-
#define ap_inline
184-
#define __attribute__(__x)
185-
#define ENUM_BITFIELD(e,n,w) signed int n : w
186-
#else
187-
#define ap_inline __inline__
188-
#define USE_GNU_INLINE
189-
#define ENUM_BITFIELD(e,n,w) e n : w
190-
#endif
191-
192127
/* EAGAIN apparently isn't defined on some systems */
193128
#if !defined(HAVE_EAGAIN) && !defined(EAGAIN)
194129
#define EAGAIN EWOULDBLOCK
@@ -216,19 +151,10 @@ extern "C" {
216151
#endif
217152

218153
#ifdef SCO5
219-
/* XXX - What's this for */
220-
#define SecureWare
221-
222-
/* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
223-
consts. Sigh. */
224-
extern int strcasecmp(const char *, const char *);
225-
extern int strncasecmp(const char *, const char *, unsigned);
226-
#endif /* SCO5 */
227-
228-
/* If APR has OTHER_CHILD logic, use reliable piped logs.
154+
/* This allows Apache to run from a startup script on a SCO box in high
155+
* security (C2) mode.
229156
*/
230-
#if (APR_HAS_OTHER_CHILD)
231-
#define HAVE_RELIABLE_PIPED_LOGS TRUE
157+
#define SecureWare
232158
#endif
233159

234160
/* XXX - The PHP4 comments say -D_HPUX_SOURCE is obsolete. */
@@ -251,6 +177,12 @@ extern int strncasecmp(const char *, const char *, unsigned);
251177
#define USE_MEM_BASED_SCOREBOARD
252178
#endif
253179

180+
/* If APR has OTHER_CHILD logic, use reliable piped logs.
181+
*/
182+
#if (APR_HAS_OTHER_CHILD)
183+
#define HAVE_RELIABLE_PIPED_LOGS TRUE
184+
#endif
185+
254186
#if defined(CHARSET_EBCDIC) && !defined(APACHE_XLATE)
255187
#define APACHE_XLATE
256188
#endif

modules/aaa/mod_access.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@
7373
#ifdef HAVE_STRING_H
7474
#include <string.h>
7575
#endif
76+
#ifdef HAVE_NETINET_IN_H
77+
#include <netinet/in.h>
78+
#endif
79+
80+
#ifdef HAVE_ARPA_INET_H
81+
#include <arpa/inet.h>
82+
#endif
83+
7684

7785
enum allowdeny_type {
7886
T_ENV,

modules/aaa/mod_auth_db.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
#include "http_core.h"
100100
#include "http_log.h"
101101
#include "http_protocol.h"
102+
#include "http_request.h" /* for ap_hook_(check_user_id | auth_check) */
102103
#ifdef HAVE_DB_H
103104
#include <db.h>
104105
#endif
@@ -319,10 +320,10 @@ static int db_authenticate_basic_user(request_rec *r)
319320
invalid_pw = ap_validate_password(sent_pw, real_pw);
320321

321322
if (invalid_pw != APR_SUCCESS) {
322-
char buf[120]
323323
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
324-
"DB user %s: authentication failure for \"%s\": %s",
325-
r->user, r->uri, ap_strerror(invalid_pw, buf, sizeof(buf)));
324+
"DB user %s: authentication failure for \"%s\": "
325+
"Password Mismatch",
326+
r->user, r->uri);
326327
ap_note_basic_auth_failure(r);
327328
return AUTH_REQUIRED;
328329
}

modules/aaa/mod_auth_dbm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
#include "http_core.h"
7676
#include "http_log.h"
7777
#include "http_protocol.h"
78+
#include "http_request.h" /* for ap_hook_(check_user_id | auth_checker)*/
7879
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
7980
&& __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
8081
#include <db1/ndbm.h>
@@ -239,8 +240,9 @@ static int dbm_authenticate_basic_user(request_rec *r)
239240
invalid_pw = ap_validate_password(sent_pw, real_pw);
240241
if (invalid_pw != APR_SUCCESS) {
241242
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
242-
"DBM user %s: authentication failure for \"%s\": %s",
243-
r->user, r->uri, invalid_pw);
243+
"DBM user %s: authentication failure for \"%s\": "
244+
"Password Mismatch",
245+
r->user, r->uri);
244246
ap_note_basic_auth_failure(r);
245247
return AUTH_REQUIRED;
246248
}

modules/generators/mod_cgid.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
#include "ap_mpm.h"
9191
#include "iol_socket.h"
9292
#include "unixd.h"
93+
#include <sys/stat.h>
94+
#include <sys/socket.h> /* for sockaddr_un */
9395
#include <sys/un.h> /* for sockaddr_un */
9496
#include <sys/types.h>
9597
#include <sys/stat.h>

modules/http/http_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#include "http_connection.h"
7474
#include "util_ebcdic.h"
7575
#include "mpm.h"
76+
#include <netdb.h>
7677

7778
/* Allow Apache to use ap_mmap */
7879
#ifdef USE_MMAP_FILES

modules/http/http_protocol.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#include "util_charset.h"
7979
#include "mpm_status.h"
8080
#include <stdarg.h>
81+
#include <unistd.h>
8182

8283
AP_HOOK_STRUCT(
8384
AP_HOOK_LINK(post_read_request)

modules/loggers/mod_log_config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
#include "http_core.h" /* For REMOTE_NAME */
177177
#include "http_log.h"
178178
#include "http_protocol.h"
179+
#include <unistd.h>
179180
#ifdef HAVE_LIMITS_H
180181
#include <limits.h>
181182
#endif

modules/mappers/mod_rewrite.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
#include <sys/uio.h>
112112
#endif
113113
#endif
114+
#ifdef HAVE_PWD_H
115+
#include <pwd.h>
116+
#endif
117+
#ifdef HAVE_GRP_H
118+
#include <grp.h>
119+
#endif
120+
#ifdef HAVE_UNISTD_H
121+
#include <unistd.h>
122+
#endif
114123

115124
/*
116125
** +-------------------------------------------------------+

0 commit comments

Comments
 (0)