fix: break server-side locks via X-User-Lock, map 423 to EBUSY #4
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-lock-unlock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes deletion of files locked by the Nextcloud Text app (or any other lock owner).
Problem
rmon a server-locked file returned EIO. Nextcloud's files_lock app stores a permanent stale lock (lock_timeout=-1, never expires) owned by the Text app; a plain WebDAV UNLOCK is rejected (UnauthorizedUnlockException) because the lock owner isn't the WebDAV session user.Fix
X-User-Lock: 1on the UNLOCK. The files_lock LockPlugin honors this header and enables a user-override, allowing the file owner to break any lock.Test plan
cargo test --lib: 108 passed (4 new tests, incl. a mockito UNLOCK-header test that is mutation-verified to catch a missing header).Empty file.md(locked by Text app since 2026-07-31); journal showsSuccessfully broke lockand the file was removed from the mount.b9b9776ceato631c112bac