autofs is passing -n to the mount if /etc/mtab is a symlink:
davfs2 currently does not support -n, because it does check if mtab is a symlink and act accordingly without the "-n" flag, so it should just ignore it.
The issue is reported upstream:
Steps to Reproduce:
I tried mounting with autofs:
# grep dav /etc/autofs/auto.master /etc/autofs/auto.davfs
/etc/autofs/auto.master:/mnt/davfs /etc/autofs/auto.davfs --timeout=60 --ghost
/etc/autofs/auto.davfs:hidrive -fstype=davfs,rw :https\://webdav.hidrive.ionos.com/
$ grep sec $HOME/.davfs2/davfs2.conf
$ cat $HOME/.davfs2/sec
"https://webdav.hidrive.ionos.com/" "foobar" "foo123"
[automount] pidinfo requestor: pid:10847 comm:ls tgid:10847 uid:4728 euid:4728 gid:4728 egid:4728
[automount] pidinfo parent: pid:6301 comm:bash tgid:6301 uid:4728 euid:4728 gid:4728 egid:4728
[automount] attempting to mount entry /mnt/davfs/hidrive
[automount] mount(generic): calling mount -t davfs -o rw https://webdav.hidrive.ionos.com/ /mnt/davfs/hidrive
[automount] >> /sbin/mount.davfs: invalid option -- 'n'
[automount] mount(generic): failed to mount https://webdav.hidrive.ionos.com/ (type davfs) on /mnt/davfs/hidrive
[automount] failed to mount /mnt/davfs/hidrive
Same happens with sshfs.
Please report that upstream as well.
I feel like this issue is really on autofs side like davfs2 developers said, even though they added a workaround on their code.
Who is responsible for autofs, is that kernel.org ?
I have no clue.
Actually, I've been trying to search it yesterday already.
Only clue I have is the homepage: https://web.archive.org/web/*/http://www.linux-consulting.com/Amd_AutoFS/autofs.html
Yeah. Which is dead. Doeasn't look good for autofs.
Confirmed with net-fs/autofs-5.1.6 :
mount type fuse.sshfs does not support -n (--no-mtab) option, but autofs add automatically this one :
automount: spawn_mount: mtab link detected, passing -n to mount
automount: >> fuse: unknown option(s): `-n'
Same with autofs-5.1.5-r2.