build-sys: make chown usage more robust

* add --disable-makeinstall-chown to travis non-root mode

* use "if MAKEINSTALL_DO_SETUID" for chown root:root

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2017-06-21 11:12:04 +02:00
parent 6f1507f135
commit a65041b5ae
3 changed files with 12 additions and 3 deletions

View File

@ -42,6 +42,7 @@ function check_nonroot
xconfigure \
--disable-use-tty-group \
--disable-makeinstall-chown \
--enable-all-programs \
|| return
$MAKE || return

View File

@ -229,8 +229,10 @@ test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
install-exec-hook:
if BUILD_SU
if MAKEINSTALL_DO_SETUID
if MAKEINSTALL_DO_CHOWN
chown root:root $(DESTDIR)$(bindir)/su
endif
if MAKEINSTALL_DO_SETUID
chmod 4755 $(DESTDIR)$(bindir)/su
endif
endif

View File

@ -289,15 +289,21 @@ umount_static_LDFLAGS = $(umount_LDFLAGS) -all-static
umount_static_LDADD = $(umount_LDADD)
endif
if MAKEINSTALL_DO_SETUID
install-exec-hook-mount:
if MAKEINSTALL_DO_CHOWN
chown root:root $(DESTDIR)$(bindir)/mount
endif
if MAKEINSTALL_DO_SETUID
chmod 4755 $(DESTDIR)$(bindir)/mount
endif
if MAKEINSTALL_DO_CHOWN
chown root:root $(DESTDIR)$(bindir)/umount
endif
if MAKEINSTALL_DO_SETUID
chmod 4755 $(DESTDIR)$(bindir)/umount
endif
INSTALL_EXEC_HOOKS += install-exec-hook-mount
endif
endif # BUILD_MOUNT