Issue 126305 - WebDAV lock on 4.1.1 does not work
Summary: WebDAV lock on 4.1.1 does not work
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 4.1.1
Hardware: All All
: P5 (lowest) Normal with 4 votes (vote)
Target Milestone: 4.1.2
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-13 13:01 UTC by Giuseppe Castagno (aka beppec56)
Modified: 2016-08-30 21:33 UTC (History)
6 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---
pescetti: 4.1.2_release_blocker+


Attachments
Add lock functionality to WebDAV, according to RFC4918 (179.38 KB, patch)
2015-05-14 13:08 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff
Proposed patch to fix the issue, version #2 (218.74 KB, patch)
2015-06-11 12:53 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff
Proposed patch to fix the issue, version #3 (219.53 KB, patch)
2015-07-11 13:39 UTC, Giuseppe Castagno (aka beppec56)
giuseppe.castagno: review?
Details | Diff
patch to unbreak the FreeBSD port build after the proposed patch was committed (1.51 KB, patch)
2015-09-27 09:27 UTC, truckman
no flags Details | Diff
Move an added enum as the last one (889 bytes, patch)
2015-09-30 08:22 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff
Path to fix access to non webdav sites (2.75 KB, patch)
2015-09-30 09:54 UTC, Giuseppe Castagno (aka beppec56)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Giuseppe Castagno (aka beppec56) 2015-05-13 13:01:04 UTC
When serf library was added to AOO, the WebDAV lock file feature was not implemented.

To check it, you should have a WebDAV server available, on which the lock feature is enabled.

This can be achieved on both Linux or Windows 7 Professional, instruction to do this can be found on the Internet.
On Windows 7 Professional only the Basic authentication will work, current AOO serf version does not have Windows authentication.

Try to access the same file on the WebDAV server with AOO 4.1.1 from two different PC at the same time and both of them will permit modification of the file.

I'll attach a patch that implements the WebDAV lock, only for files, WebDAV lock on containers (directory) is not implemented.
The implementation is according to RFC4918, plus errata.

The main project where the changes are located is ucb.
Comment 1 Giuseppe Castagno (aka beppec56) 2015-05-14 13:08:22 UTC
Created attachment 84738 [details]
Add lock functionality to WebDAV, according to RFC4918

The patch is rebased on trunk, r1678268.

I added the placeholder '//->i126305' where changes where made in ucb client applications (sfx2, ucbhelper, comphelper, offapi),
I didn't do that in ucb, where the changes are substantial.

Other placeholder are 'i12605 TODO' something that works but I'm not sure I did the right choice,
in this case suggestions welcome.

The patch was built successfully both on Linux (Ubuntu 14.04 64bit) and Windows (Windows 7 64bit).
Comment 2 Giuseppe Castagno (aka beppec56) 2015-05-16 09:06:28 UTC
See issue 126312 for a better use in some Windows installation where Windows authentication is needed.

See issue 125194 for an issue with roots in WebDAV lock problem, but solved in another way.
Comment 3 Giuseppe Castagno (aka beppec56) 2015-06-11 12:53:50 UTC
Created attachment 84784 [details]
Proposed patch to fix the issue, version #2

The patch is rebased on trunk, r1683442.

It completely replaces the former one.

I added the placeholder '//->i126305' where changes where made (sfx2, ucbhelper, comphelper, offapi, ucb).

The patch was built successfully both on Linux (Ubuntu 14.04 64bit) and Windows (Windows 7 64bit).

Changes from the previous patch version:

- fixed a regression while doing copy/paste among AOO application;

- added a correct refresh of the document while turning it to r/w from r/o (e.g. when the other user releases the lock on the WebDAV resource). This same refresh is operating even when you try to switch from r/o to r/w and the document is reported as still locked, so the user can see the current document state;

- corrected a wrong behaviour existent in AOO 4.1.1, where the edit button on toolbar stop functioning after you try it several time and the file is still locked by another user;

- shortened the refresh time of the lock because some WebDAV servers even though they are HTTP/1.1 after some time they return an error that is mapped by serf to 'connection closed by peer'.
Time was reduced from 3 minutes down to 2 minutes to solve the problem.

- removed some unused white spaces while I was at it...

In my own opinion, this patch should be evaluated to be added to AOO 4.1.2 version.
Comment 4 Andrea Pescetti 2015-06-21 19:02:19 UTC
Setting target 4.1.2 as per discussions in mailing list and issue comments.
Comment 5 Giuseppe Castagno (aka beppec56) 2015-07-11 13:39:34 UTC
Created attachment 84822 [details]
Proposed patch to fix the issue, version #3

