inode_permission problem

From: Javier Valencia (jvalencia@private)
Date: Sat Nov 27 2004 - 05:36:22 PST


Hi all, i'm trying to use a very simple function to print when inode_permission is called:

line_number    code
--------------------------------------------

53    static int smac_inode_permission (struct inode *inode, int mask, struct nameidata *nd)
54    {
55        if (nd)
56        {
57            if (nd->dentry)
58                printk(KERN_INFO "inode_permission on: %s\n", nd->dentry->d_name.name);
59        }
60        return 0;
61    }


I get the following errors when compiling:

enigma linux # make modules
  CHK     include/linux/version.h
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
  CHK     include/asm-i386/asm_offsets.h
  CC [M]  security/smac.o
security/smac.c: In function `smac_inode_permission':
security/smac.c:57: error: dereferencing pointer to incomplete type
security/smac.c:58: error: dereferencing pointer to incomplete type
make[1]: *** [security/smac.o] Error 1
make: *** [security] Error 2

If i delete "nd->entry" it works. It looks like nd is not populated. Do i have to populate it with some function?
My kernel is a vanilla 2.6.9

thanks.



This archive was generated by hypermail 2.1.3 : Sat Nov 27 2004 - 05:41:17 PST