]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: don't put a symlink pointing to '20-systemd-ssh-proxy.conf' in /etc in all...
authorFranck Bui <fbui@suse.com>
Fri, 24 May 2024 12:11:54 +0000 (14:11 +0200)
committerFranck Bui <fbui@suse.com>
Mon, 27 May 2024 15:20:26 +0000 (17:20 +0200)
On distros like SUSE where ssh config dropins in /usr are supported, there's no
need for a symlink in /etc/ssh/ssh_config.d/ that points to the dropin
installed somewhere in /usr (that is not reachable by ssh).

meson.build
src/ssh-generator/meson.build
tmpfiles.d/20-systemd-ssh-generator.conf.in

index dfea903b60e08009965c9c25c579f99db7fe46c0..3eedf9251be0b49ffe08de9aab87af13c3cfa4e0 100644 (file)
@@ -204,6 +204,7 @@ sshconfdir = get_option('sshconfdir')
 if sshconfdir == ''
         sshconfdir = sysconfdir / 'ssh/ssh_config.d'
 endif
+conf.set10('LINK_SSH_PROXY_DROPIN', sshconfdir != 'no' and not sshconfdir.startswith('/usr/'))
 
 sshdconfdir = get_option('sshdconfdir')
 if sshdconfdir == ''
index ab01da3c05e6b1b6cec918204a4136782dbb8a5e..d5413f71ab50c7eb808ae29e42ad0c1334788b4f 100644 (file)
@@ -18,10 +18,12 @@ if conf.get('ENABLE_SSH_PROXY_CONFIG') == 1
                 output : '20-systemd-ssh-proxy.conf',
                 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
                 install : true,
-                install_dir : libexecdir / 'ssh_config.d')
+                install_dir : sshconfdir.startswith('/usr/') ? sshconfdir : libexecdir / 'ssh_config.d')
 
-        install_emptydir(sshconfdir)
+        if not sshconfdir.startswith('/usr/')
+                install_emptydir(sshconfdir)
 
-        meson.add_install_script(sh, '-c',
-                ln_s.format(libexecdir / 'ssh_config.d' / '20-systemd-ssh-proxy.conf', sshconfdir / '20-systemd-ssh-proxy.conf'))
+                meson.add_install_script(sh, '-c',
+                        ln_s.format(libexecdir / 'ssh_config.d' / '20-systemd-ssh-proxy.conf', sshconfdir / '20-systemd-ssh-proxy.conf'))
+        endif
 endif
index 6d1a6a3e3198e504d44b62d98d7ae28da8e3fed4..dbe354a2d2d9457ac3f749c736e5c734e52a6324 100644 (file)
@@ -7,7 +7,9 @@
 
 # See tmpfiles.d(5) for details
 
+{% if LINK_SSH_PROXY_DROPIN %}
 L {{SSHCONFDIR}}/20-systemd-ssh-proxy.conf - - - - {{LIBEXECDIR}}/ssh_config.d/20-systemd-ssh-proxy.conf
+{% endif %}
 {% if CREATE_SSHDPRIVSEPDIR %}
 d {{SSHDPRIVSEPDIR}} 0755
 {% endif %}