First of all, stop calling me sir. FYI, I am still a student.
Secondly, you got my email id wrong.
Finally (and the worse) I cannot help you here! I tried inserting the
module but it gives unresolved sysmbols for sys_call_table. Which header
does this data structure belong to? Are you sure such a structure exists in
the kernel. I tried finding but could'nt find it.
--
Goldwyn :o)
Respected sir ,(goldwyn ([EMAIL PROTECTED]) )
Thanks a lot for ur kind help . Sir i have corrected those
error and
compiled the code RAMDISK module. Sir in the below mentioned
program i
am intercepting makedir system call so that user would not
be able to make
any directories . But i am getting " unresolved sysmbol
sys_call_table "
error while inserting the module .Plz help me 2 resolve it
.
Thanks a lot .
My kernel version is 2.4.18.14 .
gcc -DMODULE -D__KERNEL__ -I/usr/src/linux-2.4.18-14/include -Wall -O2 -c
nodir.c -o
nodir.o
/* program nodir.c */
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/smp_lock.h>
#include <linux/sched.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/file.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
#include <asm/errno.h>
#include <asm/io.h>
#include <sys/syscall.h>
extern void* sys_call_table[]; /*sys_call_table is exported, so we
can access it*/
int (*orig_mkdir)(const char *path); /*the original systemcall*/
int hacked_mkdir(const char *path)
{
return 0; /*everything is ok, but he new
systemcall
does nothing*/
}
int init_module(void) /*module setup*/
{
orig_mkdir=sys_call_table[__NR_mkdir];
sys_call_table[__NR_mkdir]=hacked_mkdir;
return 0;
}
void cleanup_module(void) /*module shutdown*/
{
sys_call_table[__NR_mkdir]=orig_mkdir; /*set mkdir syscall to the origal
one*/
}
MODULE_LICENSE("GPL");
=====
[EMAIL PROTECTED]
We all have ability. The difference is how we use it.
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers
--
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers