Ejemplo n.º 1
0
/**
 * ccs_run_loader - Start /sbin/ccs-init .
 *
 * @unused: Not used.
 *
 * Returns PID of /sbin/ccs-init on success, negative value otherwise.
 */
static int ccs_run_loader(void *unused)
{
	char *argv[2];
	char *envp[3];
	printk(KERN_INFO "Calling %s to load policy. Please wait.\n",
	       ccs_loader);
	argv[0] = (char *) ccs_loader;
	argv[1] = NULL;
	envp[0] = "HOME=/";
	envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
	envp[2] = NULL;
	return exec_usermodehelper(argv[0], argv, envp);
}
Ejemplo n.º 2
0
/*
 * This is the task which runs the usermode application
 */
static int ____call_usermodehelper(void *data)
{
    struct subprocess_info *sub_info = data;
    int retval;

    retval = -EPERM;
    if (current->fs->root)
        retval = exec_usermodehelper(sub_info->path, sub_info->argv, sub_info->envp);

    /* Exec failed? */
    sub_info->retval = (pid_t)retval;
    do_exit(0);
}
Ejemplo n.º 3
0
static int exec_modprobe(void * module_name)
{
    static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
    char *argv[] = { modprobe_path, "-s", "-k", "--", (char*)module_name, NULL };
    int ret;

    ret = exec_usermodehelper(modprobe_path, argv, envp);
    if (ret)
    {
        printk(KERN_ERR
               "kmod: failed to exec %s -s -k %s, errno = %d\n",
               modprobe_path, (char*) module_name, errno);
    }
    return ret;
}