ONLYOFFICE / DesktopEditors

An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
https://www.onlyoffice.com
Other
2.67k stars 314 forks source link

Desktop Editors don't lock files for editing on samba shares, can corrupt files #1362

Open IanHead opened 10 months ago

IanHead commented 10 months ago

This issue is unique.

Operating System

Linux (DEB package)

Version information

7.4.1.36 (flatpak)

Expected Behavior

When a file is open in OnlyOffice DEs, it should be locked and prevent other users from being able to make edits. Vice versa OnlyOffice should display a 'read only' warning when opening a file that is already open by another program/user. This is the case if working in local file system.

Actual Behavior

Other users/applications can freely open, save the file and make conflicting saves while OnlyOffice DEs is open. If you save again in OnlyOffice, mounted via Samba/gvfs, your edits will override theirs. If mounted at the kernel level via linux-cifs (using cifs-utils package), OnlyOffice can actually corrupt the document and destroy it.

Reproduction Steps

Ubuntu 23.04

  1. Mount a samba share with gvfs or cifs
  2. Open a file in OnlyOffice, make edits to it, save it, leave it open
  3. Attempt to open the same file as another user/application and make changes, then save

Additional information

See videos for two demonstrations of the issue:

Conflicting changes

https://github.com/ONLYOFFICE/DesktopEditors/assets/12196401/c8d3f1e2-df61-4818-af7c-c01700bf089c

File corruption

https://github.com/ONLYOFFICE/DesktopEditors/assets/12196401/ed60e53e-60ea-43e2-aa9d-3fd689da47d1

Rita-Bubnova commented 10 months ago

Hello, @IanHead, thank you for report. I can confirm - this is bug in video 1, issue #46748.

XDmitryK commented 10 months ago

@IanHead I cannot repeat your case with an error when saving a file in LO on my Ubuntu 22.04 and Fedora 38 OS. Do you have any other systems other than Ubuntu 23.04? Can you check there?

IanHead commented 10 months ago

Hi @XDmitryK, I've been able to replicate the behaviour with Ubuntu 22.04 with the exact same results. In the first example, I am mounting the drive from nautilus using the smb://. In the second example, I have the shared drive set up in fstab using cifs, like this (some details redacted):

//192.168.0.1/Company /mnt/Company cifs username=*********,domain=***,password=*********,noauto,rw,users 0 0

And then I mount it on login using the commend:

mount.cifs //192.168.0.1/Company /mnt/Company

XDmitryK commented 10 months ago

@IanHead Thanks for the detailed answer. Another small clarification, are you using smb between two Linux OS?

IanHead commented 10 months ago

Thanks @XDmitryK for the follow-up. The other machine is running Windows Server 2012

IanHead commented 5 months ago

Congratulations on the 8.0 release! This issue seems to be resolved with the new version. Are you able to confirm?