From 6eefa5da3453e560aaf311fd4801c14b10428c84 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 27 Jun 2022 15:39:19 +0100 Subject: [PATCH] meson_post_install.py: Call chmod after chown If we call chmod before chown, then chown will remove the setuid bit. Signed-off-by: Simon McVittie --- meson_post_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_post_install.py b/meson_post_install.py index 3b083130b..9c558c99f 100755 --- a/meson_post_install.py +++ b/meson_post_install.py @@ -91,8 +91,8 @@ def post_install_exe(): exe_path = abs_libdir / 'dbus-1.0' / exe_name dbus_user = get_option('dbus_user') if os.getuid() == 0: - os.chmod(exe_path, stat.S_ISUID | stat.S_IXUSR | stat.S_IXGRP) os.chown(exe_path, 0, grp.getgrnam(dbus_user).gr_gid) + os.chmod(exe_path, stat.S_ISUID | stat.S_IXUSR | stat.S_IXGRP) else: print('Not installing {0} binary setuid!'.format(exe_path)) print('You\'ll need to manually set permissions to root:{0} and permissions 4750' -- 2.47.3