]> granicus.if.org Git - apache/commitdiff
Use the apr_file_copy function rather than doing a system call to copy
authorJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 2 Jul 2002 22:19:13 +0000 (22:19 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Tue, 2 Jul 2002 22:19:13 +0000 (22:19 +0000)
the file.

Submitted by: Thom May <thom@planetarytramp.net>
Reviewed by: Justin Erenkrantz

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95944 13f79535-47bb-0310-9956-ffa450edef68

support/htpasswd.c

index 28f16bfa6a80b92ffa1df74638d3947bdf1bfc8b..a391f35a5c74d09877fa6749ab8d6bcb482e667f 100644 (file)
@@ -606,12 +606,7 @@ int main(int argc, const char * const argv[])
 
     /* 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;
 }