Bug 101533 - Can't save to a CIFS mount
Summary: Can't save to a CIFS mount
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.1.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-15 07:26 UTC by Esa Varemo
Modified: 2016-09-15 14:43 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esa Varemo 2016-08-15 07:26:51 UTC
When trying to save a new Writer document to a mounted CIFS share I get the following error:

Error saving the document Untitled1:
Access to /tmp/lu6247vp88ys.tmp/lu6247vp88yx.tmp was denied.

Error saving the document test:
Object not accessible.
The object cannot be accessed due to insufficient user rights.

[user@desk1 ~]$ ls /tmp/lu6247vp88ys.tmp/ -lah
total 0
drwx------.  2 user user  80 Aug 15 10:08 .
drwxrwxrwt. 20 root root 500 Aug 15 10:10 ..
-rw-------.  1 user user   0 Aug 15 10:08 lu6247vp88yt.tmp
----rw----.  1 user user   0 Aug 15 10:08 lu6247vp88yx.tmp

Mount:
[user@desk1 ~]$ mount | grep yht
systemd-1 on /mnt/yhteinen type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13493)
//files.intra.company.fi/yhteinen on /mnt/yhteinen type cifs (rw,relatime,vers=1.0,cache=strict,username=kaikki,domain=FILES,uid=0,noforceuid,gid=951000012,forcegid,addr=10.0.0.203,file_mode=060,dir_mode=070,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

version/OS:
libreoffice-core-5.1.5.2-1.fc24.x86_64 on Fedora 24
Comment 1 mahfiaz 2016-08-15 07:41:43 UTC
Can any other program save to a similar file? E.g simple text file with kate or gedit.
Comment 2 Esa Varemo 2016-08-15 07:59:28 UTC
Yes, the share can be read/written to by other programs. Actually it seems that even LibreOffice can atleast create a file.

I can create a file /mnt/share/test/test.txt using gedit.

If I try to save /mnt/share/test/test.odt using Writer it gives the error but the file still gets created. 
It's also not possible to open the file (/tmp/... access was denied) but copying it to a local location and then opening it works fine.
Comment 3 Esa Varemo 2016-08-15 10:38:47 UTC
I found out that it has to do with the permissions of the file.

The files in question are shared by the office, permissions 060 with a common group.

# ls /mnt/yhteinen/test.odt -lah
----rw----. 1 root office 8.7K Aug 15 10:08 /mnt/yhteinen/test.odt

Possibly libreoffice tries to copy the file or atleast the mode/permissions which ends in a temp file like this:
----rw----.  1 user user   0 Aug 15 10:08 lu6247vp88yx.tmp

Since now the effective permission is the user instead of the group it no longer has access.

After changing to file_mode=660 in mount options it works.
Comment 4 Buovjaga 2016-09-15 14:43:12 UTC
(In reply to Esa Varemo from comment #3)
> After changing to file_mode=660 in mount options it works.

Ok, setting to NOTABUG (checked on dev IRC to be sure as I'm not a shared mount expert).