2007-03-24 15:38:49 +00:00
|
|
|
/*
|
|
|
|
* load_policy
|
|
|
|
* Author: Yuichi Nakamura <ynakam@hitachisoft.jp>
|
2008-12-07 00:52:58 +00:00
|
|
|
*
|
2010-08-16 20:14:46 +02:00
|
|
|
* Licensed under GPLv2, see file LICENSE in this source tree.
|
2007-03-24 15:38:49 +00:00
|
|
|
*/
|
2016-11-23 18:46:40 +01:00
|
|
|
//config:config LOAD_POLICY
|
2017-07-19 14:32:54 +02:00
|
|
|
//config: bool "load_policy (1.6 kb)"
|
2016-11-23 18:46:40 +01:00
|
|
|
//config: default n
|
|
|
|
//config: depends on SELINUX
|
|
|
|
//config: help
|
2017-07-21 09:50:55 +02:00
|
|
|
//config: Enable support to load SELinux policy.
|
2016-11-23 18:46:40 +01:00
|
|
|
|
|
|
|
//applet:IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
|
|
|
|
|
|
|
|
//kbuild:lib-$(CONFIG_LOAD_POLICY) += load_policy.o
|
2011-04-11 03:29:49 +02:00
|
|
|
|
|
|
|
//usage:#define load_policy_trivial_usage NOUSAGE_STR
|
|
|
|
//usage:#define load_policy_full_usage ""
|
|
|
|
|
2007-05-26 19:00:18 +00:00
|
|
|
#include "libbb.h"
|
2007-03-24 15:38:49 +00:00
|
|
|
|
2007-10-11 10:05:36 +00:00
|
|
|
int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2010-01-04 14:15:38 +01:00
|
|
|
int load_policy_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
2007-03-24 15:38:49 +00:00
|
|
|
{
|
2007-09-26 18:01:32 +00:00
|
|
|
int rc;
|
|
|
|
|
2010-01-04 14:15:38 +01:00
|
|
|
if (argv[1]) {
|
2007-03-24 15:38:49 +00:00
|
|
|
bb_show_usage();
|
|
|
|
}
|
|
|
|
|
2007-09-26 18:01:32 +00:00
|
|
|
rc = selinux_mkload_policy(1);
|
|
|
|
if (rc < 0) {
|
2007-03-24 15:38:49 +00:00
|
|
|
bb_perror_msg_and_die("can't load policy");
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|