diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-06 19:28:50 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-06 19:28:50 +0000 |
commit | d46d3c292e9aff0550f6540ab631d742fe353964 (patch) | |
tree | 05f6461f18eba790a90a971c41ddb91163ae7847 /libbb/xfuncs.c | |
parent | b292264bfd7064b651192b966f30d76b75161c70 (diff) | |
download | busybox-w32-d46d3c292e9aff0550f6540ab631d742fe353964.tar.gz busybox-w32-d46d3c292e9aff0550f6540ab631d742fe353964.tar.bz2 busybox-w32-d46d3c292e9aff0550f6540ab631d742fe353964.zip |
new applets: selinux utils by KaiGai Kohei <kaigai@kaigai.gr.jp>
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r-- | libbb/xfuncs.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index 3cbb0d3eb..f6444bbc6 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -570,6 +570,21 @@ void xstat(const char *name, struct stat *stat_buf) | |||
570 | bb_perror_msg_and_die("can't stat '%s'", name); | 570 | bb_perror_msg_and_die("can't stat '%s'", name); |
571 | } | 571 | } |
572 | 572 | ||
573 | // selinux_or_die() - die if SELinux is disabled. | ||
574 | void selinux_or_die(void) | ||
575 | { | ||
576 | #if ENABLE_SELINUX | ||
577 | int rc = is_selinux_enabled(); | ||
578 | if (rc == 0) { | ||
579 | bb_error_msg_and_die("SELinux is disabled"); | ||
580 | } else if (rc < 0) { | ||
581 | bb_error_msg_and_die("is_selinux_enabled() failed"); | ||
582 | } | ||
583 | #else | ||
584 | bb_error_msg_and_die("SELinux support is disabled"); | ||
585 | #endif | ||
586 | } | ||
587 | |||
573 | /* It is perfectly ok to pass in a NULL for either width or for | 588 | /* It is perfectly ok to pass in a NULL for either width or for |
574 | * height, in which case that value will not be set. */ | 589 | * height, in which case that value will not be set. */ |
575 | int get_terminal_width_height(const int fd, int *width, int *height) | 590 | int get_terminal_width_height(const int fd, int *width, int *height) |