]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: add -D tty-setgid=[false|true]
authorKarel Zak <kzak@redhat.com>
Fri, 15 Nov 2024 10:32:34 +0000 (11:32 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 15 Nov 2024 10:32:34 +0000 (11:32 +0100)
If your distribution does not define permissions for installed
binaries and follows the upstream guidelines, disabling the tty
group's setgid could be a beneficial decision in certain situations.

Signed-off-by: Karel Zak <kzak@redhat.com>
meson.build
meson_options.txt

index 6b0bfe1e017b485965eb2e42619ef65d758f9591..addcca25342cb0f031436a4980ae451aef3520fa 100644 (file)
@@ -2675,6 +2675,13 @@ if opt
   bashcompletions += ['mesg']
 endif
 
+tty_setgid = get_option('tty-setgid')
+if tty_setgid
+  tty_install_mode = [ 'rwxr-sr-x', 'root', 'tty' ]
+else
+  tty_install_mode = [ false, false, false ]
+endif
+
 opt = not get_option('build-wall').disabled()
 exe = executable(
   'wall',
@@ -2683,7 +2690,7 @@ exe = executable(
   link_with : [lib_common],
   dependencies : [lib_systemd],
   install_dir : usrbin_exec_dir,
-  install_mode : [ 'rwxr-sr-x', 'root', 'tty' ],
+  install_mode : tty_install_mode,
   install : opt,
   build_by_default : opt)
 if opt
@@ -2703,7 +2710,7 @@ exe = executable(
   link_with : [lib_common],
   dependencies : [lib_systemd],
   install_dir : usrbin_exec_dir,
-  install_mode : [ 'rwxr-sr-x', 'root', 'tty' ],
+  install_mode : tty_install_mode,
   install : opt,
   build_by_default : opt)
 if opt
index 2c7b2d1c08ab83ba6c79e452a3c8854cecc16e37..aa1af78414b4a254d270d7fa7d6a9dde2fe85737 100644 (file)
@@ -309,3 +309,7 @@ option('lastlog-compat-symlink', type : 'boolean',
 option('login-lastlogin', type : 'boolean',
        value : false,
        description : 'program login writes lastlog entries')
+
+option('tty-setgid', type : 'boolean',
+       value : true,
+       description : 'setgid tty group for wall and write programs')