Create /etc/dconf/profile/user dynamically, if not present

The /etc/dconf/profile/user file in some distributions is part of dconf
package, in some not. There are even cases where it changes between
package versions (Fedora 27 don't have it, but Fedora 28 do).
Also, base Debian Stretch don't have it, but Kali Linux based on it do.

To avoid overly complex dependency handling, create the file dynamically
on package installation if it's missing in that particular case. The
file content is canonical:

    user-db:user
    system-db:local

Fixes QubesOS/qubes-issues#3834

(cherry picked from commit 23250f84b2)
This commit is contained in:
Marek Marczykowski-Górecki 2018-05-02 02:57:37 +02:00 committed by Frédéric Pierret
parent b0d342eaa3
commit 503a7fdf59
No known key found for this signature in database
GPG Key ID: 1DABC232BE02201E
5 changed files with 20 additions and 7 deletions

View File

@ -282,9 +282,6 @@ install-common:
install -d $(DESTDIR)/usr/share/nautilus-python/extensions
install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions
ifeq ($(findstring CentOS,$(shell cat /etc/redhat-release)),)
install -D -m 0644 misc/dconf-profile-user $(DESTDIR)/etc/dconf/profile/user
endif
install -D -m 0644 misc/dconf-db-local-dpi $(DESTDIR)/etc/dconf/db/local.d/dpi
install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)/usr/bin/qubes-desktop-run

View File

@ -82,6 +82,14 @@ update_qubesconfig() {
#/usr/lib/qubes/update-proxy-configs
# Archlinux pacman configuration is handled in update_finalize
if ! [ -r /etc/dconf/profile/user ]; then
mkdir -p /etc/dconf/profile
echo "user-db:user" >> /etc/dconf/profile/user
echo "system-db:local" >> /etc/dconf/profile/user
fi
dconf update &> /dev/null || :
# Location of files which contains list of protected files
mkdir -p /etc/qubes/protected-files.d
# shellcheck source=init/functions

View File

@ -64,7 +64,6 @@ etc/qubes-rpc/qubes.GetImageRGBA
etc/polkit-1/rules.d/00-qubes-allow-all.rules
etc/polkit-1/localauthority/50-local.d/qubes-allow-all.pkla
etc/pam.d/su.qubes
etc/dconf/profile/user
etc/dconf/db/local.d/dpi
etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
etc/apt/apt.conf.d/70no-unattended

View File

@ -189,6 +189,12 @@ case "${1}" in
glib-compile-schemas /usr/share/glib-2.0/schemas || true
if ! [ -r /etc/dconf/profile/user ]; then
mkdir -p /etc/dconf/profile
echo "user-db:user" >> /etc/dconf/profile/user
echo "system-db:local" >> /etc/dconf/profile/user
fi
if [ -x /usr/bin/dconf ]; then
dconf update
fi

View File

@ -282,6 +282,12 @@ if test -f /etc/yum.conf && ! grep -q '/etc/yum\.conf\.d/qubes-proxy\.conf' /etc
echo 'include=file:///etc/yum.conf.d/qubes-proxy.conf' >> /etc/yum.conf
fi
if ! [ -r /etc/dconf/profile/user ]; then
mkdir -p /etc/dconf/profile
echo "user-db:user" >> /etc/dconf/profile/user
echo "system-db:local" >> /etc/dconf/profile/user
fi
dconf update &> /dev/null || :
# And actually setup the proxy usage in package managers
@ -504,9 +510,6 @@ rm -f %{name}-%{version}
%if %{fedora} < 22
/etc/yum/post-actions/qubes-trigger-sync-appmenus.action
%endif
%if 0%{?fedora} >= 23
%config(noreplace) /etc/dconf/profile/user
%endif
%config(noreplace) /etc/dconf/db/local.d/dpi
/usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf
/usr/sbin/qubes-serial-login