diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-12 18:22:55 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-12 18:22:55 +0000 |
commit | d8d054080fdba1f2dbfc8249a6b51fc3001d6205 (patch) | |
tree | ad535283af2299825f65b6b44c889dc7e7bfc842 /libbb | |
parent | 51afb265f7e30cad62a1ece2940f54d61240e0ce (diff) | |
download | busybox-w32-d8d054080fdba1f2dbfc8249a6b51fc3001d6205.tar.gz busybox-w32-d8d054080fdba1f2dbfc8249a6b51fc3001d6205.tar.bz2 busybox-w32-d8d054080fdba1f2dbfc8249a6b51fc3001d6205.zip |
introduce and use setfscreatecon_or_die
(patch by Yuichi Nakamura <ynakam@hitachisoft.jp>)
runcon: *yet another* fix for vda's brainfart :(
git-svn-id: svn://busybox.net/trunk/busybox@18073 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/copy_file.c | 2 | ||||
-rw-r--r-- | libbb/selinux_common.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 6391824aa..07564afd0 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c | |||
@@ -74,7 +74,7 @@ int copy_file(const char *source, const char *dest, int flags) | |||
74 | } | 74 | } |
75 | } else { | 75 | } else { |
76 | if (errno == ENOTSUP || errno == ENODATA) { | 76 | if (errno == ENOTSUP || errno == ENODATA) { |
77 | setfscreatecon(NULL); | 77 | setfscreatecon_or_die(NULL); |
78 | } else { | 78 | } else { |
79 | bb_perror_msg("cannot lgetfilecon %s", source); | 79 | bb_perror_msg("cannot lgetfilecon %s", source); |
80 | return -1; | 80 | return -1; |
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: | |||
28 | context_free(con); | 28 | context_free(con); |
29 | return NULL; | 29 | return NULL; |
30 | } | 30 | } |
31 | |||
32 | void setfscreatecon_or_die(security_context_t scontext) | ||
33 | { | ||
34 | if (setfscreatecon(scontext) < 0) { | ||
35 | /* Can be NULL. All known printf implementations | ||
36 | * display "(null)", "<null>" etc */ | ||
37 | bb_perror_msg_and_die("cannot set default " | ||
38 | "file creation context to %s", scontext); | ||
39 | } | ||
40 | } | ||