If a pdf is saved (changed or unchanged) via "File Save As…". the resulting file has 0600 permissions, regardless of umask settings. Tested on nfs and non-nfs locations (both for the opened and the saved file).
How to test:
1. Set umask to anything other than 0077 and run okular from that shell.
2. Open a pdf file.
3. Save as a differently named pdf file.
4. Check the permissions on the original and the saved file.
Seems the QTemporaryFile in Part::saveAs is to blame, i guess we should apply a similar solution to https://git.reviewboard.kde.org/r/122612/diff/2#index_header
Anyone has time for it?
Git commit c5592689874f41df393b44f3ba572acc751c5645 by Albert Astals Cid, on behalf of Chinmoy Ranjan Pradhan.
Committed on 23/04/2018 at 21:07.
Pushed by aacid into branch 'Applications/18.04'.
Obey umask rules when saving new file
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
Set umask to 0040
Open a pdf file from the same shell and save it under a new name.
file permisions -> 0600
file permisions -> 0606
Reviewers: #okular, aacid
Differential Revision: https://phabricator.kde.org/D12049
M +12 -0 part.cpp
*** Bug 398450 has been marked as a duplicate of this bug. ***