Linux 4.7: Follow key_alloc API change 45/12345/2
authorAnders Kaseorg <andersk@mit.edu>
Tue, 26 Jul 2016 01:04:59 +0000 (21:04 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 26 Jul 2016 16:56:22 +0000 (12:56 -0400)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/LINUX/osi_compat.h

index d7de39e..d591626 100644 (file)
@@ -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);