mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
sysusers: Provide meson argument to set gid for 'users' group (#7533)
To allow better integration with distributions requiring an explicitly set gid for the `users` group, provide the new `-Dusers-gid` option to set to a new numeric value. In the absence of a specified gid, we'll fallback to the default existing behaviour of `-` as the gid value, to automatically assign the next available gid on the system.
This commit is contained in:
parent
01a7e0a14d
commit
84786b8e32
@ -633,6 +633,14 @@ tty_gid = get_option('tty-gid')
|
|||||||
conf.set('TTY_GID', tty_gid)
|
conf.set('TTY_GID', tty_gid)
|
||||||
substs.set('TTY_GID', tty_gid)
|
substs.set('TTY_GID', tty_gid)
|
||||||
|
|
||||||
|
# Ensure provided GID argument is numeric, otherwise fallback to default assignment
|
||||||
|
if get_option('users-gid') != ''
|
||||||
|
users_gid = get_option('users-gid').to_int()
|
||||||
|
else
|
||||||
|
users_gid = '-'
|
||||||
|
endif
|
||||||
|
substs.set('USERS_GID', users_gid)
|
||||||
|
|
||||||
if get_option('adm-group')
|
if get_option('adm-group')
|
||||||
m4_defines += ['-DENABLE_ADM_GROUP']
|
m4_defines += ['-DENABLE_ADM_GROUP']
|
||||||
endif
|
endif
|
||||||
@ -2495,6 +2503,7 @@ status = [
|
|||||||
'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
|
'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
|
||||||
get_option('debug-tty')),
|
get_option('debug-tty')),
|
||||||
'TTY GID: @0@'.format(tty_gid),
|
'TTY GID: @0@'.format(tty_gid),
|
||||||
|
'users GID: @0@'.format(users_gid),
|
||||||
'maximum system UID: @0@'.format(system_uid_max),
|
'maximum system UID: @0@'.format(system_uid_max),
|
||||||
'maximum system GID: @0@'.format(system_gid_max),
|
'maximum system GID: @0@'.format(system_gid_max),
|
||||||
'/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
|
'/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),
|
||||||
|
@ -150,6 +150,8 @@ option('system-gid-max', type : 'string',
|
|||||||
option('tty-gid', type : 'string',
|
option('tty-gid', type : 'string',
|
||||||
description : 'the numeric GID of the "tty" group',
|
description : 'the numeric GID of the "tty" group',
|
||||||
value : '5')
|
value : '5')
|
||||||
|
option('users-gid', type : 'string',
|
||||||
|
description : 'the numeric GID of the "users" group')
|
||||||
option('adm-group', type : 'boolean',
|
option('adm-group', type : 'boolean',
|
||||||
description : 'the ACL for adm group should be added')
|
description : 'the ACL for adm group should be added')
|
||||||
option('wheel-group', type : 'boolean',
|
option('wheel-group', type : 'boolean',
|
||||||
|
@ -35,4 +35,4 @@ g tape - - -
|
|||||||
g video - - -
|
g video - - -
|
||||||
|
|
||||||
# Default group for normal users
|
# Default group for normal users
|
||||||
g users - - -
|
g users @USERS_GID@ - -
|
||||||
|
Loading…
Reference in New Issue
Block a user