Issue 6541 - File locking for new OO file formats (SXW / SXC / ..) does not work
Summary: File locking for new OO file formats (SXW / SXC / ..) does not work
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: PC All
: P4 Trivial with 4 votes (vote)
Target Milestone: OOo 1.1 Beta
Assignee: thorsten.martens
QA Contact: issues@framework
URL:
Keywords:
: 1164 11858 (view as issue list)
Depends on:
Blocks: 11768
  Show dependency tree
 
Reported: 2002-07-24 11:42 UTC by jameslee
Modified: 2003-06-20 17:09 UTC (History)
6 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 jameslee 2002-07-24 11:42:40 UTC
uncommenting:

SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING

in the soffice script does not make file locking work.


Please see also:
http://www.openoffice.org/issues/show_bug.cgi?id=1681


Dispite the comments IT DOES NOT WORK. Nor could anyone else make this work when 
I apealed on the discussion forum. I tried withhyphens in the name but this 
won't work in the shell script:

$ OpenOffice.org1.0.1/soffice
OpenOffice.org1.0.1/soffice: SAL-ENABLE-FILE-LOCKING=1: not found
OpenOffice.org1.0.1/soffice: SAL-ENABLE-FILE-LOCKING: is not an identifier



(I might be pretty stupid but I can make file locking work in 5.2 so I think I'm 
right to expect this to work for OO too.)
Comment 1 jkeil 2002-08-02 17:11:27 UTC
Seems to work for me.

I've tried the command

  env SAL_ENABLE_FILE_LOCKING=1 $HOME/OpenOffice.org1.0.1/soffice

on two solaris 8 boxes and then tried editing the same file in the
two OO instances.  The second OO copy could only "view" the file.
So, the locking works as expected.


The "SAL-ENABLE-FILE-LOCKING=1: not found" error is OK.  There
should really be underlines in that shell variable,  a hyphen/minus
character does *not* work.  This is standard bourne shell syntax:

% sh
$ a-b-c=1
a-b-c=1: not found
$ a_b_c=1
Comment 2 jameslee 2002-08-03 17:36:05 UTC
Oh no it doesn't, oh yes it does, oh no it doesn't...

Does issueilla sound like a pantomime to you too?

Again...
FILE LOCKING DOES NOT WORK.

One more time...
It does NOT WORK!!!!!!

Interestingly it does work for the old sdm 5.2 files, I can't think
why but then I don't know what method is being used to lock the files.

I've tried this several more times, I'm using system patched to
August-2002 standard. I'm using OO-1.0.1. File locking works in SO5.2
and I've given you another clue in that is works in OO when using 5.2
files - but not the new OO ones.

[Please also check the file mask? Make sure you chmod 666 before
trying this as for sure you can't read other poeple's files.]
Comment 3 jkeil 2002-08-03 18:43:44 UTC
I've played a bit more with locking...

File locking works for me in OpenOffice 1.0.1 with
'.sdw' '.sdc' '.doc' '.xls' files (i.e. StarOffice 5.x and MS formats). 

But, it does *not* work with '.sxw' and '.sxc' files (i.e. the new
StarOffice 6.0 or OpenOffice 1.0 formats).  That appears to be a
bug.

James, what file formats did you use for your tests when the
locking failed?
  


