MCPcopy Create free account
hub / github.com/coreutils/coreutils / set_file_security_ctx

Function set_file_security_ctx

src/copy.c:637–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635 Return false on failure, true on success. */
636
637bool
638set_file_security_ctx (char const *dst_name,
639 bool recurse, const struct cp_options *x)
640{
641 bool all_errors = (!x->data_copy_required
642 || x->require_preserve_context);
643 bool some_errors = !all_errors && !x->reduce_diagnostics;
644
645 if (! restorecon (x->set_security_context, dst_name, recurse))
646 {
647 if (all_errors || (some_errors && !errno_unsupported (errno)))
648 error (0, errno, _("failed to set the security context of %s"),
649 quoteaf_n (0, dst_name));
650 return false;
651 }
652
653 return true;
654}
655
656#if HAVE_FCLONEFILEAT && !USE_XATTR
657# include <sys/acl.h>

Callers 3

copy_regFunction · 0.85
copy_internalFunction · 0.85
make_dir_parents_privateFunction · 0.85

Calls 2

errno_unsupportedFunction · 0.85
restoreconFunction · 0.70

Tested by

no test coverage detected