Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Ark
Commits
2d6fbadb
Commit
2d6fbadb
authored
Mar 11, 2021
by
Kai Uwe Broulik
🍇
Browse files
[libarchiveplugin] Handle absolute paths
... by treating them as relative to the archive root
parent
db9d53bc
Pipeline
#100412
passed with stage
in 2 minutes and 33 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
plugins/libarchive/libarchiveplugin.cpp
View file @
2d6fbadb
...
...
@@ -264,12 +264,9 @@ bool LibarchivePlugin::extractFiles(const QVector<Archive::Entry*> &files, const
continue
;
}
// For now we just can't handle absolute filenames in a tar archive.
// TODO: find out what to do here!!
// Don't allow absolute paths, instead, treat them like relative to the root of the archive.
if
(
entryName
.
startsWith
(
QLatin1Char
(
'/'
)))
{
Q_EMIT
error
(
i18n
(
"This archive contains archive entries with absolute paths, "
"which are not supported by Ark."
));
return
false
;
entryName
.
remove
(
0
,
1
);
}
// Should the entry be extracted?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment