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 758066 - 'dconf update' changes permissions if umask is set
'dconf update' changes permissions if umask is set
Status: RESOLVED OBSOLETE
Product: dconf
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-13 16:25 UTC by Marek Kašík
Modified: 2018-09-21 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Restore permissions on changed files (1.34 KB, patch)
2015-11-13 16:25 UTC, Marek Kašík
reviewed Details | Review
Restore permissions on changed and missing files (875 bytes, patch)
2017-03-02 15:49 UTC, Felix Zhang
none Details | Review

Description Marek Kašík 2015-11-13 16:25:24 UTC
Created attachment 315420 [details] [review]
Restore permissions on changed files

Hi,

I've got downstream report which says that when 'dconf update' is called after umask has been changed to e.g. 077 then files updated by this call have changed permissions (to 600 on the /etc/dconf/db/local in this specific report).

The function which changes the permissions is the g_file_set_contents() from gvdb_table_write_contents() because it creates temporary file with the new contents and then renames it to the resulting one. Since the function updates contents of the file and is not primarily for creating of new file I guess that the resulting file should have the same permissions as the original one.

Could we restore the permissions after the contents has been written?

Moreover, shouldn't we set the permissions to at least 644 by default (on files under /etc/dconf/db/)?

Attached is a patch which restores the permissions.

Regards

Marek
Comment 1 Marek Kašík 2016-01-14 13:43:07 UTC
Does this looks like a bug to you or is the current behaviour intentional?
Comment 2 Marek Kašík 2016-07-19 13:15:11 UTC
Hi, I would like to resolve this downstream but I don't want to diverge from upstream. Do you think that the patch is appropriate or it should stay as it is?

Regards
Comment 3 Bjørn Lie 2016-08-22 13:08:04 UTC
As a extra datapoint - we have seen the same on openSUSE/SLED.

On request from our SLED people, we have just applied the patch from reporter.
Comment 4 Felix Zhang 2017-03-02 15:43:49 UTC
Review of attachment 315420 [details] [review]:

Hi Marek. The patch works perfectly for existing files. However in case a db file is missing (e.g. deleted by hand), 'dconf update' regenerates the file and still set its permission to 0600. IMHO in this case we should set it to 0644 as you have previously suggested.
Comment 5 Felix Zhang 2017-03-02 15:49:16 UTC
Created attachment 347082 [details] [review]
Restore permissions on changed and missing files

Based on Marek's patch.
Comment 6 GNOME Infrastructure Team 2018-09-21 16:15:48 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/dconf/issues/25.