build/meson: allow configuring default for main.auth-polkit setting

We always build PolicyKit support, because it merely depends on some
D-Bus calls. However, there are two things to configure:

 - the default value for main.auth-polkit in NetworkManager.conf. This
   is now called "-Dconfig_auth_polkit_default=$VAL".

 - whether to install the policy file. This is called "-Dpolkit=$VAL".

These settings are mostly independent, so add "config_auth_polkit_default" to
make the default explicitly configurable.
This commit is contained in:
Thomas Haller
2019-12-10 10:01:24 +01:00
parent 0c6cd07ec8
commit c21c6bc0be
3 changed files with 10 additions and 6 deletions

View File

@@ -585,6 +585,7 @@ This tool is still experimental.
%endif %endif
-Dselinux=true \ -Dselinux=true \
-Dpolkit=true \ -Dpolkit=true \
-Dconfig_auth_polkit_default=true \
-Dpolkit_agent=true \ -Dpolkit_agent=true \
-Dmodify_system=true \ -Dmodify_system=true \
-Dconcheck=true \ -Dconcheck=true \

View File

@@ -464,8 +464,11 @@ if enable_polkit
polkit_gobject_policydir = dependency('polkit-gobject-1').get_pkgconfig_variable('policydir', define_variable: ['prefix', nm_prefix]) polkit_gobject_policydir = dependency('polkit-gobject-1').get_pkgconfig_variable('policydir', define_variable: ['prefix', nm_prefix])
endif endif
config_default_main_auth_polkit = enable_polkit.to_string() config_auth_polkit_default = get_option('config_auth_polkit_default')
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT', config_default_main_auth_polkit) if config_auth_polkit_default == 'default'
config_auth_polkit_default = (enable_polkit ? 'true' : 'false')
endif
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT', config_auth_polkit_default)
enable_modify_system = get_option('modify_system') enable_modify_system = get_option('modify_system')
@@ -784,7 +787,7 @@ data_conf = configuration_data()
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : '')) data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit) data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit)
data_conf.set('NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT', config_logging_backend_default) data_conf.set('NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT', config_logging_backend_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT', config_default_main_auth_polkit) data_conf.set('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT', config_auth_polkit_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default) data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default)
data_conf.set('NM_MAJOR_VERSION', nm_major_version) data_conf.set('NM_MAJOR_VERSION', nm_major_version)
@@ -935,10 +938,9 @@ output += ' nmplugindir: ' + nm_plugindir + '\n'
output += '\nPlatform:\n' output += '\nPlatform:\n'
output += ' session tracking: ' + ','.join(session_trackers) + '\n' output += ' session tracking: ' + ','.join(session_trackers) + '\n'
output += ' suspend/resume: ' + suspend_resume + '\n' output += ' suspend/resume: ' + suspend_resume + '\n'
output += ' policykit: ' + enable_polkit.to_string() output += ' policykit: ' + enable_polkit.to_string() + ' (default: ' + config_auth_polkit_default + ')'
if enable_polkit if enable_polkit
modify = (enable_modify_system ? 'permissive' : 'restrictive') output += ' (' + (enable_modify_system ? 'permissive' : 'restrictive') + ' modify.system)'
output += ' (' + modify + ' modify.system) (default: main.auth-polkit=true)'
endif endif
output += '\n' output += '\n'
output += ' polkit agent: ' + enable_polkit_agent.to_string() + '\n' output += ' polkit agent: ' + enable_polkit_agent.to_string() + '\n'

View File

@@ -14,6 +14,7 @@ option('session_tracking_consolekit', type: 'boolean', value: true, description:
option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'], value: 'systemd', description: 'Compatibility option to choose one session tracking module') option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'], value: 'systemd', description: 'Compatibility option to choose one session tracking module')
option('suspend_resume', type: 'combo', choices: ['upower', 'systemd', 'elogind', 'consolekit', 'auto'], value: 'auto', description: 'Build NetworkManager with specific suspend/resume support') option('suspend_resume', type: 'combo', choices: ['upower', 'systemd', 'elogind', 'consolekit', 'auto'], value: 'auto', description: 'Build NetworkManager with specific suspend/resume support')
option('polkit', type: 'boolean', value: true, description: 'User auth-polkit configuration option.') option('polkit', type: 'boolean', value: true, description: 'User auth-polkit configuration option.')
option('config_auth_polkit_default', type: 'combo', choices: ['default', 'true', 'false'], value: 'default', description: 'Default value for configuration main.auth-polkit.')
option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections') option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections')
option('polkit_agent', type: 'boolean', value: false, description: 'enable polkit agent for clients') option('polkit_agent', type: 'boolean', value: false, description: 'enable polkit agent for clients')
option('selinux', type: 'boolean', value: true, description: 'Build with SELinux') option('selinux', type: 'boolean', value: true, description: 'Build with SELinux')