Package: fuse
Version: 2.9.8-2
Severity: wishlist

Hello,

when I mount a fuse filesystem (in my case usually sshfs) Gnome detects
this an offers an eject button e.g. in nautilus. Clicking that results
in an error however. I think this could be done in a nicer way when
using uhelper=fuse as mount option.

I tried to implement this:

--- fuse-2.9.8.orig/lib/mount.c
+++ fuse-2.9.8/lib/mount.c
@@ -471,7 +471,7 @@ static int fuse_mount_sys(const char *mn
                return -1;
        }
 
-       snprintf(tmp, sizeof(tmp),  "fd=%i,rootmode=%o,user_id=%u,group_id=%u",
+       snprintf(tmp, sizeof(tmp),  
"fd=%i,uhelper=fuse,rootmode=%o,user_id=%u,group_id=%u",
                 fd, stbuf.st_mode & S_IFMT, getuid(), getgid());
 
        res = fuse_opt_add_opt(&mo->kernel_opts, tmp);

but unfortunately this makes fuse stop working with

        fusermount: mount failed: Invalid argument

. Checking the kernel I think the following patch is needed there:

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index db9e60b7eb69..115e465b74b9 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -454,6 +454,7 @@ enum {
        OPT_ALLOW_OTHER,
        OPT_MAX_READ,
        OPT_BLKSIZE,
+       OPT_UHELPER,
        OPT_ERR
 };
 
@@ -466,6 +467,7 @@ static const match_table_t tokens = {
        {OPT_ALLOW_OTHER,               "allow_other"},
        {OPT_MAX_READ,                  "max_read=%u"},
        {OPT_BLKSIZE,                   "blksize=%u"},
+       {OPT_UHELPER,                   "uhelper=%s"},
        {OPT_ERR,                       NULL}
 };
 
@@ -552,6 +554,10 @@ static int parse_fuse_opt(char *opt, struct 
fuse_mount_data *d, int is_bdev,
                        d->blksize = value;
                        break;
 
+               case OPT_UHELPER:
+                       /* ignore */
+                       break;
+
                default:
                        return 0;
                }

but I didn't test that yet. With that in place fuse only needs to
provide /sbin/umount.fuse which then calls fusermount -u with the right
options.

Best regards
Uwe

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (500, 'unstable-debug'), 
(500, 'stable'), (499, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-rc4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages fuse depends on:
ii  adduser   3.118
ii  libc6     2.27-8
ii  libfuse2  2.9.8-2ukl1
ii  mount     2.32.1-0.1
ii  sed       4.5-2

fuse recommends no packages.

fuse suggests no packages.

-- no debconf information

Reply via email to