Obey umask rules when saving new file
ClosedPublic

Authored by chinmoyr on Apr 8 2018, 6:04 PM.

Details

Summary

Okular saves a new file with permissions 0600 completely ignoring the umask value. This is because it
makes use of QTemporaryFile which creates file with the said permissions and which then Okular copies
to the new location.
So to overcome this generate new file permissions using old mask value and change permissions of the
new file.

BUG: 392682

Test Plan

Set umask to 0040
Open a pdf file from the same shell and save it under a new name.
Before patch:
file permisions -> 0600
After patch:
file permisions -> 0606

Diff Detail

Repository
R223 Okular
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
chinmoyr created this revision.Apr 8 2018, 6:04 PM
Restricted Application added a project: Okular. · View Herald TranscriptApr 8 2018, 6:04 PM
chinmoyr requested review of this revision.Apr 8 2018, 6:04 PM
chinmoyr updated this revision to Diff 31692.Apr 8 2018, 6:07 PM

Fix coding style

aacid accepted this revision.Apr 23 2018, 9:07 PM

I'll land it

This revision is now accepted and ready to land.Apr 23 2018, 9:07 PM
This revision was automatically updated to reflect the committed changes.