diff options
Diffstat (limited to 'os')
49 files changed, 0 insertions, 4284 deletions
diff --git a/os/.cvsignore b/os/.cvsignore deleted file mode 100644 index bd5fe06963..0000000000 --- a/os/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -.deps diff --git a/os/.indent.pro b/os/.indent.pro deleted file mode 100644 index a9fbe9f9a1..0000000000 --- a/os/.indent.pro +++ /dev/null @@ -1,54 +0,0 @@ --i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 --TBUFF --TFILE --TTRANS --TUINT4 --T_trans --Tallow_options_t --Tapache_sfio --Tarray_header --Tbool_int --Tbuf_area --Tbuff_struct --Tbuffy --Tcmd_how --Tcmd_parms --Tcommand_rec --Tcommand_struct --Tconn_rec --Tcore_dir_config --Tcore_server_config --Tdir_maker_func --Tevent --Tglobals_s --Thandler_func --Thandler_rec --Tjoblist_s --Tlisten_rec --Tmerger_func --Tmode_t --Tmodule --Tmodule_struct --Tmutex --Tn_long --Tother_child_rec --Toverrides_t --Tparent_score --Tpid_t --Tpiped_log --Tpool --Trequest_rec --Trequire_line --Trlim_t --Tscoreboard --Tsemaphore --Tserver_addr_rec --Tserver_rec --Tserver_rec_chain --Tshort_score --Ttable --Ttable_entry --Tthread --Tu_wide_int --Tvtime_t --Twide_int diff --git a/os/Makefile.in b/os/Makefile.in deleted file mode 100644 index 6850624f70..0000000000 --- a/os/Makefile.in +++ /dev/null @@ -1,4 +0,0 @@ - -SUBDIRS = $(OS_DIR) - -include $(top_srcdir)/build/rules.mk diff --git a/os/beos/.cvsignore b/os/beos/.cvsignore deleted file mode 100644 index bbc8ba00d1..0000000000 --- a/os/beos/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -.deps -.libs -*.lo -*.la diff --git a/os/beos/Makefile.in b/os/beos/Makefile.in deleted file mode 100644 index 66272ecc46..0000000000 --- a/os/beos/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libos.la -LTLIBRARY_SOURCES = os.c beosd.c - -include $(top_srcdir)/build/ltlib.mk diff --git a/os/beos/beosd.c b/os/beos/beosd.c deleted file mode 100644 index c29be7f1a3..0000000000 --- a/os/beos/beosd.c +++ /dev/null @@ -1,163 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include <unistd.h> -#include "httpd.h" -#include "http_config.h" -#include "http_main.h" -#include "http_log.h" -#include "beosd.h" - -beosd_config_rec beosd_config; - -/* Set group privileges. - * - * Note that we use the username as set in the config files, rather than - * the lookup of to uid --- the same uid may have multiple passwd entries, - * with different sets of groups for each. - */ - -#if B_BEOS_VERSION < 0x0460 -static int set_group_privs(void) -{ - - if (!geteuid()) { - char *name; - - /* Get username if passed as a uid */ - - if (beosd_config.user_name[0] == '#') { - struct passwd *ent; - uid_t uid = atoi(&beosd_config.user_name[1]); - - if ((ent = getpwuid(uid)) == NULL) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "getpwuid: couldn't determine user name from uid %u, " - "you probably need to modify the User directive", - (unsigned)uid); - return -1; - } - - name = ent->pw_name; - } - else - name = beosd_config.user_name; - - if (setgid(beosd_config.group_id) == -1) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "setgid: unable to set group id to Group %u", - (unsigned)beosd_config.group_id); - return -1; - } - - /* Reset `groups' attributes. */ - -#ifdef HAVE_INITGROUPS - if (initgroups(name, beosd_config.group_id) == -1) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "initgroups: unable to set groups for User %s " - "and Group %u", name, (unsigned)beosd_config.group_id); - return -1; - } -#endif - } - return 0; -} -#endif - - -int beosd_setup_child(void) -{ - /* TODO: revisit the whole issue of users/groups for BeOS as - * R5 and below doesn't really have much concept of them. - */ - - return 0; -} - - -const char *beosd_set_user(cmd_parms *cmd, void *dummy, char *arg) -{ - const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); - if (err != NULL) { - return err; - } - - beosd_config.user_name = arg; - beosd_config.user_id = ap_uname2id(arg); - return NULL; -} - -const char *beosd_set_group(cmd_parms *cmd, void *dummy, char *arg) -{ - const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); - if (err != NULL) { - return err; - } - - beosd_config.group_id = ap_gname2id(arg); - - return NULL; -} - -void beosd_pre_config(void) -{ - beosd_config.user_name = DEFAULT_USER; - beosd_config.user_id = ap_uname2id(DEFAULT_USER); - beosd_config.group_id = ap_gname2id(DEFAULT_GROUP); -} diff --git a/os/beos/beosd.h b/os/beos/beosd.h deleted file mode 100644 index 31b055bd7f..0000000000 --- a/os/beos/beosd.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef BEOSD_H -#define BEOSD_H - -/* common stuff that beos MPMs will want */ - -/* Default user name and group name. These may be specified as numbers by - * placing a # before a number */ - -#ifndef DEFAULT_USER -#define DEFAULT_USER "#-1" -#endif -#ifndef DEFAULT_GROUP -#define DEFAULT_GROUP "#" -#endif - -typedef struct { - char *user_name; - uid_t user_id; - gid_t group_id; -} beosd_config_rec; -extern beosd_config_rec beosd_config; - -void beosd_detach(void); -int beosd_setup_child(void); -void beosd_pre_config(void); -const char *beosd_set_user(cmd_parms *cmd, void *dummy, char *arg); -const char *beosd_set_group(cmd_parms *cmd, void *dummy, char *arg); - -#define beosd_killpg(x, y) (kill (-(x), (y))) - -#define UNIX_DAEMON_COMMANDS \ -{ "User", beosd_set_user, NULL, RSRC_CONF, TAKE1, \ - "Effective user id for this server"}, \ -{ "Group", beosd_set_group, NULL, RSRC_CONF, TAKE1, \ - "Effective group id for this server"}, \ - -#endif /* BEOSD_H */ diff --git a/os/beos/config.m4 b/os/beos/config.m4 deleted file mode 100644 index 4fe95b7509..0000000000 --- a/os/beos/config.m4 +++ /dev/null @@ -1,3 +0,0 @@ -if test "$OS" = "beos" ; then - APR_ADDTO(CFLAGS,-DBEOS) -fi diff --git a/os/beos/os.c b/os/beos/os.c deleted file mode 100644 index 13bcfd8a3c..0000000000 --- a/os/beos/os.c +++ /dev/null @@ -1,84 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file will include OS specific functions which are not inlineable. - * Any inlineable functions should be defined in os-inline.c instead. - */ - -#include "ap_config.h" -#include "os.h" -#include "httpd.h" -#include "apr_thread_proc.h" -#include "ap_mpm.h" /* needed for definition of - * ap_os_create_privileged_process */ - -int ap_os_is_path_absolute(const char *file) -{ - return file[0] == '/'; -} - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - return apr_proc_create(newproc, progname, args, env, attr, p); -} diff --git a/os/beos/os.h b/os/beos/os.h deleted file mode 100644 index b7dcd1cdd3..0000000000 --- a/os/beos/os.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H - -#include "ap_config.h" - -#ifndef PLATFORM - #ifdef BONE_VERSION - #define PLATFORM "BeOS BONE" - #else - #define PLATFORM "BeOS R5" - #endif -#endif - -/* - * This file is included in all Apache source code. It contains definitions - * of facilities available on _this_ operating system (HAVE_* macros), - * and prototypes of OS specific functions defined in os.c or os-inline.c - */ - -extern int ap_os_is_path_absolute(const char *file); -#define ap_os_canonical_filename(p,f) (f) -#define ap_os_case_canonical_filename(p,f) (f) -#define ap_os_systemcase_filename(p,f) (f) - -#endif /* !APACHE_OS_H */ diff --git a/os/bs2000/.cvsignore b/os/bs2000/.cvsignore deleted file mode 100644 index bd5fe06963..0000000000 --- a/os/bs2000/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -.deps diff --git a/os/bs2000/bs2login.c b/os/bs2000/bs2login.c deleted file mode 100644 index 2320e3f73f..0000000000 --- a/os/bs2000/bs2login.c +++ /dev/null @@ -1,308 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifdef _OSD_POSIX -#include "httpd.h" -#include "http_config.h" -#include "http_log.h" -#include <ctype.h> -#include <sys/utsname.h> - -#define ACCT_LEN 8 -#define USER_LEN 8 - -static const char *bs2000_account = NULL; -typedef enum -{ - bs2_unknown, /* not initialized yet. */ - bs2_noFORK, /* no fork() because -X flag was specified */ - bs2_FORK, /* only fork() because uid != 0 */ - bs2_FORK_RINI, /* prior to A17, regular fork() and _rini() was used. */ - bs2_RFORK_RINI, /* for A17, use of _rfork() and _rini() was required */ - bs2_UFORK /* As of A18, the new ufork() is used. */ -} bs2_ForkType; - -static bs2_ForkType forktype = bs2_unknown; - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -typedef struct { - char *username; - char *account; - char *processor_name; -} _rini_struct; - -extern int _rini(_rini_struct *); -#endif /* !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) */ - - -static void ap_pad(char *dest, size_t size, char ch) -{ - int i = strlen(dest); /* Leave space for trailing '\0' */ - - while (i < size-1) - dest[i++] = ch; - - dest[size-1] = '\0'; /* Guarantee for trailing '\0' */ -} - -static void ap_str_toupper(char *str) -{ - while (*str) { - *str = apr_toupper(*str); - ++str; - } -} - -/* Determine the method for forking off a child in such a way as to - * set both the POSIX and BS2000 user id's to the unprivileged user. - */ -static bs2_ForkType os_forktype(void) -{ - struct utsname os_version; - - /* have we checked the OS version before? If yes return the previous - * result - the OS release isn't going to change suddenly! - */ - if (forktype != bs2_unknown) { - return forktype; - } - - /* If the user is unprivileged, use the normal fork() only. */ - if (getuid() != 0) { - return forktype = bs2_FORK; - } - - if (uname(&os_version) < 0) - { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "uname() failed - aborting."); - exit(APEXIT_CHILDFATAL); - } - - /* - * Old BS2000/OSD versions (before XPG4 SPEC1170) don't work with Apache. - * Anyway, simply return a fork(). - */ - if (strcmp(os_version.release, "01.0A") == 0 || - strcmp(os_version.release, "02.0A") == 0 || - strcmp(os_version.release, "02.1A") == 0) - { - ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL, - "Error: unsupported OS version. " - "You may encounter problems."); - forktype = bs2_FORK; - } - - /* The following versions are special: - * OS versions before A17 needs regular fork() and _rini(). - * A17 requires _rfork() and _rini(), - * and later versions need ufork(). - */ - else if (strcmp(os_version.release, "01.1A") == 0 || - strcmp(os_version.release, "03.0A") == 0 || - strcmp(os_version.release, "03.1A") == 0 || - strcmp(os_version.release, "04.0A") == 0) - { - if (strcmp (os_version.version, "A18") >= 0) - forktype = bs2_UFORK; - - else if (strcmp (os_version.version, "A17") < 0) - forktype = bs2_FORK_RINI; - - else - forktype = bs2_RFORK_RINI; - } - - /* All later OS versions will hopefully use ufork() only ;-) */ - else - forktype = bs2_UFORK; - - return forktype; -} - - - -/* This routine is called by http_core for the BS2000Account directive */ -/* It stores the account name for later use */ -const char *os_set_account(apr_pool_t *p, const char *account) -{ - char account_temp[ACCT_LEN+1]; - - apr_cpystrn(account_temp, account, sizeof account_temp); - - /* Make account all upper case */ - ap_str_toupper(account_temp); - - /* Pad to length 8 */ - ap_pad(account_temp, sizeof account_temp, ' '); - - bs2000_account = apr_pstrdup(p, account_temp); - return NULL; -} - -/* This routine complements the setuid() call: it causes the BS2000 job - * environment to be switched to the target user's user id. - * That is important if CGI scripts try to execute native BS2000 commands. - */ -int os_init_job_environment(server_rec *server, const char *user_name, int one_process) -{ - _rini_struct inittask; - char username[USER_LEN+1]; - int save_errno; - bs2_ForkType type = os_forktype(); - - /* We can be sure that no change to uid==0 is possible because of - * the checks in http_core.c:set_user() - */ - - /* The _rini() function works only after a prior _rfork(). - * In the case of one_process, it would fail. - */ - if (one_process) { - - type = forktype = bs2_noFORK; - - ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, server, - "The debug mode of Apache should only " - "be started by an unprivileged user!"); - return 0; - } - - /* If no _rini() is required, then return quickly. */ - if (type != bs2_RFORK_RINI && type != bs2_FORK_RINI) - return 0; - - /* An Account is required for _rini() */ - if (bs2000_account == NULL) - { - ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, server, - "No BS2000Account configured - cannot switch to User %s", - user_name); - exit(APEXIT_CHILDFATAL); - } - - apr_cpystrn(username, user_name, sizeof username); - - /* Make user name all upper case */ - ap_str_toupper(username); - - /* Pad to length 8 */ - ap_pad(username, sizeof username, ' '); - - inittask.username = username; - inittask.account = bs2000_account; - inittask.processor_name = " "; - - /* Switch to the new logon user (setuid() and setgid() are done later) */ - /* Only the super user can switch identities. */ - if (_rini(&inittask) != 0) { - - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server, - "_rini: BS2000 auth failed for user \"%s\" acct \"%s\"", - inittask.username, inittask.account); - - exit(APEXIT_CHILDFATAL); - } - - return 0; -} - -/* BS2000 requires a "special" version of fork() before a setuid()/_rini() call */ -pid_t os_fork(const char *user) -{ - pid_t pid; - char username[USER_LEN+1]; - - switch (os_forktype()) { - case bs2_FORK: - case bs2_FORK_RINI: - pid = fork(); - break; - - case bs2_RFORK_RINI: - pid = _rfork(); - break; - - case bs2_UFORK: - apr_cpystrn(username, user, sizeof username); - - /* Make user name all upper case - for some versions of ufork() */ - ap_str_toupper(username); - - pid = ufork(username); - if (pid == -1 && errno == EPERM) { - ap_log_error(APLOG_MARK, APLOG_EMERG, errno, - NULL, "ufork: Possible mis-configuration " - "for user %s - Aborting.", user); - exit(1); - } - break; - - default: - pid = 0; - break; - } - - return pid; -} - -#else /* _OSD_POSIX */ -void bs2login_is_not_here() -{ -} -#endif /* _OSD_POSIX */ diff --git a/os/bs2000/ebcdic.c b/os/bs2000/ebcdic.c deleted file mode 100644 index a6914e9e57..0000000000 --- a/os/bs2000/ebcdic.c +++ /dev/null @@ -1,252 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "ap_config.h" -#if APR_CHARSET_EBCDIC -#include "ebcdic.h" -/* - Initial Port for Apache-1.3 by <Martin.Kraemer@Mch.SNI.De> - -"BS2000 OSD" is a POSIX on a main frame. It is made by Siemens AG, Germany. -Within the POSIX subsystem, the same character set was chosen as in -"native BS2000", namely EBCDIC. - -EBCDIC Table. (Yes, in EBCDIC, the letters 'a'..'z' are not contiguous!) -This apr_table_t is bijective, i.e. there are no ambigous or duplicate characters -00 00 01 02 03 85 09 86 7f 87 8d 8e 0b 0c 0d 0e 0f *................* -10 10 11 12 13 8f 0a 08 97 18 19 9c 9d 1c 1d 1e 1f *................* -20 80 81 82 83 84 92 17 1b 88 89 8a 8b 8c 05 06 07 *................* -30 90 91 16 93 94 95 96 04 98 99 9a 9b 14 15 9e 1a *................* -40 20 a0 e2 e4 e0 e1 e3 e5 e7 f1 60 2e 3c 28 2b 7c * .........`.<(+|* -50 26 e9 ea eb e8 ed ee ef ec df 21 24 2a 29 3b 9f *&.........!$*);.* -60 2d 2f c2 c4 c0 c1 c3 c5 c7 d1 5e 2c 25 5f 3e 3f *-/........^,%_>?* -70 f8 c9 ca cb c8 cd ce cf cc a8 3a 23 40 27 3d 22 *..........:#@'="* -80 d8 61 62 63 64 65 66 67 68 69 ab bb f0 fd fe b1 *.abcdefghi......* -90 b0 6a 6b 6c 6d 6e 6f 70 71 72 aa ba e6 b8 c6 a4 *.jklmnopqr......* -a0 b5 af 73 74 75 76 77 78 79 7a a1 bf d0 dd de ae *..stuvwxyz......* -b0 a2 a3 a5 b7 a9 a7 b6 bc bd be ac 5b 5c 5d b4 d7 *...........[\]..* -c0 f9 41 42 43 44 45 46 47 48 49 ad f4 f6 f2 f3 f5 *.ABCDEFGHI......* -d0 a6 4a 4b 4c 4d 4e 4f 50 51 52 b9 fb fc db fa ff *.JKLMNOPQR......* -e0 d9 f7 53 54 55 56 57 58 59 5a b2 d4 d6 d2 d3 d5 *..STUVWXYZ......* -f0 30 31 32 33 34 35 36 37 38 39 b3 7b dc 7d da 7e *0123456789.{.}.~* -*/ - -/* The bijective ebcdic-to-ascii table: */ -const unsigned char os_toascii_strictly[256] = { -/*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, - 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................*/ -/*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /*................*/ -/*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /*................*/ -/*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /*................*/ -/*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, - 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+|*/ -/*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /*&.........!$*);.*/ -/*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, - 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /*-/........^,%_>?*/ -/*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, - 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /*..........:#@'="*/ -/*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /*.abcdefghi......*/ -/*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /*.jklmnopqr......*/ -/*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /*..stuvwxyz......*/ -/*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, - 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /*...........[\]..*/ -/*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /*.ABCDEFGHI......*/ -/*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /*.JKLMNOPQR......*/ -/*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /*..STUVWXYZ......*/ -/*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~*/ -}; - -/* This apr_table_t is (almost) identical to the previous one. The only difference - * is the fact that it maps every EBCDIC *except 0x0A* to its ASCII - * equivalent. The reason for this apr_table_t is simple: Throughout the - * server, protocol strings are used in the form - * "Content-Type: text/plain\015\012". Now all the characters in the string - * are stored as EBCDIC, only the semantics of \012 is completely - * different from LF (look it up in the apr_table_t above). \015 happens to be - * mapped to \015 anyway, so there's no special case for it. - * - * In THIS table, EBCDIC-\012 is mapped to ASCII-\012. - * This apr_table_t is therefore used wherever an EBCDIC to ASCII conversion is - * needed in the server. - */ -/* ebcdic-to-ascii with \012 mapped to ASCII-\n */ -const unsigned char os_toascii[256] = { -/*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, - 0x87, 0x8d, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................*/ -/*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /*................*/ -/*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /*................*/ -/*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /*................*/ -/*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, - 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+|*/ -/*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /*&.........!$*);.*/ -/*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, - 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /*-/........^,%_>?*/ -/*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, - 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /*..........:#@'="*/ -/*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /*.abcdefghi......*/ -/*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /*.jklmnopqr......*/ -/*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /*..stuvwxyz......*/ -/*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, - 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /*...........[\]..*/ -/*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /*.ABCDEFGHI......*/ -/*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /*.JKLMNOPQR......*/ -/*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /*..STUVWXYZ......*/ -/*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~*/ -}; - -/* The ascii-to-ebcdic table: -00 00 01 02 03 37 2d 2e 2f 16 05 15 0b 0c 0d 0e 0f *................* -10 10 11 12 13 3c 3d 32 26 18 19 3f 27 1c 1d 1e 1f *................* -20 40 5a 7f 7b 5b 6c 50 7d 4d 5d 5c 4e 6b 60 4b 61 * !"#$%&'()*+,-./ -30 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 7a 5e 4c 7e 6e 6f *0123456789:;<=>?* -40 7c c1 c2 c3 c4 c5 c6 c7 c8 c9 d1 d2 d3 d4 d5 d6 *@ABCDEFGHIJKLMNO* -50 d7 d8 d9 e2 e3 e4 e5 e6 e7 e8 e9 bb bc bd 6a 6d *PQRSTUVWXYZ[\]^_* -60 4a 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 *`abcdefghijklmno* -70 97 98 99 a2 a3 a4 a5 a6 a7 a8 a9 fb 4f fd ff 07 *pqrstuvwxyz{|}~.* -80 20 21 22 23 24 04 06 08 28 29 2a 2b 2c 09 0a 14 *................* -90 30 31 25 33 34 35 36 17 38 39 3a 3b 1a 1b 3e 5f *................* -a0 41 aa b0 b1 9f b2 d0 b5 79 b4 9a 8a ba ca af a1 *................* -b0 90 8f ea fa be a0 b6 b3 9d da 9b 8b b7 b8 b9 ab *................* -c0 64 65 62 66 63 67 9e 68 74 71 72 73 78 75 76 77 *................* -d0 ac 69 ed ee eb ef ec bf 80 e0 fe dd fc ad ae 59 *................* -e0 44 45 42 46 43 47 9c 48 54 51 52 53 58 55 56 57 *................* -f0 8c 49 cd ce cb cf cc e1 70 c0 de db dc 8d 8e df *................* -*/ -const unsigned char os_toebcdic[256] = { -/*00*/ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, - 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................*/ -/*10*/ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /*................*/ -/*20*/ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* !"#$%&'()*+,-./ */ -/*30*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /*0123456789:;<=>?*/ -/*40*/ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /*@ABCDEFGHIJKLMNO*/ -/*50*/ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, - 0xe7, 0xe8, 0xe9, 0xbb, 0xbc, 0xbd, 0x6a, 0x6d, /*PQRSTUVWXYZ[\]^_*/ -/*60*/ 0x4a, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /*`abcdefghijklmno*/ -/*70*/ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, - 0xa7, 0xa8, 0xa9, 0xfb, 0x4f, 0xfd, 0xff, 0x07, /*pqrstuvwxyz{|}~.*/ -/*80*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x14, /*................*/ -/*90*/ 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17, - 0x38, 0x39, 0x3a, 0x3b, 0x1a, 0x1b, 0x3e, 0x5f, /*................*/ -/*a0*/ 0x41, 0xaa, 0xb0, 0xb1, 0x9f, 0xb2, 0xd0, 0xb5, - 0x79, 0xb4, 0x9a, 0x8a, 0xba, 0xca, 0xaf, 0xa1, /*................*/ -/*b0*/ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, - 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /*................*/ -/*c0*/ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /*................*/ -/*d0*/ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, - 0x80, 0xe0, 0xfe, 0xdd, 0xfc, 0xad, 0xae, 0x59, /*................*/ -/*e0*/ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /*................*/ -/*f0*/ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, - 0x70, 0xc0, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /*................*/ -}; - -/* Translate a memory block from EBCDIC (host charset) to ASCII (net charset) - * dest and srce may be identical, or separate memory blocks, but - * should not overlap. - */ -void -ebcdic2ascii(unsigned char *dest, const unsigned char *srce, size_t count) -{ - while (count-- != 0) { - *dest++ = os_toascii[*srce++]; - } -} -void -ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count) -{ - while (count-- != 0) { - *dest++ = os_toascii_strictly[*srce++]; - } -} -void -ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count) -{ - while (count-- != 0) { - *dest++ = os_toebcdic[*srce++]; - } -} -#endif /*APR_CHARSET_EBCDIC*/ diff --git a/os/bs2000/ebcdic.h b/os/bs2000/ebcdic.h deleted file mode 100644 index 63821f73ec..0000000000 --- a/os/bs2000/ebcdic.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include <sys/types.h> - -extern const unsigned char os_toascii[256]; -extern const unsigned char os_toebcdic[256]; -void ebcdic2ascii(unsigned char *dest, const unsigned char *srce, size_t count); -void ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count); -void ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count); - diff --git a/os/bs2000/os-inline.c b/os/bs2000/os-inline.c deleted file mode 100644 index c8299b58ac..0000000000 --- a/os/bs2000/os-inline.c +++ /dev/null @@ -1,87 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file contains functions which can be inlined if the compiler - * has an "inline" modifier. Because of this, this file is both a - * header file and a compilable module. - * - * Only inlineable functions should be defined in here. They must all - * include the APR_INLINE modifier. - * - * If the compiler supports inline, this file will be #included as a - * header file from os.h to create all the inline function - * definitions. APR_INLINE will be defined to whatever is required on - * function definitions to make them inline declarations. - * - * If the compiler does not support inline, this file will be compiled - * as a normal C file into libos.a (along with os.c). In this case - * APR_HAS_INLINE will be zero so we can use this to test if we are - * compiling this source file. - */ - -#include "apr.h" - -#if APR_HAS_INLINE -/* keep inlined functions private to the including file */ -static -#endif -APR_INLINE int ap_os_is_path_absolute(const char *file) -{ - return file[0] == '/'; -} diff --git a/os/bs2000/os.c b/os/bs2000/os.c deleted file mode 100644 index 63907a4393..0000000000 --- a/os/bs2000/os.c +++ /dev/null @@ -1,76 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file will include OS specific functions which are not inlineable. - * Any inlineable functions should be defined in os-inline.c instead. - */ - -#include "httpd.h" -#include "os.h" - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - return apr_proc_create(newproc, progname, args, env, attr, p); -} - diff --git a/os/bs2000/os.h b/os/bs2000/os.h deleted file mode 100644 index 4b7fd4c893..0000000000 --- a/os/bs2000/os.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H - -#define PLATFORM "BS2000" - -#include "apr.h" - -/* - * This file in included in all Apache source code. It contains definitions - * of facilities available on _this_ operating system (HAVE_* macros), - * and prototypes of OS specific functions defined in os.c or os-inline.c - */ - -#if APR_HAS_INLINE -/* Compiler supports inline, so include the inlineable functions as - * part of the header - */ - -#include "os-inline.c" - -#else -/* Compiler does not support inline, so prototype the inlineable functions - * as normal - */ -extern int ap_os_is_path_absolute(const char *file); -#endif - -/* Other ap_os_ routines not used by this platform */ - - -extern pid_t os_fork(const char *user); - -#endif /*! APACHE_OS_H*/ diff --git a/os/config.m4 b/os/config.m4 deleted file mode 100644 index 7442325d73..0000000000 --- a/os/config.m4 +++ /dev/null @@ -1,25 +0,0 @@ -AC_MSG_CHECKING(for target platform) - -#PLATFORM=`${CONFIG_SHELL-/bin/sh} $ac_config_guess` -PLATFORM=$host - -case "$PLATFORM" in -*beos*) - OS="beos" - OS_DIR=$OS - ;; -*pc-os2_emx*) - OS="os2" - OS_DIR=$OS - ;; -bs2000*) - OS="unix" - OS_DIR=bs2000 # only the OS_DIR is platform specific. - ;; -*) - OS="unix" - OS_DIR=$OS;; -esac - -AC_MSG_RESULT($OS) -APACHE_FAST_OUTPUT(os/$OS_DIR/Makefile) diff --git a/os/os2/.cvsignore b/os/os2/.cvsignore deleted file mode 100644 index a00af59e15..0000000000 --- a/os/os2/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -.deps -*.lo -*.la -.libs diff --git a/os/os2/Makefile.in b/os/os2/Makefile.in deleted file mode 100644 index 5796f5c57c..0000000000 --- a/os/os2/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libos.la -LTLIBRARY_SOURCES = os-inline.c util_os2.c - -include $(top_srcdir)/build/ltlib.mk diff --git a/os/os2/config.m4 b/os/os2/config.m4 deleted file mode 100644 index b62d214e1d..0000000000 --- a/os/os2/config.m4 +++ /dev/null @@ -1,3 +0,0 @@ -if test "$OS" = "os2" ; then - APR_ADDTO(CFLAGS, [-DOS2 -O2]) -fi diff --git a/os/os2/core.mk b/os/os2/core.mk deleted file mode 100644 index aac4356532..0000000000 --- a/os/os2/core.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Some rules for making a shared core dll on OS/2 - -os2core: httpd.dll $(CORE_IMPLIB) - $(LIBTOOL) --mode=link gcc $(EXTRA_LDFLAGS) -o httpd $(CORE_IMPLIB) - -httpd.dll: $(PROGRAM_DEPENDENCIES) $(CORE_IMPLIB) - $(LINK) -Zdll $(EXTRA_LDFLAGS) -s -o $@ server/exports.lo modules.lo $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) server/ApacheCoreOS2.def diff --git a/os/os2/core_header.def b/os/os2/core_header.def deleted file mode 100644 index 9764c4a484..0000000000 --- a/os/os2/core_header.def +++ /dev/null @@ -1,29 +0,0 @@ -LIBRARY httpd INITINSTANCE -DESCRIPTION "Apache Server Core" -EXPORTS - "main" - "ap_my_generation" - "ap_restart_time" - "ap_extended_status" - "ap_scoreboard_image" - "ap_conftree" - "ap_server_root" - "ap_top_module" - -; Some globals from apr & apr-util - "apr_day_snames" - "apr_month_snames" - "apr_global_hook_pool" - "apr_debug_module_hooks" - "apr_current_hooking_module" - -; One for mod_dav from socket library - "_swaps" - -; And some more for mod_unique_id - "gethostname" - "gethostbyname" - "_swapl" - "h_errno" - "inet_ntoa" - diff --git a/os/os2/os-inline.c b/os/os2/os-inline.c deleted file mode 100644 index dfcf05cc00..0000000000 --- a/os/os2/os-inline.c +++ /dev/null @@ -1,93 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file contains functions which can be inlined if the compiler - * has an "inline" modifier. Because of this, this file is both a - * header file and a compilable module. - * - * Only inlineable functions should be defined in here. They must all - * include the APR_INLINE modifier. - * - * If the compiler supports inline, this file will be #included as a - * header file from os.h to create all the inline function - * definitions. APR_INLINE will be defined to whatever is required on - * function definitions to make them inline declarations. - * - * If the compiler does not support inline, this file will be compiled - * as a normal C file into libos.a (along with os.c). In this case - * APR_HAS_INLINE will be zero so we can use this to test if we are - * compiling this source file. - */ - -#include "apr.h" - -#if APR_HAS_INLINE -/* keep inlined functions private to the including file */ -static -#endif -APR_INLINE int ap_os_is_path_absolute(const char *file) -{ - /* For now, just do the same check that http_request.c and mod_alias.c do. - * XXX: Accept /bleh still? Or do we concur that d:/bleh is a minimum - * requirement? If so, canonical name needs to convert to drive/path - * syntax, and the test is (file[0] == '/' && file[1] == '/') ||... - */ - return (file[0] == '/' - || (file[0] != '\0' && file[1] == ':' && file[2] == '/')); -} diff --git a/os/os2/os.h b/os/os2/os.h deleted file mode 100644 index 1f8f44dce3..0000000000 --- a/os/os2/os.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H - -#define PLATFORM "OS/2" -#define HAVE_CANONICAL_FILENAME -#define HAVE_DRIVE_LETTERS -#define HAVE_UNC_PATHS - -#include <apr.h> -#include <apr_pools.h> - -/* - * This file in included in all Apache source code. It contains definitions - * of facilities available on _this_ operating system (HAVE_* macros), - * and prototypes of OS specific functions defined in os.c or os-inline.c - */ - -#if APR_HAS_INLINE -/* Compiler supports inline, so include the inlineable functions as - * part of the header - */ - -#include "os-inline.c" - -#else -/* Compiler does not support inline, so prototype the inlineable functions - * as normal - */ -extern int ap_os_is_path_absolute(const char *file); -#endif - -char *ap_os_canonical_filename(apr_pool_t *p, const char *file); -char *ap_os_case_canonical_filename(apr_pool_t *p, const char *szFile); - -/* OS/2 doesn't have symlinks so S_ISLNK is always false */ -#define S_ISLNK(m) 0 - -#endif /* ! APACHE_OS_H */ diff --git a/os/os2/util_os2.c b/os/os2/util_os2.c deleted file mode 100644 index 0ecb9dc4fd..0000000000 --- a/os/os2/util_os2.c +++ /dev/null @@ -1,183 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#define INCL_DOS -#define INCL_DOSERRORS -#include <os2.h> -#include "ap_config.h" -#include "httpd.h" -#include "http_log.h" -#include "os.h" -#include <sys/time.h> -#include <sys/signal.h> -#include <ctype.h> -#include <string.h> -#include "apr_strings.h" - - -AP_DECLARE(char *)ap_os_case_canonical_filename(apr_pool_t *pPool, const char *szFile) -{ - char buf[HUGE_STRING_LEN]; - char buf2[HUGE_STRING_LEN]; - int rc, len; - char *pos; - -/* Remove trailing slash unless it's a root directory */ - strcpy(buf, szFile); - len = strlen(buf); - - if (len > 3 && buf[len-1] == '/') - buf[--len] = 0; - - rc = DosQueryPathInfo(buf, FIL_QUERYFULLNAME, buf2, HUGE_STRING_LEN); - - if (rc) { - if (rc != ERROR_INVALID_NAME) { - ap_log_error(APLOG_MARK, APLOG_ERR, APR_OS2_STATUS(rc), NULL, "for file [%s]", szFile); - } - apr_cpystrn(buf2, buf, sizeof(buf2)); - } - -/* Switch backslashes to forward */ - for (pos=buf2; *pos; pos++) - if (*pos == '\\') - *pos = '/'; - - return apr_pstrdup(pPool, buf2); -} - - - -static void fix_component(char *path, char *lastcomp) -{ - FILEFINDBUF3 fb3; - HDIR hDir = HDIR_CREATE; - ULONG numNames = 1; - ULONG rc = DosFindFirst( (UCHAR *)path, &hDir, FILE_NORMAL|FILE_DIRECTORY, &fb3, sizeof(fb3), &numNames, FIL_STANDARD ); - - if (rc == 0) - strcpy(lastcomp, fb3.achName); - - DosFindClose(hDir); -} - - - -char *ap_os_systemcase_canonical_filename(apr_pool_t *pPool, const char *szFile) -{ - char *szCanonicalFile = ap_os_case_canonical_filename(pPool, szFile); - int startslash = 2, slashnum=0; - char *pos, *prevslash = NULL; - - if (szCanonicalFile[0] == '/' && szCanonicalFile[1] == '/') /* a UNC name */ - startslash = 5; - - for (pos = szCanonicalFile; *pos; pos++) { - if (*pos == '/') { - slashnum++; - if (slashnum >= startslash) { - *pos = 0; - fix_component(szCanonicalFile, prevslash+1); - *pos = '/'; - } - prevslash = pos; - } - } - - if (slashnum >= startslash) { - fix_component(szCanonicalFile, prevslash+1); - } - - return szCanonicalFile; -} - - - -char *ap_os_canonical_filename(apr_pool_t *pPool, const char *szFile) -{ - char *szCanonicalFile; - const unsigned char *pos = szFile; - - /* Find any 8 bit characters */ - while (*pos && *pos < 128) { - pos++; - } - - /* Only use the very expensive ap_os_systemcase_canonical_filename() if - * the file name contains non-english characters as they are the only type - * that can't be made canonical with a simple strlwr() - */ - if (*pos < 128) { - szCanonicalFile = ap_os_case_canonical_filename(pPool, szFile); - } else { - szCanonicalFile = ap_os_systemcase_canonical_filename(pPool, szFile); - } - - strlwr(szCanonicalFile); - return szCanonicalFile; -} - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - return apr_proc_create(newproc, progname, args, env, attr, p); -} diff --git a/os/tpf/.cvsignore b/os/tpf/.cvsignore deleted file mode 100644 index bd5fe06963..0000000000 --- a/os/tpf/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -.deps diff --git a/os/tpf/TPFExport b/os/tpf/TPFExport deleted file mode 100644 index 449ebf2f93..0000000000 --- a/os/tpf/TPFExport +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -echo " Setting TPF/c89 environment variables" -export _C89_CCMODE=1 -# replace the following with the location of your TPF include files -export _C89_INCDIRS="/u/tpf41/currentmaint/include /u/tpf41/currentmaint/include/oco" -export TPF=YES -echo "Done" diff --git a/os/tpf/ebcdic.c b/os/tpf/ebcdic.c deleted file mode 100644 index dc838004e5..0000000000 --- a/os/tpf/ebcdic.c +++ /dev/null @@ -1,221 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "ap_config.h" -#if APR_CHARSET_EBCDIC -#include "ebcdic.h" -/* -This code does basic character mapping for IBM's TPF operating system. -It is a modified version of <Martin.Kraemer@Mch.SNI.De>'s code for -the BS2000 (apache/src/os/bs2000/ebcdic.c). -*/ - -/* -Bijective EBCDIC (character set IBM-1047) to US-ASCII table: -This apr_table_t is bijective - there are no ambigous or duplicate characters. -*/ -const unsigned char os_toascii_strictly[256] = { - 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, /* 00-0f: */ - 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */ - 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, /* 10-1f: */ - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */ - 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, /* 20-2f: */ - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* ................ */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30-3f: */ - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* ................ */ - 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, /* 40-4f: */ - 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* ...........<(+| */ - 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, /* 50-5f: */ - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, /* &.........!$*);^ */ - 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, /* 60-6f: */ - 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* -/.........,%_>? */ - 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, /* 70-7f: */ - 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* .........`:#@'=" */ - 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80-8f: */ - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /* .abcdefghi...... */ - 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* 90-9f: */ - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /* .jklmnopqr...... */ - 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* a0-af: */ - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae, /* .~stuvwxyz...[.. */ - 0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, /* b0-bf: */ - 0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7, /* .............].. */ - 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* c0-cf: */ - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /* {ABCDEFGHI...... */ - 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* d0-df: */ - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, /* }JKLMNOPQR...... */ - 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* e0-ef: */ - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /* \.STUVWXYZ...... */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* f0-ff: */ - 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f /* 0123456789...... */ -}; - -/* -Server EBCDIC (character set IBM-1047) to US-ASCII table: -This apr_table_t is a copy of the os_toascii_strictly bijective apr_table_t above. -The only change is that hex 0a (\012 octal) is mapped to hex 0a -(ASCII's line feed) instead of hex 8e. This is done because throughout -Apache, protocol string definitions hardcode the linefeed as \012 (octal): -"Content-Type: text/plain\015\012". Without this kludge all protocol -string definitions would need to be changed from ...\012 to ...\025. -*/ -const unsigned char os_toascii[256] = { - 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, /* 00-0f: */ - 0x87, 0x8d, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */ - 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, /* 10-1f: */ - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */ - 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, /* 20-2f: */ - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /* ................ */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30-3f: */ - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /* ................ */ - 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, /* 40-4f: */ - 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* ...........<(+| */ - 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, /* 50-5f: */ - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x5e, /* &.........!$*);^ */ - 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, /* 60-6f: */ - 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /* -/.........,%_>? */ - 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, /* 70-7f: */ - 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /* .........`:#@'=" */ - 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80-8f: */ - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /* .abcdefghi...... */ - 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, /* 90-9f: */ - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /* .jklmnopqr...... */ - 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* a0-af: */ - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0x5b, 0xde, 0xae, /* .~stuvwxyz...[.. */ - 0xac, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, /* b0-bf: */ - 0xbd, 0xbe, 0xdd, 0xa8, 0xaf, 0x5d, 0xb4, 0xd7, /* .............].. */ - 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* c0-cf: */ - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /* {ABCDEFGHI...... */ - 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* d0-df: */ - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, /* }JKLMNOPQR...... */ - 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* e0-ef: */ - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /* \.STUVWXYZ...... */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* f0-ff: */ - 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f /* 0123456789...... */ -}; - -/* -The US-ASCII to EBCDIC (character set IBM-1047) table: -This apr_table_t is bijective (no ambiguous or duplicate characters) -*/ -const unsigned char os_toebcdic[256] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 00-0f: */ - 0x16, 0x05, 0x15, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* ................ */ - 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, /* 10-1f: */ - 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f, /* ................ */ - 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, /* 20-2f: */ - 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, /* !"#$%&'()*+,-./ */ - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 30-3f: */ - 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, /* 0123456789:;<=>? */ - 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 40-4f: */ - 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, /* @ABCDEFGHIJKLMNO */ - 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, /* 50-5f: */ - 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d, /* PQRSTUVWXYZ[\]^_ */ - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60-6f: */ - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* `abcdefghijklmno */ - 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 70-7f: */ - 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07, /* pqrstuvwxyz{|}~. */ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08, /* 80-8f: */ - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x14, /* ................ */ - 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17, /* 90-9f: */ - 0x38, 0x39, 0x3a, 0x3b, 0x1a, 0x1b, 0x3e, 0xff, /* ................ */ - 0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5, /* a0-af: */ - 0xbb, 0xb4, 0x9a, 0x8a, 0xb0, 0xca, 0xaf, 0xbc, /* ................ */ - 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, /* b0-bf: */ - 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, /* ................ */ - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, /* c0-cf: */ - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* ................ */ - 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, /* d0-df: */ - 0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xba, 0xae, 0x59, /* ................ */ - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, /* e0-ef: */ - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* ................ */ - 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, /* f0-ff: */ - 0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf /* ................ */ -}; - -/* Translate a memory block from EBCDIC (host charset) to ASCII (net charset) - * dest and srce may be identical, or separate memory blocks, but - * should not overlap. - */ -void -ebcdic2ascii(void *dest, const void *srce, size_t count) -{ - unsigned char *udest = dest; - const unsigned char *usrce = srce; - while (count-- != 0) { - *udest++ = os_toascii[*usrce++]; - } -} -void -ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count) -{ - while (count-- != 0) { - *dest++ = os_toascii_strictly[*srce++]; - } -} -void -ascii2ebcdic(void *dest, const void *srce, size_t count) -{ - unsigned char *udest = dest; - const unsigned char *usrce = srce; - - while (count-- != 0) { - *udest++ = os_toebcdic[*usrce++]; - } -} -#endif /*APR_CHARSET_EBCDIC*/ - diff --git a/os/tpf/ebcdic.h b/os/tpf/ebcdic.h deleted file mode 100644 index 026a888740..0000000000 --- a/os/tpf/ebcdic.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include <sys/types.h> - -extern const unsigned char os_toascii[256]; -extern const unsigned char os_toebcdic[256]; -void ebcdic2ascii(void *dest, const void *srce, size_t count); -void ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count); -void ascii2ebcdic(void *dest, const void *srce, size_t count); - diff --git a/os/tpf/os-inline.c b/os/tpf/os-inline.c deleted file mode 100644 index c8299b58ac..0000000000 --- a/os/tpf/os-inline.c +++ /dev/null @@ -1,87 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file contains functions which can be inlined if the compiler - * has an "inline" modifier. Because of this, this file is both a - * header file and a compilable module. - * - * Only inlineable functions should be defined in here. They must all - * include the APR_INLINE modifier. - * - * If the compiler supports inline, this file will be #included as a - * header file from os.h to create all the inline function - * definitions. APR_INLINE will be defined to whatever is required on - * function definitions to make them inline declarations. - * - * If the compiler does not support inline, this file will be compiled - * as a normal C file into libos.a (along with os.c). In this case - * APR_HAS_INLINE will be zero so we can use this to test if we are - * compiling this source file. - */ - -#include "apr.h" - -#if APR_HAS_INLINE -/* keep inlined functions private to the including file */ -static -#endif -APR_INLINE int ap_os_is_path_absolute(const char *file) -{ - return file[0] == '/'; -} diff --git a/os/tpf/os.c b/os/tpf/os.c deleted file mode 100644 index 5424f992b3..0000000000 --- a/os/tpf/os.c +++ /dev/null @@ -1,178 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file will include OS specific functions which are not inlineable. - * Any inlineable functions should be defined in os-inline.c instead. - */ - -#include "httpd.h" -#include "http_core.h" -#include "os.h" -#include "scoreboard.h" -#include "http_log.h" - -static FILE *sock_fp; - -#ifndef __PIPE_ -int pipe(int fildes[2]) -{ - errno = ENOSYS; - return(-1); -} -#endif - -/* fork and exec functions are not defined on - TPF due to the implementation of tpf_fork() */ - -pid_t fork(void) -{ - errno = ENOSYS; - return(-1); -} - -int execl(const char *path, const char *arg0, ...) -{ - errno = ENOSYS; - return(-1); -} - -int execle(const char *path, const char *arg0, ...) -{ - errno = ENOSYS; - return(-1); -} - -int execve(const char *path, char *const argv[], char *const envp[]) -{ - errno = ENOSYS; - return(-1); -} - -int execvp(const char *file, char *const argv[]) -{ - errno = ENOSYS; - return(-1); -} - - -pid_t os_fork(server_rec *s, int slot) -{ - struct tpf_fork_input fork_input; - APACHE_TPF_INPUT input_parms; - int count; - listen_rec *lr; - - fflush(stdin); - if (dup2(fileno(sock_fp), STDIN_FILENO) == -1) - ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s, - "unable to replace stdin with sock device driver"); - fflush(stdout); - if (dup2(fileno(sock_fp), STDOUT_FILENO) == -1) - ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s, - "unable to replace stdout with sock device driver"); - input_parms.generation = ap_my_generation; -#ifdef SCOREBOARD_FILE - input_parms.scoreboard_fd = scoreboard_fd; -#else /* must be USE_TPF_SCOREBOARD or USE_SHMGET_SCOREBOARD */ - input_parms.scoreboard_heap = ap_scoreboard_image; -#endif - - lr = ap_listeners; - count = 0; - do { - input_parms.listeners[count] = lr->fd; - lr = lr->next; - count++; - } while(lr != ap_listeners); - - input_parms.slot = slot; - input_parms.restart_time = ap_restart_time; - fork_input.ebw_data = &input_parms; - fork_input.program = ap_server_argv0; - fork_input.prog_type = TPF_FORK_NAME; - fork_input.istream = TPF_FORK_IS_BALANCE; - fork_input.ebw_data_length = sizeof(input_parms); - fork_input.parm_data = "-x"; - return tpf_fork(&fork_input); -} - -int os_check_server(char *server) { -#ifndef USE_TPF_DAEMON - int rv; - int *current_acn; - if((rv = inetd_getServerStatus(server)) == INETD_SERVER_STATUS_INACTIVE) - return 1; - else { - current_acn = (int *)cinfc_fast(CINFC_CMMACNUM); - if(ecbp2()->ce2acn != *current_acn) - return 1; - } -#endif - return 0; -} - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - return apr_proc_create(newproc, progname, args, env, attr, p); -} diff --git a/os/tpf/os.h b/os/tpf/os.h deleted file mode 100644 index c50fdc5451..0000000000 --- a/os/tpf/os.h +++ /dev/null @@ -1,145 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H - -#define PLATFORM "TPF" - -#ifdef errno -#undef errno -#endif - -/* - * This file in included in all Apache source code. It contains definitions - * of facilities available on _this_ operating system (HAVE_* macros), - * and prototypes of OS specific functions defined in os.c or os-inline.c - */ - -#include "apr.h" -#include "ap_config.h" - -#if APR_HAS_INLINE -/* Compiler supports inline, so include the inlineable functions as - * part of the header - */ - -#include "os-inline.c" - -#else -/* Compiler does not support inline, so prototype the inlineable functions - * as normal - */ -extern int ap_os_is_path_absolute(const char *f); -#endif - - -#include <strings.h> -#ifndef __strings_h - -#define FD_SETSIZE 2048 - -typedef long fd_mask; - -#define NBBY 8 /* number of bits in a byte */ -#define NFDBITS (sizeof(fd_mask) * NBBY) -#define howmany(x, y) (((x)+((y)-1))/(y)) - -typedef struct fd_set { - fd_mask fds_bits [howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; - -#define FD_CLR(n, p)((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p)((p)->fds_bits[(n)/NFDBITS] & (1 <<((n) % NFDBITS))) -#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) -#endif - -#ifdef FD_SET -#undef FD_SET -#define FD_SET(n, p) (0) -#endif - -#include <i$netd.h> -struct apache_input { - INETD_SERVER_INPUT inetd_server; - void *scoreboard_heap; /* scoreboard system heap address */ - int scoreboard_fd; /* scoreboard file descriptor */ - int slot; /* child number */ - int generation; /* server generation number */ - int listeners[10]; - time_t restart_time; -}; - -typedef struct apache_input APACHE_TPF_INPUT; - -extern int tpf_child; - -struct server_rec; -pid_t os_fork(struct server_rec *s, int slot); -int os_check_server(char *server); - -extern char *ap_server_argv0; -extern int scoreboard_fd; -#include <signal.h> -#ifndef SIGPIPE -#define SIGPIPE 14 -#endif -#ifdef NSIG -#undef NSIG -#endif -#endif /*! APACHE_OS_H*/ diff --git a/os/tpf/samples/linkdll.jcl b/os/tpf/samples/linkdll.jcl deleted file mode 100644 index 16524bf3c9..0000000000 --- a/os/tpf/samples/linkdll.jcl +++ /dev/null @@ -1,121 +0,0 @@ -//APACH JOB MSGLEVEL=(1,1),CLASS=A,MSGCLASS=A -/*ROUTE PRINT XXXXXX.XXXXXX -/*ROUTE PUNCH XXXXXX.XXXXXX -/*NOTIFY XXXXXX.XXXXXX -//CCLE JCLLIB ORDER=(SYS1.CBC.SCBCPRC,SYS1.CEE.SCEEPROC) -//PRELINK EXEC EDCPL,COND.LKED=(0,NE), -// PPARM='OMVS,DLLNAME(pppp)', -// LREGSIZ='2048K', -// LPARM='AMODE=31,RMODE=ANY,LIST,XREF' -//PLKED.SYSLIB DD DISP=SHR,DSN=FSE0000.DEVP.STUB.OB -// DD DISP=SHR,DSN=FSE0000.DEVP.CLIB.OB -// DD DISP=SHR,DSN=ACP.CLIB.RLSE46.WEB -// DD DISP=SHR,DSN=ACP.STUB.RLSE46.WEB -// DD DISP=SHR,DSN=ACP.CLIB.RLSE40 -// DD DISP=SHR,DSN=ACP.STUB.RLSE40 -//PLKED.SYSDEFSD DD DSN=APA0000.DEVP.IMPORTS.DSD(ppppvv),DISP=SHR -//PLKED.DSD DD DSN=APA0000.DEVP.IMPORTS.DSD,DISP=SHR -//PLKED.OBJLIB DD DISP=SHR,DSN=FSE0000.DEVP.TEST.OB -// DD DISP=SHR,DSN=ACP.OBJ.RLSE46.WEB -// DD DISP=SHR,DSN=ACP.OBJ.INTG98.NBS -// DD DISP=SHR,DSN=ACP.MAIN.SYST.OBBSS -// DD DISP=SHR,DSN=ACP.DF.MAIN.SYST.OBBSS -// DD DISP=SHR,DSN=ACP.OBJ.RLSE40.BSS -//PLKED.OBJ1 DD PATH='/usr/local/apache/src/ap/ap_cpystrn.o' -//PLKED.OBJ2 DD PATH='/usr/local/apache/src/ap/ap_execve.o' -//PLKED.OBJ3 DD PATH='/usr/local/apache/src/ap/ap_signal.o' -//PLKED.OBJ4 DD PATH='/usr/local/apache/src/ap/ap_slack.o' -//PLKED.OBJ5 DD PATH='/usr/local/apache/src/ap/ap_snprintf.o' -//PLKED.OBJ6 DD PATH='/usr/local/apache/src/ap/ap_strings.o' -//PLKED.OBJ7 DD PATH='/usr/local/apache/src/os/tpf/ebcdic.o' -//PLKED.OBJ8 DD PATH='/usr/local/apache/src/os/tpf/os.o' -//PLKED.OBJ9 DD PATH='/usr/local/apache/src/os/tpf/os-inline.o' -//PLKED.OBJ10 DD PATH='/usr/local/apache/src/regex/regcomp.o' -//PLKED.OBJ11 DD PATH='/usr/local/apache/src/regex/regerror.o' -//PLKED.OBJ12 DD PATH='/usr/local/apache/src/regex/regexec.o' -//PLKED.OBJ13 DD PATH='/usr/local/apache/src/regex/regfree.o' -//PLKED.OBJ14 DD PATH='/usr/local/apache/src/main/alloc.o' -//PLKED.OBJ15 DD PATH='/usr/local/apache/src/main/buff.o' -//PLKED.OBJ16 DD PATH='/usr/local/apache/src/main/fnmatch.o' -//PLKED.OBJ17 DD PATH='/usr/local/apache/src/main/http_config.o' -//PLKED.OBJ18 DD PATH='/usr/local/apache/src/main/http_core.o' -//PLKED.OBJ19 DD PATH='/usr/local/apache/src/main/http_log.o' -//PLKED.OBJ20 DD PATH='/usr/local/apache/src/main/http_main.o' -//PLKED.OBJ21 DD PATH='/usr/local/apache/src/main/http_protocol.o' -//PLKED.OBJ22 DD PATH='/usr/local/apache/src/main/http_request.o' -//PLKED.OBJ23 DD PATH='/usr/local/apache/src/main/http_vhost.o' -//PLKED.OBJ24 DD PATH='/usr/local/apache/src/main/md5c.o' -//PLKED.OBJ25 DD PATH='/usr/local/apache/src/main/rfc1413.o' -//PLKED.OBJ26 DD PATH='/usr/local/apache/src/main/util.o' -//PLKED.OBJ27 DD PATH='/usr/local/apache/src/main/util_date.o' -//PLKED.OBJ28 DD PATH='/usr/local/apache/src/main/util_md5.o' -//PLKED.OBJ29 DD PATH='/usr/local/apache/src/main/util_script.o' -//PLKED.OBJ30 DD PATH='/usr/local/apache/src/main/util_uri.o' -//PLKED.OBJ31 DD PATH='/usr/local/apache/src/modules.o' -//PLKED.OBJ32 DD PATH='/usr/local/apache/src/buildmark.o' -//PLKED.OBJ33 DD PATH='/usr/local/apache/src/modules/standard/mod_auto\ -// index.o' -//PLKED.OBJ34 DD PATH='/usr/local/apache/src/modules/standard/mod_dir.\ -// o' -//PLKED.OBJ35 DD PATH='/usr/local/apache/src/modules/standard/mod_mime\ -// .o' -//PLKED.OBJ36 DD PATH='/usr/local/apache/src/modules/standard/mod_sete\ -// nvif.o' -//PLKED.OBJ37 DD PATH='/usr/local/apache/src/modules/standard/mod_alia\ -// s.o' -//PLKED.OBJ38 DD PATH='/usr/local/apache/src/modules/standard/mod_acce\ -// ss.o' -//PLKED.OBJ39 DD PATH='/usr/local/apache/src/modules/standard/mod_user\ -// dir.o' -//PLKED.OBJ40 DD PATH='/usr/local/apache/src/modules/standard/mod_spel\ -// ing.o' -//PLKED.OBJ41 DD PATH='/usr/local/apache/src/modules/standard/mod_nego\ -// tiation.o' -//PLKED.SYSIN DD * - ORDER @@DLMHDR - INCLUDE OBJLIB(CSTRTD40) - INCLUDE OBJ1 - INCLUDE OBJ2 - INCLUDE OBJ3 - INCLUDE OBJ4 - INCLUDE OBJ5 - INCLUDE OBJ6 - INCLUDE OBJ7 - INCLUDE OBJ8 - INCLUDE OBJ9 - INCLUDE OBJ10 - INCLUDE OBJ11 - INCLUDE OBJ12 - INCLUDE OBJ13 - INCLUDE OBJ14 - INCLUDE OBJ15 - INCLUDE OBJ16 - INCLUDE OBJ17 - INCLUDE OBJ18 - INCLUDE OBJ19 - INCLUDE OBJ20 - INCLUDE OBJ21 - INCLUDE OBJ22 - INCLUDE OBJ23 - INCLUDE OBJ24 - INCLUDE OBJ25 - INCLUDE OBJ26 - INCLUDE OBJ27 - INCLUDE OBJ28 - INCLUDE OBJ29 - INCLUDE OBJ30 - INCLUDE OBJ31 - INCLUDE OBJ32 - INCLUDE OBJ33 - INCLUDE OBJ34 - INCLUDE OBJ35 - INCLUDE OBJ36 - INCLUDE OBJ37 - INCLUDE OBJ38 - INCLUDE OBJ39 - INCLUDE OBJ40 - INCLUDE OBJ41 -/* -//*** WARNING *** NEVER change .LK to .OB in SYSLMOD!!! -//LKED.SYSLMOD DD DISP=OLD,DSN=xxxxxx.xxxx(ppppvv) -// diff --git a/os/tpf/samples/loadset.jcl b/os/tpf/samples/loadset.jcl deleted file mode 100644 index 405af82847..0000000000 --- a/os/tpf/samples/loadset.jcl +++ /dev/null @@ -1,58 +0,0 @@ -//OLDRWEB JOB MSGLEVEL=1,CLASS=A,MSGCLASS=S -//JOBCAT DD DSN=ICFCAT.ESAWK2,DISP=SHR -/*ROUTE PRINT xxxxxx.xxxxxxx -/*ROUTE PUNCH xxxxxx.xxxxxxx -//TLDR EXEC PGM=TPFLDRCA,REGION=8M, -// PARM='OLDR,SYS=ACP,CLMSIZE=8000000' -//STEPLIB DD DSN=ACP.LINK.RLSE46.WEB,DISP=SHR -// DD DSN=ACP.LINK.RLSE40.BSS,DISP=SHR -// DD DSN=VIS0000.DEVP.TEST.LK,DISP=SHR -// DD DSN=SYS1.CEE.SCEERUN,DISP=SHR -//SALTB DD DSN=ACP.SALTBL.RLSE46.WEB,DISP=SHR -// DD DSN=ACP.SALTBL.INTG46.WEB,DISP=SHR -//OBJLIB DD DSN=FSE0000.DEVP.TEST.OB,DISP=SHR -// DD DSN=APA0000.DEVP.TEST.OB,DISP=SHR -// DD DSN=ACP.DRVE.TEST.OB,DISP=SHR -// DD DSN=ACP.OBJ.RLSE46.WEB,DISP=SHR -// DD DSN=ACP.OBJ.INTG36.DRV,DISP=SHR -// DD DSN=ACP.OBJ.INTG46.WEB,DISP=SHR -// DD DSN=ACP.OBJ.INTG40.BSS,DISP=SHR -//LOADMOD DD DSN=FSE0000.DEVP.TEST.LK,DISP=SHR -// DD DSN=APA0000.DEVP.TEST.LK,DISP=SHR -// DD DSN=CWEISS.LINK,DISP=SHR -// DD DSN=ACP.DRVE.TEST.LK,DISP=SHR -// DD DSN=ACP.LINK.RLSE46.WEB,DISP=SHR -// DD DSN=ACP.LINK.INTG98.NBS,DISP=SHR -// DD DSN=ACP.LINK.INTG46.WEB,DISP=SHR -// DD DSN=ACP.LINK.INTG36.DRV,DISP=SHR -// DD DSN=ACP.LINK.INTG40.BSS,DISP=SHR -//LOADSUM DD DSN=&&LOADSUM,DISP=(NEW,PASS),UNIT=SYSDA, -// LRECL=133,SPACE=(TRK,(10,10)),RECFM=FBA -//CPRTEMP DD UNIT=SYSDA, -// DSN=&&CPRTEMP,SPACE=(TRK,(100,20)), -// DCB=(RECFM=FB,BLKSIZE=4095,LRECL=4095), -// DISP=(NEW,DELETE) -//PROGTEMP DD UNIT=SYSDA, -// DSN=&&PRTEMP,SPACE=(TRK,(100,20)), -// DCB=(RECFM=FB,BLKSIZE=4095,LRECL=4095), -// DISP=(NEW,DELETE) -//OUTPUT DD DSN=&&VRDROUT,DISP=(NEW,PASS),UNIT=SYSDA, -// DCB=(RECFM=F,BLKSIZE=4095,LRECL=4095) -//SYSUDUMP DD DUMMY -//SYSABEND DD DUMMY -//SYSOUT DD SYSOUT=A -//SYSPRINT DD SYSOUT=A -//PRINTER DD SYSOUT=A -//CEEDUMP DD SYSOUT=A -//SYSIN DD * -SYSID=BSS -PATVERS=NONE -SALVERS=40 -LOADER LOADSET lllllll -LOADER CALL PROG ppppvv -/* -//TRANSMIT EXEC PGM=IKJEFT01, -// PARM='TRANSMIT xxxxxx.xxxxxx DDNAME(SYSTSIN) NOLOG NONOTIFY SEQ' -//SYSTSIN DD UNIT=SYSDA, -// DSN=&&VRDROUT,DISP=(OLD,DELETE) -//SYSTSPRT DD DUMMY diff --git a/os/unix/.cvsignore b/os/unix/.cvsignore deleted file mode 100644 index bbc8ba00d1..0000000000 --- a/os/unix/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -.deps -.libs -*.lo -*.la diff --git a/os/unix/Makefile.in b/os/unix/Makefile.in deleted file mode 100644 index 63596967db..0000000000 --- a/os/unix/Makefile.in +++ /dev/null @@ -1,5 +0,0 @@ - -LTLIBRARY_NAME = libos.la -LTLIBRARY_SOURCES = os-inline.c unixd.c - -include $(top_srcdir)/build/ltlib.mk diff --git a/os/unix/config.m4 b/os/unix/config.m4 deleted file mode 100644 index 688312c4a6..0000000000 --- a/os/unix/config.m4 +++ /dev/null @@ -1,7 +0,0 @@ -if test "$OS" = "unix" ; then - APACHE_TYPE_RLIM_T - - AC_CHECK_HEADERS(sys/time.h sys/resource.h) - - AC_CHECK_FUNCS(setsid killpg) -fi diff --git a/os/unix/os-inline.c b/os/unix/os-inline.c deleted file mode 100644 index c8299b58ac..0000000000 --- a/os/unix/os-inline.c +++ /dev/null @@ -1,87 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -/* - * This file contains functions which can be inlined if the compiler - * has an "inline" modifier. Because of this, this file is both a - * header file and a compilable module. - * - * Only inlineable functions should be defined in here. They must all - * include the APR_INLINE modifier. - * - * If the compiler supports inline, this file will be #included as a - * header file from os.h to create all the inline function - * definitions. APR_INLINE will be defined to whatever is required on - * function definitions to make them inline declarations. - * - * If the compiler does not support inline, this file will be compiled - * as a normal C file into libos.a (along with os.c). In this case - * APR_HAS_INLINE will be zero so we can use this to test if we are - * compiling this source file. - */ - -#include "apr.h" - -#if APR_HAS_INLINE -/* keep inlined functions private to the including file */ -static -#endif -APR_INLINE int ap_os_is_path_absolute(const char *file) -{ - return file[0] == '/'; -} diff --git a/os/unix/os.h b/os/unix/os.h deleted file mode 100644 index 267210d064..0000000000 --- a/os/unix/os.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H - -#include "apr.h" -#include "ap_config.h" - -#ifndef PLATFORM -#define PLATFORM "Unix" -#endif - -/** - * @package OS Specific Functions - */ - -/* - * This file in included in all Apache source code. It contains definitions - * of facilities available on _this_ operating system (HAVE_* macros), - * and prototypes of OS specific functions defined in os.c or os-inline.c - */ - - -#if APR_HAS_INLINE -/* Compiler supports inline, so include the inlineable functions as - * part of the header - */ - -#include "os-inline.c" - -#else - -/* Compiler does not support inline, so prototype the inlineable functions - * as normal - */ - -/** - * Is the path an absolute or relative path - * @param file The path to the file - * @return 1 if absolute, 0 otherwise - * @deffunc int ap_os_is_path_absolute(const char *file) - */ -extern int ap_os_is_path_absolute(const char *file); - -#endif - -/* Other ap_os_ routines not used by this platform */ - -/** - * Perform canonicalization on a given filename. This means that files on - * all platforms have the same format - * @param p The pool to allocate the canonical filename out of - * @param f The filename to canonicalize - * @return The new filename - * @deffunc char *ap_os_canonical_filename(apr_pool_t *p, const char *f) - */ -#define ap_os_canonical_filename(p,f) (f) - -/** - * Perform canonicalization on a given filename, except that the input case - * is preserved. - * @param p The pool to allocate the canonical filename out of - * @param f The filename to canonicalize - * @return The new filename - * @deffunc char *ap_os_case_canonical_filename(apr_pool_t *p, const char *f) - */ -#define ap_os_case_canonical_filename(p,f) (f) - -/** - * Tries to match a filename to the existing patch, and returns the pathname - * in the case that is present on the existing path. This routine also - * converts alias names to long names. - * @param p The pool to allocate out of - * @param f The file to match - * @return The matched file name with the correct case - * @deffunc char *ap_os_systemcase_filename(apr_pool_t *p, const char *f) - */ -#define ap_os_systemcase_filename(p,f) (f) - -#endif /* !APACHE_OS_H */ diff --git a/os/unix/unixd.c b/os/unix/unixd.c deleted file mode 100644 index 9cdbd7384f..0000000000 --- a/os/unix/unixd.c +++ /dev/null @@ -1,372 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "ap_config.h" -#define CORE_PRIVATE -#include "httpd.h" -#include "http_config.h" -#include "http_main.h" -#include "http_log.h" -#include "unixd.h" -#include "mpm_common.h" -#include "os.h" -#include "ap_mpm.h" -#include "apr_thread_proc.h" -#include "apr_strings.h" -#ifdef HAVE_PWD_H -#include <pwd.h> -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif -/* XXX */ -#include <sys/stat.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_GRP_H -#include <grp.h> -#endif -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif - -unixd_config_rec unixd_config; - -/* Set group privileges. - * - * Note that we use the username as set in the config files, rather than - * the lookup of to uid --- the same uid may have multiple passwd entries, - * with different sets of groups for each. - */ - -static int set_group_privs(void) -{ - if (!geteuid()) { - const char *name; - - /* Get username if passed as a uid */ - - if (unixd_config.user_name[0] == '#') { - struct passwd *ent; - uid_t uid = atoi(&unixd_config.user_name[1]); - - if ((ent = getpwuid(uid)) == NULL) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "getpwuid: couldn't determine user name from uid %u, " - "you probably need to modify the User directive", - (unsigned)uid); - return -1; - } - - name = ent->pw_name; - } - else - name = unixd_config.user_name; - -#if !defined(OS2) && !defined(TPF) - /* OS/2 and TPF don't support groups. */ - - /* - * Set the GID before initgroups(), since on some platforms - * setgid() is known to zap the group list. - */ - if (setgid(unixd_config.group_id) == -1) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "setgid: unable to set group id to Group %u", - (unsigned)unixd_config.group_id); - return -1; - } - - /* Reset `groups' attributes. */ - - if (initgroups(name, unixd_config.group_id) == -1) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "initgroups: unable to set groups for User %s " - "and Group %u", name, (unsigned)unixd_config.group_id); - return -1; - } -#endif /* !defined(OS2) && !defined(TPF) */ - } - return 0; -} - - -int unixd_setup_child(void) -{ - if (set_group_privs()) { - return -1; - } -#ifdef MPE - /* Only try to switch if we're running as MANAGER.SYS */ - if (geteuid() == 1 && unixd_config.user_id > 1) { - GETPRIVMODE(); - if (setuid(unixd_config.user_id) == -1) { - GETUSERMODE(); - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "setuid: unable to change to uid: %ld", - (long) unixd_config.user_id); - exit(1); - } - GETUSERMODE(); - } -#else - /* Only try to switch if we're running as root */ - if (!geteuid() && ( -#ifdef _OSD_POSIX - os_init_job_environment(server_conf, unixd_config.user_name, one_process) != 0 || -#endif - setuid(unixd_config.user_id) == -1)) { - ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL, - "setuid: unable to change to uid: %ld", - (long) unixd_config.user_id); - return -1; - } -#endif - return 0; -} - - -const char *unixd_set_user(cmd_parms *cmd, void *dummy, const char *arg) -{ - const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); - if (err != NULL) { - return err; - } - - unixd_config.user_name = arg; - unixd_config.user_id = ap_uname2id(arg); -#if !defined (BIG_SECURITY_HOLE) && !defined (OS2) - if (unixd_config.user_id == 0) { - return "Error:\tApache has not been designed to serve pages while\n" - "\trunning as root. There are known race conditions that\n" - "\twill allow any local user to read any file on the system.\n" - "\tIf you still desire to serve pages as root then\n" - "\tadd -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line in your\n" - "\tsrc/Configuration file and rebuild the server. It is\n" - "\tstrongly suggested that you instead modify the User\n" - "\tdirective in your httpd.conf file to list a non-root\n" - "\tuser.\n"; - } -#endif - - return NULL; -} - -const char *unixd_set_group(cmd_parms *cmd, void *dummy, const char *arg) -{ - const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); - if (err != NULL) { - return err; - } - - unixd_config.group_id = ap_gname2id(arg); - - return NULL; -} - -void unixd_pre_config(apr_pool_t *ptemp) -{ - apr_finfo_t wrapper; - - unixd_config.user_name = DEFAULT_USER; - unixd_config.user_id = ap_uname2id(DEFAULT_USER); - unixd_config.group_id = ap_gname2id(DEFAULT_GROUP); - - /* Check for suexec */ - unixd_config.suexec_enabled = 0; - if ((apr_stat(&wrapper, SUEXEC_BIN, - APR_FINFO_NORM, ptemp)) != APR_SUCCESS) { - return; - } - - /* XXX - apr_stat is incapable of checking suid bits (grumble) */ - /* if ((wrapper.filetype & S_ISUID) && wrapper.user == 0) { */ - unixd_config.suexec_enabled = 1; - /* } */ -} - - -AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, - const char *arg, const char * arg2, int type) -{ -#if (defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS)) && APR_HAVE_STRUCT_RLIMIT && APR_HAVE_GETRLIMIT - char *str; - struct rlimit *limit; - /* If your platform doesn't define rlim_t then typedef it in ap_config.h */ - rlim_t cur = 0; - rlim_t max = 0; - - *plimit = (struct rlimit *)apr_pcalloc(cmd->pool, sizeof(**plimit)); - limit = *plimit; - if ((getrlimit(type, limit)) != 0) { - *plimit = NULL; - ap_log_error(APLOG_MARK, APLOG_ERR, errno, cmd->server, - "%s: getrlimit failed", cmd->cmd->name); - return; - } - - if ((str = ap_getword_conf(cmd->pool, &arg))) { - if (!strcasecmp(str, "max")) { - cur = limit->rlim_max; - } - else { - cur = atol(str); - } - } - else { - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, cmd->server, - "Invalid parameters for %s", cmd->cmd->name); - return; - } - - if (arg2 && (str = ap_getword_conf(cmd->pool, &arg2))) { - max = atol(str); - } - - /* if we aren't running as root, cannot increase max */ - if (geteuid()) { - limit->rlim_cur = cur; - if (max) { - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, cmd->server, - "Must be uid 0 to raise maximum %s", cmd->cmd->name); - } - } - else { - if (cur) { - limit->rlim_cur = cur; - } - if (max) { - limit->rlim_max = max; - } - } -#else - - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, cmd->server, - "Platform does not support rlimit for %s", cmd->cmd->name); -#endif -} - -APR_HOOK_STRUCT( - APR_HOOK_LINK(get_suexec_identity) -) - -AP_IMPLEMENT_HOOK_RUN_FIRST(ap_unix_identity_t *, get_suexec_identity, - (const request_rec *r), (r), NULL) - -static apr_status_t ap_unix_create_privileged_process( - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, ap_unix_identity_t *ugid, - apr_pool_t *p) -{ - int i = 0; - const char **newargs; - char *newprogname; - char *execuser, *execgroup; - - if (!unixd_config.suexec_enabled) { - return apr_proc_create(newproc, progname, args, env, attr, p); - } - - execuser = apr_psprintf(p, "%ld", (long) ugid->uid); - execgroup = apr_psprintf(p, "%ld", (long) ugid->gid); - - if (!execuser || !execgroup) { - return APR_ENOMEM; - } - - i = 0; - if (args) { - while (args[i]) { - i++; - } - } - newargs = apr_palloc(p, sizeof(char *) * (i + 4)); - newprogname = SUEXEC_BIN; - newargs[0] = SUEXEC_BIN; - newargs[1] = execuser; - newargs[2] = execgroup; - newargs[3] = apr_pstrdup(p, progname); - - i = 0; - do { - newargs[i + 4] = args[i]; - } while (args[i++]); - - return apr_proc_create(newproc, newprogname, newargs, env, attr, p); -} - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - ap_unix_identity_t *ugid = ap_run_get_suexec_identity(r); - - if (ugid == NULL) { - return apr_proc_create(newproc, progname, args, env, attr, p); - } - - return ap_unix_create_privileged_process(newproc, progname, args, env, - attr, ugid, p); -} - diff --git a/os/unix/unixd.h b/os/unix/unixd.h deleted file mode 100644 index e943b38912..0000000000 --- a/os/unix/unixd.h +++ /dev/null @@ -1,127 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef UNIXD_H -#define UNIXD_H - -#include "httpd.h" -#include "http_config.h" -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif -#include "apr_hooks.h" -#include "apr_thread_proc.h" - -#include <pwd.h> -#include <grp.h> -#include <sys/types.h> - -typedef struct { - uid_t uid; - gid_t gid; -} ap_unix_identity_t; - -AP_DECLARE_HOOK(ap_unix_identity_t *, get_suexec_identity,(const request_rec *r) -) - -/* common stuff that unix MPMs will want */ - -/* Default user name and group name. These may be specified as numbers by - * placing a # before a number */ - -#ifndef DEFAULT_USER -#define DEFAULT_USER "#-1" -#endif -#ifndef DEFAULT_GROUP -#define DEFAULT_GROUP "#-1" -#endif - -typedef struct { - const char *user_name; - uid_t user_id; - gid_t group_id; - int suexec_enabled; -} unixd_config_rec; -extern unixd_config_rec unixd_config; - -int unixd_setup_child(void); -void unixd_pre_config(apr_pool_t *ptemp); -const char *unixd_set_user(cmd_parms *cmd, void *dummy, const char *arg); -const char *unixd_set_group(cmd_parms *cmd, void *dummy, const char *arg); -#if defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) -AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, - const char *arg, const char * arg2, int type); -#endif - - -#ifdef HAVE_KILLPG -#define unixd_killpg(x, y) (killpg ((x), (y))) -#else /* HAVE_KILLPG */ -#define unixd_killpg(x, y) (kill (-(x), (y))) -#endif /* HAVE_KILLPG */ - -#define UNIX_DAEMON_COMMANDS \ -AP_INIT_TAKE1("User", unixd_set_user, NULL, RSRC_CONF, \ - "Effective user id for this server"), \ -AP_INIT_TAKE1("Group", unixd_set_group, NULL, RSRC_CONF, \ - "Effective group id for this server"), - -#endif diff --git a/os/win32/.cvsignore b/os/win32/.cvsignore deleted file mode 100644 index 97bcd09a59..0000000000 --- a/os/win32/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -*.mdp -*.ncb -*.opt -*.plg -*.dsw -*.mak -mod_*D -mod_*R diff --git a/os/win32/BaseAddr.ref b/os/win32/BaseAddr.ref deleted file mode 100644 index 83b556a10a..0000000000 --- a/os/win32/BaseAddr.ref +++ /dev/null @@ -1,26 +0,0 @@ -; os/win32/BaseAddr.ref contains the central repository -; of all module base addresses -; to avoid relocation - -; WARNING: Update this file by reviewing the image size -; of the debug-generated dll files; release images -; should fit in the larger debug-sized space. - -; module name base-address max-size - -libhttpd 0x6FF00000 0x000A0000 -mod_auth_anon 0x6FEF0000 0x00010000 -mod_auth_digest 0x6FED0000 0x00020000 -mod_cern_meta 0x6FEC0000 0x00010000 -mod_expires 0x6FEB0000 0x00010000 -mod_headers 0x6FEA0000 0x00010000 -mod_info 0x6FE90000 0x00010000 -mod_rewrite 0x6FE70000 0x00020000 -mod_speling 0x6FE60000 0x00010000 -mod_status 0x6FE50000 0x00010000 -mod_usertrack 0x6FE40000 0x00010000 -mod_proxy 0x6FE20000 0x00020000 -mod_file_cache 0x6FE00000 0x00020000 -mod_auth_dbm 0x6FDF0000 0x00010000 -mod_dav_fs 0x6FDE0000 0x00010000 -mod_dav 0x6FDC0000 0x00020000 diff --git a/os/win32/apache.ico b/os/win32/apache.ico Binary files differdeleted file mode 100644 index 5e8adcbfc5..0000000000 --- a/os/win32/apache.ico +++ /dev/null diff --git a/os/win32/apache.rc b/os/win32/apache.rc deleted file mode 100644 index d1105fe554..0000000000 --- a/os/win32/apache.rc +++ /dev/null @@ -1,78 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winresrc.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -101 ICON DISCARDABLE "apache.ico" -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winresrc.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/os/win32/modules.c b/os/win32/modules.c deleted file mode 100644 index f37583dea2..0000000000 --- a/os/win32/modules.c +++ /dev/null @@ -1,79 +0,0 @@ -/* modules.c --- major modules compiled into Apache for Win32. - * Only insert an entry for a module if it must be compiled into - * the core server - */ - -#define CORE_PRIVATE -#include "httpd.h" -#include "http_config.h" - -extern module core_module; -extern module mpm_winnt_module; -extern module http_module; -extern module so_module; -extern module mime_module; -extern module access_module; -extern module auth_module; -extern module negotiation_module; -extern module include_module; -extern module autoindex_module; -extern module dir_module; -extern module cgi_module; -extern module userdir_module; -extern module alias_module; -extern module env_module; -extern module log_config_module; -extern module asis_module; -extern module imap_module; -extern module actions_module; -extern module setenvif_module; -extern module isapi_module; - -AP_DECLARE_DATA module *ap_prelinked_modules[] = { - &core_module, - &mpm_winnt_module, - &http_module, - &so_module, - &mime_module, - &access_module, - &auth_module, - &negotiation_module, - &include_module, - &autoindex_module, - &dir_module, - &cgi_module, - &userdir_module, - &alias_module, - &env_module, - &log_config_module, - &asis_module, - &imap_module, - &actions_module, - &setenvif_module, - &isapi_module, - NULL -}; -AP_DECLARE_DATA module *ap_preloaded_modules[] = { - &core_module, - &mpm_winnt_module, - &http_module, - &so_module, - &mime_module, - &access_module, - &auth_module, - &negotiation_module, - &include_module, - &autoindex_module, - &dir_module, - &cgi_module, - &userdir_module, - &alias_module, - &env_module, - &log_config_module, - &asis_module, - &imap_module, - &actions_module, - &setenvif_module, - &isapi_module, - NULL -}; diff --git a/os/win32/os.h b/os/win32/os.h deleted file mode 100644 index 560c5963f2..0000000000 --- a/os/win32/os.h +++ /dev/null @@ -1,129 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#ifndef APACHE_OS_H -#define APACHE_OS_H -/* - * Compile the server including all the Windows NT 4.0 header files by - * default. We still want the server to run on Win95/98 so use - * runtime checks before calling NT specific functions to verify we are - * really running on an NT system. - * - * Delegate windows include to the apr.h header, if USER or GDI declarations - * are required (for a window rather than console application), include - * windows.h prior to any other Apache header files. - */ - -#ifndef _WIN32 -#define _WIN32 -#endif - -#include "apr_general.h" -#include <process.h> -#include <malloc.h> -#include <io.h> -#include <fcntl.h> - -#define PLATFORM "Win32" - -#define APACHE_MPM_DIR "modules/mpm/winnt" /* generated on unix */ - -/* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for - chdir() */ -#include <direct.h> - -#define CASE_BLIND_FILESYSTEM -#define NO_WRITEV -#define HAVE_CANONICAL_FILENAME -#define HAVE_DRIVE_LETTERS -#define HAVE_UNC_PATHS - -typedef int uid_t; -typedef int gid_t; -typedef int pid_t; -typedef int mode_t; -typedef char * caddr_t; - -#define S_ISLNK(m) (0) -#define S_ISREG(m) ((m & _S_IFREG) == _S_IFREG) -#ifndef S_ISDIR -#define S_ISDIR(m) (((m) & S_IFDIR) == S_IFDIR) -#endif - -#define JMP_BUF jmp_buf -#define O_CREAT _O_CREAT -#define O_RDWR _O_RDWR - -#include <stddef.h> - -__inline int ap_os_is_path_absolute(const char *file) -{ - /* For now, just do the same check that http_request.c and mod_alias.c do. - * XXX: Accept /bleh still? Or do we concur that d:/bleh is a minimum - * requirement? If so, canonical name needs to convert to drive/path - * syntax, and the test becomes (file[0] == '/' && file[1] == '/') ||... - */ - return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/')); -} - -/* OS-dependent filename routines in util_win32.c */ -AP_DECLARE(char *) ap_os_canonical_filename(apr_pool_t *p, const char *file); -AP_DECLARE(char *) ap_os_case_canonical_filename(apr_pool_t *pPool, const char *szFile); -AP_DECLARE(char *) ap_os_systemcase_filename(apr_pool_t *pPool, const char *szFile); - -#endif /* ! APACHE_OS_H */ diff --git a/os/win32/util_win32.c b/os/win32/util_win32.c deleted file mode 100644 index 8923db001b..0000000000 --- a/os/win32/util_win32.c +++ /dev/null @@ -1,514 +0,0 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000-2001 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -#include "httpd.h" -#include "http_log.h" -#include "apr_strings.h" - -#include <stdarg.h> -#include <time.h> -#include <stdlib.h> - -/* Returns TRUE if the input string is a string - * of one or more '.' characters. - */ -static BOOL OnlyDots(char *pString) -{ - char *c; - - if (*pString == '\0') - return FALSE; - - for (c = pString;*c;c++) - if (*c != '.') - return FALSE; - - return TRUE; -} - -/* Accepts as input a pathname, and tries to match it to an - * existing path and return the pathname in the case that - * is present on the existing path. This routine also - * converts alias names to long names. - */ -AP_DECLARE(char *) ap_os_systemcase_filename(apr_pool_t *pPool, - const char *szFile) -{ - char buf[HUGE_STRING_LEN]; - char *pInputName; - char *p, *q, *t; - BOOL bDone = FALSE; - BOOL bFileExists = TRUE; - - if (!szFile || strlen(szFile) == 0 || strlen(szFile) >= sizeof(buf)) - return apr_pstrdup(pPool, ""); - - t = buf; - pInputName = apr_pstrdup(pPool, szFile); - - /* First convert all slashes to \ so Win32 calls work OK */ - for (p = pInputName; *p; p++) { - if (*p == '/') - *p = '\\'; - } - - q = p = pInputName; - /* If there is drive information, copy it over. */ - if (pInputName[1] == ':') { - /* This is correct - if systemcase is used for - * comparison, d: designations will match - */ - *(t++) = tolower(*p++); - *(t++) = *p++; - q = p; - - /* If all we have is a drive letter, then we are done */ - if (!*p) - bDone = TRUE; - - q = p; - } - - if (*p == '\\') { - ++p; - if (*p == '\\') /* UNC name */ - { - p++; - /* Get past the machine name. FindFirstFile - * will not find a machine name only - */ - *(t++) = '\\'; - ++q; - p = strchr(p + 1, '\\'); - if (p) - { - p++; - /* Get past the share name. FindFirstFile */ - /* will not find a \\machine\share name only */ - p = strchr(p, '\\'); - if (p) { - /* This was faulty - as of 1.3.13 \\machine\share - * name is now always lowercased - */ - strncpy(t,q,p-q); - strlwr(t); - t += p - q; - q = p; - p++; - } - } - - if (!p) { - bFileExists = FALSE; - p = q; - } - } - } - - p = strchr(p, '\\'); - - while (!bDone) { - if (p) - *p = '\0'; - - if (strchr(q, '*') || strchr(q, '?')) - bFileExists = FALSE; - - /* If the path exists so far, call FindFirstFile - * again. However, if this portion of the path contains - * only '.' charaters, skip the call to FindFirstFile - * since it will convert '.' and '..' to actual names. - * Note: in the call to OnlyDots, we may have to skip - * a leading slash. - */ - if (bFileExists && !OnlyDots((*q == '.' ? q : q+1))) { - apr_finfo_t fs; - if (apr_stat(&fs, pInputName, APR_FINFO_NAME, pPool) != APR_SUCCESS) { - bFileExists = FALSE; - } - else { - if (*q == '\\') - *(t++) = '\\'; - t = strchr(strcpy(t, fs.name), '\0'); - } - } - - if (!bFileExists || OnlyDots((*q == '.' ? q : q+1))) { - /* XXX: Comparison could be faulty ...\unknown - * names may not be tested (if they reside outside - * of the file system)! - */ - strcpy(t, q); - t = strchr(t, '\0'); - } - - if (p) { - q = p; - *p++ = '\\'; - p = strchr(p, '\\'); - } - else { - bDone = TRUE; - } - } - *t = '\0'; - - /* Finally, convert all slashes to / so server code handles it ok */ - - for (p = buf; *p; p++) { - if (*p == '\\') - *p = '/'; - } - - return apr_pstrdup(pPool, buf); -} - - -/* Perform canonicalization with the exception that the - * input case is preserved. - */ -AP_DECLARE(char *) ap_os_case_canonical_filename(apr_pool_t *pPool, - const char *szFile) -{ - char *pNewStr; - char *s; - char *p; - char *q; - - if (szFile == NULL || strlen(szFile) == 0) - return apr_pstrdup(pPool, ""); - - pNewStr = apr_pstrdup(pPool, szFile); - - /* Change all '\' characters to '/' characters. - * While doing this, remove any trailing '.'. - * Also, blow away any directories with 3 or - * more '.' - */ - for (p = pNewStr,s = pNewStr; *s; s++,p++) { - if (*s == '\\' || *s == '/') { - - q = p; - while (p > pNewStr && *(p-1) == '.') - p--; - - if (p == pNewStr && q-p <= 2 && *p == '.') - p = q; - else if (p > pNewStr && p < q && *(p-1) == '/') { - if (q-p > 2) - p--; - else - p = q; - } - - *p = '/'; - } - else { - *p = *s; - } - } - *p = '\0'; - - /* Blow away any final trailing '.' since on Win32 - * foo.bat == foo.bat. == foo.bat... etc. - * Also blow away any trailing spaces since - * "filename" == "filename " - */ - q = p; - while (p > pNewStr && (*(p-1) == '.' || *(p-1) == ' ')) - p--; - if ((p > pNewStr) || - (p == pNewStr && q-p > 2)) - *p = '\0'; - - - /* One more security issue to deal with. Win32 allows - * you to create long filenames. However, alias filenames - * are always created so that the filename will - * conform to 8.3 rules. According to the Microsoft - * Developer's network CD (1/98) - * "Automatically generated aliases are composed of the - * first six characters of the filename plus ~n - * (where n is a number) and the first three characters - * after the last period." - * Here, we attempt to detect and decode these names. - * - * XXX: Netware network clients may have alternate short names, - * simply truncated, with no embedded '~'. Further, this behavior - * can be modified on WinNT volumes. This was not a safe test, - * therefore exclude the '~' pretest. - */ -#ifdef WIN32_SHORT_FILENAME_INSECURE_BEHAVIOR - p = strchr(pNewStr, '~'); - if (p != NULL) -#endif - { - char *pConvertedName, *pQstr, *pPstr; - char buf[HUGE_STRING_LEN]; - /* We potentially have a short name. Call - * ap_os_systemcase_filename to examine the filesystem - * and possibly extract the long name. - */ - pConvertedName = ap_os_systemcase_filename(pPool, pNewStr); - - /* Since we want to preserve the incoming case as much - * as we can, compare for differences in the string and - * only substitute in the path names that changed. - */ - if (stricmp(pNewStr, pConvertedName)) { - buf[0] = '\0'; - - q = pQstr = pConvertedName; - p = pPstr = pNewStr; - do { - q = strchr(q,'/'); - p = strchr(p,'/'); - - if (p != NULL) { - *q = '\0'; - *p = '\0'; - } - - if (stricmp(pQstr, pPstr)) - strcat(buf, pQstr); /* Converted name */ - else - strcat(buf, pPstr); /* Original name */ - - - if (p != NULL) { - pQstr = q; - pPstr = p; - *q++ = '/'; - *p++ = '/'; - } - - } while (p != NULL); - - pNewStr = apr_pstrdup(pPool, buf); - } - } - - return pNewStr; -} - -/* Perform complete canonicalization. - */ -AP_DECLARE(char *) ap_os_canonical_filename(apr_pool_t *pPool, const char *szFile) -{ - char *pNewName; - pNewName = ap_os_case_canonical_filename(pPool, szFile); - strlwr(pNewName); - return pNewName; -} - -#ifdef NEVER_SINCE_THESE_TESTS_ARE_MOVING -/* - * XXX we will no longer use this redunant parsing function, it's - * logic moves off into the canonical filename processing and the - * apr file handling functions. Left for today till it's finished. - * - * ap_os_is_filename_valid is given a filename, and returns 0 if the filename - * is not valid for use on this system. On Windows, this means it fails any - * of the tests below. Otherwise returns 1. - * - * Test for filename validity on Win32. This is of tests come in part from - * the MSDN article at "Technical Articles, Windows Platform, Base Services, - * Guidelines, Making Room for Long Filenames" although the information - * in MSDN about filename testing is incomplete or conflicting. There is a - * similar set of tests in "Technical Articles, Windows Platform, Base Services, - * Guidelines, Moving Unix Applications to Windows NT". - * - * The tests are: - * - * 1) total path length greater than MAX_PATH - * - * 2) anything using the octets 0-31 or characters " < > | : - * (these are reserved for Windows use in filenames. In addition - * each file system has its own additional characters that are - * invalid. See KB article Q100108 for more details). - * - * 3) anything ending in "." (no matter how many) - * (filename doc, doc. and doc... all refer to the same file) - * - * 4) any segment in which the basename (before first period) matches - * one of the DOS device names - * (the list comes from KB article Q100108 although additional - * names such as "COM5" are also special devices). - * - * If the path fails ANY of these tests, the result must be to deny access. - */ - -AP_DECLARE(int) ap_os_is_filename_valid(const char *file) -{ - const char *segstart; - unsigned int seglength; - const char *pos; - static const char * const invalid_characters = "?\"<>*|:"; - static const char * const invalid_filenames[] = { - "CON", "AUX", "COM1", "COM2", "COM3", - "COM4", "LPT1", "LPT2", "LPT3", "PRN", "NUL", NULL - }; - - /* Test 1 */ - if (strlen(file) >= MAX_PATH) { - /* Path too long for Windows. Note that this test is not valid - * if the path starts with //?/ or \\?\. */ - return 0; - } - - pos = file; - - /* Skip any leading non-path components. This can be either a - * drive letter such as C:, or a UNC path such as \\SERVER\SHARE\. - * We continue and check the rest of the path based on the rules above. - * This means we could eliminate valid filenames from servers which - * are not running NT (such as Samba). - */ - - if (pos[0] && pos[1] == ':') { - /* Skip leading drive letter */ - pos += 2; - } - else { - if ((pos[0] == '\\' || pos[0] == '/') && - (pos[1] == '\\' || pos[1] == '/')) { - /* Is a UNC, so skip the server name and share name */ - pos += 2; - while (*pos && *pos != '/' && *pos != '\\') - pos++; - if (!*pos) { - /* No share name */ - return 0; - } - pos++; /* Move to start of share name */ - while (*pos && *pos != '/' && *pos != '\\') - pos++; - if (!*pos) { - /* No path information */ - return 0; - } - } - } - - while (*pos) { - unsigned int idx; - unsigned int baselength; - - while (*pos == '/' || *pos == '\\') { - pos++; - } - if (*pos == '\0') { - break; - } - segstart = pos; /* start of segment */ - while (*pos && *pos != '/' && *pos != '\\') { - pos++; - } - seglength = pos - segstart; - /* - * Now we have a segment of the path, starting at position "segstart" - * and length "seglength" - */ - - /* Test 2 */ - for (idx = 0; idx < seglength; idx++) { - if ((segstart[idx] > 0 && segstart[idx] < 32) || - strchr(invalid_characters, segstart[idx])) { - return 0; - } - } - - /* Test 3 */ - if (segstart[seglength-1] == '.') { - return 0; - } - - /* Test 4 */ - for (baselength = 0; baselength < seglength; baselength++) { - if (segstart[baselength] == '.') { - break; - } - } - - /* baselength is the number of characters in the base path of - * the segment (which could be the same as the whole segment length, - * if it does not include any dot characters). */ - if (baselength == 3 || baselength == 4) { - for (idx = 0; invalid_filenames[idx]; idx++) { - if (strlen(invalid_filenames[idx]) == baselength && - !strnicmp(invalid_filenames[idx], segstart, baselength)) { - return 0; - } - } - } - } - - return 1; -} -#endif - -AP_DECLARE(apr_status_t) ap_os_create_privileged_process( - const request_rec *r, - apr_proc_t *newproc, const char *progname, - const char * const *args, - const char * const *env, - apr_procattr_t *attr, apr_pool_t *p) -{ - return apr_proc_create(newproc, progname, args, env, attr, p); -} - |