You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Thom May <th...@planetarytramp.net> on 2002/07/02 23:43:30 UTC

[PATCH] htpasswd: use apr_file_copy

this seems a bit cleaner than doing a system(), also hopefully more
maintainable.
Cheers,
-Thom
-- 
Thom May -> thom@planetarytramp.net

<doogie> I shaved more of my butt this time.  it's got a few days 
         stubble growth, and it causes the most odd type of itching.
<Overfiend> doogie: I would imagine that it is not particularly pleasant 
            to have a persistent itch in your ass crack.
<doogie> the most fun part was figuring out how to shave my balls 
         without causing pain.


Index: support/htpasswd.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/support/htpasswd.c,v
retrieving revision 1.50
diff -u -u -r1.50 htpasswd.c
--- support/htpasswd.c	2 Jul 2002 19:48:38 -0000	1.50
+++ support/htpasswd.c	2 Jul 2002 21:45:42 -0000
@@ -605,12 +606,7 @@
 
     /* The temporary file has all the data, just copy it to the new location.
      */
-#if defined(OS2) || defined(WIN32)
-    str = apr_psprintf(pool, "copy \"%s\" \"%s\"", tn, pwfilename);
-#else
-    str = apr_psprintf(pool, "cp %s %s", tn, pwfilename);
-#endif
-    system(str);
+    apr_file_copy(tn, pwfilename, APR_FILE_SOURCE_PERMS, pool);
     apr_file_close(ftemp);
     return 0;
 }

Re: [PATCH] htpasswd: use apr_file_copy

Posted by Justin Erenkrantz <je...@apache.org>.
On Tue, Jul 02, 2002 at 10:43:30PM +0100, Thom May wrote:
> this seems a bit cleaner than doing a system(), also hopefully more
> maintainable.

Committed.  Thanks!  -- justin