You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Mark Cox <mj...@hyperreal.com> on 1996/04/09 10:18:44 UTC

cvs commit: apache/src scoreboard.h mod_status.c mod_auth_dbm.c http_main.c Configuration.tmpl CHANGES

mjc         96/04/09 01:18:43

  Modified:    src       scoreboard.h mod_status.c mod_auth_dbm.c
                        http_main.c  Configuration.tmpl CHANGES
  Log:
  Change define "STATUS_INSTRUMENTATION" to "STATUS" and make module
  included in Configuration.
  
  Revision  Changes    Path
  1.8       +1 -1      apache/src/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/scoreboard.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -C3 -r1.7 -r1.8
  *** scoreboard.h	1996/04/06 20:45:08	1.7
  --- scoreboard.h	1996/04/09 08:18:37	1.8
  ***************
  *** 72,78 ****
    typedef struct {
        pid_t pid;
        char status;
  ! #if defined(STATUS_INSTRUMENTATION)
        unsigned long access_count;
        unsigned long bytes_served;
        unsigned long my_access_count;
  --- 72,78 ----
    typedef struct {
        pid_t pid;
        char status;
  ! #if defined(STATUS)
        unsigned long access_count;
        unsigned long bytes_served;
        unsigned long my_access_count;
  
  
  
  1.11      +1 -1      apache/src/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_status.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -C3 -r1.10 -r1.11
  *** mod_status.c	1996/04/06 20:45:08	1.10
  --- mod_status.c	1996/04/09 08:18:37	1.11
  ***************
  *** 218,224 ****
            sprintf(buffer,"\n%d requests currently being processed,\n %d idle servers\n",busy,ready);
        rputs(buffer,r);
    
  ! #ifdef STATUS_INSTRUMENTATION
        if (!short_report)
          rputs("<hr><h2>Server Details</h2>",r);
        for (i = 0; i<HARD_SERVER_MAX; ++i) {
  --- 218,224 ----
            sprintf(buffer,"\n%d requests currently being processed,\n %d idle servers\n",busy,ready);
        rputs(buffer,r);
    
  ! #if defined(STATUS)
        if (!short_report)
          rputs("<hr><h2>Server Details</h2>",r);
        for (i = 0; i<HARD_SERVER_MAX; ++i) {
  
  
  
  1.3       +63 -65    apache/src/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_auth_dbm.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -C3 -r1.2 -r1.3
  *** mod_auth_dbm.c	1996/02/22 11:46:56	1.2
  --- mod_auth_dbm.c	1996/04/09 08:18:38	1.3
  ***************
  *** 1,57 ****
    
  ! /* ====================================================================
  !  * Copyright (c) 1995 The Apache Group.  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. All advertising materials mentioning features or use of this
  !  *    software must display the following acknowledgment:
  !  *    "This product includes software developed by the Apache Group
  !  *    for use in the Apache HTTP server project (http://www.apache.org/)."
     *
  !  * 4. The names "Apache Server" and "Apache Group" must not be used to
  !  *    endorse or promote products derived from this software without
  !  *    prior written permission.
     *
  !  * 5. Redistributions of any form whatsoever must retain the following
  !  *    acknowledgment:
  !  *    "This product includes software developed by the Apache Group
  !  *    for use in the Apache HTTP server project (http://www.apache.org/)."
     *
  !  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``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 GROUP 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 Group and was originally based
  -  * on public domain software written at the National Center for
  -  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  -  * For more information on the Apache Group and the Apache HTTP server
  -  * project, please see <http://www.apache.org/>.
     *
     */
    
    
    /*
     * http_auth: authentication
     * 
  --- 1,64 ----
    
  ! /*-
  !  * Copyright (c) 1995 The Apache Group. All rights reserved.
  !  * 
     *
  !  * Apache httpd license
  !  * ====================
  !  * 
     *
  !  * This is the license for the Apache Server. It covers all the
  !  * files which come in this distribution, and should never be removed.
  !  * 
  !  * The "Apache Group" has based this server, called "Apache", on
  !  * public domain code distributed under the name "NCSA httpd 1.3".
  !  * 
  !  * NCSA httpd 1.3 was placed in the public domain by the National Center 
  !  * for Supercomputing Applications at the University of Illinois 
  !  * at Urbana-Champaign.
  !  * 
  !  * As requested by NCSA we acknowledge,
  !  * 
  !  *  "Portions developed at the National Center for Supercomputing
  !  *   Applications at the University of Illinois at Urbana-Champaign."
     *
  !  * Copyright on the sections of code added by the "Apache Group" belong
  !  * to the "Apache Group" and/or the original authors. The "Apache Group" and
  !  * authors hereby grant permission for their code, along with the
  !  * public domain NCSA code, to be distributed under the "Apache" name.
  !  * 
  !  * Reuse of "Apache Group" code outside of the Apache distribution should
  !  * be acknowledged with the following quoted text, to be included with any new
  !  * work;
  !  * 
  !  * "Portions developed by the "Apache Group", taken with permission 
  !  *  from the Apache Server   http://www.apache.org/apache/   "
     *
     *
  +  * Permission is hereby granted to anyone to redistribute Apache under
  +  * the "Apache" name. We do not grant permission for the resale of Apache, but
  +  * we do grant permission for vendors to bundle Apache free with other software,
  +  * or to charge a reasonable price for redistribution, provided it is made
  +  * clear that Apache is free. Permission is also granted for vendors to 
  +  * sell support for Apache. We explicitly forbid the redistribution of 
  +  * Apache under any other name.
  +  * 
  +  * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND
  +  * ANY EXPRESS 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 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.
  +  * 
     */
    
    
  + 
    /*
     * http_auth: authentication
     * 
  ***************
  *** 116,143 ****
        return pw; 
    }
    
  - /* We do something strange with the group file.  If the group file
  -  * contains any : we assume the format is
  -  *      key=username value=":"groupname [":"anything here is ignored]
  -  * otherwise we now (0.8.14+) assume that the format is
  -  *      key=username value=groupname
  -  * The first allows the password and group files to be the same 
  -  * physical DBM file;   key=username value=password":"groupname[":"anything]
  -  *
  -  * mark@telescope.org, 22Sep95
  -  */
  - 
    char  *get_dbm_grp(request_rec *r, char *user, char *auth_dbmgrpfile) {
        char *grp_data = get_dbm_pw (r, user, auth_dbmgrpfile);
  !     char *grp_colon; char *grp_colon2;
    
        if (grp_data == NULL) return NULL;
        
  !     if ((grp_colon = strchr(grp_data, ':'))!=NULL) {
  !         grp_colon2 = strchr(++grp_colon, ':');
  !         if (grp_colon2) *grp_colon2='\0';
  !         return grp_colon;
  !     }
        return grp_data;
    }
    
  --- 123,138 ----
        return pw; 
    }
    
    char  *get_dbm_grp(request_rec *r, char *user, char *auth_dbmgrpfile) {
        char *grp_data = get_dbm_pw (r, user, auth_dbmgrpfile);
  !     char *grp_colon;
    
        if (grp_data == NULL) return NULL;
        
  !     grp_data = strchr(grp_data, ':');
  !     if (grp_data) ++grp_data;
  !     grp_colon = strchr(grp_data, ':');
  !     if (grp_colon) *grp_colon='\0';
        return grp_data;
    }
    
  ***************
  *** 166,171 ****
  --- 161,167 ----
        /* Password is up to first : if exists */
        colon_pw = strchr(real_pw,':');
        if (colon_pw) *colon_pw='\0';   
  + /* MJC */
        /* anyone know where the prototype for crypt is? */
        if(strcmp(real_pw,(char *)crypt(sent_pw,real_pw))) {
            sprintf(errstr,"user %s: password mismatch",c->user);
  ***************
  *** 173,178 ****
  --- 169,178 ----
    	note_basic_auth_failure (r);
    	return AUTH_REQUIRED;
        }
  +     if (*(colon_pw+1)) {
  + 	table_set(r->headers_in,"AUTH_DATA",colon_pw+1);
  + 	table_set(r->subprocess_env,"AUTH_DATA",colon_pw+1);
  +     }
        return OK;
    }
        
  ***************
  *** 203,209 ****
            w = getword(r->pool, &t, ' ');
    	
            if(!strcmp(w,"group") && sec->auth_dbmgrpfile) {
  !            char *orig_groups,*groups,*v;
    
               if (!(groups = get_dbm_grp(r, user, sec->auth_dbmgrpfile))) {
                   sprintf(errstr,"user %s not in DBM group file %s",
  --- 203,209 ----
            w = getword(r->pool, &t, ' ');
    	
            if(!strcmp(w,"group") && sec->auth_dbmgrpfile) {
  !            char *groups,*v;
    
               if (!(groups = get_dbm_grp(r, user, sec->auth_dbmgrpfile))) {
                   sprintf(errstr,"user %s not in DBM group file %s",
  ***************
  *** 212,221 ****
    	       note_basic_auth_failure (r);
    	       return AUTH_REQUIRED;
               }
  -            orig_groups = groups;
               while(t[0]) {
                   w = getword(r->pool, &t, ' ');
  -                groups = orig_groups;
                   while(groups[0]) {
                       v = getword(r->pool, &groups,',');
                       if(!strcmp(v,w))
  --- 212,219 ----
  
  
  
  1.21      +4 -4      apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -C3 -r1.20 -r1.21
  *** http_main.c	1996/04/06 20:45:07	1.20
  --- http_main.c	1996/04/09 08:18:38	1.21
  ***************
  *** 664,670 ****
        new_score_rec.pid = getpid();
        new_score_rec.status = status;
    
  ! #if defined(STATUS_INSTRUMENTATION)
        new_score_rec.last_used=time(NULL);
        if (status == SERVER_DEAD) {
    	/*
  --- 664,670 ----
        new_score_rec.pid = getpid();
        new_score_rec.status = status;
    
  ! #if defined(STATUS)
        new_score_rec.last_used=time(NULL);
        if (status == SERVER_DEAD) {
    	/*
  ***************
  *** 712,718 ****
        return (scoreboard_image[i]);
    }
    
  ! #if defined(STATUS_INSTRUMENTATION)
    void increment_counts (int child_num, request_rec *r)
    {
        long int bs=0;
  --- 712,718 ----
        return (scoreboard_image[i]);
    }
    
  ! #if defined(STATUS)
    void increment_counts (int child_num, request_rec *r)
    {
        long int bs=0;
  ***************
  *** 1175,1181 ****
    	update_child_status (child_num, SERVER_BUSY_WRITE, r);
    	if (r) process_request (r); /* else premature EOF --- ignore */
    
  ! #if defined(STATUS_INSTRUMENTATION)
            if (r) increment_counts(child_num,r);
    #endif
    	while (r && current_conn->keepalive) {
  --- 1175,1181 ----
    	update_child_status (child_num, SERVER_BUSY_WRITE, r);
    	if (r) process_request (r); /* else premature EOF --- ignore */
    
  ! #if defined(STATUS)
            if (r) increment_counts(child_num,r);
    #endif
    	while (r && current_conn->keepalive) {
  ***************
  *** 1186,1192 ****
    	  update_child_status (child_num, SERVER_BUSY_WRITE, r);
    	  if (r) process_request (r);
    
  ! #if defined(STATUS_INSTRUMENTATION)
    	  if (r) increment_counts(child_num,r);
    #endif
    	}
  --- 1186,1192 ----
    	  update_child_status (child_num, SERVER_BUSY_WRITE, r);
    	  if (r) process_request (r);
    
  ! #if defined(STATUS)
    	  if (r) increment_counts(child_num,r);
    #endif
    	}
  
  
  
  1.11      +9 -6      apache/src/Configuration.tmpl
  
  Index: Configuration.tmpl
  ===================================================================
  RCS file: /export/home/cvs/apache/src/Configuration.tmpl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -C3 -r1.10 -r1.11
  *** Configuration.tmpl	1996/04/05 09:39:15	1.10
  --- Configuration.tmpl	1996/04/09 08:18:39	1.11
  ***************
  *** 45,51 ****
    #  In order for the status module to obtain full statistics Apache must
    #  be modified to keep track of various information.  This is not
    #  turned on by default.
  ! # In order to enable full status details add -DSTATUS_INSTRUMENTATION to
    # the end of the CFLAGS line below
    
    # [Some other former Apache compile-time options are now treated differently;
  --- 45,51 ----
    #  In order for the status module to obtain full statistics Apache must
    #  be modified to keep track of various information.  This is not
    #  turned on by default.
  ! # In order to enable full status details add -DSTATUS to
    # the end of the CFLAGS line below
    
    # [Some other former Apache compile-time options are now treated differently;
  ***************
  *** 170,175 ****
  --- 170,182 ----
    Module anon_auth_module   mod_auth_anon.o
    Module digest_module      mod_digest.o
    
  + # The status module allows the server to display current details about 
  + # how well it is performing and what it is doing.  Consider also enabling 
  + # -DSTATUS (see the CFLAGS section near the start of the file) to allow
  + # full status information.  Also check conf/httpd.conf to enable this.
  + 
  + Module status_module	mod_status.o
  + 
    # Optional authentication modules, which should only be
    # uncommented out if you have the neccessary system support.
    # (if you don't have the decade-old "new" DBM libs, for example)
  ***************
  *** 188,201 ****
    # allows other modules to be loaded in at runtime, and mod_cookies
    # uses Netscape cookies to automatically construct and log accurate
    # click-trails from Netscape cookies, for Netscape-using clients who
  ! # aren't coming in via proxy.   The status module allows the server
  ! # to display current details about how well it is performing and what
  ! # it is doing.  Consider also enabling -DSTATUS_INSTRUMENTATION explained
  ! # near the start of this file
    
    # Module dld_module     mod_dld.o
    # Module cookies_module mod_cookies.o
  - # Module status_module	mod_status.o
    
    # Finally, this is a *replacement* for mod_log_common which 
    # supports a LogFormat directive which allows you to specify what
  --- 195,204 ----
    # allows other modules to be loaded in at runtime, and mod_cookies
    # uses Netscape cookies to automatically construct and log accurate
    # click-trails from Netscape cookies, for Netscape-using clients who
  ! # aren't coming in via proxy.   
    
    # Module dld_module     mod_dld.o
    # Module cookies_module mod_cookies.o
    
    # Finally, this is a *replacement* for mod_log_common which 
    # supports a LogFormat directive which allows you to specify what
  
  
  
  1.23      +1 -1      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -C3 -r1.22 -r1.23
  *** CHANGES	1996/04/06 23:38:24	1.22
  --- CHANGES	1996/04/09 08:18:39	1.23
  ***************
  *** 31,37 ****
      *) Added simple and complex instrumentation to Apache to allow a
         instantaneous status screen to be displayed.  Since the complex
         instrumentation makes the scoreboard file bigger it has been 
  !      made a compile-time define (add "-DSTATUS_INSTRUMENTATION" to 
         CFLAGS in the Configuration file) [Mark Cox]
    
      *) Made it so XBITHACK behavior only occurs for files of type text/html, as
  --- 31,37 ----
      *) Added simple and complex instrumentation to Apache to allow a
         instantaneous status screen to be displayed.  Since the complex
         instrumentation makes the scoreboard file bigger it has been 
  !      made a compile-time define (add "-DSTATUS" to 
         CFLAGS in the Configuration file) [Mark Cox]
    
      *) Made it so XBITHACK behavior only occurs for files of type text/html, as