Issue 108925

Summary: [Samba] Problem saving files over CIFS share
Product: General Reporter: wolfperkins <wolfperkins>
Component: uiAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: elish, issues
Version: OOo 3.0.1Keywords: needhelp
Target Milestone: ---   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description wolfperkins 2010-02-03 22:25:11 UTC
I keep my documents on an external NAS device connected to my PC through a
mounted CIFS folder. Here is what I have:
$ uname -a
Linux <host> 2.6.27.41-170.2.117.fc10.i686 #1 SMP Thu Dec 10 11:00:29 EST 2009
i686 i686 i386 GNU/Linux
$ mount | grep isabelle
gvfs-fuse-daemon on /home/isabelle/.gvfs type fuse.gvfs-fuse-daemon
(rw,nosuid,nodev,user=isabelle)
//<host>/ISABELLE on /mnt/isabelle_san type cifs (rw)
$ grep isabelle /etc/fstab
//<host>/ISABELLE       /mnt/isabelle_san       cifs   
credentials=/etc/samba/isabelle.smb,_netdev,uid=500,gid=500,dir_mode=0777,file_mode=0777,noacl,noperm,nobrl
   0       0
$ rpm -qa | grep openoffice.org-core
openoffice.org-core-3.0.1-15.6.fc10.i386
$

Now when I manipulate .odt, .ods, .doc files off of the mounted share the OO
(writer, and calc) component will initially open the document stipulating
"(read-only)" in the title bar. If you close the document immediately and reopen
it. The read-only indication goes away. Close and reopen once more and it comes
back. This seems related to how the lock file gets generated and managed. Under
all circumstances thought you can never save, regardless of read-only indication
in title bar or not.

Repeatable/reproducible steps:
1) List files on CIFS
  $ ls -la /mnt/isabelle_san/test
  total 20
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:01 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
2) Open test ods document
   - "Read-only" indicated in title bar
3) List files while document open
  $  ls -la /mnt/isabelle_san/test
  total 24
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:03 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:03 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
4) Close document
5) List files
  $  ls -la /mnt/isabelle_san/test
  total 24
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:03 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:03 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
6) Open the document once more
  - No "Read-only" indicated in title bar
7) List files while document open
  $  ls -la /mnt/isabelle_san/test
  total 24
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:03 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:03 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
8) Close document
9) List files
  $  ls -la /mnt/isabelle_san/test
  total 24
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:03 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:03 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
10) Open test ods document
   - "Read-only" indicated once more in title bar
11) List files while document open
  $ ls -la /mnt/isabelle_san/test
  total 24
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:09 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:09 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods

This could be related to issue 72045 but not sure.

It is not possible to save any updates to the document that overwrites an
existing file.

If you try to save as a new file on the CIFS mount you get an error about
"object cannot be created" and the listed files look like this:
  $ ls -la /mnt/isabelle_san/test
  total 28
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:16 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:16 .~lock.test2.ods#
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:09 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $
Now if you try the "save as" once more with the exact same new name you get a
different error but you get a saved file.
  $ ls -la /mnt/isabelle_san/test
  total 44
  drwxr-xr-x  2 isabelle isabelle     0 fév  3 17:18 .
  drwx------ 40 isabelle isabelle     0 fév  3 17:01 ..
  -rwxr--r--  1 isabelle isabelle    92 fév  3 17:09 .~lock.test.ods#
  -rwxr--r--  1 isabelle isabelle 16751 fév  3 17:18 test2.ods
  -rwxr--r--  1 isabelle isabelle 16694 fév  3 16:45 test.ods
  $

I hope there is enough details. This is especially painful for my wife as she is
not into geeky stuff and hates changes. I already forced her off Windows/Word
into Fedora/Writer.

My current work-around is
- save to a "local" folder
- delete existing file on CIFS
- move file from local folder onto CIFS