Prevent file to be opened by more than one user on same time

Hi,

I’ve a problem I can’t figure out how.
A user is writing his file (name and inode and size are well known). The file is copied on the collabora server before editing.
A second user with another file open the 1st user file (same inode but filename different and size different)… But the most amazing : The file opened by the 2nd user is in fact the 1st user’s file and he can see what the 1st user is typing… There is less than 15 secs between the 2 users
I can’t understand how they can have the same inode because I don’t delete the file but that’s a fact : Same inode, different name and size different but opening the same file !!! In fact, for the 2nd user I don’t have any getfile request ! I think collabora reuse the same datas (same inode).

So, to avoid this is there a way to prevent 2 users opening the same file (not wopi locks : It won’t work).

I hope that’s clear for you !
Regards

Can you give some more context? what integration are you using to fire up COOL?
Ultimately if the WOPISRC is the same for both of these - then they will be loaded into the same document editing / Kit process - which is a feature; but that shouldn’t be based on inode etc.

Hi,

The wopi server works with inodes (post and get url with fileid → /wopi/files/fileid…)
I’ve a log of the problem →
The user 1 “Lydie” opens a file with a name and a inode.
A few seconds later, the user 2 “Charles” opens another file but with the same inode.
You’ll say me : “The 1st file has been deleted”. Yes may be, but I don’t know who has deleted the file and how (rm - mv to another device, program … ) !!! The auditctl doesn’t teach me anything !
So a work around would be to prevent a file to be opened twice.

Regards

Here is my wopi log :
05/19/2022 14:21:23 - INFO - iopopen - args = ImmutableMultiDict([(‘filename’, ‘100895_28370283_21899.odt’), (‘viewmode’, ‘VIEW_MODE_READ_WRITE’)])
05/19/2022 14:21:23 - INFO - Generation Token 100895_28370283_21899.odt - Lydie L - READ_WRITE
05/19/2022 14:21:23 - INFO - ZZToken - eyJ0eXAi… ZXJGcmllbmRseU5hbWUiOiJMeWRpZSBQUkFEQUwifQ.ERbEK7JYDIhnLbirwhV-CwQNewXFVUWOZDgLrMoJ-YA
05/19/2022 14:21:25 - INFO - wopigetfileinfo- 18219428
05/19/2022 14:21:25 - INFO - ZZToken - {‘userid’: ‘Lydie L’, ‘filename’: ‘100895_28370283_21899.odt’, ‘full_filename’: ‘/home/wopi-taq/100895_28370283_21899.odt’, ‘viewmode’: ‘READ_WRITE’, ‘token_expiration’: 1653049283, ‘inode’: ‘18219428’, ‘size’: ‘194885’, ‘random’: 582, ‘UserFriendlyName’: ‘Lydie L’}
05/19/2022 14:21:25 - INFO - wopigetfile 18219428
05/19/2022 14:21:25 - INFO - GetFile - 18219428
05/19/2022 14:21:25 - INFO - Getfile - 18219428 - /home/wopi-taq/100895_28370283_21899.odt
05/19/2022 14:21:25 - INFO - ZZToken - {‘userid’: ‘Lydie L’, ‘filename’: ‘100895_28370283_21899.odt’, ‘full_filename’: ‘/home/wopi-taq/100895_28370283_21899.odt’, ‘viewmode’: ‘READ_WRITE’, ‘token_expiration’: 1653049283, ‘inode’: ‘18219428’, ‘size’: ‘194885’, ‘random’: 582, ‘UserFriendlyName’: ‘Lydie L’}
05/19/2022 14:21:25 - INFO - Read - /home/wopi-taq/100895_28370283_21899.odt
05/19/2022 14:21:25 - INFO - wopifilespost - 18219428
05/19/2022 14:21:25 - INFO - Post_op - 18219428 - LOCK
05/19/2022 14:21:25 - INFO - ZZToken - {‘userid’: ‘Lydie L’, ‘filename’: ‘100895_28370283_21899.odt’, ‘full_filename’: ‘/home/wopi-taq/100895_28370283_21899.odt’, ‘viewmode’: ‘READ_WRITE’, ‘token_expiration’: 1653049283, ‘inode’: ‘18219428’, ‘size’: ‘194885’, ‘random’: 582, ‘UserFriendlyName’: ‘Lydie L’}

05/19/2022 14:22:43 - INFO - iopopen - args = ImmutableMultiDict([(‘filename’, ‘101572_cor_ct_variante_148672.odt’), (‘viewmode’, ‘VIEW_MODE_READ_WRITE’)])
05/19/2022 14:22:43 - INFO - Generation Token 101572_cor_ct_variante_148672.odt - Charles D - READ_WRITE
05/19/2022 14:22:43 - INFO - ZZToken - eyJ0eXAiOiJKV1… RebFWrNg1CiDFG0xg
05/19/2022 14:22:45 - INFO - wopigetfileinfo- 18219428
05/19/2022 14:22:45 - INFO - ZZToken - {‘userid’: ‘Charles D’, ‘filename’: ‘101572_cor_ct_variante_148672.odt’, ‘full_filename’: ‘/home/wopi-taq/101572_cor_ct_variante_148672.odt’, ‘viewmode’: ‘READ_WRITE’, ‘token_expiration’: 1653049363, ‘inode’: ‘18219428’, ‘size’: ‘70454’, ‘random’: 768, ‘UserFriendlyName’: ‘Charles D’}

05/19/2022 14:26:38 - INFO - ZZToken - {‘userid’: ‘Lydie L’, ‘filename’: ‘100895_28370283_21899.odt’, ‘full_filename’: ‘/home/wopi-taq/100895_28370283_21899.odt’, ‘viewmode’: ‘READ_WRITE’, ‘token_expiration’: 1653049283, ‘inode’: ‘18219428’, ‘size’: ‘194885’, ‘random’: 582, ‘UserFriendlyName’: ‘Lydie L’}
05/19/2022 14:26:38 - INFO - PutFile - 18219428 - /home/wopi-taq/100895_28370283_21899.odt
05/19/2022 14:26:38 - INFO - Write - /home/wopi-taq/100895_28370283_21899.odt