[e-lang] anyone ever look at refactoring code to use object-capabilities?
Mark Seaborn
mrs at mythic-beasts.com
Sun May 27 15:47:25 EDT 2007
David Hopwood <david.hopwood at industrial-designers.co.uk> wrote:
> Mark Seaborn wrote:
> > However changing existing apps is an interesting question. One useful
> > refactoring could be to pass in explicit "namespace" arguments to
> > functions that take filenames, such as open(). This would specify the
> > namespace that the filename should be looked up in. The namespace
> > would be passed using capability discipline, even if individual files
> > aren't.
>
> Here is a concrete API suggestion: add an 'AT_SUBDIRECTORIES_ONLY' flag
> for the *at family of functions.
>
> http://plash.beasts.org/wiki/AtDirFunctions
>
> When set, this flag prevents using ".." in the pathname argument to access
> directories above the one passed as a file descriptor. (All combinations of
> 'AT_SUBDIRECTORIES_ONLY' and 'AT_SYMLINK_NOFOLLOW' are potentially useful.)
It would be better to associate a "subdirectories only" property with
directory FDs rather than passing the flag in to every operation.
Are you thinking of this as a kernel-provided API or a
userspace-provided API?
AT_SYMLINK_NOFOLLOW only applies to the last pathname element, and it
would be useful to have a "don't follow any symlinks at all" flag, but
I think the use cases for that would be limited. It would be useful
for improving the performance of
http://plash.beasts.org/wiki/FsObjReal.
Mark
More information about the e-lang
mailing list