Inconsistent Glob/Lookup behaviour for directories
Assume that [email protected] has the following Upspin root:
/Access # read,list: [email protected]
/foo/bar
/baz/Access # list: [email protected]
/qux/Access # *: [email protected]/qux/Access thus prevents [email protected] from accessing anything within /qux, but my list access in the root still allows me to know of its existence. As such, if I do:
upspin ls [email protected]I see
/Access
/foo/
/baz/
/qux/Doing an upspin info on each of the directories shows me the blocks for /foo, an incomplete entry for /baz (no blocks), and /qux returns an "information withheld" error.
If I apply a glob pattern, however:
upspin info [email protected]/*Is see the full entry, complete with blocks, for both /baz and /qux. So it seems that the directory server's Glob() function leaks the complete entry, and ignores the Access files within the directories of those entries. I guess the inconsistency here is that Glob() seems to think that a read right within a directory gives a user the right to read the blocks of all entries within that directory, but Lookup() thinks that the rules apply differently for files and directories: file reads are controlled by adjacent access files, while directory reads are controlled by the access files within them.
So which behaviour is correct? On the one hand it seems silly that Lookup("[email protected]/qux") fails completely but Glob("[email protected]/qu?") gives me the full entry. On the other hand if Lookup() is changed to match the behaviour of Glob(), the semantics of WhichAccess() become pretty muddy because the access file in control is then dependent on which right is queried.
Source: upspin/upspin