bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH]: cp: make -a option preserve SELinux context and xattrs with


From: Jim Meyering
Subject: Re: [PATCH]: cp: make -a option preserve SELinux context and xattrs with reduced diagnostics
Date: Tue, 17 Feb 2009 17:32:33 +0100

Ondřej Vašík <address@hidden> wrote:
> Jim Meyering wrote:
>> Ondřej Vašík <address@hidden> wrote:
>> > What about to split that into two patches? One for SELinux changes and
>> > one for xattr changes (commited after 7.1) - to make it more safe - and
>> > to give other distros more time to fix the leak...
>> 
>> That sounds even better.  I see that debian stable's libattr1-dev
>> is at 1:2.4.43-2, which means it has the leak.
>> Please do.
>
> Ok, split patches attached.

Thanks!  Looking at them now.

> Note: in the xattr patch there is no NEWS at the moment as it would
> cause conflict when added after 7.1 release - I guess something like
> "cp: -a option tries to preserve xattrs but doesn't inform about
> failure" would be ok.
...
> From 57d3893e8454f766e0b48e107b10e64da9c511be Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <address@hidden>
> Date: Tue, 17 Feb 2009 16:06:48 +0100
> Subject: [PATCH] cp: make -a option preserve xattrs with reduced diagnostics
>
> * copy.c (copy_attr_by_fd): Reduce xattr diagnostics for 'cp -a'.
>   (copy_attr_by_name): Likewise.
> * cp.c (main):  preserve xattrs with -a option, when possible
> * doc/coreutils.texi: document that xattrs are preserved with
>   cp -a, with no added diagnostics
> * tests/misc/xattr: Add tests for 'cp --preserve=all' and 'cp -a'.
...
> diff --git a/src/cp.c b/src/cp.c
> index 57907cc..0dda228 100644
> --- a/src/cp.c
> +++ b/src/cp.c
> @@ -931,6 +931,7 @@ main (int argc, char **argv)
>         x.require_preserve = true;
>         if (selinux_enabled)
>            x.preserve_security_context = true;
> +       x->preserve_xattr = true;
>         x.reduce_diagnostics = true;

Oops.  That doesn't compile.
You'll want to fold this onto your change.

>From bd615f930122e88e4e6fbca25131326fcf7d6260 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 17 Feb 2009 17:29:46 +0100
Subject: [PATCH] fix compile failure

---
 src/cp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/cp.c b/src/cp.c
index 0dda228..1ad6b13 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -931,7 +931,7 @@ main (int argc, char **argv)
          x.require_preserve = true;
          if (selinux_enabled)
             x.preserve_security_context = true;
-         x->preserve_xattr = true;
+         x.preserve_xattr = true;
          x.reduce_diagnostics = true;
          x.recursive = true;
          break;
-- 
1.6.2.rc1.175.g96b8a




reply via email to

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