Subject: Re: cp doesn't behaves as mkdir and touch when a default acl exists

From: Andreas Grünbacher <[email-masked]>
Date: Mon, 13 Apr 2015 01:10:21 +0200

When a file is copied with cp, the default is to create the new file
in the target directory, with the file mode of the original file as
the create mode. This default can be overridden with cp's -p or
--preserve=mode options.

This has the following effect:

 * In the absence of a default acl, the new file will have the original
   file's permission bits minus the umask.

 * In the presence of a default acl, the default acl replaces the umask.
   The new file will inherit the default acl, which results in an imaginary
   file mode. The actual file mode is set to the intersection of the original
   file's permission bits and this imaginary file mode.

This is not a bug, it is the expected and documented behavior; see the
POSIX standard, POSIX 1003.1e/2c draft standard [*], and also the
coreutils info pages (info coreutils 'cp invocation') which could be
improved.

[*] http://wt.tuxomania.net/publications/posix.1e/download.html

Andreas