mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
DEVEL15-linux-keyring-export-check-20090701
LICENSE IPL10 FIXES 125001 check for key_type_keyring being exported; only use it if so (cherry picked from commit 4ca66112c2a012e04619445275507ae9cd6c11da)
This commit is contained in:
parent
c02f9d1d30
commit
8f71815c74
@ -941,6 +941,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
|||||||
LINUX_KERNEL_PAGE_FOLLOW_LINK
|
LINUX_KERNEL_PAGE_FOLLOW_LINK
|
||||||
LINUX_KERNEL_HLIST_UNHASHED
|
LINUX_KERNEL_HLIST_UNHASHED
|
||||||
LINUX_KEY_TYPE_H_EXISTS
|
LINUX_KEY_TYPE_H_EXISTS
|
||||||
|
LINUX_EXPORTS_KEY_TYPE_KEYRING
|
||||||
LINUX_NEED_RHCONFIG
|
LINUX_NEED_RHCONFIG
|
||||||
LINUX_RECALC_SIGPENDING_ARG_TYPE
|
LINUX_RECALC_SIGPENDING_ARG_TYPE
|
||||||
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
|
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
|
||||||
|
@ -637,6 +637,7 @@ extern rwlock_t tasklist_lock __attribute__((weak));
|
|||||||
|
|
||||||
void osi_keyring_init(void)
|
void osi_keyring_init(void)
|
||||||
{
|
{
|
||||||
|
#if !defined(EXPORTED_KEY_TYPE_KEYRING)
|
||||||
struct task_struct *p;
|
struct task_struct *p;
|
||||||
|
|
||||||
/* If we can't lock the tasklist, either with its explicit lock,
|
/* If we can't lock the tasklist, either with its explicit lock,
|
||||||
@ -660,10 +661,7 @@ void osi_keyring_init(void)
|
|||||||
#if defined(EXPORTED_FIND_TASK_BY_PID)
|
#if defined(EXPORTED_FIND_TASK_BY_PID)
|
||||||
p = find_task_by_pid(1);
|
p = find_task_by_pid(1);
|
||||||
#else
|
#else
|
||||||
p = pid_task(1, PIDTYPE_PID);
|
|
||||||
/*
|
|
||||||
p = find_task_by_vpid(1);
|
p = find_task_by_vpid(1);
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
if (p && task_user(p)->session_keyring)
|
if (p && task_user(p)->session_keyring)
|
||||||
__key_type_keyring = task_user(p)->session_keyring->type;
|
__key_type_keyring = task_user(p)->session_keyring->type;
|
||||||
@ -678,6 +676,7 @@ void osi_keyring_init(void)
|
|||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
register_key_type(&key_type_afs_pag);
|
register_key_type(&key_type_afs_pag);
|
||||||
|
@ -1245,3 +1245,22 @@ AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
|
|||||||
AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
|
AC_DEFINE([POSIX_TEST_LOCK_CONFLICT_ARG], 1, [define if posix_test_lock takes a conflict argument])
|
||||||
fi])
|
fi])
|
||||||
|
|
||||||
|
AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
|
||||||
|
AC_MSG_CHECKING([for exported key_type_keyring])
|
||||||
|
AC_CACHE_VAL([ac_cv_linux_exports_key_type_keyring], [
|
||||||
|
AC_TRY_KBUILD(
|
||||||
|
[
|
||||||
|
#ifdef KEY_TYPE_H_EXISTS
|
||||||
|
#include <linux/key-type.h>
|
||||||
|
#endif
|
||||||
|
#include <linux/key.h>],
|
||||||
|
[
|
||||||
|
printk("%s", key_type_keyring.name);
|
||||||
|
],
|
||||||
|
ac_cv_linux_exports_key_type_keyring=yes,
|
||||||
|
ac_cv_linux_exports_key_type_keyring=no)])
|
||||||
|
AC_MSG_RESULT($ac_cv_linux_exports_key_type_keyring)
|
||||||
|
if test "x$ac_cv_linux_exports_key_type_keyring" = "xyes"; then
|
||||||
|
AC_DEFINE([EXPORTED_KEY_TYPE_KEYRING], 1, [define if key_type_keyring is exported])
|
||||||
|
fi])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user