diff options
author | Tim Schumacher <timschumi@gmx.de> | 2021-11-22 21:17:24 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-22 21:57:42 +0100 |
commit | 75978d5fff3a568bc1ed096ebe0ee6f83446def4 (patch) | |
tree | ae3029c7a4cd9821232d1c0d459549f4a8afdf4e /Userland/Utilities/tar.cpp | |
parent | a0c80a6f17ce4e4e45e667a2b824931b9845ff9f (diff) | |
download | serenity-75978d5fff3a568bc1ed096ebe0ee6f83446def4.zip |
tar: Support extracting symlinks
We can now extract GitHub's LLVM tarballs. :^)
Diffstat (limited to 'Userland/Utilities/tar.cpp')
-rw-r--r-- | Userland/Utilities/tar.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Utilities/tar.cpp b/Userland/Utilities/tar.cpp index 09b18146e2..fc98681a84 100644 --- a/Userland/Utilities/tar.cpp +++ b/Userland/Utilities/tar.cpp @@ -105,6 +105,16 @@ int main(int argc, char** argv) close(fd); break; } + case Archive::TarFileType::SymLink: { + Core::File::ensure_parent_directories(absolute_path); + + if (symlink(header.link_name().to_string().characters(), absolute_path.characters())) { + perror("symlink"); + return 1; + } + + break; + } case Archive::TarFileType::Directory: { Core::File::ensure_parent_directories(absolute_path); |