I am writing kernel module(C in Linux) and I want to change the permission of the other files in it. any solution? since I am in kernel I can't use chmod syscall and ... thanks for your help
This is my Makefile:
> obj-m += ca.o
>
> all:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
> clean:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
And this is my Code:
> #include <linux/string.h>
> #include <linux/mm.h>
> /* Snip, tons of includes (all of them :))*/
> #include <linux/delay.h> .... int procfile_write(struct file *file,
> const char *buffer, unsigned long
> count,
> void *data) { ... sys_chmod(path, per); ... } ...
When Making it gives a warning:
WARNING: "sys_chmod" [file] undefiened
and when loading the module with "sudo insmod" it gives this error:
Unknown sybol in module
it seems that this error happens especialy in kernel modules. any idea? again thanks!