/* vi: set sw=4 ts=4: */
/*
- * Copyright (C) 2003 by Glenn McGrath <bug1@iinet.net.au>
+ * Copyright (C) 2003 by Glenn McGrath <bug1@iinet.net.au>
+ * SELinux support: by Yuichi Nakamura <ynakam@hitachisoft.jp>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
if (!is_selinux_enabled()) {
return;
- }
+ }
if (lstat(path, &s) != 0) {
return;
}
/* -c exists for backwards compatibility, it's needed */
flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext));
-
+
#if ENABLE_SELINUX
if (flags & OPT_PRESERVE_SECURITY_CONTEXT) {
use_default_selinux_context = 0;
}
if (flags & OPT_SET_SECURITY_CONTEXT) {
selinux_or_die();
- if (setfscreatecon(scontext) < 0) {
- bb_error_msg_and_die("setfscreatecon(%s)", scontext); // perror?
- }
+ setfscreatecon_or_die(scontext);
use_default_selinux_context = 0;
copy_flags |= FILEUTILS_SET_SECURITY_CONTEXT;
}