pcs 98/02/24 04:27:23
Modified: src ApacheCore.dsp ApacheCore.mak CHANGES
src/main http_main.c
src/os/win32 service.c
Log:
Use the value of the Apache serveroot key in the registry, if it exists,
in preference to the compiled in default. Any -d command line flag
will override the registry value. Apache -i sets the serverroot key
in the registry.
Reviewed by: (concept only) Martin Kraemer, Jim Jagielski, Ken Coar
Revision Changes Path
1.21 +8 -0 apache-1.3/src/ApacheCore.dsp
Index: ApacheCore.dsp
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/ApacheCore.dsp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ApacheCore.dsp 1998/02/24 10:30:52 1.20
+++ ApacheCore.dsp 1998/02/24 12:27:14 1.21
@@ -237,6 +237,10 @@
# End Source File
# Begin Source File
+SOURCE=.\os\win32\registry.c
+# End Source File
+# Begin Source File
+
SOURCE=.\main\rfc1413.c
# End Source File
# Begin Source File
@@ -354,6 +358,10 @@
# Begin Source File
SOURCE=.\os\win32\readdir.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\win32\registry.h
# End Source File
# Begin Source File
1.31 +59 -18 apache-1.3/src/ApacheCore.mak
Index: ApacheCore.mak
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/ApacheCore.mak,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ApacheCore.mak 1998/02/24 10:30:52 1.30
+++ ApacheCore.mak 1998/02/24 12:27:15 1.31
@@ -86,6 +86,7 @@
[EMAIL PROTECTED] "$(INTDIR)\modules.obj"
[EMAIL PROTECTED] "$(INTDIR)\multithread.obj"
[EMAIL PROTECTED] "$(INTDIR)\readdir.obj"
+ [EMAIL PROTECTED] "$(INTDIR)\registry.obj"
[EMAIL PROTECTED] "$(INTDIR)\rfc1413.obj"
[EMAIL PROTECTED] "$(INTDIR)\service.obj"
[EMAIL PROTECTED] "$(INTDIR)\util.obj"
@@ -156,6 +157,7 @@
"$(INTDIR)\modules.obj" \
"$(INTDIR)\multithread.obj" \
"$(INTDIR)\readdir.obj" \
+ "$(INTDIR)\registry.obj" \
"$(INTDIR)\rfc1413.obj" \
"$(INTDIR)\service.obj" \
"$(INTDIR)\util.obj" \
@@ -258,6 +260,8 @@
[EMAIL PROTECTED] "$(INTDIR)\multithread.sbr"
[EMAIL PROTECTED] "$(INTDIR)\readdir.obj"
[EMAIL PROTECTED] "$(INTDIR)\readdir.sbr"
+ [EMAIL PROTECTED] "$(INTDIR)\registry.obj"
+ [EMAIL PROTECTED] "$(INTDIR)\registry.sbr"
[EMAIL PROTECTED] "$(INTDIR)\rfc1413.obj"
[EMAIL PROTECTED] "$(INTDIR)\rfc1413.sbr"
[EMAIL PROTECTED] "$(INTDIR)\service.obj"
@@ -328,6 +332,7 @@
"$(INTDIR)\modules.sbr" \
"$(INTDIR)\multithread.sbr" \
"$(INTDIR)\readdir.sbr" \
+ "$(INTDIR)\registry.sbr" \
"$(INTDIR)\rfc1413.sbr" \
"$(INTDIR)\service.sbr" \
"$(INTDIR)\util.sbr" \
@@ -386,6 +391,7 @@
"$(INTDIR)\modules.obj" \
"$(INTDIR)\multithread.obj" \
"$(INTDIR)\readdir.obj" \
+ "$(INTDIR)\registry.obj" \
"$(INTDIR)\rfc1413.obj" \
"$(INTDIR)\service.obj" \
"$(INTDIR)\util.obj" \
@@ -806,6 +812,7 @@
".\os\win32\getopt.h"\
".\os\win32\os.h"\
".\os\win32\readdir.h"\
+ ".\os\win32\registry.h"\
".\os\win32\service.h"\
@@ -837,6 +844,7 @@
".\os\win32\getopt.h"\
".\os\win32\os.h"\
".\os\win32\readdir.h"\
+ ".\os\win32\registry.h"\
".\os\win32\service.h"\
@@ -1009,9 +1017,6 @@
!ENDIF
SOURCE=.\main\md5c.c
-
-!IF "$(CFG)" == "ApacheCore - Win32 Release"
-
DEP_CPP_MD5C_=\
".\include\conf.h"\
".\include\hsregex.h"\
@@ -1019,18 +1024,15 @@
".\os\win32\os.h"\
+!IF "$(CFG)" == "ApacheCore - Win32 Release"
+
+
"$(INTDIR)\md5c.obj" : $(SOURCE) $(DEP_CPP_MD5C_) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ELSEIF "$(CFG)" == "ApacheCore - Win32 Debug"
-DEP_CPP_MD5C_=\
- ".\include\conf.h"\
- ".\include\hsregex.h"\
- ".\include\md5.h"\
- ".\os\win32\os.h"\
-
"$(INTDIR)\md5c.obj" "$(INTDIR)\md5c.sbr" : $(SOURCE) $(DEP_CPP_MD5C_)\
"$(INTDIR)"
@@ -1945,9 +1947,6 @@
!ENDIF
SOURCE=.\os\win32\multithread.c
-
-!IF "$(CFG)" == "ApacheCore - Win32 Release"
-
DEP_CPP_MULTI=\
".\include\conf.h"\
".\include\hsregex.h"\
@@ -1955,18 +1954,15 @@
".\os\win32\os.h"\
+!IF "$(CFG)" == "ApacheCore - Win32 Release"
+
+
"$(INTDIR)\multithread.obj" : $(SOURCE) $(DEP_CPP_MULTI) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ELSEIF "$(CFG)" == "ApacheCore - Win32 Debug"
-DEP_CPP_MULTI=\
- ".\include\conf.h"\
- ".\include\hsregex.h"\
- ".\include\multithread.h"\
- ".\os\win32\os.h"\
-
"$(INTDIR)\multithread.obj" "$(INTDIR)\multithread.sbr" : $(SOURCE)\
$(DEP_CPP_MULTI) "$(INTDIR)"
@@ -1997,6 +1993,47 @@
!ENDIF
+SOURCE=.\os\win32\registry.c
+
+!IF "$(CFG)" == "ApacheCore - Win32 Release"
+
+DEP_CPP_REGIS=\
+ ".\include\alloc.h"\
+ ".\include\ap.h"\
+ ".\include\buff.h"\
+ ".\include\conf.h"\
+ ".\include\hsregex.h"\
+ ".\include\http_log.h"\
+ ".\include\httpd.h"\
+ ".\os\win32\os.h"\
+ ".\os\win32\readdir.h"\
+
+
+"$(INTDIR)\registry.obj" : $(SOURCE) $(DEP_CPP_REGIS) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "ApacheCore - Win32 Debug"
+
+DEP_CPP_REGIS=\
+ ".\include\alloc.h"\
+ ".\include\ap.h"\
+ ".\include\buff.h"\
+ ".\include\conf.h"\
+ ".\include\hsregex.h"\
+ ".\include\http_log.h"\
+ ".\include\httpd.h"\
+ ".\os\win32\os.h"\
+ ".\os\win32\readdir.h"\
+
+
+"$(INTDIR)\registry.obj" "$(INTDIR)\registry.sbr" : $(SOURCE)
$(DEP_CPP_REGIS)\
+ "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
SOURCE=.\main\rfc1413.c
!IF "$(CFG)" == "ApacheCore - Win32 Release"
@@ -2052,12 +2089,14 @@
".\include\buff.h"\
".\include\conf.h"\
".\include\hsregex.h"\
+ ".\include\http_conf_globals.h"\
".\include\http_log.h"\
".\include\http_main.h"\
".\include\httpd.h"\
".\include\multithread.h"\
".\os\win32\os.h"\
".\os\win32\readdir.h"\
+ ".\os\win32\registry.h"\
".\os\win32\service.h"\
@@ -2073,12 +2112,14 @@
".\include\buff.h"\
".\include\conf.h"\
".\include\hsregex.h"\
+ ".\include\http_conf_globals.h"\
".\include\http_log.h"\
".\include\http_main.h"\
".\include\httpd.h"\
".\include\multithread.h"\
".\os\win32\os.h"\
".\os\win32\readdir.h"\
+ ".\os\win32\registry.h"\
".\os\win32\service.h"\
1.664 +5 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.663
retrieving revision 1.664
diff -u -r1.663 -r1.664
--- CHANGES 1998/02/24 07:22:20 1.663
+++ CHANGES 1998/02/24 12:27:16 1.664
@@ -1,5 +1,10 @@
Changes with Apache 1.3b6
+ *) WIN32: The server root is obtained from the registry key
+ HKLM\SOFTWARE\Apache Group\Apache\<version> (version is currently
+ "1.3 beta"), unless overridden by the -d command line flag. The
+ value is stored by running "apache -i -d serverroot".
+
*) Now mod_rewrite no longer makes problematic assumptions on the
characters
a username can contain when trying to expand it via /etc/passwd.
[Ralf S. Engelschall]
1.295 +17 -1 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -r1.294 -r1.295
--- http_main.c 1998/02/22 20:52:33 1.294
+++ http_main.c 1998/02/24 12:27:19 1.295
@@ -162,6 +162,7 @@
#ifdef WIN32
#include "../os/win32/service.h"
+#include "../os/win32/registry.h"
#endif
@@ -4904,7 +4905,22 @@
server_post_read_config = make_array(pcommands, 1, sizeof(char *));
server_argv0 = argv[0];
- ap_cpystrn(server_root, HTTPD_ROOT, sizeof(server_root));
+
+ /* Get the serverroot from the registry, if it exists. This can be
+ * overridden by a command line -d argument.
+ */
+ if (ap_registry_get_server_root(pconf, server_root, sizeof(server_root))
< 0) {
+ /* The error has already been logged. Actually it won't have been,
+ * because we haven't read the config files to find out where our
+ * error log is. But we can't just ignore the error since we might
+ * end up using totally the wrong server root.
+ */
+ exit(1);
+ }
+
+ if (!*server_root) {
+ ap_cpystrn(server_root, HTTPD_ROOT, sizeof(server_root));
+ }
ap_cpystrn(server_confname, SERVER_CONFIG_FILE, sizeof(server_confname));
setup_prelinked_modules();
1.8 +5 -0 apache-1.3/src/os/win32/service.c
Index: service.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/os/win32/service.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- service.c 1998/01/10 04:41:33 1.7
+++ service.c 1998/02/24 12:27:22 1.8
@@ -8,10 +8,12 @@
#include <direct.h>
#include "httpd.h"
+#include "http_conf_globals.h"
#include "http_log.h"
#include "http_main.h"
#include "multithread.h"
#include "service.h"
+#include "registry.h"
static struct
{
@@ -247,6 +249,9 @@
if (schService) {
CloseServiceHandle(schService);
+
+ /* Now store the server_root in the registry */
+ ap_registry_set_server_root(server_root);
}
else {
aplog_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL,