Issue 67081 - samba locking => cannot reference cell of open spreadsheet
Summary: samba locking => cannot reference cell of open spreadsheet
Status: CONFIRMED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 2.0.3
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-06 16:50 UTC by caolanm
Modified: 2017-05-20 10:45 UTC (History)
4 users (show)

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


Attachments
collapsed view of what happens in sal in this case (772 bytes, text/plain)
2006-07-06 17:22 UTC, caolanm
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2006-07-06 16:50:10 UTC
Yeah, I know locking is a wonderful topic that everyone is really happy to see,
but bear with me, at least to at least be aware of this particular effect.

mount a dir exported through samba from a Fedora Core 5 box to another one (or
itself), e.g.

mount //127.0.0.1/samba /mnt/serveur -t cifs -o user=caolan

put some .ods content onto /mnt/serveur

take the attached test case code and run it like so...

./a.out /mnt/serveur/essai1.ods unlock
ok
./a.out /mnt/serveur/essai1.ods lock
Permission denied

i.e. you can't read from a fd which points to a file which is opened with a
write lock over samba (with the default options anyway, I'm not much of a samba guy)

This bites calc like so...
open the .ods from the samba mount in calc, 
open a new empty spreadsheet, and click "=" 
and then move to the opened doc (which is holding a write lock) and click in a
cell. 
Now back to the empty sheet, the reference to the cell in the first doc is
shown, press enter to accept it and to attempt to insert it's content into OOo.

Now calc reopens the original document to attempt to parse it to get the content
of the selected cell to put into the empty spreadsheet, but it fails. =>
"#NAME?", because the underlying new fd to the samba mounted calc doc cannot be
read from.

If instead you close the samba mounted doc and type the reference manually into
a cell, then all is ok.
Comment 1 caolanm 2006-07-06 16:51:05 UTC
reassign I guess
Comment 2 Stephan Bergmann 2006-07-06 16:56:03 UTC
...but not to me, but rather NN (calc) or HRO (sal locking).
Comment 3 niklas.nebel 2006-07-06 17:14:18 UTC
"Attached test case code", you say?
Comment 4 caolanm 2006-07-06 17:22:12 UTC
Created attachment 37546 [details]
collapsed view of what happens in sal in this case
Comment 5 sitkarev 2007-02-01 16:32:43 UTC
It is all true and a proposed attachment performs the described "Permission
denied". But this has nothing in common with OpenOffice. Is a totaly Samba/CIFS
issue. Increasing the debug level of the smbd(1) can give a lot of useful
information about the behaviour which causes the problem of concurent access. In
short, when someone has put a range lock, using posix symantics, through the
cifs, samba can deny access to other read/write attempts. And that's what it
does by default. Samba itself tries to resolv locking conflicts and denies
access if it finds the conflict.

To resolve the problem you can simply modify your smb.conf(5) by setting

strict locking = no

It is acceptable, as the smb.conf(5) tells us, and nothing breakes the usual
behaviour. Setting this parameter to "no" has a good effect on us, and the
locked file can be opened in read-only mode. That is the default behaviour of
the OpenOffice. It opens locked file in read-only mode.

In cases when we can't influence smb.conf(5) we simply can supply additional
option to mount.cifs which disables byte range locks at all, though it is not
recommended, like that:

mount //127.0.0.1/samba /mnt/server -t cifs -o rw,username=myname,nobrl
Comment 6 colsocota 2010-11-11 00:07:10 UTC
Created attachment 73884
Comment 7 Rainer Bielefeld 2013-09-30 05:10:27 UTC
Comment on attachment 73884


Inappropriate SPAM Attachment
Comment 8 Marcus 2017-05-20 10:45:09 UTC
Reset the assignee to the default "issues@openoffice.apache.org".