From: Chuck Bell Date: May 5 2009 2:04pm Subject: Re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2797) Bug#43747 Bug#43767 List-Archive: http://lists.mysql.com/commits/73396 Message-Id: <4A004766.9020901@sun.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=UTF-8 Content-Transfer-Encoding: 8BIT That is fine by me. Ingo Strüwing wrote: > Hi Chuck, Jørgen, > > Chuck Bell, 28.04.2009 19:07: > ... >> COMMENTARY >> ---------- >> Very well done. :) > > Jørgen Løland, 29.04.2009 11:13: > ... >> COMMENT: >> -------- >> Very nicely written patch. Well done! > > Thank you for the worm words. :-) > > Some time during my vacation, after I pushed the patch, I got aware that > my solution might not be optimal: > > The current patch does not clean up ../ from paths if the preceding path > element is a symbolic link. This is important and correct, but perhaps > not sufficient. > > The clean up of ../ is also done if the previous path element references > a nonexistent file system object. This is acceptable only as long as the > object remains non-existent. However, if it becomes a plain file, or > some other non-directory object, it might have been replaced by later > path elements and the resulting path would become invalid. For example, > assume this path: > > dir/non-existent-file.txt/../existent-file.txt > > The resulting path would be dir/existent-file.txt, which does not match > what standard file operations would do. ../ is a valid path element only > if the preceding element is an existing directory. > > So I ask you, if you agree that I change safe_cleanup_cat_path() so that > it does not clean up ../ if the preceding path element is not a real > (non-symlink) directory? > > Regards > Ingo