Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case
authorAnders Kaseorg <andersk@mit.edu>
Thu, 7 Nov 2013 20:37:25 +0000 (15:37 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 13 Nov 2013 15:55:11 +0000 (07:55 -0800)
On the few kernel versions before struct key.uid was converted to
kuid_t (v3.7-rc1~147^2~76), it was not possible to enable both
CONFIG_KEYS and CONFIG_UIDGID_STRICT_TYPE_CHECKS, so this case was
impossible.  That’s good, because it also had a typo in its
implementation (and was confusing to deal with correctly).

Change-Id: I4ecd164ed3604558ed4419bf6f9d531bd5d1a9ff
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10443
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

acinclude.m4
src/afs/LINUX/osi_compat.h
src/cf/linux-test4.m4

index 6ed9d83..695a139 100644 (file)
@@ -1012,7 +1012,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_LINUX_KEYRING_SUPPORT
                 LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK
                 LINUX_KEY_ALLOC_NEEDS_CRED
-                LINUX_STRUCT_KEY_UID_IS_KUID_T
                 LINUX_INIT_WORK_HAS_DATA
                 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
                 LINUX_HAVE_DCACHE_LOCK
index 71ffb40..105a7e9 100644 (file)
@@ -178,14 +178,6 @@ afs_linux_key_alloc(struct key_type *type, const char *desc, afs_kuid_t uid,
 {
 # if defined(KEY_ALLOC_NEEDS_STRUCT_TASK)
     return key_alloc(type, desc, uid, gid, current, perm, flags);
-# elif defined(KEY_ALLOC_NEEDS_CRED) && defined(HAVE_LINUX_KUID_T) && \
-    !defined(STRUCT_KEY_UID_IS_KUID_T)
-    /* In this case, uid and gid are specified relative to
-     * current_cred() */
-    return key_alloc(type, desc,
-                    from_kuid(afs_current_user_ns(), uid),
-                    from_guid(afs_current_user_ns(), gid),
-                    current_cred(), perm, flags);
 # elif defined(KEY_ALLOC_NEEDS_CRED)
     return key_alloc(type, desc, uid, gid, current_cred(), perm, flags);
 # else
index 68ad2d6..dad91d9 100644 (file)
@@ -375,18 +375,6 @@ AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
 ])
 
 
-AC_DEFUN([LINUX_STRUCT_KEY_UID_IS_KUID_T], [
-  AC_CHECK_LINUX_BUILD([if struct key.uid is kuid_t],
-                       [ac_cv_struct_key_uid_is_kuid_t],
-                       [#include <linux/rwsem.h>
-                       #include <linux/key.h>],
-                       [struct key k = {};
-                       kuid_t *kuid = &k.uid;],
-                       [STRUCT_KEY_UID_IS_KUID_T],
-                       [define if struct key.uid is kuid_t])
-])
-
-
 AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
   AC_CHECK_LINUX_BUILD([whether INIT_WORK has a _data argument],
                       [ac_cv_linux_init_work_has_data],