From 14519d7dfa806a1d2d999e4c88037f3ce6a84c08 Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 8 Feb 2026 14:22:28 +0100 Subject: [PATCH] meson: guard symlinks in sysconfdir behind install_sysconfidr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symlinks to files inside sysconfdir are now only installed if ìnstall_sysconfdir=true (which is the default). If sshconfdir,sshdconfdir,shellprofiledir are not inside sysconfdir and install_sysconfidr=false, these symlinks are still installed to the configured directory. --- profile.d/meson.build | 4 ++-- src/ssh-generator/meson.build | 2 +- src/userdb/meson.build | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/profile.d/meson.build b/profile.d/meson.build index b1692920f4..9551d2a111 100644 --- a/profile.d/meson.build +++ b/profile.d/meson.build @@ -3,7 +3,7 @@ install_data('70-systemd-shell-extra.sh', install_dir : shellprofiledir.startswith('/usr/') ? shellprofiledir : libexecdir / 'profile.d') install_data('80-systemd-osc-context.sh', install_dir : shellprofiledir.startswith('/usr/') ? shellprofiledir : libexecdir / 'profile.d') -if conf.get('LINK_SHELL_EXTRA_DROPIN') == 1 +if (not shellprofiledir.startswith(sysconfdir) or install_sysconfdir) and conf.get('LINK_SHELL_EXTRA_DROPIN') == 1 if meson.version().version_compare('>=1.3.0') install_symlink( '70-systemd-shell-extra.sh', @@ -19,7 +19,7 @@ if conf.get('LINK_SHELL_EXTRA_DROPIN') == 1 endif endif -if conf.get('LINK_OSC_CONTEXT_DROPIN') == 1 +if (not shellprofiledir.startswith(sysconfdir) or install_sysconfdir) and conf.get('LINK_OSC_CONTEXT_DROPIN') == 1 if meson.version().version_compare('>=1.3.0') install_symlink( '80-systemd-osc-context.sh', diff --git a/src/ssh-generator/meson.build b/src/ssh-generator/meson.build index 6fcf8d11fe..f6babb47d3 100644 --- a/src/ssh-generator/meson.build +++ b/src/ssh-generator/meson.build @@ -25,7 +25,7 @@ if conf.get('ENABLE_SSH_PROXY_CONFIG') == 1 install : true, install_dir : sshconfdir.startswith('/usr/') ? sshconfdir : libexecdir / 'ssh_config.d') - if conf.get('LINK_SSH_PROXY_DROPIN') == 1 + if (not sshconfdir.startswith(sysconfdir) or install_sysconfdir) and conf.get('LINK_SSH_PROXY_DROPIN') == 1 if meson.version().version_compare('>=1.3.0') install_symlink( '20-systemd-ssh-proxy.conf', diff --git a/src/userdb/meson.build b/src/userdb/meson.build index 4bb8ac17a6..a933a4907b 100644 --- a/src/userdb/meson.build +++ b/src/userdb/meson.build @@ -32,7 +32,7 @@ if conf.get('ENABLE_SSH_USERDB_CONFIG') == 1 install : true, install_dir : sshdconfdir.startswith('/usr/') ? sshdconfdir : libexecdir / 'sshd_config.d') - if conf.get('LINK_SSHD_USERDB_DROPIN') == 1 + if (not sshdconfdir.startswith(sysconfdir) or install_sysconfdir) and conf.get('LINK_SSHD_USERDB_DROPIN') == 1 if meson.version().version_compare('>=1.3.0') install_symlink( '20-systemd-userdb.conf',