head, od, split, tac, tail, and wc no longer mishandle input from files in
/proc and /sys file systems that report somewhat-incorrect file sizes.
+ mkdir --parents -Z now correctly sets the context for the last component,
+ even if the parent directory exists and has a different default context.
+ [bug introduced with the -Z restorecon functionality in coreutils-8.22]
+
paste no longer truncates output for large input files. This would happen
for example with files larger than 4GiB on 32 bit systems with a '\n'
character at the 4GiB position.
process_dir (char *dir, struct savewd *wd, void *options)
{
struct mkdir_options const *o = options;
- bool set_defaultcon = false;
/* If possible set context before DIR created. */
if (o->set_security_context)
{
- if (! o->make_ancestor_function)
- set_defaultcon = true;
- else
- {
- char *pdir = dir_name (dir);
- struct stat st;
- if (STREQ (pdir, ".")
- || (stat (pdir, &st) == 0 && S_ISDIR (st.st_mode)))
- set_defaultcon = true;
- free (pdir);
- }
- if (set_defaultcon && defaultcon (dir, S_IFDIR) < 0
+ if (! o->make_ancestor_function && defaultcon (dir, S_IFDIR) < 0
&& ! ignorable_ctx_err (errno))
error (0, errno, _("failed to set default creation context for %s"),
quote (dir));
final component of DIR is created. So for now, create the
final component with the context from previous component
and here we set the context for the final component. */
- if (ret == EXIT_SUCCESS && o->set_security_context && ! set_defaultcon)
+ if (ret == EXIT_SUCCESS && o->set_security_context
+ && o->make_ancestor_function)
{
if (! restorecon (last_component (dir), false, false)
&& ! ignorable_ctx_err (errno))
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ mkdir
+print_ver_ mkdir mknod mkfifo
require_selinux_
mkdir -Z single || fail=1
# Run these as separate processes in case global context
# set for an arg, impacts on another arg
+ # TODO: Have the defaultcon() vary over these directories
for dir in single_p single_p/existing multi/ple; do
mkdir -Zp "$dir" || fail=1
done