Linux 5.3.0 commit
dcf49dbc8077e278ddd1bc7298abc781496e8a08 "keys: Add a
'recurse' flag for keyring searches" adds a new parameter to
Linux kernel keyring_search function.
Update the call to keyring_search to include the recurse parameter if
available. Setting the parameter to true (1) maintains the current
search behavior.
Change-Id: I54b7ed686bf1fb4c42789e5d251ae76789e9fc88
Reviewed-on: https://gerrit.openafs.org/13752
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
key_ref_t key_ref;
if (afs_session_keyring(cred)) {
+# if defined(KEYRING_SEARCH_TAKES_RECURSE)
+ key_ref = keyring_search(
+ make_key_ref(afs_session_keyring(cred), 1),
+ type, "_pag", 1);
+# else
key_ref = keyring_search(
make_key_ref(afs_session_keyring(cred), 1),
type, "_pag");
+# endif
if (IS_ERR(key_ref))
return ERR_CAST(key_ref);
LINUX_IOP_LOOKUP_TAKES_UNSIGNED
LINUX_D_INVALIDATE_IS_VOID
LINUX_KERNEL_READ_OFFSET_IS_LAST
+LINUX_KEYRING_SEARCH_TAKES_RECURSE
])
[define if your kernel_read has offset as the last argument],
[])
])
+
+AC_DEFUN([LINUX_KEYRING_SEARCH_TAKES_RECURSE], [
+ AC_CHECK_LINUX_BUILD([whether keyring_search has the recurse parameter],
+ [ac_cv_linux_func_keyring_search_takes_recurse],
+ [#include <linux/key.h>
+ key_ref_t tkey;],
+ [
+ keyring_search(tkey, NULL, NULL, 0);
+ ],
+ [KEYRING_SEARCH_TAKES_RECURSE],
+ [define if your keyring_search has the recurse parameter],
+ [])
+])