X Tutup
Skip to content

Commit 84786b8

Browse files
ikeydohertykeszybz
authored andcommitted
sysusers: Provide meson argument to set gid for 'users' group (systemd#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.
1 parent 01a7e0a commit 84786b8

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

meson.build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,14 @@ tty_gid = get_option('tty-gid')
633633
conf.set('TTY_GID', tty_gid)
634634
substs.set('TTY_GID', tty_gid)
635635

636+
# Ensure provided GID argument is numeric, otherwise fallback to default assignment
637+
if get_option('users-gid') != ''
638+
users_gid = get_option('users-gid').to_int()
639+
else
640+
users_gid = '-'
641+
endif
642+
substs.set('USERS_GID', users_gid)
643+
636644
if get_option('adm-group')
637645
m4_defines += ['-DENABLE_ADM_GROUP']
638646
endif
@@ -2495,6 +2503,7 @@ status = [
24952503
'debug shell: @0@ @ @1@'.format(get_option('debug-shell'),
24962504
get_option('debug-tty')),
24972505
'TTY GID: @0@'.format(tty_gid),
2506+
'users GID: @0@'.format(users_gid),
24982507
'maximum system UID: @0@'.format(system_uid_max),
24992508
'maximum system GID: @0@'.format(system_gid_max),
25002509
'/dev/kvm access mode: @0@'.format(get_option('dev-kvm-mode')),

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ option('system-gid-max', type : 'string',
150150
option('tty-gid', type : 'string',
151151
description : 'the numeric GID of the "tty" group',
152152
value : '5')
153+
option('users-gid', type : 'string',
154+
description : 'the numeric GID of the "users" group')
153155
option('adm-group', type : 'boolean',
154156
description : 'the ACL for adm group should be added')
155157
option('wheel-group', type : 'boolean',

sysusers.d/basic.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ g tape - - -
3535
g video - - -
3636

3737
# Default group for normal users
38-
g users - - -
38+
g users @USERS_GID@ - -

0 commit comments

Comments
 (0)
X Tutup