[tahoe-dev] [tahoe-lafs] #686: Search for lost share resulted in a directory popping up at unexpected place
tahoe-lafs
trac at allmydata.org
Sun Apr 26 13:42:27 PDT 2009
#686: Search for lost share resulted in a directory popping up at unexpected
place
-----------------------+----------------------------------------------------
Reporter: [4-tea-2] | Owner: nobody
Type: defect | Status: new
Priority: major | Milestone: undecided
Component: unknown | Version: 1.4.1
Keywords: | Launchpad_bug:
-----------------------+----------------------------------------------------
Comment(by warner):
it's a bug. In the webapi code that handles path traversal, there is a
piece that sometimes creates a missing directory (so the traversal can
continue). This is meant for use by an operation like {{{PUT
/uri/DIRCAP/parent/subdir/file.txt}}}, and the loop looks vaguely like:
{{{
here = get_dirnode_from_dircap(DIRCAP)
for name in path[:-1]:
if here.has_child(name):
here = here.get_child(name)
else:
here = here.create_empty_directory(name)
here.add_file(path[-1], DATA)
}}}
But, of course, this create-missing-directory code should only be run when
we're actually going to PUT or POST a file into that spot. Otherwise it
should use a 404 to report the missing directory.
I think the bug is that this code is not examining the operation closely
enough (i.e. not paying attention to the t= query argument), and creating
directories for all POSTs, not just the specific kind that will upload a
file.
--
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/686#comment:5>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid
More information about the tahoe-dev
mailing list