[tar/f17] Force extended attributes to be stored after fchown(2) (#771927)
Pavel Raiskup
praiskup at fedoraproject.org
Thu Jul 12 09:26:59 UTC 2012
commit 4e0f0eca7cb54f8091a33d76cf27551c35e22edd
Author: Pavel Raiskup <praiskup at redhat.com>
Date: Thu Jul 12 11:26:40 2012 +0200
Force extended attributes to be stored after fchown(2) (#771927)
tar-1.24-xattrs.patch | 18 ++++++++++--------
tar.spec | 4 +++-
2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/tar-1.24-xattrs.patch b/tar-1.24-xattrs.patch
index 7140556..cb147b6 100644
--- a/tar-1.24-xattrs.patch
+++ b/tar-1.24-xattrs.patch
@@ -368,17 +368,19 @@ diff -urNp tar-1.24-orig/src/extract.c tar-1.24/src/extract.c
/* The desired target of the desired link. */
char target[1];
};
-@@ -335,6 +355,10 @@ set_stat (char const *file_name,
- utime_error (file_name);
- }
-
+@@ -360,6 +380,12 @@ set_stat (char const *file_name,
+ st->stat.st_mode & ~ current_umask,
+ 0 < same_permissions_option && ! interdir ? MODE_ALL : MODE_RWX,
+ fd, current_mode, current_mode_mask, typeflag, atflag);
++
++ /* these three calls must be done *after* fd_chown() call because fd_chown
++ causes that linux capabilities becomes cleared */
+ xattrs_acls_set(st, file_name, typeflag);
+ xattrs_selinux_set(st, file_name, typeflag);
+ xattrs_xattrs_set(st, file_name, typeflag);
-+
- if (0 < same_owner_option && ! interdir)
- {
- /* Some systems allow non-root users to give files away. Once this
+ }
+
+ /* For each entry H in the leading prefix of entries in HEAD that do
@@ -431,6 +455,36 @@ delay_set_stat (char const *file_name, s
data->atflag = atflag;
data->after_links = 0;
diff --git a/tar.spec b/tar.spec
index 5bdfcbc..5e553b1 100644
--- a/tar.spec
+++ b/tar.spec
@@ -5,7 +5,7 @@ Summary: A GNU file archiving program
Name: tar
Epoch: 2
Version: 1.26
-Release: 6%{?dist}
+Release: 7%{?dist}
License: GPLv3+
Group: Applications/Archiving
URL: http://www.gnu.org/software/tar/
@@ -127,6 +127,8 @@ fi
%{_infodir}/tar.info*
%changelog
+* Thu Jul 12 2012 Pavel Raiskup <praiskup at redhat.com 2:1.26-7
+- force the fchown() be called before xattrs_set() (#771927)
* Sat Jun 16 2012 Ondrej Vasik <ovasik at redhat.com> 2:1.26-6
- add virtual provides for bundled(gnulib) copylib (#821790)
- store&restore security.capability extended attributes category
More information about the scm-commits
mailing list