diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/config.m4 | 4 | ||||
-rw-r--r-- | os/netware/pre_nw.h | 6 | ||||
-rw-r--r-- | os/netware/util_nw.c | 37 | ||||
-rw-r--r-- | os/unix/unixd.c | 17 | ||||
-rw-r--r-- | os/unix/unixd.h | 3 | ||||
-rw-r--r-- | os/win32/Makefile.in | 5 | ||||
-rw-r--r-- | os/win32/ap_regkey.c | 14 | ||||
-rw-r--r-- | os/win32/os.h | 9 | ||||
-rw-r--r-- | os/win32/util_win32.c | 3 |
9 files changed, 66 insertions, 32 deletions
diff --git a/os/config.m4 b/os/config.m4 index 336f360d..b5ab86bd 100644 --- a/os/config.m4 +++ b/os/config.m4 @@ -17,6 +17,10 @@ bs2000*) OS="cygwin" OS_DIR="unix" ;; +*mingw32*) + OS="win32" + OS_DIR=$OS + ;; *) OS="unix" OS_DIR=$OS;; diff --git a/os/netware/pre_nw.h b/os/netware/pre_nw.h index f4ce6f53..21ebb675 100644 --- a/os/netware/pre_nw.h +++ b/os/netware/pre_nw.h @@ -63,12 +63,6 @@ #define __int64 long long #endif -/* Don't use the DBM rewrite map for mod_rewrite */ -#define NO_DBM_REWRITEMAP - -/* Allow MOD_AUTH_DBM to use APR */ -#define AP_AUTH_DBM_USE_APR - /* Restrict the number of nested includes */ #define AP_MAX_INCLUDE_DEPTH 48 diff --git a/os/netware/util_nw.c b/os/netware/util_nw.c index bfa196e6..97845d47 100644 --- a/os/netware/util_nw.c +++ b/os/netware/util_nw.c @@ -16,9 +16,15 @@ #include "httpd.h" #include "http_log.h" +#include "ap_mpm.h" #include <netware.h> #include <nks/netware.h> +#include <nks/vm.h> + +void ap_down_server_cb(void *, void *); +void ap_dummy_cb(void *, void *); +void ap_cb_destroy(void *); int nlmUnloadSignaled(int wait); event_handle_t eh; @@ -35,31 +41,31 @@ AP_DECLARE(apr_status_t) ap_os_create_privileged_process( return apr_proc_create(newproc, progname, args, env, attr, p); } -int _NonAppCheckUnload( void ) +int _NonAppCheckUnload(void) { - return nlmUnloadSignaled(1); + return nlmUnloadSignaled(1); } -// down server event callback -void ap_down_server_cb(void *, void *) +/* down server event callback */ +void ap_down_server_cb(void *a, void *b) { - nlmUnloadSignaled(0); + nlmUnloadSignaled(0); return; } -// Required place holder event callback -void ap_dummy_cb(void *, void *) +/* Required place holder event callback */ +void ap_dummy_cb(void *a, void *b) { return; } -// destroy callback resources -void ap_cb_destroy(void *) +/* destroy callback resources */ +void ap_cb_destroy(void *a) { - // cleanup down event notification - UnRegisterEventNotification(eh); - NX_UNWRAP_INTERFACE(ref); - NX_UNWRAP_INTERFACE(dum); + /* cleanup down event notification */ + UnRegisterEventNotification(eh); + NX_UNWRAP_INTERFACE(ref); + NX_UNWRAP_INTERFACE(dum); } int _NonAppStart @@ -88,7 +94,7 @@ int _NonAppStart #pragma unused(messageCount) #pragma unused(messages) - // register for down server event + /* register for down server event */ rtag_t rt = AllocateResourceTag(NLMHandle, "Apache2 Down Server Callback", EventSignature); @@ -98,8 +104,9 @@ int _NonAppStart EVENT_PRIORITY_APPLICATION, ref, dum, NULL); - // clean-up + /* clean-up */ NXVmRegisterExitHandler(ap_cb_destroy, NULL); + return 0; } diff --git a/os/unix/unixd.c b/os/unix/unixd.c index 7a306be6..85d5a98b 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -237,6 +237,23 @@ AP_DECLARE(const char *) unixd_set_chroot_dir(cmd_parms *cmd, void *dummy, return NULL; } +AP_DECLARE(const char *) unixd_set_suexec(cmd_parms *cmd, void *dummy, + int arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + if (!unixd_config.suexec_enabled && arg) { + return "suEXEC isn't supported; check existence, owner, and " + "file mode of " SUEXEC_BIN; + } + + unixd_config.suexec_enabled = arg; + return NULL; +} + AP_DECLARE(void) unixd_pre_config(apr_pool_t *ptemp) { apr_finfo_t wrapper; diff --git a/os/unix/unixd.h b/os/unix/unixd.h index 833cc8f0..0da52784 100644 --- a/os/unix/unixd.h +++ b/os/unix/unixd.h @@ -90,6 +90,9 @@ AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, const char *arg, const char * arg2, int type); #endif +AP_DECLARE(const char *) unixd_set_suexec(cmd_parms *cmd, void *dummy, + int arg); + /** * One of the functions to set mutex permissions should be called in * the parent process on platforms that switch identity when the diff --git a/os/win32/Makefile.in b/os/win32/Makefile.in new file mode 100644 index 00000000..8a16bb82 --- /dev/null +++ b/os/win32/Makefile.in @@ -0,0 +1,5 @@ + +LTLIBRARY_NAME = libos.la +LTLIBRARY_SOURCES = util_win32.c ap_regkey.c modules.c + +include $(top_srcdir)/build/ltlib.mk diff --git a/os/win32/ap_regkey.c b/os/win32/ap_regkey.c index ea5a56d3..e080ab4f 100644 --- a/os/win32/ap_regkey.c +++ b/os/win32/ap_regkey.c @@ -43,7 +43,7 @@ AP_DECLARE(const ap_regkey_t *) ap_regkey_const(int i) } -apr_status_t regkey_cleanup(void *key) +static apr_status_t regkey_cleanup(void *key) { ap_regkey_t *regkey = key; @@ -363,7 +363,7 @@ AP_DECLARE(apr_status_t) ap_regkey_value_raw_get(void **result, else if (valuelen) return APR_ENAMETOOLONG; /* Read to NULL buffer to determine value size */ - rc = RegQueryValueExW(key->hkey, wvalname, 0, resulttype, + rc = RegQueryValueExW(key->hkey, wvalname, 0, (LPDWORD)resulttype, NULL, (LPDWORD)resultsize); if (rc != ERROR_SUCCESS) { return APR_FROM_OS_ERROR(rc); @@ -371,7 +371,7 @@ AP_DECLARE(apr_status_t) ap_regkey_value_raw_get(void **result, /* Read value based on size query above */ *result = apr_palloc(pool, *resultsize); - rc = RegQueryValueExW(key->hkey, wvalname, 0, resulttype, + rc = RegQueryValueExW(key->hkey, wvalname, 0, (LPDWORD)resulttype, (LPBYTE)*result, (LPDWORD)resultsize); } #endif /* APR_HAS_UNICODE_FS */ @@ -379,14 +379,14 @@ AP_DECLARE(apr_status_t) ap_regkey_value_raw_get(void **result, ELSE_WIN_OS_IS_ANSI { /* Read to NULL buffer to determine value size */ - rc = RegQueryValueEx(key->hkey, valuename, 0, resulttype, + rc = RegQueryValueEx(key->hkey, valuename, 0, (LPDWORD)resulttype, NULL, (LPDWORD)resultsize); if (rc != ERROR_SUCCESS) return APR_FROM_OS_ERROR(rc); /* Read value based on size query above */ *result = apr_palloc(pool, *resultsize); - rc = RegQueryValueEx(key->hkey, valuename, 0, resulttype, + rc = RegQueryValueEx(key->hkey, valuename, 0, (LPDWORD)resulttype, (LPBYTE)*result, (LPDWORD)resultsize); if (rc != ERROR_SUCCESS) return APR_FROM_OS_ERROR(rc); @@ -452,7 +452,7 @@ AP_DECLARE(apr_status_t) ap_regkey_value_array_get(apr_array_header_t **result, void *value; char *buf; char *tmp; - DWORD type; + apr_int32_t type; apr_size_t size = 0; rv = ap_regkey_value_raw_get(&value, &size, &type, key, valuename, pool); @@ -468,8 +468,6 @@ AP_DECLARE(apr_status_t) ap_regkey_value_array_get(apr_array_header_t **result, { apr_size_t alloclen; apr_size_t valuelen = strlen(valuename) + 1; - apr_size_t wvallen = 256; - apr_wchar_t *wvalue = (apr_wchar_t *)value; /* ###: deliberately overallocate plus two extra nulls. * We could precalculate the exact buffer here instead, the question diff --git a/os/win32/os.h b/os/win32/os.h index 8b9f8acb..0fce4787 100644 --- a/os/win32/os.h +++ b/os/win32/os.h @@ -38,7 +38,11 @@ #include <io.h> #include <fcntl.h> +#ifdef _WIN64 +#define PLATFORM "Win64" +#else #define PLATFORM "Win32" +#endif /* going away shortly... */ #define HAVE_DRIVE_LETTERS @@ -48,6 +52,7 @@ #define APACHE_MPM_DIR "server/mpm/winnt" /* generated on unix */ #include <stddef.h> +#include <stdlib.h> /* for exit() */ #ifdef __cplusplus extern "C" { @@ -84,7 +89,7 @@ typedef enum { FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal); -PSECURITY_ATTRIBUTES GetNullACL(); +PSECURITY_ATTRIBUTES GetNullACL(void); void CleanNullACL(void *sa); int set_listeners_noninheritable(apr_pool_t *p); @@ -93,7 +98,7 @@ int set_listeners_noninheritable(apr_pool_t *p); #define AP_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *ap_winapi_fpt_##fn) args; \ static ap_winapi_fpt_##fn ap_winapi_pfn_##fn = NULL; \ - __inline rettype ap_winapi_##fn args \ + static APR_INLINE rettype ap_winapi_##fn args \ { if (!ap_winapi_pfn_##fn) \ ap_winapi_pfn_##fn = (ap_winapi_fpt_##fn) ap_load_dll_func(lib, #fn, ord); \ return (*(ap_winapi_pfn_##fn)) names; }; \ diff --git a/os/win32/util_win32.c b/os/win32/util_win32.c index ab96ff11..3a4038a5 100644 --- a/os/win32/util_win32.c +++ b/os/win32/util_win32.c @@ -20,6 +20,7 @@ #include "httpd.h" #include "http_log.h" +#include "ap_mpm.h" #include <stdarg.h> #include <time.h> @@ -105,7 +106,7 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal) /* To share the semaphores with other processes, we need a NULL ACL * Code from MS KB Q106387 */ -PSECURITY_ATTRIBUTES GetNullACL() +PSECURITY_ATTRIBUTES GetNullACL(void) { PSECURITY_DESCRIPTOR pSD; PSECURITY_ATTRIBUTES sa; |