Overview
Artifact ID: | a9a4256f80a48c72b7fb89555e9e55d62b03ade5 |
---|---|
Ticket: | 99caf06e17bed849146e834a8341d40590c29bc5
Error moving a file to a directory with ../.. |
User & Date: | anonymous 2011-01-06 21:34:19 |
Changes
- Appended to comment:
<hr /><i>anonymous claiming to be viric added on 2011-01-06 21:34:19 UTC:</i><br /> I investigated the problem further. file_isdir() was made to use file_simplify_name() because of some bug in mingw [a7822bcc001e9]. Nevertheless, file_isdir() is called sometimes with a canonical filename, sometimes with a filename directly from program arguments. The function file_simplify_name() works well only for canonical names, because it is meant to remove the ".." in absolute paths. So when file_isdir() is called without a canonical name with the sequence '../..' in it, it works bad. As I don't know the mingw bug, I imagine that the file_simplify_name() call has to be there. So, I propose what comes to mind: * Make file_simplify_name() work well when it's given a non-canonical name * Make file_isdir() not call file_simplify_name() if the name is not canonical. Any preference? As drh did the change [a7822bcc001e9], he may know the best option.
- title changed to: "Error moving a file to a directory with ../.."