From d0a13fe678412464452afae9379d63fa48d41d83 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 7 Nov 2013 15:37:25 -0500 Subject: [PATCH] Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://gerrit.openafs.org/10443 Reviewed-by: Derrick Brashear Reviewed-by: Stephan Wiesand Reviewed-by: Marc Dionne Tested-by: BuildBot --- acinclude.m4 | 1 - src/afs/LINUX/osi_compat.h | 8 -------- src/cf/linux-test4.m4 | 12 ------------ 3 files changed, 21 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 6ed9d838e6..695a139a72 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h index 71ffb407b6..105a7e9390 100644 --- a/src/afs/LINUX/osi_compat.h +++ b/src/afs/LINUX/osi_compat.h @@ -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 diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 68ad2d63fe..dad91d9027 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 - #include ], - [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],