mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 02:20:06 +01:00
Add a build option to allow installing a Polkit rule that will grant permissions for admin users without asking for their password if they're in a local console. This shouldn't be encouraged, though. It's common practice that admin users has to introduce their password to make system-wide changes. The standard polkit policy, without this rule, is auth_admin_keep. This policy will ask for the password once and won't ask for it again for ~5 minutes, so it is not too unconvenient. Different distros use different group names for users with admin rights, typically 'sudo' or 'wheel'. The build option allows to define the desired group, or to leave it empty to not install the rule. However, until the previous commit it was allowed that local users (even non-admin) could do system-wide changes without introducing a password. This option allows to maintain the same behavior for admin users, keeping backwards compatibility so we avoid breaking existing scripts, for example. We cannot achieve the same for non-admin users because allowing them to create system-wide connection causes security vulnerabilities that cannot be fixed in any other way.
81 lines
1.9 KiB
Meson
81 lines
1.9 KiB
Meson
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
configure_file(
|
|
input: 'server.conf.in',
|
|
output: '@BASENAME@',
|
|
install_dir: join_paths(nm_datadir, 'doc', nm_name, 'examples'),
|
|
configuration: data_conf,
|
|
)
|
|
|
|
if install_systemdunitdir
|
|
services = [
|
|
'NetworkManager-dispatcher.service',
|
|
'NetworkManager.service',
|
|
'nm-priv-helper.service',
|
|
'NetworkManager-wait-online.service',
|
|
'NetworkManager-config-initrd.service',
|
|
'NetworkManager-initrd.service',
|
|
'NetworkManager-wait-online-initrd.service',
|
|
]
|
|
|
|
foreach service: services
|
|
configure_file(
|
|
input: service + '.in',
|
|
output: service,
|
|
install_dir: systemd_systemdsystemunitdir,
|
|
configuration: data_conf,
|
|
)
|
|
|
|
test(
|
|
'check-' + service,
|
|
find_program(join_paths(source_root, 'src/tests/check-systemd-unit.sh')),
|
|
args: [ join_paths(meson.current_build_dir(), service) ],
|
|
)
|
|
endforeach
|
|
|
|
if enable_ovs
|
|
install_data(
|
|
'NetworkManager-ovs.conf',
|
|
install_dir: join_paths(systemd_systemdsystemunitdir, 'NetworkManager.service.d'),
|
|
)
|
|
endif
|
|
endif
|
|
|
|
if install_udevdir
|
|
data = files(
|
|
'84-nm-drivers.rules',
|
|
'85-nm-unmanaged.rules',
|
|
'90-nm-thunderbolt.rules',
|
|
)
|
|
|
|
install_data(
|
|
data,
|
|
install_dir: join_paths(udev_udevdir, 'rules.d'),
|
|
)
|
|
endif
|
|
|
|
if enable_polkit
|
|
i18n.merge_file(
|
|
input: 'org.freedesktop.NetworkManager.policy.in',
|
|
output: '@BASENAME@',
|
|
po_dir: po_dir,
|
|
install: true,
|
|
install_dir: polkit_policydir,
|
|
)
|
|
|
|
if polkit_noauth_group != ''
|
|
configure_file(
|
|
input: 'org.freedesktop.NetworkManager.rules.in',
|
|
output: '@BASENAME@',
|
|
install_dir: polkit_rulesdir,
|
|
configuration: {'NM_POLKIT_NOAUTH_GROUP': polkit_noauth_group},
|
|
)
|
|
endif
|
|
endif
|
|
|
|
if enable_firewalld_zone
|
|
install_data(
|
|
'nm-shared.xml',
|
|
install_dir: join_paths(nm_prefix, 'lib', 'firewalld', 'zones')
|
|
)
|
|
endif
|