ark: handle abosolute path entries properly

This commit is contained in:
Ivailo Monev 2015-02-24 23:31:46 +00:00
parent a655d08b8d
commit f9842ce013

View file

@ -220,11 +220,8 @@ bool LibArchiveInterface::copyFiles(const QVariantList& files, const QString& de
QString entryName = QDir::fromNativeSeparators(QFile::decodeName(archive_entry_pathname(entry))); QString entryName = QDir::fromNativeSeparators(QFile::decodeName(archive_entry_pathname(entry)));
if (entryName.startsWith(QLatin1Char( '/' ))) { if (entryName.startsWith(QLatin1Char( '/' ))) {
//for now we just can't handle absolute filenames in a tar archive. // remove leading slash from absolute path entries
//TODO: find out what to do here!! entryName = entryName.mid(1);
emit error(i18n("This archive contains archive entries with absolute paths, which are not yet supported by ark."));
return false;
} }
if (files.contains(entryName) || entryName == fileBeingRenamed || extractAll) { if (files.contains(entryName) || entryName == fileBeingRenamed || extractAll) {