bug-diffutils
[Top][All Lists]
Advanced

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

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


From: Thomas Keller
Subject: Re: [bug-diffutils] Does patch ignore Linux ACLs?
Date: Sat, 16 Oct 2010 01:11:46 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.2.11) Gecko/20101004 Lightning/1.0b3pre Thunderbird/3.1.5

Am 16.10.10 00:55, schrieb Paul Eggert:
> On 10/15/10 07:39, Thomas Keller wrote:
>> My umask on some server creates no world-readable files, but this
>> should actually not be a problem when ACLs are in place which inherit
>> permissions from default rules for certain users and groups, right?
>>
>> I was quite astouned that patch(1) however ignored these default ACLs
>> when it created new files form a patch it received from STDIN. Is this
>> expected behaviour or considered a bug?
> 
> Sorry, I'm lost, and I expect almost any other reader of your email
> would be lost too, as there's not enough context.  Can you please
> tell us a specific way to reproduce the bug?

Oh, sorry, of course. Here we go:

1) Create a test directory and place a default ACL on it for some other
user ("apache" in this example):

$ mkdir test
$ setfacl -m d:u:apache:rwx test
$ getfacl test
# file: test
# owner: me
# group: me
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:apache:rwx
default:group::r-x
default:mask::rwx
default:other::r-x

2) Create a file in test/ with some editor and save some content in it:

~/test $ ls -la
total 12K
drwxr-xr-x+ 2 me me 4.0K 2010-10-16 00:58 ./
drwxr-xr-x  6 me me 4.0K 2010-10-16 00:57 ../
-rw-rw-r--+ 1 me me   16 2010-10-16 00:58 test
~/test $ getfacl test
# file: test
# owner: me
# group: me
user::rw-
user:apache:rwx                 #effective:rw-
group::r-x                      #effective:r--
mask::rw-
other::r--

The created test file gets automatically the expected rights from the
default rule.

3) Now copy test to test2, edit some contents and create a patch:

~/test $ cp test test2
~/test $ nano test2
~/test $ diff -u test test2 > patch
~/test $ cat patch
--- test        2010-10-16 00:58:11.620542512 +0200
+++ test2       2010-10-16 00:58:51.480539647 +0200
@@ -1,2 +1,3 @@
 This is a test
+This is a new line

Everything still looks ok here:

~/test $ ll
total 20K
drwxr-xr-x+ 2 me me 4.0K 2010-10-16 00:59 ./
drwxr-xr-x  6 me me 4.0K 2010-10-16 00:57 ../
-rw-rw-r--+ 1 me me  145 2010-10-16 00:59 patch
-rw-rw-r--+ 1 me me   16 2010-10-16 00:58 test
-rw-rw-r--+ 1 me me   35 2010-10-16 00:58 test2

4) Finally apply this patch:

~/test $ patch -p0 < patch
patching file test
~/test $ ll
total 20K
drwxr-xr-x+ 2 me me 4.0K 2010-10-16 00:59 ./
drwxr-xr-x  6 me me 4.0K 2010-10-16 00:57 ../
-rw-rw-r--+ 1 me me  145 2010-10-16 00:59 patch
-rw-rw-r--  1 me me   35 2010-10-16 00:59 test
-rw-rw-r--+ 1 me me   35 2010-10-16 00:58 test2
~/test $ getfacl test
# file: test
# owner: me
# group: me
user::rw-
group::rw-
other::r--

And suddenly the test file lost its ACL - do'h!

This is patch 2.5.9, btw.

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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