From 55b799e3df98e3c19952c81839929f4e3b9113cb Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Wed, 3 Aug 2022 11:56:25 -0400 Subject: [PATCH] Add option to specific PAM limits.d directory --- data/meson.build | 2 +- meson.build | 8 ++++++++ meson_options.txt | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/data/meson.build b/data/meson.build index 8a49939..22e300e 100644 --- a/data/meson.build +++ b/data/meson.build @@ -41,7 +41,7 @@ if with_pam_renicing input: 'pam_limits/10-gamemode.conf.in', output: '10-gamemode.conf', configuration: data_conf, - install_dir: '/etc/security/limits.d', + install_dir: path_pam_limits_dir, ) endif diff --git a/meson.build b/meson.build index 8672e82..074eb69 100644 --- a/meson.build +++ b/meson.build @@ -132,6 +132,9 @@ endif if with_privileged_group != '' with_pam_renicing = get_option('with-pam-renicing') + if with_pam_renicing + path_pam_limits_dir = get_option('with-pam-limits-dir') + endif else with_pam_renicing = false endif @@ -209,6 +212,11 @@ report = [ ' includedir: @0@'.format(path_includedir), ] +if with_pam_renicing +report += [ + ' PAM limits.d directory: @0@'.format(path_pam_limits_dir), +] +endif if sd_bus_provider == 'systemd' if with_systemd_unit report += [ diff --git a/meson_options.txt b/meson_options.txt index 66e7b76..342b225 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,6 @@ # limits.d option('with-pam-renicing', type: 'boolean', description: 'Install the limits.d configuration file to allow renicing as a user being part of the privileged gamemode group', value: 'true') +option('with-pam-limits-dir', type: 'string', description: 'Explicitly set the PAM limits.d directory', value: '/etc/security/limits.d') # sd-bus provider option('with-sd-bus-provider', type: 'combo', choices: ['systemd', 'elogind', 'no-daemon'], value: 'systemd')