fuse3: mount_util.c: restore symlink check
authorGeorgi Valkov <[email protected]>
Fri, 13 Jun 2025 07:35:28 +0000 (10:35 +0300)
committerRobert Marko <[email protected]>
Mon, 23 Jun 2025 08:26:34 +0000 (10:26 +0200)
Fixes the following error when mounting iPhone using ifuse:
ifuse /mnt --container com.httpstorm.httpstorm
mount: mounting ifuse on /mnt failed: Invalid argument

[1] https://github.com/libfuse/libfuse/pull/1247

Signed-off-by: Georgi Valkov <[email protected]>
utils/fuse3/Makefile
utils/fuse3/patches/101-mount_util.c-restore-symlink-check.patch [new file with mode: 0644]

index 9a518f08883a273b65618f6e9f87e34f9e421d18..f3a131955ee3c015eedeab07f5e488f232391bda 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=fuse3
 PKG_VERSION:=3.17.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=fuse-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/libfuse/libfuse/releases/download/fuse-$(PKG_VERSION)
diff --git a/utils/fuse3/patches/101-mount_util.c-restore-symlink-check.patch b/utils/fuse3/patches/101-mount_util.c-restore-symlink-check.patch
new file mode 100644 (file)
index 0000000..fdd0185
--- /dev/null
@@ -0,0 +1,36 @@
+From: Georgi Valkov <[email protected]>
+Date: Fri, 13 Jun 2025 08:49:22 +0300
+Subject: [PATCH] mount_util.c: restore symlink check
+
+Fixes the following error when mounting iPhone using ifuse:
+ifuse /mnt --container com.httpstorm.httpstorm
+mount: mounting ifuse on /mnt failed: Invalid argument
+
+The regression was introduced in
+74b1df2e84e836a1710561f52075d51f20cd5c78
+
+Signed-off-by: Georgi Valkov <[email protected]>
+---
+ lib/mount_util.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/lib/mount_util.c
++++ b/lib/mount_util.c
+@@ -54,6 +54,7 @@ static int mtab_needs_update(const char
+        * Skip mtab update if /etc/mtab:
+        *
+        *  - doesn't exist,
++       *  - is a symlink,
+        *  - is on a read-only filesystem.
+        */
+       res = lstat(_PATH_MOUNTED, &stbuf);
+@@ -64,6 +65,9 @@ static int mtab_needs_update(const char
+               uid_t ruid;
+               int err;
++              if (S_ISLNK(stbuf.st_mode))
++                      return 0;
++
+               ruid = getuid();
+               if (ruid != 0)
+                       setreuid(0, -1);