Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/selinux_common.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/selinux_common.c
r1765 r2725 4 4 * 5 5 * Copyright 2007 KaiGai Kohei <kaigai@kaigai.gr.jp> 6 * 7 * Licensed under GPLv2, see file LICENSE in this source tree. 6 8 */ 7 9 #include "libbb.h" 8 10 #include <selinux/context.h> 9 11 10 context_t set_security_context_component(security_context_t cur_context,12 context_t FAST_FUNC set_security_context_component(security_context_t cur_context, 11 13 char *user, char *role, char *type, char *range) 12 14 { … … 30 32 } 31 33 32 void setfscreatecon_or_die(security_context_t scontext)34 void FAST_FUNC setfscreatecon_or_die(security_context_t scontext) 33 35 { 34 36 if (setfscreatecon(scontext) < 0) { 35 37 /* Can be NULL. All known printf implementations 36 38 * display "(null)", "<null>" etc */ 37 bb_perror_msg_and_die("can not set default "39 bb_perror_msg_and_die("can't set default " 38 40 "file creation context to %s", scontext); 39 41 } 40 42 } 43 44 void FAST_FUNC selinux_preserve_fcontext(int fdesc) 45 { 46 security_context_t context; 47 48 if (fgetfilecon(fdesc, &context) < 0) { 49 if (errno == ENODATA || errno == ENOTSUP) 50 return; 51 bb_perror_msg_and_die("fgetfilecon failed"); 52 } 53 setfscreatecon_or_die(context); 54 freecon(context); 55 }
Note:
See TracChangeset
for help on using the changeset viewer.