From ddb15e306727b79e3ee92f2bd465475d164d3d09 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 25 Jul 2016 21:04:59 -0400 Subject: [PATCH] Linux 4.7: Follow key_alloc API change Linux v4.7-rc1~124^2~2^2^2~9 adds an eighth optional argument restrict_link. The same commit adds a KEY_ALLOC_BYPASS_RESTRICTION macro, which we test so we can avoid adding another configure test. Reviewed-on: https://gerrit.openafs.org/12345 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Reviewed-by: Benjamin Kaduk (cherry picked from commit 83a0f2a9ef88e63fbd300fbb436c17ca80c245b4) Change-Id: I1ba16468888e160fdedf90ff1a9007d90dce9c3b Reviewed-on: https://gerrit.openafs.org/12348 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk Reviewed-by: Joe Gorse Tested-by: Joe Gorse Reviewed-by: Stephan Wiesand --- src/afs/LINUX/osi_compat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index 059627395..a25fd2ee4 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -190,7 +190,9 @@ static inline struct key * afs_linux_key_alloc(struct key_type *type, const char *desc, afs_kuid_t uid, afs_kgid_t gid, key_perm_t perm, unsigned long flags) { -# if defined(KEY_ALLOC_NEEDS_STRUCT_TASK) +# if defined(KEY_ALLOC_BYPASS_RESTRICTION) + return key_alloc(type, desc, uid, gid, current_cred(), perm, flags, NULL); +# elif defined(KEY_ALLOC_NEEDS_STRUCT_TASK) return key_alloc(type, desc, uid, gid, current, perm, flags); # elif defined(KEY_ALLOC_NEEDS_CRED) return key_alloc(type, desc, uid, gid, current_cred(), perm, flags); -- 2.39.5