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-2.0/src/support htpasswd.c
Date Wed, 03 May 2000 10:32:46 GMT
coar        00/05/03 03:32:46

  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.99      +4 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -u -r1.98 -r1.99
  --- CHANGES	2000/05/03 02:02:54	1.98
  +++ CHANGES	2000/05/03 10:32:45	1.99
  @@ -1,4 +1,8 @@
   Changes with Apache 2.0a4-dev
  +
  +  *) Add some more error reporting to htpasswd in the case of problems
  +     generating or accessing the temporary file.  [Ken Coar]
  +
     *) Configure creates config.nice now containing your configure
        options. Syntax: ./config.nice [--more-options]
        [Sascha Schumann]
  
  
  
  1.10      +9 -1      apache-2.0/src/support/htpasswd.c
  
  Index: htpasswd.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/htpasswd.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -u -r1.9 -r1.10
  --- htpasswd.c	2000/04/29 16:23:46	1.9
  +++ htpasswd.c	2000/05/03 10:32:45	1.10
  @@ -518,9 +518,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