Skip to content

Commit

Permalink
Add meson option for privileged group
Browse files Browse the repository at this point in the history
Add -Dprivileged_group that can be used to override the default
of 'wheel', which is set in 50-default.rules. In Debian and
derivatives, the privileged group is 'sudo', 'wheel' does not
exist.
  • Loading branch information
bluca authored and jrybar-rh committed Aug 22, 2024
1 parent 13bea3e commit c36e1eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +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('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', ''], value: '', description: 'distribution or OS')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
return ["unix-group:@PRIVILEGED_GROUP@"];
});
9 changes: 7 additions & 2 deletions src/polkitbackend/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ libpolkit_backend = static_library(
cpp_args: c_flags,
)

install_data(
'50-default.rules',
configure_file(
input: '50-default.rules.in',
output: '@BASENAME@',
configuration: {
'PRIVILEGED_GROUP': get_option('privileged_group'),
},
install: true,
install_dir: pk_pkgdatadir / 'rules.d',
)

Expand Down

0 comments on commit c36e1eb

Please sign in to comment.