cvs commit: apache-apr/pthreads/src/os/unix Makefile.tmpl multithread.c

1999-05-31 Thread manoj
manoj   99/05/30 16:49:02

  Modified:pthreads/src/main Makefile.tmpl alloc.c scoreboard.c
   pthreads/src/modules/proxy Makefile.tmpl proxy_cache.c
proxy_util.c
   pthreads/src/modules/standard Makefile.tmpl mod_unique_id.c
   pthreads/src/os/unix Makefile.tmpl
  Removed: pthreads/src/include multithread.h
   pthreads/src/os/unix multithread.c
  Log:
  More code cleanup. Get rid of multithread.[ch], so that we have one
  consistent scheme for using mutexes, and to simplify the switch to a
  portable runtime.
  
  Revision  ChangesPath
  1.9   +2 -2  apache-apr/pthreads/src/main/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/Makefile.tmpl,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- Makefile.tmpl 1999/04/17 03:35:54 1.8
  +++ Makefile.tmpl 1999/05/30 23:48:58 1.9
  @@ -72,7 +72,7 @@
$(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
$(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
$(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/apr.h \
  - $(INCDIR)/util_uri.h $(INCDIR)/multithread.h $(INCDIR)/http_log.h
  + $(INCDIR)/util_uri.h $(INCDIR)/http_log.h
   buff.o: buff.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
$(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
$(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  @@ -176,7 +176,7 @@
$(INCDIR)/alloc.h $(INCDIR)/buff.h $(INCDIR)/ap.h $(INCDIR)/apr.h \
$(INCDIR)/util_uri.h $(INCDIR)/http_log.h $(INCDIR)/http_main.h \
$(INCDIR)/http_core.h $(INCDIR)/http_conf_globals.h \
  - $(INCDIR)/scoreboard.h $(INCDIR)/multithread.h
  + $(INCDIR)/scoreboard.h
   util.o: util.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
$(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
$(OSDIR)/os-inline.c $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h \
  
  
  
  1.6   +14 -17apache-apr/pthreads/src/main/alloc.c
  
  Index: alloc.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/alloc.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- alloc.c   1999/04/09 03:43:28 1.5
  +++ alloc.c   1999/05/30 23:48:58 1.6
  @@ -63,10 +63,10 @@
*/
   
   #include httpd.h
  -#include multithread.h
   #include http_log.h
   
   #include stdarg.h
  +#include pthread.h
   
   /* debugging support, define this to enable code which helps detect re-use
* of freed memory and other such nonsense.
  @@ -199,8 +199,7 @@
   
   
   static union block_hdr *block_freelist = NULL;
  -static mutex *alloc_mutex = NULL;
  -static mutex *spawn_mutex = NULL;
  +static pthread_mutex_t alloc_mutex = PTHREAD_MUTEX_INITIALIZER;
   #ifdef POOL_DEBUG
   static char *known_stack_point;
   static int stack_direction;
  @@ -320,7 +319,7 @@
   if (blok == NULL)
return; /* Sanity check --- freeing empty pool? */
   
  -(void) ap_acquire_mutex(alloc_mutex);
  +(void) pthread_mutex_lock(alloc_mutex);
   old_free_list = block_freelist;
   block_freelist = blok;
   
  @@ -339,7 +338,7 @@
   /* Finally, reset next pointer to get the old free blocks back */
   
   blok-h.next = old_free_list;
  -(void) ap_release_mutex(alloc_mutex);
  +(void) pthread_mutex_unlock(alloc_mutex);
   #endif
   }
   
  @@ -388,9 +387,9 @@
   {
   union block_hdr *blok;
   
  -(void) ap_acquire_mutex(alloc_mutex);
  +(void) pthread_mutex_lock(alloc_mutex);
   blok = new_block(min_size);
  -(void) ap_release_mutex(alloc_mutex);
  +(void) pthread_mutex_unlock(alloc_mutex);
   return blok;
   }
   
  @@ -435,7 +434,7 @@
   union block_hdr *blok;
   root_pool *new_pool;
   
  -(void) ap_acquire_mutex(alloc_mutex);
  +(void) pthread_mutex_lock(alloc_mutex);
   
   blok = new_block(ROOT_HDR_BYTES);
   new_pool = (root_pool *) blok-h.first_avail;
  @@ -449,7 +448,7 @@
   new_pool-p.first = new_pool-p.last = blok;
   new_pool-p.thread_root = new_pool;
   
  -(void) ap_release_mutex(alloc_mutex);
  +(void) pthread_mutex_unlock(alloc_mutex);
   return (pool *)new_pool;
   }
   
  @@ -513,8 +512,6 @@
   known_stack_point = s;
   stack_var_init(s);
   #endif
  -alloc_mutex = ap_create_mutex(NULL);
  -spawn_mutex = ap_create_mutex(NULL);
   permanent_pool = ap_make_root_pool();
   
   return permanent_pool;
  @@ -554,7 +551,7 @@
   {
   ap_clear_pool(a);
   
  -(void) ap_acquire_mutex(alloc_mutex);
  +(void) pthread_mutex_lock(alloc_mutex);
   if (a-parent) {
if (a-parent-sub_pools == a)
a-parent-sub_pools = a-sub_next;
  @@ -563,7 +560,7 @@
if (a-sub_next)

cvs commit: apache-1.3/src/lib/expat-lite Makefile.tmpl asciitab.h expat.html hashtable.c hashtable.h iasciitab.h latin1tab.h nametab.h utf8tab.h xmldef.h xmlparse.c xmlparse.h xmlrole.c xmlrole.h xmltok.c xmltok.h xmltok_impl.c xmltok_impl.h xmltok_ns.c

1999-05-31 Thread gstein
gstein  99/05/31 03:56:27

  Added:   src/lib/expat-lite Makefile.tmpl asciitab.h expat.html
hashtable.c hashtable.h iasciitab.h latin1tab.h
nametab.h utf8tab.h xmldef.h xmlparse.c xmlparse.h
xmlrole.c xmlrole.h xmltok.c xmltok.h xmltok_impl.c
xmltok_impl.h xmltok_ns.c
  Log:
  This directory contains a subset of James Clark's Expat parser. It is covered
  under the MPL 1.1 license, which can be found at http://www.mozilla.org/MPL/.
  See the CHANGES file for any changes the Apache Group has made, if any. The
  original Expat can be found at http://www.jclark.com/xml/expat.html.
  
  Revision  ChangesPath
  1.1  apache-1.3/src/lib/expat-lite/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  #
  # default definition of these two. dunno how to get it prepended when the
  # Makefile is built, so we do it manually
  #
  CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
  INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
  
  # If you know what your system's byte order is, define BYTE_ORDER:
  # use -DBYTE_ORDER=12 for little-endian byte order;
  # use -DBYTE_ORDER=21 for big-endian (network) byte order.
  #CFLAGS=-O2
  
  OBJS=xmltok.o xmlrole.o xmlparse.o hashtable.o
  
  all lib: libexpat.a
  
  libexpat.a: $(OBJS)
rm -f libexpat.a
ar cr libexpat.a $(OBJS)
$(RANLIB) libexpat.a
  
  clean:
rm -f $(OBJS) libexpat.a
  
  distclean: clean
-rm -f Makefile
  
  .SUFFIXES: .o
  
  .c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $
  
  
  
  1.1  apache-1.3/src/lib/expat-lite/asciitab.h
  
  Index: asciitab.h
  ===
  /*
  The contents of this file are subject to the Mozilla Public License
  Version 1.1 (the License); you may not use this file except in
  compliance with the License. You may obtain a copy of the License at
  http://www.mozilla.org/MPL/
  
  Software distributed under the License is distributed on an AS IS
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  License for the specific language governing rights and limitations
  under the License.
  
  The Original Code is expat.
  
  The Initial Developer of the Original Code is James Clark.
  Portions created by James Clark are Copyright (C) 1998, 1999
  James Clark. All Rights Reserved.
  
  Contributor(s):
  
  Alternatively, the contents of this file may be used under the terms
  of the GNU General Public License (the GPL), in which case the
  provisions of the GPL are applicable instead of those above.  If you
  wish to allow use of your version of this file only under the terms of
  the GPL and not to allow others to use your version of this file under
  the MPL, indicate your decision by deleting the provisions above and
  replace them with the notice and other provisions required by the
  GPL. If you do not delete the provisions above, a recipient may use
  your version of this file under either the MPL or the GPL.
  */
  
  /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
  /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
  /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
  /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
  /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
  /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
  /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
  /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
  /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
  /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
  /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
  /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
  /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
  /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
  /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
  /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
  /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
  /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
  /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
  /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,
  
  
  
  1.1  apache-1.3/src/lib/expat-lite/expat.html
  
  Index: expat.html
  

cvs commit: apache-1.3/src/lib/expat-lite CHANGES

1999-05-31 Thread gstein
gstein  99/05/31 04:12:55

  Added:   src/lib/expat-lite CHANGES
  Log:
  Document changes made by the Apache Group, along with details on Apache's
  particular subset of the full Expat 1.1 distribution.
  
  Revision  ChangesPath
  1.1  apache-1.3/src/lib/expat-lite/CHANGES
  
  Index: CHANGES
  ===
  === PURPOSE ===
  
  This file documents the changes made by the Apache Group to James
  Clark's Expat parser. The original Expat distribution can be found at
  http://www.jclark.com/xml/expat.html.
  
  
  === SUBSET INFORMATION ===
  
  Apache does not choose (or need) to use the entire Expat parser
  distribution. The subset that Apache will use will be referred to as
  expat-lite. In particular, this directory contains the files from
  the following Expat distribution subdirectories:
  
expat/xmltok/*
expat/xmlparse/*
  
  We also retain expat/expat.html for attribution to James Clark and
  licensing information.
  
  In addition, we remove expat/xmltok/dllmain.c from our version since
  we statically link expat-lite into the executable (rather than
  building a DLL on the Win32 platform). The *.dsp files are also
  removed, since we place those elsewhere in the Apache source
  distribution and they will have a very different structure.
  
  Makefile.tmpl has been created from scratch to provide build
  instructions to the Apache build system.
  
  This file (CHANGES) has been added to document changes from the
  original Expat distribution.
  
  
  === CHANGES TO ORIGINAL ===
  
  There have been no changes made to any Expat file at this point in
  time (May 31, 1999).
  
  The files, in their original state from the Expat distribution, have
  been tagged within CVS with the EXPAT_1_1 tag. That tag may be used
  as a reference for changes made by the Apache Group.
  
  
  


cvs commit: apache-1.3/src Configuration.tmpl Configure

1999-05-31 Thread gstein
gstein  99/05/31 04:57:59

  Modified:src  Configuration.tmpl Configure
  Log:
  The directory has changed to lib/expat-lite/ to clarify that we are not
  using the full Expat distribution (suggested by Roy).
  
  Revision  ChangesPath
  1.115 +3 -3  apache-1.3/src/Configuration.tmpl
  
  Index: Configuration.tmpl
  ===
  RCS file: /home/cvs/apache-1.3/src/Configuration.tmpl,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- Configuration.tmpl1999/05/25 11:28:39 1.114
  +++ Configuration.tmpl1999/05/31 11:57:57 1.115
  @@ -162,9 +162,9 @@
   #
   # EXPAT:
   #  Include James Clark's Expat package into Apache, for use by the
  -#  modules. The default is to include it if the lib/expat/ directory
  -#  is present. This rule will always be interpreted as no if the
  -#  directory is not present.
  +#  modules. The default is to include it if the lib/expat-lite/
  +#  directory is present. This rule will always be interpreted as no
  +#  if the directory is not present.
   #
   
   Rule SOCKS4=no
  
  
  
  1.351 +4 -4  apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.350
  retrieving revision 1.351
  diff -u -r1.350 -r1.351
  --- Configure 1999/05/25 12:24:44 1.350
  +++ Configure 1999/05/31 11:57:57 1.351
  @@ -1569,7 +1569,7 @@
   
   ## Add in the Expat library if needed/wanted.
   ##
  -if [ -d ./lib/expat/ ]; then
  +if [ -d ./lib/expat-lite/ ]; then
   if [ x$RULE_EXPAT = xdefault ]; then
   RULE_EXPAT=yes
   fi
  @@ -1582,9 +1582,9 @@
   fi
   fi
   if [ x$RULE_EXPAT = xyes ]; then
  -EXPATLIB=lib/expat/libexpat.a
  -APLIBDIRS=expat $APLIBDIRS
  -CFLAGS=$CFLAGS -DUSE_EXPAT -I\$(SRCDIR)/lib/expat
  +EXPATLIB=lib/expat-lite/libexpat.a
  +APLIBDIRS=expat-lite $APLIBDIRS
  +CFLAGS=$CFLAGS -DUSE_EXPAT -I\$(SRCDIR)/lib/expat-lite
   fi
   
   
  
  
  


cvs commit: apache-1.3/src/include ap.h

1999-05-31 Thread coar
coar99/05/31 10:09:32

  Modified:src/ap   Makefile.tmpl
   src/include ap.h
  Added:   src/ap   ap_getpass.c
  Log:
Prepare for some rework of htpasswd and htdigest by moving a
getpass() wrapper/abstraction into libap.
  
  Revision  ChangesPath
  1.32  +5 -2  apache-1.3/src/ap/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /home/cvs/apache-1.3/src/ap/Makefile.tmpl,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Makefile.tmpl 1999/01/12 15:47:04 1.31
  +++ Makefile.tmpl 1999/05/31 17:09:30 1.32
  @@ -5,8 +5,8 @@
   
   LIB=libap.a
   
  -OBJS=ap_execve.o ap_cpystrn.o ap_signal.o \
  - ap_slack.o ap_snprintf.o ap_fnmatch.o ap_md5c.o
  +OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o 
ap_signal.o \
  + ap_slack.o ap_snprintf.o
   
   .c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $
  @@ -52,6 +52,9 @@
   ap_fnmatch.o: ap_fnmatch.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
$(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \
$(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/fnmatch.h
  +ap_getpass.o: ap_getpass.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
  + $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \
  + $(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap.h
   ap_md5c.o: ap_md5c.c $(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
$(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(OSDIR)/os-inline.c \
$(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap_md5.h \
  
  
  
  1.1  apache-1.3/src/ap/ap_getpass.c
  
  Index: ap_getpass.c
  ===
  /* 
   * Copyright (c) 1995-1999 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. For written permission, please contact
   *[EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * 6. 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/.
   *
   */
  /*
   * ap_getpass.c: abstraction to provide for obtaining a password from the
   * command line in whatever way the OS supports.  In the best case, it's a
   * wrapper for the system library's getpass() routine; otherwise, we
   * use one we define ourselves.
   */
 

cvs commit: apache-1.3/src/support htpasswd.c

1999-05-31 Thread coar
coar99/05/31 10:10:19

  Modified:src/support htpasswd.c
  Log:
Oops.  Too much Perl coding at the time, I guess. :-*
  
  Revision  ChangesPath
  1.29  +2 -2  apache-1.3/src/support/htpasswd.c
  
  Index: htpasswd.c
  ===
  RCS file: /home/cvs/apache-1.3/src/support/htpasswd.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- htpasswd.c1999/04/10 15:08:45 1.28
  +++ htpasswd.c1999/05/31 17:10:19 1.29
  @@ -431,8 +431,8 @@
   
   /*
* Make sure we still have exactly the right number of arguments left
  - # (the filename, the username, and possibly the password if -b was
  - # specified).
  + * (the filename, the username, and possibly the password if -b was
  + * specified).
*/
   if ((argc - i) != args_left) {
return usage();
  
  
  


cvs commit: apache-1.3/src/support htdigest.c htpasswd.c

1999-05-31 Thread coar
coar99/05/31 12:44:31

  Modified:src/support htdigest.c htpasswd.c
  Log:
Use the ap_getpass() wrapper rather than reinventing it.
  
  Revision  ChangesPath
  1.23  +68 -12apache-1.3/src/support/htdigest.c
  
  Index: htdigest.c
  ===
  RCS file: /home/cvs/apache-1.3/src/support/htdigest.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- htdigest.c1999/04/09 12:57:06 1.22
  +++ htdigest.c1999/05/31 19:44:30 1.23
  @@ -1,3 +1,59 @@
  +/* 
  + * Copyright (c) 1995-1999 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. For written permission, please contact
  + *[EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called Apache
  + *nor may Apache appear in their names without prior written
  + *permission of the Apache Group.
  + *
  + * 6. 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/.
  + *
  + */
   
/**

**
* NOTE! This program is not safe as a setuid executable!  Do not make it
  @@ -17,6 +73,7 @@
   #else
   #include sys/signal.h
   #endif
  +#include ap.h
   #include ap_md5.h
   
   #ifdef CHARSET_EBCDIC
  @@ -31,15 +88,6 @@
   
   char *tn;
   
  -static char *strd(char *s)
  -{
  -char *d;
  -
  -d = (char *) malloc(strlen(s) + 1);
  -strcpy(d, s);
  -return (d);
  -}
  -
   static void getword(char *word, char *line, char stop)
   {
   int x = 0, y;
  @@ -89,15 +137,23 @@
   AP_MD5_CTX context;
   unsigned char digest[16];
   char string[MAX_STRING_LEN];
  +char pwin[MAX_STRING_LEN];
  +char pwv[MAX_STRING_LEN];
   unsigned int i;
   
  -pw = strd((char *) getpass(New password:));
  -if (strcmp(pw, (char *) getpass(Re-type new password:))) {
  +if (ap_getpass(New password: , pwin, sizeof(pwin)) != 0) {
  + fprintf(stderr, password too long);
  + exit(5);
  +}
  +ap_getpass(Re-type new password: , pwv, sizeof(pwv));
  +if (strcmp(pwin, pwv) != 0) {
fprintf(stderr, They don't match, sorry.\n);
  - if (tn)
  + if (tn) {
unlink(tn);
  + }
exit(1);
   }
  +pw = pwin;
   fprintf(f, %s:%s:,