GNU bug report logs - #18748
cp doesn't behaves as mkdir and touch when a default acl exists.

Previous Next

Package: coreutils;

Reported by: f0rhum <f0rhum <at> free.fr>

Date: Thu, 16 Oct 2014 19:15:02 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #36 received at 18748 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Grünbacher <andreas.gruenbacher <at> gmail.com>
To: 18748 <at> debbugs.gnu.org
Subject: Re: cp doesn't behaves as mkdir and touch when a default acl exists
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




This bug report was last modified 10 years and 45 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.