From: Karel Zak Date: Fri, 15 Nov 2024 10:32:34 +0000 (+0100) Subject: meson: add -D tty-setgid=[false|true] X-Git-Tag: v2.42-start~152^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a4082068dc40900711e1e749a8dbf921efb0e5d;p=thirdparty%2Futil-linux.git meson: add -D tty-setgid=[false|true] 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 --- diff --git a/meson.build b/meson.build index 6b0bfe1e0..addcca253 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/meson_options.txt b/meson_options.txt index 2c7b2d1c0..aa1af7841 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')