Merge pull request #7252 from yorickvP/fix-7175
tarfile: set directory mode to at least 0500, don't extract fflags and perms
This commit is contained in:
commit
4d2244c757
|
@ -77,9 +77,7 @@ TarArchive::~TarArchive()
|
||||||
|
|
||||||
static void extract_archive(TarArchive & archive, const Path & destDir)
|
static void extract_archive(TarArchive & archive, const Path & destDir)
|
||||||
{
|
{
|
||||||
int flags = ARCHIVE_EXTRACT_FFLAGS
|
int flags = ARCHIVE_EXTRACT_TIME
|
||||||
| ARCHIVE_EXTRACT_PERM
|
|
||||||
| ARCHIVE_EXTRACT_TIME
|
|
||||||
| ARCHIVE_EXTRACT_SECURE_SYMLINKS
|
| ARCHIVE_EXTRACT_SECURE_SYMLINKS
|
||||||
| ARCHIVE_EXTRACT_SECURE_NODOTDOT;
|
| ARCHIVE_EXTRACT_SECURE_NODOTDOT;
|
||||||
|
|
||||||
|
@ -98,6 +96,10 @@ static void extract_archive(TarArchive & archive, const Path & destDir)
|
||||||
archive_entry_copy_pathname(entry,
|
archive_entry_copy_pathname(entry,
|
||||||
(destDir + "/" + name).c_str());
|
(destDir + "/" + name).c_str());
|
||||||
|
|
||||||
|
// sources can and do contain dirs with no rx bits
|
||||||
|
if (archive_entry_filetype(entry) == AE_IFDIR && (archive_entry_mode(entry) & 0500) != 0500)
|
||||||
|
archive_entry_set_mode(entry, archive_entry_mode(entry) | 0500);
|
||||||
|
|
||||||
// Patch hardlink path
|
// Patch hardlink path
|
||||||
const char *original_hardlink = archive_entry_hardlink(entry);
|
const char *original_hardlink = archive_entry_hardlink(entry);
|
||||||
if (original_hardlink) {
|
if (original_hardlink) {
|
||||||
|
|
Loading…
Reference in a new issue