From 8c1979948c6a616d5e53ef693b4b123ec879441d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 20 Jun 2017 13:12:43 +0200 Subject: [PATCH] build-sys: chown before chmod for SUIDs Make sure SUIDs are really owned by root. Reported-by: L A Walsh Signed-off-by: Karel Zak --- login-utils/Makemodule.am | 1 + sys-utils/Makemodule.am | 2 ++ 2 files changed, 3 insertions(+) diff --git a/login-utils/Makemodule.am b/login-utils/Makemodule.am index f3397b9f4..ac9819f80 100644 --- a/login-utils/Makemodule.am +++ b/login-utils/Makemodule.am @@ -230,6 +230,7 @@ test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS) install-exec-hook: if BUILD_SU if MAKEINSTALL_DO_SETUID + chown root:root $(DESTDIR)$(bindir)/su chmod 4755 $(DESTDIR)$(bindir)/su endif endif diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am index c5651946b..6fbc517d2 100644 --- a/sys-utils/Makemodule.am +++ b/sys-utils/Makemodule.am @@ -291,7 +291,9 @@ endif if MAKEINSTALL_DO_SETUID install-exec-hook-mount: + chown root:root $(DESTDIR)$(bindir)/mount chmod 4755 $(DESTDIR)$(bindir)/mount + chown root:root $(DESTDIR)$(bindir)/umount chmod 4755 $(DESTDIR)$(bindir)/umount INSTALL_EXEC_HOOKS += install-exec-hook-mount