]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX 5.3.0: Check for 'recurse' arg in keyring_search
authorCheyenne Wills <cwills@sinenomine.net>
Thu, 8 Aug 2019 22:53:13 +0000 (16:53 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 6 Sep 2019 14:58:07 +0000 (10:58 -0400)
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: I038117d1bccdf619a42132fba7d8d61b3ce3c14b
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>
Reviewed-on: https://gerrit.openafs.org/13787
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/LINUX/osi_compat.h
src/cf/linux-kernel-assorted.m4
src/cf/linux-test4.m4

index abe6b711be000aa71be737b5cd5a05f6195f1111..d236081431d613999fc6222344785245329fb97a 100644 (file)
@@ -222,9 +222,15 @@ afs_linux_search_keyring(afs_ucred_t *cred, struct key_type *type)
     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);
 
index b991c3a617cb3dfdf95aa3752e6a965789cb2c23..03d5f6583048f86e5f7322a839bd053c97b153c1 100644 (file)
@@ -55,6 +55,7 @@ LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED
 LINUX_IOP_LOOKUP_TAKES_UNSIGNED
 LINUX_D_INVALIDATE_IS_VOID
 LINUX_KERNEL_READ_OFFSET_IS_LAST
+LINUX_KEYRING_SEARCH_TAKES_RECURSE
 ])
 
 
index cf82056759797f12425f0460c040da49bfb65fe4..f7699cec31ce23399294adfde2c72f6196c6a105 100644 (file)
@@ -836,3 +836,16 @@ AC_DEFUN([LINUX_KERNEL_READ_OFFSET_IS_LAST], [
                        [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],
+                       [])
+])