You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@wandisco.com> on 2010/06/17 16:33:31 UTC

[PATCH] Fix filename encoding error in svn_io_open_unique_file3()

I spotted a filename encoding error when using "delete on pool cleanup"
with svn_io_open_unique_file3().  I have not tested this, but I believe
this bug would fail to clean up the temp file if the UTF-8 encoding of
the directory path differs from its APR encoding.

How can I easily test this in my Ubuntu UTF-8 environment?

- Julian


Re: [PATCH] Fix filename encoding error in svn_io_open_unique_file3()

Posted by Julian Foad <ju...@wandisco.com>.
On Thu, 2010-06-17 at 18:09 +0100, Philip Martin wrote:
> Julian Foad <ju...@wandisco.com> writes:
> 
> > How can I easily test this in my Ubuntu UTF-8 environment?
> 
> I think you can do it in an 8-bit non-utf8 locale:
> 
> $ sudo dpkg-reconfigure locales  # select en_GB.8859-15
> $ LANG=en_GB.8859-15 ./executable

Thanks.  I got it to work by using "sudo locale-gen en_GB.ISO-8859-15".
(The "dpkg-reconfigure locales" command just re-generated a set of UTF-8
locales and didn't offer me any options.)

I then tested with a debugging printf in the delete-on-pool-cleanup
function:

[[[
$ LC_ALL=en_GB.ISO-8859-15 TMP=/tmp/svn-tëst svn up -r1 
At revision 1.
## removing '/tmp/svn-tëst/svn-tempfile.tmp'
## removing '/tmp/svn-tëst/svn-5EX6hs'
$ ls /tmp/svn-tëst/
-rw-r--r-- 1 julianfoad 11 2010-06-22 17:07 svn-5EX6hs
]]]

The first debug line shows it removing a temp file created from some
other (correct) code path, and the second line shows it silently failing
to remove a temp file created in the broken code path.

I committed the fix in r956940, and some better documentation and naming
in r956941.

- Julian


Re: [PATCH] Fix filename encoding error in svn_io_open_unique_file3()

Posted by Philip Martin <ph...@wandisco.com>.
Julian Foad <ju...@wandisco.com> writes:

> How can I easily test this in my Ubuntu UTF-8 environment?

I think you can do it in an 8-bit non-utf8 locale:

$ sudo dpkg-reconfigure locales  # select en_GB.8859-15
$ LANG=en_GB.8859-15 ./executable


-- 
Philip