handling ACLs on Cygwin and Solaris platforms. [bug introduced in
coreutils-8.24]
+ cp --parents --no-preserve=mode, no longer copies permissions from source
+ directories, instead using default permissions for created directories.
+ [bug introduced in coreutils-5.93]
+
chcon, chgrp, chmod, chown, du, and rm, or specifically utilities
using the FTS interface, now diagnose failures returned by readdir().
[this bug was inherent in the use of fts: thus, for rm the bug was
(src_mode & ~S_IRWXUGO) != 0. However, common practice is
to ask mkdir to copy all the CHMOD_MODE_BITS, letting mkdir
decide what to do with S_ISUID | S_ISGID | S_ISVTX. */
- mkdir_mode = src_mode & CHMOD_MODE_BITS & ~omitted_permissions;
+ mkdir_mode = x->explicit_no_preserve_mode ? S_IRWXUGO : src_mode;
+ mkdir_mode &= CHMOD_MODE_BITS & ~omitted_permissions;
if (mkdir (dir, mkdir_mode) != 0)
{
error (0, errno, _("cannot make directory %s"),
#!/bin/sh
-# cp -R --parents dir-specified-with-trailing-slash/ other-dir
-# would get a failed assertion.
# Copyright (C) 2000-2016 Free Software Foundation, Inc.
# Run the setgid check from the just-created directory.
skip_if_setgid_
-mkdir foo bar || framework_failure_
-mkdir -p a/b/c d e g || framework_failure_
-ln -s d/a sym || framework_failure_
-touch f || framework_failure_
-
+{
+ mkdir foo bar
+ mkdir -p a/b/c d e g
+ ln -s d/a sym
+ touch f
+} || framework_failure_
# With 4.0.37 and earlier (back to when?), this would fail
-# with the failed assertion from dirname.c.
+# with the failed assertion from dirname.c due to the trailing slash.
cp -R --parents foo/ bar || fail=1
# Exercise the make_path and re_protect code in cp.c.
p=$(ls -ld e/d/a/b/c|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
p=$(ls -ld g/sym/b/c|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
+# Before 8.25 cp --parents --no-preserve=mode would copy
+# the mode bits from the source directories
+{
+ mkdir -p np/b &&
+ chmod 0700 np &&
+ touch np/b/file &&
+ chmod 775 np/b/file &&
+ mkdir np_dest
+} || framework_failure_
+cp --parents --no-preserve=mode np/b/file np_dest/ || fail=1
+p=$(ls -ld np_dest/np|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
+
Exit $fail