Skip to content

Commit

Permalink
meson: use different default privileged_group on Debian and derivatives
Browse files Browse the repository at this point in the history
On Debian and derivatives the privileged group is sudo, so adjust the
default accordingly, if not explicitly provided
  • Loading branch information
bluca authored and jrybar-rh committed Dec 19, 2024
1 parent 080e63b commit 402aeb7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ if os_type == ''
endif
endif

# The default privileged group differs between distributions, set it accordingly if not specified
privileged_group = get_option('privileged_group')
if privileged_group == ''
if os_type == 'debian'
privileged_group = 'sudo'
else
privileged_group = 'wheel'
endif
endif

pam_include = get_option('pam_include')
if pam_include == ''
if ['suse', 'solaris', 'openembedded'].contains(os_type)
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ option('systemdsystemunitdir', type: 'string', value: '', description: 'custom d
option('libs-only', type: 'boolean', value: false, description: 'Only build libraries (skips building polkitd)')
option('polkitd_user', type: 'string', value: 'polkitd', description: 'User for running polkitd (polkitd)')
option('polkitd_uid', type: 'string', value: '-', description: 'Fixed UID for user running polkitd (polkitd)')
option('privileged_group', type: 'string', value: 'wheel', description: 'Group to use for default privileged access')
option('privileged_group', type: 'string', value: '', description: 'Group to use for default privileged access (default: wheel)')

option('authfw', type: 'combo', choices: ['pam', 'shadow', 'bsdauth'], value: 'pam', description: 'Authentication framework (pam/shadow)')
option('os_type', type: 'combo', choices: ['redhat', 'suse', 'gentoo', 'pardus', 'solaris', 'netbsd', 'lfs', 'openembedded', 'debian', ''], value: '', description: 'distribution or OS')
Expand Down
2 changes: 1 addition & 1 deletion src/polkitbackend/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ configure_file(
input: '50-default.rules.in',
output: '@BASENAME@',
configuration: {
'PRIVILEGED_GROUP': get_option('privileged_group'),
'PRIVILEGED_GROUP': privileged_group,
},
install: true,
install_dir: pk_pkgdatadir / 'rules.d',
Expand Down

0 comments on commit 402aeb7

Please sign in to comment.