You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/06/22 18:16:20 UTC
svn commit: r956940 - /subversion/trunk/subversion/libsvn_subr/io.c
Author: julianfoad
Date: Tue Jun 22 16:16:20 2010
New Revision: 956940
URL: http://svn.apache.org/viewvc?rev=956940&view=rev
Log:
Fix a filename encoding error when using "delete on pool cleanup" with
svn_io_open_unique_file3(). This bug would potentially fail to clean up the
correct temp file (and would in fact attempt to delete some file at a
different path) if the UTF-8 encoding of the directory path differs from its
APR encoding. I was able to demonstrate this by using a non-UTF-8 locale
and specifying a system temp dir with a non-ASCII character in its path.
* subversion/libsvn_subr/io.c
(svn_io_open_unique_file3): Convert the filename to APR encoding before
storing it in the pool-cleanup baton.
Modified:
subversion/trunk/subversion/libsvn_subr/io.c
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=956940&r1=956939&r2=956940&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Jun 22 16:16:20 2010
@@ -3763,12 +3763,7 @@ svn_io_open_unique_file3(apr_file_t **fi
*unique_path = tempname; /* Was allocated in result_pool */
if (baton)
- {
- if (unique_path)
- baton->name = *unique_path;
- else
- baton->name = tempname; /* Was allocated in result_pool */
- }
+ SVN_ERR(cstring_from_utf8(&baton->name, tempname, result_pool));
return SVN_NO_ERROR;
}