Review 1 of S1: the served-text row finds the list tool by its full name; list's text is the contract's word for word
Builds: design 39 parts D3 (§15), bullets 2 and 4.
This commit is contained in:
@@ -288,8 +288,8 @@ func rawReadTools(r Reader) []stdio.Tool {
|
||||
object(map[string]any{"path": str("an absolute path")}, "path"),
|
||||
func(a map[string]any) (any, error) { return r.Readlink(arg(a, "path")) }),
|
||||
verb("list", "Every entry of one directory with its type, owner, group, mode, size and, for a link, its "+
|
||||
"target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is "+
|
||||
"listed too, at any depth, and marked secret-place: its entries, never their content; what reaches a "+
|
||||
"target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept, at any depth "+
|
||||
"beneath it, is listed too and marked secret-place: its entries, never their content; what reaches a "+
|
||||
"process's memory or files (/proc/<pid>/environ, mem, fd, map_files, root, cwd) is refused by name. Read "+readsAs+".",
|
||||
object(map[string]any{"path": str("an absolute path to a directory")}, "path"),
|
||||
func(a map[string]any) (any, error) { return r.List(arg(a, "path")) }),
|
||||
|
||||
@@ -105,7 +105,7 @@ func TestSecretPlacesAreRefusedByNameBeforeAnyRead(t *testing.T) {
|
||||
}
|
||||
// the served text of list says it lists a secret place, and no longer that it refuses one
|
||||
for _, tl := range readTools(r) {
|
||||
if tl.Name == "list" && (strings.Contains(tl.Description, "known credential file, is refused") ||
|
||||
if strings.HasSuffix(tl.Name, ".list") && (strings.Contains(tl.Description, "known credential file, is refused") ||
|
||||
!strings.HasSuffix(tl.Description, "where its rights do not reach.")) {
|
||||
t.Errorf("the list text: %s", tl.Description)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user