aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Stancek <jstancek@redhat.com>2013-03-12 12:59:44 +0100
committerDavid Howells <dhowells@redhat.com>2013-08-12 14:42:26 +0100
commitd2ca0320b06dd9c39544b33256411bc21f6387dd (patch)
tree8660047c1c9473703eb7475a9f3ebd653a611bab
parent3d7bd0631a282dcc1411d3aa7de6e4a5521c4e9f (diff)
downloadkeyutils-d2ca0320b06dd9c39544b33256411bc21f6387dd.tar.gz
TEST: fix permissions on created keys and keyrings
Recent upstream kernel commit: commit 96b5c8fea6c0861621051290d705ec2e971963f1 Author: David Howells <dhowells@redhat.com> Date: Tue Oct 2 19:24:56 2012 +0100 KEYS: Reduce initial permissions on keys reduced initial permissions and some tests are now hitting EACCES because they don't get to use the 'possessed' key permissions, but must instead use the user/group/other permissions only. This particularly affects the recursion test because the test for possession hits the recursion limit and we don't see keys of that depth as being possessed. To fix this, the keyrings in the recursion test are given full user access and the eighth keyring is created elsewhere and linked in. Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--tests/keyctl/link/recursion/runtest.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/keyctl/link/recursion/runtest.sh b/tests/keyctl/link/recursion/runtest.sh
index eaa40f2..e6f5931 100644
--- a/tests/keyctl/link/recursion/runtest.sh
+++ b/tests/keyctl/link/recursion/runtest.sh
@@ -13,6 +13,7 @@ echo "++++ BEGINNING TEST" >$OUTPUTFILE
marker "CREATE KEYRING 1"
create_keyring "first" @s
expect_keyid keyringid
+set_key_perm $keyringid 0x3f3f0000
# attempt to link a keyring to itself
marker "RECURSE 1"
@@ -23,6 +24,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 2"
create_keyring "second" $keyringid
expect_keyid keyring2id
+set_key_perm $keyring2id 0x3f3f0000
# attempt to link a keyring to its child keyring
marker "RECURSE 2"
@@ -33,6 +35,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 3"
create_keyring "third" $keyring2id
expect_keyid keyring3id
+set_key_perm $keyring3id 0x3f3f0000
# attempt to link a keyring to its grandchild keyring
marker "RECURSE 3"
@@ -43,6 +46,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 4"
create_keyring "fourth" $keyring3id
expect_keyid keyring4id
+set_key_perm $keyring4id 0x3f3f0000
# attempt to link a keyring to its great grandchild keyring
marker "RECURSE 4"
@@ -53,6 +57,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 5"
create_keyring "fifth" $keyring4id
expect_keyid keyring5id
+set_key_perm $keyring5id 0x3f3f0000
# attempt to link a keyring to its great great grandchild keyring
marker "RECURSE 5"
@@ -63,6 +68,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 6"
create_keyring "sixth" $keyring5id
expect_keyid keyring6id
+set_key_perm $keyring6id 0x3f3f0000
# attempt to link a keyring to its great great great grandchild keyring
marker "RECURSE 6"
@@ -73,6 +79,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 7"
create_keyring "seventh" $keyring6id
expect_keyid keyring7id
+set_key_perm $keyring7id 0x3f3f0000
# attempt to link a keyring to its great great great great grandchild keyring
marker "RECURSE 7"
@@ -81,8 +88,11 @@ expect_error EDEADLK
# create an eigth keyring in the seventh
marker "CREATE KEYRING 8"
-create_keyring "eighth" $keyring7id
+create_keyring "eighth" @s
expect_keyid keyring8id
+set_key_perm $keyring8id 0x3f3f0000
+link_key $keyring8id $keyring7id
+unlink_key $keyring8is @s
# attempt to link a keyring to its great great great great great grandchild keyring
marker "RECURSE 8"
@@ -93,6 +103,7 @@ expect_error EDEADLK
marker "CREATE KEYRING 9"
create_keyring "ninth" $keyring8id
expect_keyid keyring9id
+set_key_perm $keyring9id 0x3f3f0000
# attempt to link a keyring to its great great great great great great grandchild keyring
marker "RECURSE 9"