httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: httpd-2.0/support htdigest.c
Date Wed, 17 Mar 2004 00:15:12 GMT
bnicholes    2004/03/16 16:15:12

  Modified:    support  htdigest.c
  Log:
  Remove the dependance on external cp/copy commands
  
  Submitted by: Guenter Knauf <eflash@gmx.net>
  
  Revision  Changes    Path
  1.42      +11 -10    httpd-2.0/support/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/htdigest.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- htdigest.c	17 Mar 2004 00:04:35 -0000	1.41
  +++ htdigest.c	17 Mar 2004 00:15:12 -0000	1.42
  @@ -63,9 +63,9 @@
    * we need to close the file before we can copy it.
    * otherwise it's locked by the system ;-(
    *
  - * XXX: Other systems affected? (Netware?, OS2?)
  + * XXX: Other systems affected? (OS2?)
    */
  -#if (defined(WIN32))
  +#if 0
   #define OMIT_DELONCLOSE 1
   #endif
   
  @@ -303,18 +303,19 @@
   	add_password(user, realm, tfp);
       }
       apr_file_close(f);
  -#if defined(OS2) || defined(WIN32)
  -    sprintf(command, "copy \"%s\" \"%s\"", dirname, argv[1]);
  -#else
  -    sprintf(command, "cp %s %s", dirname, argv[1]);
  -#endif
  -
   #ifdef OMIT_DELONCLOSE
       apr_file_close(tfp);
  -    system(command);
  +#endif
  +    /* The temporary file has all the data, just copy it to the new location.
  +     */
  +    if (apr_file_copy(dirname, argv[1], APR_FILE_SOURCE_PERMS, cntxt) !=
  +                APR_SUCCESS) {
  +        fprintf(stderr, "%s: unable to update file %s\n", 
  +                        argv[0], argv[1]);
  +    }
  +#ifdef OMIT_DELONCLOSE
       apr_file_remove(dirname, cntxt);
   #else
  -    system(command);
       apr_file_close(tfp);
   #endif
   
  
  
  

Mime
View raw message