httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thom May <t...@planetarytramp.net>
Subject [PATCH] htpasswd: use apr_file_copy
Date Tue, 02 Jul 2002 21:43:30 GMT
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;
 }

Mime
View raw message