Comment 4 jameslee 2002-08-03 19:40:17 UTC
Excellent, we are making progress (and I'm not going potty!).

Yes, that appears to be it. Initially I used OO formats with OO as one
would but to check that I knew what to look for I used 5.2 for an
initial base line test, indeed 5.2 can lock files. I did this again
today but today when I tried OO this time I used the same 5.2 sdm file
for the OO test - and it locks. Perhaps I make a mistake I think, I'll
do exactly what I did the first time, using an OO file and success (or
failure!) it doesn't lock.

This is very odd as it must be the OS doing the lock; the file type
should make no difference.  Maybe the zip file is locked but you
unpack it to read and the contents looses the lock.

James.
Comment 5 jkeil 2002-08-03 19:56:40 UTC
Hmm, this is probably due to the use of ZIP format for these new
OO file formats.  OO has to unzip them before it can get at the real
file contents. Once unpacked the orignal ZIP is not needed any more
and is probably closed. If that theory is correct, it would loose the
locks placed at "operating system" level on the ZIP file as well.


Checking with 'lsof' on an OO 1.0.1 running with locking enabled,
after opening both a file 'foobar.doc' and 'foobar.swx', I see:

% /usr/local/etc/lsof -p `pgrep soffice` | awk 'NR < 2 || /foobar/'
COMMAND     PID USER   FD   TYPE        DEVICE SIZE/OFF    NODE NAME
soffice.b 12386   jk   31r  VREG       266,546     5136      34
/home/tiger.ebgen/tmp/foobar.sxw
soffice.b 12386   jk   32uW VREG       266,546     8192      49
/home/tiger.ebgen/tmp/foobar.doc


The '.doc' file is opened for "update (read/write)" and there's a
write lock visible in the FD colum.  But the '.swx' file is opened
read only and has no locks!
Comment 6 thorsten.martens 2002-08-06 12:54:33 UTC
Problem is known and reproducible. This affects 641 builds like the OO
1.0.1. and has already been fixed in an internal 643 build which will
hopefully be the base for the next available OO-version. 
Comment 7 erpel 2002-08-12 17:37:44 UTC
I have the same problem under Windows XP Pro accessing a (linux) Samba share. I have 
tried the locking with .sxc, .sxw, .xls, .doc and .sdw, and the problems only occurs 
with the .sxc/.sxw-files.
It has nothing to do with the extension itself (renaming 
the .sxc to .xls and vice versa makes NO difference), but with the file 
format.

Thorsten said, that the error is fixed in 643. Does this also apply to the 
other OSs or Solaris only?
Perhaps the OS field should be changed to "All"?!
Comment 8 thorsten.martens 2002-08-16 11:14:46 UTC
This bugfix affects all OS, therefor OS-field is set to ALL !
Comment 9 lohmaier 2002-08-27 17:00:15 UTC
*** Issue 1164 has been marked as a duplicate of this issue. ***
Comment 10 Unknown 2002-11-18 12:50:39 UTC
Hi There,

I have tried build 643 and it works nicely in that - I couldn't tell 
if this means that it will be fixed in the next 1.0.x stable release.

It seems to me that this is quite an important defect. I have 2 
companies evaluating OOo and one already moved across. For all 3 the 
only major issue with OOo is this flaw. For myself or a small company 
I could just go build 643 but for a corporate it's only possible to 
consider the stable releases.

It would be really cool if you could get a fix for this into the next 
stable release...

Thanks a Lot.

Regards,



Brian Powell
Comment 11 rtrout 2003-01-20 03:19:23 UTC
It is working for me in 643C.

Is there a reason why the status and target milestone hasn't been
updated on this issue? I would've thought this would be a good fix to
ensure it makes 1.1 Beta?
Comment 12 rtrout 2003-01-29 03:22:51 UTC
Is this in 1.0.2? I know it is NOT in 1.0.1 and IS in 643C, but how
can I tell if it made it into 1.0.2?
Comment 13 Unknown 2003-01-29 09:36:12 UTC
I have tested 1.0.2 and as far as i can tell it's not fixed.

.sxc and .sxw are still opened for READ only.

It would be nice to have this fixed in a 1.0 stable.
Comment 14 rtrout 2003-01-29 22:07:09 UTC
brianp - if the files are opening for READ ONLY then it IS fixed in
1.0.2. The problem is when the files were NOT locked in any way,
allowing many people to simultaneously edit the same file without any
knowledge others were doing so. You previously tested in 643C (as I
have) - is the function the same or different?
Comment 15 thorsten.martens 2003-02-11 12:19:19 UTC
This issue affects all OS and all OO 1.0.x builds (based on a 641
build) like 1.0.1 or 1.0.2.. It has already been fixed in an internal
644 build and will therefore also be fixed in a OO 1.1 Beta.
So this issue is closed.  
Comment 16 jstaniek 2003-02-25 19:06:49 UTC
*** Issue 11768 has been marked as a duplicate of this issue. ***
Comment 17 jstaniek 2003-02-25 19:08:26 UTC
*** Issue 11768 has been marked as a duplicate of this issue. ***
Comment 18 jstaniek 2003-02-25 19:09:02 UTC
*** Issue 11768 has been marked as a duplicate of this issue. ***
Comment 19 miv 2003-02-25 20:07:46 UTC
Please do not add duplications of duplication notifications ;)
Comment 20 thorsten.ziehm 2003-05-20 11:23:12 UTC
Verified in OOo 1.1 Beta2.
Comment 21 thorsten.ziehm 2003-05-20 11:25:23 UTC
closed ...
Comment 22 prgmgr 2003-06-20 17:09:58 UTC
*** Issue 11858 has been marked as a duplicate of this issue. ***