[PATCH] dconf update is not correctly checking the mtime of the keyfiles
Submitted by Carlos Alberto Lopez Perez
Assigned to dco..@..e.bugs
Link to original bug (#708258)
Description
Created attachment 255130 dconf-fix-mtime-directory.patch
dconf currently compares the mtime of the directory that contains the keyfiles (for example "/etc/dconf/db/local.d") with the mtime of the database to decide if it has to trigger an update.
Quoting from https://wiki.gnome.org/dconf/SystemAdministrators:
After modifying any keyfile in one of these directories, the 'dconf update' tool should be run. This tool scans the /etc/dconf/db/ directory for databases with corresponding '.d' directories. If the timestamp on the directory is newer than the one on the file, the file is regenerated. The tool sends a notification on the system D-Bus to all running applications instructing them to re-read their settings.
This check alone is wrong, because the mtime of a directory only changes when a file is added, removed or renamed. But not when the contents of the file are modified within the directory itself.
To reproduce this buggy behaviour, edit any keyfile with the nano editor, or append to it with the shell, and check how the mtime of the directory don't changes.
$ md5sum testdir/somefile d8e8fca2dc0f896fd7cb4cb0031ba249 testdir/somefile $ stat testdir/|grep Modify Modify: 2013-09-17 20:04:11.226476625 +0200 $ echo "something" >> testdir/somefile $ md5sum testdir/somefile 1e3ead11c29e7ce8ad2a60c7968ee0cf testdir/somefile $ stat testdir/|grep Modify Modify: 2013-09-17 20:04:11.226476625 +0200
This patch adds an extra check that compares also the mtime of the files inside the directories "dirname" and "
dirname/locks"
Patch 255130, "dconf-fix-mtime-directory.patch":
dconf-fix-mtime-directory.patch
Version: git master