From: Anders Kaseorg Date: Thu, 7 Nov 2013 20:37:25 +0000 (-0500) Subject: Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case X-Git-Tag: upstream/1.6.6_pre2^2~14 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8f88530289297117b001d81843e3ac23564815d0;p=packages%2Fo%2Fopenafs.git Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case 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). 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 (cherry picked from commit d0a13fe678412464452afae9379d63fa48d41d83) Change-Id: I081115d13b6deb3b10e6da442bed7a7bb9347296 Reviewed-on: http://gerrit.openafs.org/10458 Reviewed-by: Marc Dionne Tested-by: BuildBot Tested-by: Anders Kaseorg Reviewed-by: Anders Kaseorg Reviewed-by: Stephan Wiesand --- diff --git a/acinclude.m4 b/acinclude.m4 index 09b0747de..bf9abe332 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -996,7 +996,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 783b92c36..61b4a09f2 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 5508a69fd..b068af5a1 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],