Issue 17211 - [Samba] OOo 1.1 for Linux does not lock correctly documents on an smb shared folder
Summary: [Samba] OOo 1.1 for Linux does not lock correctly documents on an smb shared ...
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 RC
Hardware: PC Linux, all
: P3 Trivial with 5 votes (vote)
Target Milestone: AOO Later
Assignee: mikhail.voytenko
QA Contact: issues@framework
URL:
Keywords: oooqa
: 25394 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-07-22 00:44 UTC by pratesi
Modified: 2010-06-18 10:13 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description pratesi 2003-07-22 00:44:15 UTC
The following tests have been performed on Mandrake Linux 9.1
with all official updates.

I have added the following lines to the default smb.conf:

/etc/samba/smb.conf
-------------------
[...]
[public]
   path = /home/samba
   public = yes
   writable = yes

Then I have issued the following commands:

[root@mandrake root]# mkdir /home/samba
[root@mandrake root]# chmod 777 /home/samba
[root@mandrake root]# service smb restart

Then: network installation of OOo 1.1rc (./setup /net)
in /usr/local/OpenOffice.org1.1rc/ , performed by the root;
workstation installation of OOo 1.1rc performed by the "pratesi"
and "foobar" users.

The following two lines have been uncommented in
/usr/local/OpenOffice.org1.1rc/program/soffice
to enable file locking:

SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING

Then I have issued the following commands:

[pratesi@mandrake pratesi]$ mkdir SMBMOUNT
[pratesi@mandrake pratesi]$ smbmount //localhost/public SMBMOUNT/

[foobar@mandrake foobar]$ mkdir SMBMOUNT
[foobar@mandrake foobar]$ smbmount //localhost/public SMBMOUNT/

Then, the "pratesi" user runs
~/OpenOffice.org1.1rc/soffice
and creates a new text document, then saves it as

/home/pratesi/SMBMOUNT/test-1.1rc.sxw

Now let us see which is the lock status:

[root@mandrake root]# smbstatus

Samba version 2.2.7a-security-rollup-fix
Service      uid      gid      pid     machine
----------------------------------------------
public       nobody   nogroup  15975   mandrake (127.0.0.1) Mon Jul 21 23:26:05 2003
public       nobody   nogroup  15956   mandrake (127.0.0.1) Mon Jul 21 23:25:04 2003

Locked files:
Pid    DenyMode   Access      R/W        Oplock           Name
--------------------------------------------------------------
15975  DENY_NONE  0x3         RDWR       NONE            
/home/samba/test-1.1rc.sxw   Mon Jul 21 23:30:41 2003
       ^^^^^^^^^
       ^^^^^^^^^
The DenyMode is wrong: it should be "DENY_WRITE", to prevent the "foobar"
user to overwrite it; instead, now the "foobar" user can open read/write
/home/foobar/SMBMOUNT/test-1.1rc.sxw
and then change it and *overwrite* it:

[foobar@mandrake foobar]$ ~/OpenOffice.org1.1rc/soffice SMBMOUNT/test-1.1rc.sxw &

