util_script.c revision d081979209689f7816b4520b0e0fe093566a9b7f
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder/* ====================================================================
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * The Apache Software License, Version 1.1
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * Redistribution and use in source and binary forms, with or without
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * modification, are permitted provided that the following conditions
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * 1. Redistributions of source code must retain the above copyright
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * notice, this list of conditions and the following disclaimer.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * 2. Redistributions in binary form must reproduce the above copyright
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * notice, this list of conditions and the following disclaimer in
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * the documentation and/or other materials provided with the
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * distribution.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * 3. The end-user documentation included with the redistribution,
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * if any, must include the following acknowledgment:
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * "This product includes software developed by the
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * Apache Software Foundation (http://www.apache.org/)."
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * Alternately, this acknowledgment may appear in the software itself,
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * if and wherever such third-party acknowledgments normally appear.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * 4. The names "Apache" and "Apache Software Foundation" must
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * not be used to endorse or promote products derived from this
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * software without prior written permission. For written
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * permission, please contact apache@apache.org.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * 5. Products derived from this software may not be called "Apache",
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * nor may "Apache" appear in their name, without prior written
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * permission of the Apache Software Foundation.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * ====================================================================
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * This software consists of voluntary contributions made by many
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * individuals on behalf of the Apache Software Foundation. For more
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * information on the Apache Software Foundation, please see
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * Portions of this software are based upon public domain software
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * originally written at the National Center for Supercomputing Applications,
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * University of Illinois, Urbana-Champaign.
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include <stdlib.h>
#define CORE_PRIVATE
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_main.h"
#include "http_log.h"
#include "http_core.h"
#include "http_protocol.h"
#include "util_script.h"
#include "util_ebcdic.h"
#ifdef OS2
#define INCL_DOS
#include <os2.h>
if (!apr_isalnum(c)) {
*cp = 0;
return res;
char *tz;
char *whack;
++whack;
return env;
apr_table_t *e;
const char *rem_logname;
char *env_path;
char *env_temp;
const char *host;
#ifndef SECURITY_HOLE_PASS_AUTHORIZATION
#ifdef WIN32
#ifdef OS2
#ifdef BEOS
if (host) {
if (r->user) {
if (r->ap_auth_type) {
if (rem_logname) {
if (r->prev) {
lu = 0;
lu++;
return lu;
NULL);
NULL);
#ifdef WIN32
int (*getsfunc) (char *, int, void *),
void *getsfunc_data)
char x[MAX_STRING_LEN];
if (buffer) {
return HTTP_INTERNAL_SERVER_ERROR;
p = strlen(w);
return cond_status;
++maybeEBCDIC;
++maybeASCII;
r->filename);
if (!buffer) {
return HTTP_INTERNAL_SERVER_ERROR;
while (*l && apr_isspace(*l)) {
char *tmp;
return OK;
char *buffer)
struct vastrs {
int arg;
const char *curpos;
if (t > len)
t = len;
char *buffer,
const char **termch,
int *termarg, ...)
int res;
if (termch)
if (termarg)
return res;