Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 887579 - sys-fs/fuse complains about unknown -n flag, which automount is injecting with sshfs automount.
Summary: sys-fs/fuse complains about unknown -n flag, which automount is injecting wit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-21 00:59 UTC by ciaran
Modified: 2023-10-20 22:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ciaran 2022-12-21 00:59:33 UTC
Hello all, I have a regular, openrc-gnome profile machine, and have had issues with this particular bug for months now, I finally posted a pull request. 

https://github.com/libfuse/libfuse/pull/716

all the details are on github, basically, automount is not working with fuse in this case. What is surprising is that I had a plasma vm which worked just fine for a few months, and didn't need sshfs any where else, but after rebuilding the system, and working on other systems (profiles) I realized that this fuse issue hadn't gone away, and that its either a weird flaw nobody is complaining about, or perhaps its to do with OPENRC/Gentoo and perhaps the way fuse or autofs is built through the ebuild system. At any rate, I have sys-fuse working for me, and autofs works just fine after a 1 liner. 

Reproducible: Always

Steps to Reproduce:
1. using mount -t fuse.sshfs works
2. using sshfs .... works
3. using auto.sshfs (autofs) never works. 
Actual Results:  
automount is passing fuse an "-n" argument which fuse is not coded to be able to handle, for which fuse is breaking (sshfs) and causing the mount never to happen.

Dec 19 01:49:24 localhost automount[53618]: >> fuse: unknown option(s): `-n'


Expected Results:  
sshfs works with autofs

Dec 19 01:49:24 localhost automount[53618]: mount(generic): calling mount -t fuse.sshfs -o uid=0,gid=0,allow_other root@127.0.0.1:/root /test
Dec 19 01:49:24 localhost automount[53618]: spawn_mount: mtab link detected, passing -n to mount
Dec 19 01:49:24 localhost automount[53618]: >> fuse: unknown option(s): `-n'
Dec 19 01:49:24 localhost automount[53618]: mount(generic): failed to mount root@127.0.0.1:/root (type fuse.sshfs) on /test
Dec 19 01:49:24 localhost automount[53618]: dev_ioctl_send_fail: token = 27
Dec 19 01:49:24 localhost automount[53618]: failed to mount /test
Comment 1 ciaran 2022-12-21 01:11:07 UTC
I will add, that I attempted to build w/ Meson, and configured both with and without disable-mtab set. And I saw no difference in results. 


Project options   Current Value   Possible Values   Description
---------------   -------------   ---------------   -----------
disable-mtab      false           [true, false]     Disable and ignore usage of /etc/mtab
Comment 2 ciaran 2022-12-21 01:23:02 UTC
to test : 
-------------------------------------------------------
/etc/autofs/...


modify auto.master
/srv/sshfs/     /etc/autofs/auto.sshfs  --ghost,uid=0,gid=0,--timeout=60

add to auto.sshfs
test  -fstype=fuse.sshfs,allow_other  root@127.0.0.1:/root

ensure you have a passwordless authorized key for root@localhost

mkdir -p /srv/sshfs/test/

should work - 

sshfs root@127.0.0.1:/root /srv/sshfs/test/

mount -t fuse.sshfs -o uid=0,gid=0,allow_other root@127.0.0.1:/root /srv/sshfs/test

[doesn't work for me, via autofs ] (no other manual mounts)

ls /srv/sshfs/test/

OR (-n)

sshfs root@127.0.0.1:/root -n /srv/sshfs/test/

[ remedy ]

cd /usr/src/

git clone git clone https://github.com/pcxmac/libfuse.git

cd libfuse

mkdir build

cd build

rc-service autofs stop

meson .. ;ninja;meson test;cp lib/libfuse3.so.3.12.0 /usr/lib64;
cp util/fusermount3 /usr/bin;cp util/mount.fuse3 /usr/sbin

rc-service autofs restart

[ does work now ]
Comment 3 ciaran 2022-12-21 07:01:54 UTC
final addition, for the record mount (automount) does know about -n, but fuse is not coded to handle such a flag. Here is the man page for [mount]'s understanding of -n

-n, --no-mtab
           Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-21 19:26:44 UTC
Sorry, it's not 100% clear to me what the request is here.

Is this a heads up about the upstream PR and a request for us to backport it to fuse in Gentoo?
Comment 5 ciaran 2022-12-22 01:28:56 UTC
I am filing the bug because it's a real issue for me, I am not sure why its not an issue for other people, although I have seen people complain about it through google search results. 

So the report is for other people to add in on, and if anyone wants / has the time to confirm the bug exists.

I use gentoo/openrc + zfs on root, to be honest SSHFS just does not work for me at least not for about half a year, and this issue could have precipitated due to recent changes in the way autofs uses mtab, how mtab works, etc... 

What I do know is that one line change, allows fuse to work with the SSHFS in mounting the entry successfully, and flawlessly. I will admit I haven't built a series of tests to see if this breaks anything else, though, I do believe that FUSE will run that flag to a 'null' function, and discard it 'effectively'.
Comment 6 ciaran 2023-10-20 22:31:43 UTC
The code change has been adopted, and [lib]fuse has been updated. SSHFS works like it should. according to my recent limited testing.