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 753019 - Evince saves copy with wrong permissions (not honoring umask)
Evince saves copy with wrong permissions (not honoring umask)
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-29 13:46 UTC by Karol Babioch
Modified: 2015-09-02 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't copy permissions from original file (1.12 KB, patch)
2015-08-19 15:53 UTC, Marek Kašík
committed Details | Review

Description Karol Babioch 2015-07-29 13:46:58 UTC
Apparently the "Save a Copy..." function of Evince is saving the copied file under the same permissions that the original file was opened with. Evince does *not* honor the user file-creation mask (umask) at all and is unaware of this concept.

#749580 is essentially referring to the same issue. There is also a similar bug over at the Ubuntu bugtracker [1].

This problem with the current behavior leads to issues: For instance, Mozilla recently [2] changed the file permission for temporary files to 0400 respectively. When using the "Open in Evince" option within Firefox, and then saving a copy with Evince the file will be end up with 0400. This is a problem when making use of Unix file and group permissions, since no group member will be able to access the file.

Evince, like other applications, should instead honor the umask set by the user, which would allow a more fine grained control.

[1]: https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1082297
[2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1074793
Comment 1 Karol Babioch 2015-08-19 14:24:04 UTC
Just as a reference:

evince version:

[kbabioch@kbabioch ~]$ rpm -q evince
evince-3.8.3-8.el7.x86_64

Distribution: 

[kbabioch@kbabioch ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Workstation release 7.1 (Maipo)

evince version 3.16.1-1 behaves in the same way, though, so I guess version numbers are not too important in this case.
Comment 2 Karol Babioch 2015-08-19 14:25:03 UTC
Another point of reference:

[kbabioch@kbabioch ~]$ rpm -q gnome-shell
gnome-shell-3.8.4-45.el7.x86_64
Comment 3 Marek Kašík 2015-08-19 15:53:55 UTC
Created attachment 309612 [details] [review]
Don't copy permissions from original file

Evince uses permissions of original file for the new copy since 3.5.2 because of these commits:

https://git.gnome.org/browse/evince/commit/?id=fd2b09adf5171df9351832a663e122cb4caab427
https://git.gnome.org/browse/evince/commit/?id=8652c61ea91698f7d3a5e11a467eca3b0ec4ac26

This was considered a bug previously:

https://bugzilla.gnome.org/show_bug.cgi?id=568593
https://bugzilla.gnome.org/show_bug.cgi?id=689319

Attached patch fixes the problem for me.
Comment 4 Oliver 2015-08-26 10:50:17 UTC
Do we have any news on this Bug? Is the Patch accepted?
Comment 5 Carlos Garcia Campos 2015-08-26 16:14:04 UTC
Review of attachment 309612 [details] [review]:

Ok, thanks!
Comment 6 Marek Kašík 2015-09-02 13:00:35 UTC
Comment on attachment 309612 [details] [review]
Don't copy permissions from original file

Thank you for the review. I've pushed the patch to master and 3.16 branches.
Comment 7 Karol Babioch 2015-09-02 13:07:46 UTC
Any chance this will also make its way into older branches? We encountered this problem with RHEL 7.1, so we would like to have this patch available in the 3.8 branch ;).
Comment 8 Marek Kašík 2015-09-02 13:33:27 UTC
(In reply to Karol Babioch from comment #7)
> Any chance this will also make its way into older branches? We encountered
> this problem with RHEL 7.1, so we would like to have this patch available in
> the 3.8 branch ;).

I think that this has to go through a downstream bug.