Browse Source

cmArchiveWrite: Clear fflags from archive entries

When reading archive entries from disk strip any "fflags" entry headers
that may have been loaded from the filesystem when libarchive is built
with HAVE_STRUCT_STAT_ST_FLAGS (struct stat has 'st_flags').  The local
filesystem flags are not useful for distribution.  Furthermore, GNU tar
does not understand the "SCHILY.fflags" extended header used to store
the flags in the archive.  Use the approach from commit e8558efa
(cmArchiveWrite: Clear xattr and acl from entries, 2011-04-07) to remove
the flags and avoid producing the non-portable extended header.
Brad King 13 years ago
parent
commit
a34015d356
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Source/cmArchiveWrite.cxx

+ 1 - 0
Source/cmArchiveWrite.cxx

@@ -240,6 +240,7 @@ bool cmArchiveWrite::AddFile(const char* file,
   // Clear acl and xattr fields not useful for distribution.
   // Clear acl and xattr fields not useful for distribution.
   archive_entry_acl_clear(e);
   archive_entry_acl_clear(e);
   archive_entry_xattr_clear(e);
   archive_entry_xattr_clear(e);
+  archive_entry_set_fflags(e, 0, 0);
   if(archive_write_header(this->Archive, e) != ARCHIVE_OK)
   if(archive_write_header(this->Archive, e) != ARCHIVE_OK)
     {
     {
     this->Error = "archive_write_header: ";
     this->Error = "archive_write_header: ";