]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
meson_post_install.py: Call chmod after chown
authorSimon McVittie <smcv@collabora.com>
Mon, 27 Jun 2022 14:39:19 +0000 (15:39 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 13 Jul 2022 19:36:13 +0000 (20:36 +0100)
If we call chmod before chown, then chown will remove the setuid bit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
meson_post_install.py

index 3b083130b1bed832de4a46b46224881a6f290dbe..9c558c99fbb3b709cd120bda2ccc836df16b6c8d 100755 (executable)
@@ -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'