httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@locus.apache.org
Subject cvs commit: apache-1.3/src/support htpasswd.c
Date Wed, 03 May 2000 10:33:59 GMT
coar        00/05/03 03:33:59

  Modified:    src      CHANGES
               src/support htpasswd.c
  Log:
  	Be more expliciti in our error messages if the tmpnam() call fails,
  	or we have trouble opening the filename it returns.
  
  PR:		Not a solution, but will help debug several
  
  Revision  Changes    Path
  1.1535    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1534
  retrieving revision 1.1535
  diff -u -u -r1.1534 -r1.1535
  --- CHANGES	2000/04/18 19:26:27	1.1534
  +++ CHANGES	2000/05/03 10:33:58	1.1535
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.13
   
  +  *) Add some more error reporting to htpasswd in the case of problems
  +     generating or accessing the temporary file.  [Ken Coar]
  +
     *) PORT: Add recognition of the GNU/Hurd platform.
        [Adam Farrell <skate111@stampede.org>]
   
  
  
  
  1.38      +49 -39    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.37
  retrieving revision 1.38
  diff -u -u -r1.37 -r1.38
  --- htpasswd.c	1999/10/21 20:46:32	1.37
  +++ htpasswd.c	2000/05/03 10:33:59	1.38
  @@ -1,58 +1,60 @@
   /* ====================================================================
  - * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
  + * The Apache Software License, Version 1.1
    *
  + * Copyright (c) 2000 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. 
  + *    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
  - *    apache@apache.org.
  - *
  - * 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
  + * 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.
  + * 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/>.
  - *
  + * 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.
    */
   
   /******************************************************************************
  @@ -517,9 +519,17 @@
        * to add or update.  Let's do it..
        */
       tempfilename = tmpnam(NULL);
  +    if ((tempfilename == NULL) || (strlen(tempfilename) == 0)) {
  +	fprintf(stderr, "%s: unable to generate temporary filename\n",
  +		argv[0]);
  +	errno = ENOENT;
  +	perror("tmpnam");
  +	exit(ERR_FILEPERM);
  +    }
       ftemp = fopen(tempfilename, "w+");
       if (ftemp == NULL) {
  -	fprintf(stderr, "%s: unable to create temporary file\n", argv[0]);
  +	fprintf(stderr, "%s: unable to create temporary file '%s'\n", argv[0],
  +		tempfilename);
   	perror("fopen");
   	exit(ERR_FILEPERM);
       }
  
  
  

Mime
View raw message