From e82999dedffd04e456b943d481a48db427ba6422 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rainer=20Sch=C3=B6pf?= Date: Mon, 21 Jun 2004 22:54:15 +0000 Subject: [PATCH] linux26-i-security-20040621 configure test is shadow@dementia.org's fault test for i_security inode field and init if exists --- acinclude.m4 | 4 ++++ src/afs/afs_vcache.c | 6 ++++++ src/afs/sysincludes.h | 3 +++ src/cf/linux-test4.m4 | 16 ++++++++++++++++ 4 files changed, 29 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 2b995322c..67ee5d2c0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -181,6 +181,7 @@ case $system in LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS LINUX_FS_STRUCT_INODE_HAS_I_DEVICES + LINUX_FS_STRUCT_INODE_HAS_I_SECURITY LINUX_INODE_SETATTR_RETURN_TYPE LINUX_KERNEL_LINUX_SYSCALL_H LINUX_KERNEL_SELINUX @@ -274,6 +275,9 @@ case $system in if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices]) fi + if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then + AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security]) + fi if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers]) fi diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 6f56d46b1..a4c113030 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -1051,6 +1051,12 @@ afs_NewVCache(struct VenusFid *afid, struct server *serverp) #if !defined(AFS_LINUX26_ENV) if (afs_globalVFS) ip->i_dev = afs_globalVFS->s_dev; +#else +#ifdef STRUCT_INODE_HAS_I_SECURITY + ip->i_security = NULL; + if (security_inode_alloc(ip)) + panic("Cannot allocate inode security"); +#endif #endif ip->i_sb = afs_globalVFS; put_inode_on_dummy_list(ip); diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index d12b2400e..c87b2a9c8 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -64,6 +64,9 @@ #include #include #include +#ifdef STRUCT_INODE_HAS_I_SECURITY +#include +#endif #include #endif /* Avoid conflicts with coda overloading AFS type namespace. Must precede diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index dc4b79d94..08e0c974b 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -285,6 +285,22 @@ AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared) CPPFLAGS="$save_CPPFLAGS"]) +AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [ +AC_MSG_CHECKING(for i_security in struct inode) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_security, +[ +AC_TRY_COMPILE( +[#include ], +[struct inode _inode; +printf("%d\n", _inode.i_security);], +ac_cv_linux_fs_struct_inode_has_i_security=yes, +ac_cv_linux_fs_struct_inode_has_i_security=no)]) +AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security) +CPPFLAGS="$save_CPPFLAGS"]) + + AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE],[ AC_MSG_CHECKING(for recalc_sigpending arg type) save_CPPFLAGS="$CPPFLAGS" -- 2.39.5