ia64/xen-unstable

view tools/xenstore/testsuite/05filepermissions.test @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children f7a7f8f2e6e4 872cf6ee0594
line source
1 # Fail to get perms on non-existent file.
2 expect getperm failed: No such file or directory
3 getperm /test
4 expect getperm failed: No such file or directory
5 getperm /dir/test
7 # Create file: inherits from root (0 READ)
8 write /test excl contents
9 expect 0 READ
10 getperm /test
11 setid 1
12 expect 0 READ
13 getperm /test
14 expect contents
15 read /test
16 expect write failed: Permission denied
17 write /test none contents
19 # Take away read access to file.
20 setid 0
21 setperm /test 0 NONE
22 setid 1
23 expect getperm failed: Permission denied
24 getperm /test
25 expect read failed: Permission denied
26 read /test
27 expect write failed: Permission denied
28 write /test none contents
30 # Grant everyone write access to file.
31 setid 0
32 setperm /test 0 WRITE
33 setid 1
34 expect getperm failed: Permission denied
35 getperm /test
36 expect read failed: Permission denied
37 read /test
38 write /test none contents2
39 setid 0
40 expect contents2
41 read /test
43 # Grant everyone both read and write access.
44 setperm /test 0 READ/WRITE
45 setid 1
46 expect 0 READ/WRITE
47 getperm /test
48 expect contents2
49 read /test
50 write /test none contents3
51 expect contents3
52 read /test
54 # Change so that user 1 owns it, noone else can do anything.
55 setid 0
56 setperm /test 1 NONE
57 setid 1
58 expect 1 NONE
59 getperm /test
60 expect contents3
61 read /test
62 write /test none contents4
64 # User 2 can do nothing.
65 setid 2
66 expect setperm failed: Permission denied
67 setperm /test 2 NONE
68 expect getperm failed: Permission denied
69 getperm /test
70 expect read failed: Permission denied
71 read /test
72 expect write failed: Permission denied
73 write /test none contents4
75 # Tools can always access things.
76 setid 0
77 expect 1 NONE
78 getperm /test
79 expect contents4
80 read /test
81 write /test none contents5