Files
xen/tools/xenstore/testsuite/14complexperms.test
T
Rusty Russell f11f68cd11 Make xenstored use tdb, transactions can soft-fail (EAGAIN)
Transactions no longer take root dir, no longer lock & block: commit can fail spuriously with EAGAIN, not ETIMEDOUT.
Speeds up transactions by over 1000 times, should be NFS safe.
New program: xs_tdb_dump to dump raw TDB contents.
Don't do failure testing: we are no longer robust against all ENOMEM 8(
Introduce "struct node" which contains perms, children and data.
Make struct xs_permissions unpadded, so we can write to tdb w/o valgrind complaints.
Gently modify TDB to use talloc, not do alloc on tdb_delete.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2005-09-23 14:25:01 +01:00

69 lines
1.6 KiB
Plaintext

# We should not be able to tell the difference between a node which
# doesn't exist, and a node we don't have permission on, if we don't
# have permission on it directory.
mkdir /dir
setperm /dir 0 NONE
# First when it doesn't exist
setid 1
expect *Permission denied
dir /dir/file
expect *Permission denied
read /dir/file
expect *Permission denied
write /dir/file value
expect *Permission denied
mkdir /dir/file
expect *Permission denied
rm /dir/file
expect *Permission denied
rm /dir
expect *Permission denied
getperm /dir/file
expect *Permission denied
setperm /dir/file 0 NONE
# We get no watch event when there's no permission. It's a corner case.
watchnoack /dir/file token
1 write /dir/file contents
1 rm /dir/file
expect waitwatch failed: Connection timed out
waitwatch
unwatch /dir/file token
expect *No such file or directory
unwatch /dir/file token
expect *Permission denied
introduce 2 100 7 /dir/file
# Now it exists
setid 0
write /dir/file contents
setid 1
expect *Permission denied
dir /dir/file
expect *Permission denied
read /dir/file
expect *Permission denied
write /dir/file value
expect *Permission denied
mkdir /dir/file
expect *Permission denied
rm /dir/file
expect *Permission denied
rm /dir
expect *Permission denied
getperm /dir/file
expect *Permission denied
setperm /dir/file 0 NONE
watchnoack /dir/file token
1 write /dir/file contents
1 rm /dir/file
expect waitwatch failed: Connection timed out
waitwatch
unwatch /dir/file token
expect *No such file or directory
unwatch /dir/file token
expect *Permission denied
introduce 2 100 7 /dir/file