Bug 1281253

Summary: 'dconf update' changes permissions on 'etc/dconf/db/local' if umask is set
Product: Red Hat Enterprise Linux 7 Reporter: Siteshwar Vashisht <svashisht>
Component: dconfAssignee: Marek Kašík <mkasik>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 7.1CC: ajipatil, ayadav, jcastran, jprajzne, mkasik, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dconf-0.26.0-2.el7 Doc Type: Bug Fix
Doc Text:
Cause: Permissions of updated database files were not restored and were set to the default ones for new files. Consequence: The database files could can be unreadable with certain umask. Fix: Permissions of updated database files are restored in current version of dconf. Result: Permissions of database files do not change between their updates.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 09:35:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Siteshwar Vashisht 2015-11-12 07:31:07 UTC
Description of problem:
'dconf update' changes permissions on 'etc/dconf/db/local' if umask is set

Version-Release number of selected component (if applicable):
dconf-0.16.0-6.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Login as root
2. Set umask by executing 'umask 0077'
3. Execute 'touch /etc/dconf/db/local.d/00-temp' to create a new file under ' /etc/dconf/db/local.d/' directory.

4. Execute 'dconf update'

Actual results:
'/etc/dconf/db/local' file is not readable by non-root users.

# ls -lh /etc/dconf/db/local
-rw-------. 1 root root 61 Sep 24 04:08 /etc/dconf/db/local

Expected results:
'/etc/dconf/db/local' should be readable by non-root users.

Additional info:
strace shows a new file is created and renamed to '/etc/dconf/db/local' :

28288 04:08:37 open("/etc/dconf/db/local", O_WRONLY) = 3 <0.000017>
28288 04:08:37 open("/etc/dconf/db/local.L2LU5X", O_RDWR|O_CREAT|O_EXCL, 0666) = 4 <0.000257>
28288 04:08:37 fallocate(4, 0, 0, 61)   = 0 <0.000088>
28288 04:08:37 write(4, "GVariant\0\0\0\0\0\0\0\0\30\0\0\0<\0\0\0\0\0\0(\1\0\0\0"..., 61) = 61 <0.000017>
28288 04:08:37 fstatfs(4, {f_type=0x58465342, f_bsize=4096, f_blocks=7720261, f_bfree=5457808, f_bavail=5457808, f_files=30896128, f_ffree=30720557, f_fsid={64768, 0}, f_namelen=255, f_frsize=4096}) = 0 <0.000014>
28288 04:08:37 lstat("/etc/dconf/db/local", {st_dev=makedev(253, 0), st_ino=69189057, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=61, st_atime=2015/09/24-04:06:59, st_mtime=2015/09/24-04:06:38, st_ctime=2015/09/24-04:06:39}) = 0 <0.000015>
28288 04:08:37 fsync(4)                 = 0 <0.061986>
28288 04:08:38 close(4)                 = 0 <0.000063>
28288 04:08:38 rename("/etc/dconf/db/local.L2LU5X", "/etc/dconf/db/local") = 0 <0.000061>
28288 04:08:38 write(3, "\0\0\0\0\0\0\0\0", 8) = 8 <0.000024>
28288 04:08:38 close(3)

Comment 1 Marek Kašík 2015-11-13 16:29:05 UTC
Hi,

I've filed an upstream bug with a patch which restores the permissions after the file has been updated. I've also asked about the setting of default permissions suggested by you so we know upstream's opinion on this.

Comment 7 Marek Kašík 2017-03-06 12:45:23 UTC
*** Bug 1426303 has been marked as a duplicate of this bug. ***

Comment 10 Jiri Prajzner 2017-04-26 09:29:46 UTC
cannot reproduce

Comment 11 errata-xmlrpc 2017-08-01 09:35:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2302