Control: forwarded -1 https://github.com/libfuse/libfuse/issues/246

On Thu, Nov 08, 2018 at 03:30:11PM +0100, Uwe Kleine-König wrote:
> Package: fuse
> Version: 2.9.8-2
> Severity: wishlist
> 
> 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 found that there is already an upstream bug report about this. Marked
the bug as forwarded accordingly.

> 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.

I tested this patch now, but it doesn't work as intended. With it
applied mounting with the change above in fuse works, but the uhelper
option doesn't make it to the output of "mount" and so I still get
"Permission denied" on umounting.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature

Reply via email to