After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792191 - Permission error saving a file - on CIFS mount (fstab)
Permission error saving a file - on CIFS mount (fstab)
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-04 09:11 UTC by MichaelB
Modified: 2018-05-22 17:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description MichaelB 2018-01-04 09:11:08 UTC
Hi,

I refer to the bug originally posted on launchpad by Alex D in 2016.
https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1567565

Short resume here:

It is impossible to SAVE (overwrite) the opened pdf file when this file is in a CIFS mount point (fstab). It appear a permission error.. and much more bad, the file is totally erased!!


Tested on different version from Evince 3.18 and now on Ubuntu 17.10 (Evince 3.26.0) and problem persist!

Example usage:
We are in a company environment, files are mounted by SMB in a mount point (fstab). We want open a pdf file, add annotations and save the file (overwrite).
Not possible... 

Please try to correct this major problem for a company daily usage.. and for the upcoming Ubuntu 18.04 LTS.

Thanks!
Comment 1 Germán Poo-Caamaño 2018-01-04 12:33:40 UTC
Evince does not handle anything specific to file systems.

Ubuntu uses AppArmor to restrict applications like Evince to the resources the application can access.

Even more, the issue and possible solution was pointed out in Comment #2 in Launchpad:
https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1567565

Check the logs and AppArmors configuration. Nothing to do with Evince at all.
Comment 2 MichaelB 2018-01-08 13:24:37 UTC
(In reply to Germán Poo-Caamaño from comment #1)
> Evince does not handle anything specific to file systems.
> 
> Ubuntu uses AppArmor to restrict applications like Evince to the resources
> the application can access.
> 
> Even more, the issue and possible solution was pointed out in Comment #2 in
> Launchpad:
> https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1567565
> 
> Check the logs and AppArmors configuration. Nothing to do with Evince at all.


Thanks for your answer.

But i already tested with Apparmor "disable" and nothing change. I can save the file only if i change the filename. BUT if i want use the SAME filename (override because i just added a annotation) i got an error that he cannot rename the file. And the file is totally erased..

Error message in french: Erreur lors du renommage du fichier temporaire : Permission non accordée

Any idea?
Comment 3 Germán Poo-Caamaño 2018-01-08 14:00:33 UTC
Quick reply (as I am busy):

I am not knowledgeable in AppArmor, but it could also be some option in the file system itself, how it is mounted and/or the operations it allows (I am just brainstorming).

Evince itself does not rename to save the document, AFAIK. So, that is happening in the underlying libraries or file system.

I would try gvfs-rename in the aforementioned directory. I would try to rename the file to a non-existent name and to rename a file to an already existent name. That would narrow the issue to gvfs. I would also try the same using mv.

I am re-opening the issue just to check-it again later, and if someone can assess if Evince can gracefully fail.
Comment 4 MichaelB 2018-01-09 10:08:44 UTC
(In reply to Germán Poo-Caamaño from comment #3)
> Quick reply (as I am busy):
> 
> I am not knowledgeable in AppArmor, but it could also be some option in the
> file system itself, how it is mounted and/or the operations it allows (I am
> just brainstorming).
> 
> Evince itself does not rename to save the document, AFAIK. So, that is
> happening in the underlying libraries or file system.
> 
> I would try gvfs-rename in the aforementioned directory. I would try to
> rename the file to a non-existent name and to rename a file to an already
> existent name. That would narrow the issue to gvfs. I would also try the
> same using mv.
> 
> I am re-opening the issue just to check-it again later, and if someone can
> assess if Evince can gracefully fail.


More informations for you, may be can help:

If i mount my network folder directly in Nautilus (smb://), GVFS i guess.. All is ok, i can open my file, edit and save again with the same filename without problem.

Problem appear ONLY when my network folder is mounted in fstab (CIFS). In that case, i cannot use the same filename to save my edited file and the file is erased. It works
with all other software that is use (gedit, libreoffice, gimp, ...) with same network share but not Evince.


In my /etc/fstab:
//mynas/datas /mnt/my-mount-point cifs credentials=/home/myuser/.smbcredentials,uid=myuser,gid=myuser,file_mode=0644,dir_mode=0755,iocharset=utf8,nobrl,vers=3.0 0 0


In mount command result:
//mynas/datas on /mnt/my-mount-point type cifs (rw,relatime,vers=3.0,sec=ntlmssp,cache=strict,username=myuser,domain=,uid=1002,forceuid,gid=1002,forcegid,addr=xxx.xxx.x.xx,file_mode=0644,dir_mode=0755,nounix,serverino,mapposix,nobrl,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)


Hope can help
Comment 5 MichaelB 2018-04-09 12:24:08 UTC
Hi, any news or test about my problem?

I tried with Ubuntu 18.04 (final beta) and the problem persist. I cannot override a pdf file (same filename because i just add a annotation) when is mounted via CIFS fstab (see my previous post)

AND the original file is ERASED from filesystem after close evince...

- Ubuntu 18.04 (final beta) and other one
- Evince 3.28
Comment 6 Germán Poo-Caamaño 2018-04-09 12:55:27 UTC
Open a terminal and run:

$ journalctl -b -f

just before saving the file. To see if there is anything that the system says about permissions.
Comment 7 MichaelB 2018-04-09 13:36:17 UTC
Results of what i got with #journalctl -b -f

- On Ubuntu 16.04 i have no message just after try saving the file

- On Ubuntu 18.04 (Final Beta) just a few messages about Gnome-Shell resource .js files but is not linked with my problem

In both case i got an error that the file cannot be saved and when i close evince, the original file is deleted and lost.


It is possible to run evince in a debug mode to see more informations?
Comment 8 GNOME Infrastructure Team 2018-05-22 17:29:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/868.