#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define err(msg) printk(KERN_INFO "%s failed.\n", msg)
static int __init main_init(void)
{
int err;
char path[256] = "/bin/mkdir";
char *argv[] = { path, "/root/tmp", NULL };
static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
err = call_usermodehelper(path, argv, envp, 1);
if (err < 0) {
err("call_usermodehelper");
goto out;
}
return 0;
out:
return -1;
}
static void __exit main_exit(void)
{
}
module_init(main_init);
module_exit(main_exit);
MODULE_LICENSE("GPL");
阅读(6318) | 评论(0) | 转发(0) |