]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
common/encrypt: use a sub-keyring within the session keyring
authorEric Biggers <ebiggers@google.com>
Thu, 14 Apr 2022 07:19:32 +0000 (00:19 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 17 Apr 2022 12:31:38 +0000 (20:31 +0800)
commit16676f2f2c3b19f19b5cb259e95139351e6e9bc2
treeea0b3ab563fe3164577ee15d43bb0ca78bf46665
parentd26e6be1290c27c4639439570ad0c8bf9ce5a5db
common/encrypt: use a sub-keyring within the session keyring

Make the encryption tests create and use a named keyring "xfstests" in
the session keyring that the tests happen to be running under, rather
than replace the session keyring using 'keyctl new_session'.
Unfortunately, the latter doesn't work when the session keyring is owned
by a non-root user, which (depending on the Linux distro) can happen if
xfstests is run in a sudo "session" rather than in a real root session.

This isn't a great solution, as the lifetime of the keyring will no
longer be tied to the tests as it should be, but it should work.  The
alternative would be the weird hack of making the 'check' script
re-execute itself using something like 'keyctl session - $0 $@'.

Reported-by: Ritesh Harjani <ritesh.list@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
12 files changed:
common/encrypt
tests/ext4/024
tests/generic/397
tests/generic/398
tests/generic/399
tests/generic/419
tests/generic/421
tests/generic/429
tests/generic/435
tests/generic/440
tests/generic/576
tests/generic/593