From 39c651e9097e0e55a52c897982d6e84d281f7396 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 12 Mar 2007 18:22:55 +0000 Subject: introduce and use setfscreatecon_or_die (patch by Yuichi Nakamura ) runcon: *yet another* fix for vda's brainfart :( --- libbb/selinux_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbb/selinux_common.c') diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c index 70d63a465..d506f0636 100644 --- a/libbb/selinux_common.c +++ b/libbb/selinux_common.c @@ -28,3 +28,13 @@ error: context_free(con); return NULL; } + +void setfscreatecon_or_die(security_context_t scontext) +{ + if (setfscreatecon(scontext) < 0) { + /* Can be NULL. All known printf implementations + * display "(null)", "" etc */ + bb_perror_msg_and_die("cannot set default " + "file creation context to %s", scontext); + } +} -- cgit v1.2.3