예제 #1
0
static int __init realtime_init(void)
{
	/* register ourselves with the security framework */
	if (register_security(&capability_ops)) {

		/* try registering with primary module */
		if (mod_reg_security(MY_NAME, &capability_ops)) {
			printk(KERN_INFO RT_ERR "Failure registering "
			       "capabilities with primary security module.\n");
			printk(KERN_INFO RT_ERR "Is kernel configured "
			       "with CONFIG_SECURITY_CAPABILITIES=m?\n");
			return -EINVAL;
		}
		secondary = 1;
	}

	if (rt_any)
		printk(KERN_INFO RT_LSM
		       "initialized (all groups, mlock=%d)\n", rt_mlock);
	else if (rt_gid == -1)
		printk(KERN_INFO RT_LSM
		       "initialized (no groups, mlock=%d)\n", rt_mlock);
	else
		printk(KERN_INFO RT_LSM
		       "initialized (group %d, mlock=%d)\n", rt_gid, rt_mlock);

	return 0;
}
예제 #2
0
static int __init capability_init (void)
{
	/* register ourselves with the security framework */
	if (register_security (&capability_ops)) {
		printk (KERN_INFO
			"Failure registering capabilities with the kernel\n");
		/* try registering with primary module */
		if (mod_reg_security (MY_NAME, &capability_ops)) {
			printk (KERN_INFO "Failure registering capabilities "
				"with primary security module.\n");
			return -EINVAL;
		}
		secondary = 1;
	}
	printk (KERN_INFO "Capability LSM initialized\n");
	return 0;
}
예제 #3
0
static int __init tuxguardian_init (void)
{

  /* register ourselves with the security framework */
  if (register_security (&tuxguardian_security_ops)) {

    printk(KERN_INFO "Failure registering TuxGuardian module with the kernel\n");

    /* try registering as the primary module */
    if (mod_reg_security (MY_NAME, &tuxguardian_security_ops)) {
      printk(KERN_INFO "Failure registering TuxGuardian as the primary security module\n");
      return -EINVAL;
    }
  }

  printk (KERN_INFO "TuxGuardian initialized\n");
  return 0;
}
예제 #4
0
static int __init capability_init (void)
{
	if (capability_disable) {
		printk(KERN_INFO "Capabilities disabled at initialization\n");
		return 0;
	}
	/* register ourselves with the security framework */
	if (register_security (&capability_ops)) {
		/* try registering with primary module */
		if (mod_reg_security (KBUILD_MODNAME, &capability_ops)) {
			printk (KERN_INFO "Failure registering capabilities "
				"with primary security module.\n");
			return -EINVAL;
		}
		secondary = 1;
	}
	printk (KERN_INFO "Capability LSM initialized%s\n",
		secondary ? " as secondary" : "");
	return 0;
}
예제 #5
0
파일: tpe.c 프로젝트: abhisek/eos-india
int tpe_init(void)
{
	int retval;

	secondary = 0;
	retval = register_security(&tpe_security_ops);
	if(unlikely(retval)) {
		retval = mod_reg_security(TPE_MODULE_NAME, &tpe_security_ops);
		if(unlikely(retval)) {
			TPE_INFO("Failed to register with kernel");

			return -EINVAL;
		}
		secondary = 1;
	}

	retval = tpe_register_procfs();
	if(unlikely(retval)) {
		tpe_exit();
		return -EINVAL;
	}

	retval = tpe_init_acl();
	if(unlikely(retval)) {
		tpe_exit();
		return -EINVAL;
	}

	retval = tpe_init_conf();
	if(unlikely(retval)) {
		tpe_exit();
		return -EINVAL;
	}
	
	TPE_INFO("Registered successfully with the kernel");
	return 0;
}