[Zope-CMF] DirectoryView.DirectoryInformation.prepareContents and subdirs

Shane Hathaway shane@digicool.com
Tue, 10 Apr 2001 12:41:50 -0400


Martijn Pieters wrote:
> Why does DirectoryInformation.prepareContents only acknowledge subdirs it
> finds if they have been registered before?

For security: if an intruder gets access to the ZMI, at least with this
restriction the CMF can't be used to read/write arbitrary directories
(though in only limited ways).

> Reason I ask is because auto-reload of a DIrectoryView works fine except
> when adding new sudirs; they are ignored until a Zope restart because of
> the above restriction.

When reloading a DirectoryView, you could make it so subdirectories
found are automatically registered.

> Tres, I CC-ed you because this code was there in your initial checkin of
> the code.

When I wrote this code (which was first checked in to PTKBase), I wrote
it to fulfill the important needs such as simple reloading and
security.  I was going to provide auto-reloading of entire directory
structures, but didn't see enough need for it at the time.  (In fact all
the FS* classes really ought to derive from a common base class, maybe
you want to tackle that too?)

Shane