Subject: Re: bug#42036: Failed to mount fuse sshfs

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Sun, 28 Jun 2020 13:49:26 +0200

Oleg Pykhalov 写道：
> Tobias Geerinckx-Rice <[email-masked]> writes:
>> However, Oleg: are you sure it looks *only* in /bin?

[…]

> Here is a ‘mount -t‘ strace:
> --8<---------------cut 
> here---------------start------------->8---
> oleg@guixsd ~$ mount -t fuse -o rw,allow_other 
> sshfs#oleg@workstation:/home/oleg /tmp/f
> /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/sh: 
> sshfs: command not found
>
> execve("/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/sh", 
> ["/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/sh", 
> "-c", "'sshfs' 'oleg@workstation:/home/oleg' '/tmp/f' '-o' 
> 'rw,allow_other,dev,suid'"], 0x961430 /* 74 vars */) = 0
> ...
> stat(".", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
> stat("/usr/local/bin/sshfs", 0x7ffed0ac1c90) = -1 ENOENT (No 
> such file or directory)
> stat("/usr/local/sbin/sshfs", 0x7ffed0ac1c90) = -1 ENOENT (No 
> such file or directory)
> stat("/usr/bin/sshfs", 0x7ffed0ac1c90)  = -1 ENOENT (No such 
> file or directory)
> stat("/usr/sbin/sshfs", 0x7ffed0ac1c90) = -1 ENOENT (No such 
> file or directory)
> stat("/bin/sshfs", 0x7ffed0ac1c90)      = -1 ENOENT (No such 
> file or directory)
> stat("/sbin/sshfs", 0x7ffed0ac1c90)     = -1 ENOENT (No such 
> file or directory)
> stat(".", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
> stat("./sshfs", 0x7ffed0ac1c90)         = -1 ENOENT (No such 
> file or directory)
> --8<---------------cut 
> here---------------end--------------->8---

Thanks!  This part comes from mount.fuse, right?

mount calls mount.fuse with $PATH unset.  mount.fuse calls 
<bash-minimal>/bin/sh -c sshfs …, which uses

  /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.

by default.  Not very useful on Guix Systems.

I'm considering the best place to fix this: util-linux (probably), 
fuse (it would only affect mount.fuse, but maybe we want that kind 
of control), or bash (almost certainly not).

Kind regards,

T G-R