From e761caacc11650960ae02642d616d19fddc1bca2 Mon Sep 17 00:00:00 2001 From: Miha Purg Date: Fri, 7 Jun 2024 11:31:03 +0200 Subject: [PATCH] Set correct permissions in macro bash_enable_dconf_user_profile Also small fix for scenario where the file exists but is empty. --- shared/macros/10-bash.jinja | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/macros/10-bash.jinja b/shared/macros/10-bash.jinja index 6d073c8fbca..7a2359de685 100644 --- a/shared/macros/10-bash.jinja +++ b/shared/macros/10-bash.jinja @@ -2483,7 +2483,8 @@ lines will be inserted at the beginning of the profile. mkdir -p /etc/dconf/profile dconf_profile_path=/etc/dconf/profile/{{{ profile }}} -[[ -e "${dconf_profile_path}" ]] || echo > "${dconf_profile_path}" +[[ -s "${dconf_profile_path}" ]] || echo > "${dconf_profile_path}" +chmod 0644 "${dconf_profile_path}" if ! grep -Pzq "(?s)^\s*user-db:user.*\n\s*system-db:{{{ database }}}" "${dconf_profile_path}"; then sed -i --follow-symlinks "1s/^/user-db:user\nsystem-db:{{{ database }}}\n/" "${dconf_profile_path}"