[PATCH app-xdm 18/19] config: replace platform check with compiler defines for SU
Gaetan Nadon
memsize at videotron.ca
Thu Sep 2 09:57:22 PDT 2010
The intent for the platform check for SU is to use "su -m" for
BSD-like systems. The compiler already provide defines for
such systems.
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
config/Makefile.am | 2 +-
config/xdm-config.cpp | 7 ++++++-
configure.ac | 24 ------------------------
3 files changed, 7 insertions(+), 26 deletions(-)
diff --git a/config/Makefile.am b/config/Makefile.am
index d13645f..c3d837f 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -54,7 +54,7 @@ CPP_FILES_FLAGS = -DBINDIR="$(bindir)" -DDEFAULTVT="$(DEFAULTVT)" \
-DXDMDIR="$(XDMLIBDIR)" -DXDMLOGDIR="$(XDMLOGDIR)" \
-DXDMXAUTHDIR="$(XDMXAUTHDIR)" \
-DXDMPIDDIR="$(XDMPIDDIR)" -DXDMCONFIGDIR="$(XDMCONFIGDIR)" \
- -DXDMSCRIPTDIR="$(XDMSCRIPTDIR)" -DSU="$(SU)" \
+ -DXDMSCRIPTDIR="$(XDMSCRIPTDIR)" \
-DCHOOSERPATH="$(XDMLIBDIR)/chooser" $(XPMDEFINES) \
-DSHELL_CMD="$(SHELL_CMD)" $(MKTEMP_DEFINES)
diff --git a/config/xdm-config.cpp b/config/xdm-config.cpp
index 59d548b..81a5931 100644
--- a/config/xdm-config.cpp
+++ b/config/xdm-config.cpp
@@ -16,7 +16,12 @@ DisplayManager.keyFile: XDMCONFIGDIR/xdm-keys
DisplayManager.servers: XDMCONFIGDIR/Xservers
DisplayManager.accessFile: XDMCONFIGDIR/Xaccess
DisplayManager*resources: XDMCONFIGDIR/Xresources
-DisplayManager.willing: SU nobody -c XDMSCRIPTDIR/Xwilling
+# if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
+ || defined(__APPLE__) || defined(__DragonFly__)
+DisplayManager.willing: su -m nobody -c XDMSCRIPTDIR/Xwilling
+#else
+DisplayManager.willing: su nobody -c XDMSCRIPTDIR/Xwilling
+#endif
! All displays should use authorization, but we cannot be sure
! X terminals may not be configured that way, so they will require
! individual resource settings.
diff --git a/configure.ac b/configure.ac
index 53793a1..69f251c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,30 +145,6 @@ if test "x$USE_SELINUX" != "xno" ; then
LIBS="$old_LIBS"
fi
-# FIXME: Find better test for which OS'es use su -m - for now, just try to
-# mirror the Imakefile setting of:
-# if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) || defined(DarwinArchitecture)
-
-
-case $host_os in
- linux*|gnu*|*-gnu)
- SU="su"
- ;;
- darwin*)
- SU="su -m"
- ;;
- *bsd*|dragonfly*)
- SU="su -m"
- ;;
- solaris*|sysv4*)
- SU="su"
- ;;
- *)
- SU="su"
- ;;
-esac
-AC_SUBST(SU)
-
# Check for /dev/random or /dev/urandom
AC_ARG_WITH(random-device,
AC_HELP_STRING([--with-random-device\[=<pathname>\]],
--
1.6.0.4
More information about the xorg-devel
mailing list