blob: 5447bb5fdc67674e9a45e69941a75ff7b2a85ed8 [file] [log] [blame]
From c9db2fb9497e4605183e0c5b124403bf4f5e76ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Degros?= <fdegros@chromium.org>
Date: Wed, 2 Sep 2020 19:52:36 +1000
Subject: [PATCH] No symlinks
Do not show symbolic links recorded in the ZIP.
Pretend they don't exist.
---
lib/fuse-zip.cpp | 2 ++
lib/fuseZipData.cpp | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/lib/fuse-zip.cpp b/lib/fuse-zip.cpp
index 113065c..7c33999 100644
--- a/lib/fuse-zip.cpp
+++ b/lib/fuse-zip.cpp
@@ -606,6 +606,8 @@ int fusezip_access(const char *, int) {
}
int fusezip_readlink(const char *path, char *buf, size_t size) {
+ return -ENOENT;
+
if (*path == '\0') {
return -ENOENT;
}
diff --git a/lib/fuseZipData.cpp b/lib/fuseZipData.cpp
index bdddb94..6d5d498 100644
--- a/lib/fuseZipData.cpp
+++ b/lib/fuseZipData.cpp
@@ -123,6 +123,8 @@ void FuseZipData::build_tree(bool readonly) {
const char *const name = sb.name;
mode_t mode = getEntryAttributes(id, name, isHardlink);
+ if (S_ISLNK(mode))
+ continue;
if (isHardlink)
continue;
@@ -154,6 +156,8 @@ void FuseZipData::build_tree(bool readonly) {
bool isHardlink;
const char *name = zip_get_name(m_zip, id, ZIP_FL_ENC_GUESS);
mode_t mode = getEntryAttributes(id, name, isHardlink);
+ if (S_ISLNK(mode))
+ continue;
if (!isHardlink)
continue;
--
2.29.1.341.ge80a0c044ae-goog