From: Anders Kaseorg Date: Tue, 26 Jul 2016 01:04:59 +0000 (-0400) Subject: Linux 4.7: Follow key_alloc API change X-Git-Tag: upstream/1.8.0_pre1^2~57 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=83a0f2a9ef88e63fbd300fbb436c17ca80c245b4;p=packages%2Fo%2Fopenafs.git 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. Change-Id: I83e27b54ba5711124dccaa41de7155be77054f47 Reviewed-on: https://gerrit.openafs.org/12345 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Reviewed-by: Benjamin Kaduk --- diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index d7de39eea..d5916266b 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);