After changes made by "foobar", "pratesi" reloads test-1.1rc.sxw and
realizes that it has been changed by someone else :-(

Now let us see which is the lock status:

[root@mandrake root]# smbstatus

Samba version 2.2.7a-security-rollup-fix
Service      uid      gid      pid     machine
----------------------------------------------
public       nobody   nogroup  15975   mandrake (127.0.0.1) Mon Jul 21 23:26:05 2003
public       nobody   nogroup  15956   mandrake (127.0.0.1) Mon Jul 21 23:25:04 2003

Locked files:
Pid    DenyMode   Access      R/W        Oplock           Name
--------------------------------------------------------------
15975  DENY_NONE  0x3         RDWR       NONE            
/home/samba/test-1.1rc.sxw   Mon Jul 21 23:36:53 2003
15956  DENY_NONE  0x3         RDWR       NONE            
/home/samba/test-1.1rc.sxw   Mon Jul 21 23:35:38 2003
       ^^^^^^^^^
       ^^^^^^^^^

An analogous "no-lock" problem can be evidenced also if the shared folder
is provided by a MS Windows box instead of a Samba server on Linux.

On the contrary, no lock problems occur if the two clients run
OOo 1.1 for MS Windows, both if the shared folder is provided
by a MS Windows box and if it is provided by a Samba server on Linux.
In the case of a Samba server on Linux, the DenyMode for a MS Windows
client is "DENY_WRITE" instead of the above "DENY_NONE".
Comment 1 thorsten.martens 2003-07-23 09:51:11 UTC
TM->HRO: Please have a look, thanks !
Comment 2 hennes.rohling 2003-07-29 14:22:33 UTC
Reassigned.
Comment 3 tino.rachui 2004-02-11 07:46:40 UTC
See also discussion on openoffice.dev from 09.02.2004, Sebastian Hetze
Comment 4 tino.rachui 2004-02-29 20:18:28 UTC
*** Issue 25394 has been marked as a duplicate of this issue. ***
Comment 5 mitaru 2004-05-31 19:10:28 UTC
I have confirmed this issue on Gentoo Linux using OOo 1.1.2rc3, so the problem
still exists.

I modified the soffice shell script to enable file locking and received the same
results as the submitter:

The open file showed a DENIED_MODE of DENY_NONE on the samba server, and another
user was able to modify the file at the same time.
Comment 6 tino.rachui 2004-07-28 19:02:41 UTC
Because of limited resources a deeper investigation and maybe a fix for this
problem must be delayed. 
Comment 7 godoy 2004-09-01 16:45:41 UTC
I'd also like to see some way to lock documents locally that was also
interchangeable independent of the means that the remote access use (smbfs, NFS,
etc.).

I guess that something like other editors do of prefixing the file with a "#" or
suffixing it with a ".lock" extension would be great.

with this, OpenOffice.org can take care of the lock by itself in all of the
platforms it runs on and Windows can use the default locking provided by samba
or its own filesystem (when it is serving the files) and this would prevent Word
from doing nasty things while OpenOffice.org is running. 

I first ran into this problem while activating some LTSP stations that had to
share files with Windows desktops...  Now, the only solution to this problem is
the one shown in http://www.hackinglinuxexposed.com/articles/20030623.html or
using Samba to access local files as well (then we run into this ticket problem)... 

I'm running into this with Conectiva Linux 9 and Conectiva Linux 10.
(OpenOffice.org 1.0.3 and OpenOffice.org 1.1.2).


Thanks for your attention.
Comment 8 tino.rachui 2005-06-13 12:41:14 UTC
Reassigned for change of responsibilities sake.
Comment 9 bobharvey 2005-09-05 06:42:43 UTC
Will this be addressed in 1.1.5 ?  It is quite important.
Comment 10 mfedyk 2005-09-05 08:41:12 UTC
I doubt this will ever get into 1.1 unless someone submits a patch.

Test against OOo 2 beta snapshots and see if it is fixed there, and if not file
a bug against version 2.

Mike (Not a developer)
Comment 11 superm401 2006-08-10 19:41:19 UTC
This is a duplicate of 67796.
Comment 12 kai.sommerfeld 2009-06-17 07:35:36 UTC
mav: Please take over.
Comment 13 mikhail.voytenko 2009-06-17 10:16:22 UTC
Is the problem still reproducible in OOo3.1?
Comment 14 mikhail.voytenko 2010-06-18 10:12:58 UTC
There is no answer to my last question since one year. I have seen the scenario
working in our configuration at least in OOo3.2. Closing the issue as working
for me. Please reopen it if the problem is still there and there is a way to
show that it lies in OOo implementation.
Comment 15 mikhail.voytenko 2010-06-18 10:13:23 UTC
.