From 7d0f47c43c5c177cae0f375ceaeef892e4c9663a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 20 Sep 2005 15:50:31 +0000 Subject: [PATCH] Add --disable-install-setuid option so you can build as non-root and chown/chmod later. Also disable by default on platforms that don't need setuid root X servers (Darwin & SPARC's, according to InstallXserverSetUID settings in the old Imake config files). --- ChangeLog | 9 +++++++++ configure.ac | 18 ++++++++++++++++++ hw/xfree86/Makefile.am | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 421a5bfc3..72768d520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-09-20 Alan Coopersmith + + * hw/xfree86/Makefile.am (install-exec-local): + * configure.ac: + Add --disable-install-setuid option so you can build as non-root + and chown/chmod later. Also disable by default on platforms that + don't need setuid root X servers (Darwin & SPARC's, according to + InstallXserverSetUID settings in the old Imake config files). + 2005-09-19 Alan Coopersmith * configure.ac: diff --git a/configure.ac b/configure.ac index 9820f95b2..c2cbbdf66 100644 --- a/configure.ac +++ b/configure.ac @@ -338,6 +338,24 @@ AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest serv AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto]) +dnl chown/chmod to be setuid root as part of build +dnl Replaces InstallXserverSetUID in imake +AC_ARG_ENABLE(install-setuid, + AS_HELP_STRING([--enable-install-setuid], + [Install Xorg server as owned by root with setuid bit (default: auto)]), + [SETUID=$enableval], [SETUID=auto]) +if test "x$SETUID" = "xauto" ; then + case $host_os in + darwin*) SETUID="no" ;; + *) + case $host_cpu in + sparc) SETUID="no" ;; + *) SETUID="yes" ;; + esac + esac +fi +AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"]) + dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro dnl was not expanded, since libX11 with no transport types is rather useless. dnl diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 5de87c9e6..413a1f615 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -67,6 +67,10 @@ endif install-data-local: $(mkdir_p) $(logdir) + install-exec-local: +if INSTALL_SETUID chown root $(DESTDIR)$(bindir)/Xorg chmod u+s $(DESTDIR)$(bindir)/Xorg +endif +