Sir this is our program”#include <linux/kernel.h>
#include
<linux/init.h>
#include
<linux/module.h>
#include
<linux/security.h>
static int
test2_mkdir (struct inode *dir,
struct dentry *dentry, int mode)
{
printk
(KERN_INFO "Got call for mkdir in inode %ld "
"to mkdir %s with mode %d\n", dir->i_ino,
(dentry->d_name).name, mode);
return
0;
}/* Use the
capability functions for some of the hooks */
static struct
security_operations test2_sec_ops = {
.inode_mkdir = test2_mkdir
};
static int
__init test2_init (void)
{
/*
register ourselves with the security framework */
if
(register_security (&test2_sec_ops)) {
printk
(KERN_INFO"Failure registering Test 2 module with the kernel\n");
return
-EINVAL;
}
printk
(KERN_INFO "Test2 module initialized");
return
0;
}
static void
__exit test2_exit (void)
{
printk
(KERN_INFO "Test2 unregistered\n");
}
module_init
(test2_init);
module_exit
(test2_exit);
MODULE_LICENSE("GPL");”
While executing
this program I got a following error mainly”register_security is undefined”
But I have
included the header file”#include
<linux/security.h>”then what may be the reason.
- do I want to check for the security.c file,then what would be the
procedure
- what may be the other reasons,please clear
this doubt
please guide
me