Updated version of the patch.
Fixes a small error in protocol testing in framework that prevented correct checking against https:// protocol.

Polished the comment a little.

IMHO it ca be used for inclusion in trunk, rebased on trunk r1687177.
Comment 6 Andrea Pescetti 2015-08-26 06:54:38 UTC
Nominating as blocker for OpenOffice 4.1.2. This is the second patch in a set of three patches that, combined, solve a major interoperability (Sharepoint) bug.
Comment 7 Giuseppe Castagno (aka beppec56) 2015-08-26 07:26:00 UTC
The proposed patch could have regressions because was tested only with a limited set of WebDAV servers.
Comment 8 SVN Robot 2015-09-25 00:01:10 UTC
"pescetti" committed SVN revision 1705200 into branches/AOO410:
#i126305# Fix typo that prevents merging from trunk.
Comment 9 SVN Robot 2015-09-25 00:01:12 UTC
"pescetti" committed SVN revision 1705199 into trunk:
#i126305# Add support for WebDAV locking.
Comment 10 SVN Robot 2015-09-25 00:26:56 UTC
"pescetti" committed SVN revision 1705201 into branches/AOO410:
#i126305# Add support for WebDAV locking.
Comment 11 SVN Robot 2015-09-25 07:59:47 UTC
"pescetti" committed SVN revision 1705247 into branches/AOO410:
#i126305# Temporary revert build breaker (limited to the AOO410 branch).
Comment 12 Andrea Pescetti 2015-09-25 08:02:23 UTC
Apparently this breaks the build in AOO410 (offapi module), so it's temporarily reverted until it can be checked better. It remains fixed on trunk, where build is OK.
Comment 13 SVN Robot 2015-09-25 11:42:54 UTC
"pescetti" committed SVN revision 1705276 into trunk:
#i126305# Add missing files from the patch.
Comment 14 SVN Robot 2015-09-25 12:01:51 UTC
"pescetti" committed SVN revision 1705278 into branches/AOO410:
#i126305# Apply the full WebDAV patch.
Comment 15 Andrea Pescetti 2015-09-25 12:08:56 UTC
Build issues were due to an incomplete commit. The patch has now been applied properly to AOO410 for OpenOffice 4.1.2.
Comment 16 truckman 2015-09-27 09:27:23 UTC
Created attachment 84961 [details]
patch to unbreak the FreeBSD port build after the proposed patch was committed

This change broke the FreeBSD port build, which uses --with-system-apr and --with-system-serf.  The attached patch fixes this problem, and builds of trunk without these two options are also successful on FreeBSD..

A similar change was made to trunk in r1654282 to fix other files under webdav.
Comment 17 Andrea Pescetti 2015-09-27 16:05:14 UTC
A different version of Don's patch has been committed to trunk and merged to AOO410 by pfg.

Relevant commits for tracking:
http://svn.apache.org/r1705542
http://svn.apache.org/r1705543
http://svn.apache.org/r1705547
Comment 18 Andrea Pescetti 2015-09-27 20:42:28 UTC
The current trunk and AOO410 have the patch by Giuseppe and the following build fixes by Don.

Adjusted by pfg with
http://svn.apache.org/r1705551 (trunk)
http://svn.apache.org/r1705552 (AOO410)
Comment 19 Andrea Pescetti 2015-09-28 20:44:35 UTC
Reopening due to the (easy) fix proposed on the dev list:
http://www.mail-archive.com/dev@openoffice.apache.org/msg25156.html

Giuseppe, are you going to implement the change yourself? Due to the nature of this change, a patch with respect to the current trunk would be best.
Comment 20 Giuseppe Castagno (aka beppec56) 2015-09-30 08:22:11 UTC
Created attachment 84971 [details]
Move an added enum as the last one

The proposed patch move the new enum to the last position.
Comment 21 Giuseppe Castagno (aka beppec56) 2015-09-30 09:54:07 UTC
Created attachment 84972 [details]
Path to fix access to non webdav sites

This patch fix access to web site not implementing webdav or to site that are read-only webdav.
Comment 22 Andrea Pescetti 2015-10-07 00:48:10 UTC
Both patches by Giuseppe are now committed to trunk and to AOO410 for OpenOffice 4.1.2.
Comment 23 Giuseppe Castagno (aka beppec56) 2015-10-19 09:23:46 UTC
Verified in Linux (64bit) and Windows (32bit): found fixed.
Comment 24 Andrea Pescetti 2015-10-19 10:29:18 UTC
Thanks, setting VERIFIED after we got confirmation on list that 4.1.2-RC2 Mac OS X works too.
Comment 25 Kay 2016-08-30 21:33:15 UTC
Closing.