[34] | 1 | # We should not be able to tell the difference between a node which |
---|
| 2 | # doesn't exist, and a node we don't have permission on, if we don't |
---|
| 3 | # have permission on it directory. |
---|
| 4 | |
---|
| 5 | mkdir /dir |
---|
| 6 | setperm /dir 0 NONE |
---|
| 7 | |
---|
| 8 | # First when it doesn't exist |
---|
| 9 | setid 1 |
---|
| 10 | expect *Permission denied |
---|
| 11 | dir /dir/file |
---|
| 12 | expect *Permission denied |
---|
| 13 | read /dir/file |
---|
| 14 | expect *Permission denied |
---|
| 15 | write /dir/file value |
---|
| 16 | expect *Permission denied |
---|
| 17 | mkdir /dir/file |
---|
| 18 | expect *Permission denied |
---|
| 19 | rm /dir/file |
---|
| 20 | expect *Permission denied |
---|
| 21 | rm /dir |
---|
| 22 | expect *Permission denied |
---|
| 23 | getperm /dir/file |
---|
| 24 | expect *Permission denied |
---|
| 25 | setperm /dir/file 0 NONE |
---|
| 26 | # We get no watch event when there's no permission. It's a corner case. |
---|
| 27 | watchnoack /dir/file token |
---|
| 28 | 1 write /dir/file contents |
---|
| 29 | 1 rm /dir/file |
---|
| 30 | expect waitwatch failed: Connection timed out |
---|
| 31 | waitwatch |
---|
| 32 | unwatch /dir/file token |
---|
| 33 | expect *No such file or directory |
---|
| 34 | unwatch /dir/file token |
---|
| 35 | expect *Permission denied |
---|
| 36 | introduce 2 100 7 /dir/file |
---|
| 37 | |
---|
| 38 | # Now it exists |
---|
| 39 | setid 0 |
---|
| 40 | write /dir/file contents |
---|
| 41 | |
---|
| 42 | setid 1 |
---|
| 43 | expect *Permission denied |
---|
| 44 | dir /dir/file |
---|
| 45 | expect *Permission denied |
---|
| 46 | read /dir/file |
---|
| 47 | expect *Permission denied |
---|
| 48 | write /dir/file value |
---|
| 49 | expect *Permission denied |
---|
| 50 | mkdir /dir/file |
---|
| 51 | expect *Permission denied |
---|
| 52 | rm /dir/file |
---|
| 53 | expect *Permission denied |
---|
| 54 | rm /dir |
---|
| 55 | expect *Permission denied |
---|
| 56 | getperm /dir/file |
---|
| 57 | expect *Permission denied |
---|
| 58 | setperm /dir/file 0 NONE |
---|
| 59 | watchnoack /dir/file token |
---|
| 60 | 1 write /dir/file contents |
---|
| 61 | 1 rm /dir/file |
---|
| 62 | expect waitwatch failed: Connection timed out |
---|
| 63 | waitwatch |
---|
| 64 | unwatch /dir/file token |
---|
| 65 | expect *No such file or directory |
---|
| 66 | unwatch /dir/file token |
---|
| 67 | expect *Permission denied |
---|
| 68 | introduce 2 100 7 /dir/file |
---|