在 Linux 中使用 davfs 挂载 SharePoint 文档库

IMT*_*Man 6 linux webdav davfs2

我能够安装davfs2,我什至可以使用它装载 SharePoint 文档库,但是当我尝试在装载上执行任何操作时,我收到错误消息。

我可以挂载文档库:

root@host:/# mount -t davfs "http://sharepoint/Shared Documents" /mnt/sp
Please enter the username to authenticate with server
http://sp/Site Stuff or hit enter for none.
  Username: username
Please enter the password to authenticate user nacho with server
http://sp/Site Stuff or hit enter for none.
  Password:  
Run Code Online (Sandbox Code Playgroud)

我可以 CD 到它,我可以看到它从那里安装:

root@host:/# cd /mnt/sp
root@host:/mnt/sp# ls
Forms  lost+found  home.html
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试创建文件或执行任何操作时,出现错误:

root@host:/mnt/sp# touch a
touch: setting times of ‘a’: No such file or directory

root@host:/mnt/sp# date > hi.txt
bash: hi.txt: Invalid argument
Run Code Online (Sandbox Code Playgroud)

任何人都知道有什么问题吗?

小智 7

我今天遇到了这个问题,因为我应用的修复工作正常,所以它在这里。

看起来 WebDAV 默认选项use_locks在 DAVFS 配置文件中设置为值 1 davfs2.conf

以下是该文件的手册摘录(由命令提供man davfs.conf):

 use_locks
Whether to lock files on the server when they are opened for writing.  0 = no, 1 = yes.
Default: 1
Run Code Online (Sandbox Code Playgroud)

我建议use_locks通过添加行将值更改为 0

use_locks 0
Run Code Online (Sandbox Code Playgroud)

在系统范围的 DAVFS 配置文件(通常是:)/etc/davfs2/davfs2.conf或用户自定义文件(通常是:)中~/.davfs2/davfs2.conf