[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] Re: [bug-diffutils] Does patch ignore Linux ACLs?

From: Andreas Gruenbacher
Subject: [bug-patch] Re: [bug-diffutils] Does patch ignore Linux ACLs?
Date: Wed, 20 Oct 2010 22:41:20 +0200
User-agent: KMail/1.13.5 (Linux/; KDE/4.4.4; x86_64; ; )

On Saturday 16 October 2010 01:36:30 Thomas Keller wrote:
> Am 16.10.10 01:27, schrieb Paul Eggert:
> > On 10/15/10 16:11, Thomas Keller wrote:
> >> And suddenly the test file lost its ACL - do'h!

It is easy to see what happens and why the default ACL is "lost" with strace: 
patch creates a temporary file /tmp/poXXXXXX with the new file contents and 
renames it over the original file.

The latest alpha snapshot at ftp://alpha.gnu.org/gnu/patch/ includes some 
temporary file handling changes/fixes.  Temporary output files are now created 
in the final directory of the file, and so default ACLs will not "disappear" 

This behavior is still wrong when patch modifies an existing file though: ACLs 
and other extended attributes of the original file should be preserved.  There 
is a FIXME comment in src/util.c:set_file_attributes() about this, but I 
didn't get to it, yet.

> > The file didn't lose its ACL.  What happens is that a copy was
> > created, and then renamed over the original. At one point chmod is
> > applied to the copy, so that it has the right permissions.  That's
> > what removes the default ACL.
> Actually chmod(1) should not remove the ACL (and not even the default
> ACL, because this only exists on the directory), but maybe the problem
> is that the default directory ACL is not (automatically) applied to the
> newly created copy?

Chmod never removes POSIX ACLs (but it may mask some of the permissions 
granted by the ACL).

Files always inherit the default ACL of the directory they are in if the 
directory has one.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]