Created attachment 237812 [details] davfs2 1.7.0 ported to FreeBSD Hello, I'm the current main developer of davfs2 [1]. I ported the project to work on FreeBSD, please find out the attached port diff Please note that due to bug 263625, davfs2 works with >= 1301503 and >= 1400057, that is checked in the Makefile [1] https://savannah.nongnu.org/projects/davfs2/
Created attachment 237857 [details] updated patch Thanks for the port, I've modified the port a little bit to follow (most of) the portlint, portfmt and portclippy suggests. Can you help check and test it?
(In reply to Li-Wen Hsu from comment #1) Thanks! I tested it, all fine.
Looking forward to it.
> I ported the project to work on FreeBSD This is great! I've tried porting it myself back in 2018 but got tired of overcoming linuxisms. Let's see it hits the tree sooner rather than later.
is there any information on the planned date of adding a new port?
What's the reason for SUID option and defaulting to it?
(In reply to ev from comment #5) > is there any information on the planned date of adding a new port? As soon as I work around those little annoying build-related gimmicks, e.g. usage of "neon-config --libs" which emits private libraries, etc. (In reply to Gleb Popov from comment #6) > What's the reason for SUID option and defaulting to it? I guess the intention was to allow mounts under regular user. I'd see if it's really needed or maybe subject to vfs.usermount=1 and will most likely remove the option and suid-bit installation.
(In reply to Alexey Dokuchaev from comment #7) > I'd see if it's really needed or maybe subject to vfs.usermount=1 and will most likely remove the option and suid-bit installation. Yes, please. No other fusefs-* ports have such option and the canonical way to allow user mounts is via sysctl. We also have bsdisks, which can serve as a mounting daemon via D-Bus.
The code checks for "vfs.usermount=1" option already, and the idea was to allows not user mount when SUID is set and vfs.usermount=1, so yes it is subject to SUID. But I can remove that if required. Now I noticed that on a new FreeBSD installation that I didn't have davfs2 user and group (on my previous system I had added those manually), they are required. Would you be okay to add those ports/GIDs and ports/UIDs ?
(In reply to Ali Abdallah from comment #9) > The code checks for "vfs.usermount=1" option already, and the idea was to allows not user mount when SUID is set and vfs.usermount=1, so yes it is subject to SUID. But I can remove that if required. I still don't quite get why bother with both vfs.usermount and SUID. Let the user deal with that if he ever wants to do mounts from non-root user. > Would you be okay to add those ports/GIDs and ports/UIDs ? Ah, this fusefs implementation runs a daemon. Yes, adding entries to GIDs and UIDs is a right thing to do.
(In reply to Gleb Popov from comment #10) > Ah, this fusefs implementation runs a daemon. Yes, adding entries to GIDs and UIDs is a right thing to do. I will provide a new patch adding GIDs and UIDs and removing the SUID option.
Created attachment 240178 [details] Updated patch with new davfs2 user and group without SUID
Why does davfs2.conf file gets installed into both /etc and /share/davfs2?
Created attachment 240179 [details] Updated patch with new davfs2 user and group without SUID v2 It was autogenerated, fixed now.
(In reply to Gleb Popov from comment #13) > Why does davfs2.conf file gets installed into both /etc and > /share/davfs2? Grepping for DAV_CONFIG in the `mount_davfs.c' suggests that DAV_SYS_CONF_DIR is used when reading/parsing configuration, but when populating missing directories in check_dirs() function, DAV_DATA_DIR is used. There are couple of small bugs in the manpage (was written by by) <- notice double "by" and usage tells to call mount(8) like this: mount -t davfs <server-url> <mountpoint> [-o options] On FreeBSD, options should precede the arguments, but that could be fixed in the later versions. More importantly, does it really work? What am I missing: $ mount -t davfs -o debug=most https://wbdav.yandex.ru /mnt/yd mount: https:/wbdav.yandex.ru: Operation not supported by device $ _ Logs do not tell much other that reporting davfs2 version. Where did one of the URL slashes go in the error message? Dropping the "http://" part does not help. When doing ``mount.davfs wbdav.yandex.ru /mnt/yd'', it asks for username and password, but later fails with ``405 Method Not Allowed'' message. Is this expected for some servers like YandexDisk? Cadaver works fine on it.
(In reply to Alexey Dokuchaev from comment #15) I will fix the reported issue for the next release. I never used mount -t davfs, don't think that will work, only mount.davfs will correctly handle the mount. "405 Method Not Allowed" is returned by the server, probably dav isn't enabled? I test usually against apache and nginx webdav implementation, and fuse-davfs2 works perfectly fine on Linux and FreeBSD with those servers. I'm planning to move the project to github soon so it will be easier to track issues.
typo in url? it should be https://webdav.yandex.ru
Ali, did you make any progress on this?
(In reply to Gleb Popov from comment #18) The project has been migrated to github [1], and a new bugfix 1.7.1 version has been released. I'm using it on a FreeBSD 14.1 box against nextcloud/apache server with no problems. If you are having any issue using it on FreeBSD, please open a ticket at github. [1] https://github.com/alisarctl/davfs2
(In reply to Ali Abdallah from comment #16) > I will fix the reported issue for the next release. "was written by by" is still greppable in the 1.7.1 sources. Also, the NLS case looks incomplete, as I need to patch `src/Makefile.in' in the following way (no need to resubmit anything, just wanted to confirm): @@ -268,6 +268,9 @@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +ifeq ($(USE_NLS),yes) +LIBS += $(LIBINTL) +endif abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ > I never used mount -t davfs, don't think that will work It doesn't work indeed (emits "Invalid fstype: Invalid argument" error) but nonetheless documented in the manpage under SYNOPSIS (root only), this could be confusing. > "405 Method Not Allowed" is returned by the server, probably dav isn't > enabled? Could be a typo on my side as noted in comment #17. I want to retest the new version against Yandex.Disk again, but apparently they require OAuth token these days which I'm now struggling to obtain, stand by... https://savannah.nongnu.org/bugs/?57589 https://yandex.com/dev/disk/webdav
(In reply to Alexey Dokuchaev from comment #20) > want to retest the new version against Yandex.Disk again, but apparently > they require OAuth token these days which I'm now struggling to obtain: Turns out yesterday I failed to RTFM, they now require a dedicated per-app password rather than Yandex account password to access the disk via WebDAV: https://yandex.ru/support/disk-desktop/webdav-app-passwords.html After generating WebDAV password, I could mount my Yandex.Disk, hooray! I've noticed something strange, however: doing plain ls(1) on mounted share is quite fast, unlike `ls -l': $ ls /mnt/yd 0.007u 0.007s 0:01.46 0.0% 0+0k 0+0io 0pf+0w $ ls -l /mnt/yd 0.015u 0.046s 2:15.82 0.0% 78+141k 0+0io 0pf+0w Well over two minutes! Looking at the `kdump -E' output, fstatat() calls take too much time to complete. But this issue can be addressed later, the program generally works and I'll add the port shortly.
(In reply to Alexey Dokuchaev from comment #21) Thank you for the feedback and for queuing the program for addition to ports. Please kindly report any issue on github to help improving davfs2 on FreeBSD!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ebd64e65a49ef01be669f868f32de82deead3ab3 commit ebd64e65a49ef01be669f868f32de82deead3ab3 Author: Alexey Dokuchaev <danfe@FreeBSD.org> AuthorDate: 2024-12-12 10:23:58 +0000 Commit: Alexey Dokuchaev <danfe@FreeBSD.org> CommitDate: 2024-12-12 10:23:58 +0000 filesystems/davfs2: new port had been added (+) This is a FUSE file system driver that allows mounting a WebDAV server as a local file system, like a disk drive. PR: 267518 (heavily modified) Submitted by: Ali Abdallah (current main developer) GIDs | 2 +- UIDs | 2 +- filesystems/Makefile | 1 + filesystems/davfs2/Makefile (new) | 38 ++++++++++++++++++++++ filesystems/davfs2/distinfo (new) | 3 ++ .../davfs2/files/patch-src_Makefile.in (new) | 12 +++++++ filesystems/davfs2/pkg-descr (new) | 13 ++++++++ filesystems/davfs2/pkg-plist (new) | 24 ++++++++++++++ 8 files changed, 93 insertions(+), 2 deletions(-)
(In reply to Ali Abdallah from comment #19) > The project has been migrated to GitHub Nonetheless, thanks for putting the distfile at Savannah as well. I've taken the liberty to list both sites for the time being, as the old tells more about the project and its development history. I've also used more elaborate and user-oriented description from my original port, hope you won't mind. Thank you for supporting FreeBSD, and sorry it took a while to wrap it up!