From 7b124c5dea3e0e1530602fc489f519387757ce7a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 15 Mar 2003 18:01:39 +0000 Subject: [PATCH] Add support for --with-stow based on patches from Robert Uhl --- INSTALL | 19 ++++++++++++------- config.h.in | 10 ++++++++++ configure | 38 ++++++++++++++++++++++++++++++-------- configure.in | 21 ++++++++++++++++++++- 4 files changed, 72 insertions(+), 16 deletions(-) diff --git a/INSTALL b/INSTALL index 7d5fefa29..6834462e0 100644 --- a/INSTALL +++ b/INSTALL @@ -147,15 +147,15 @@ Special features/options: (or at least the library and header files). --with-kerb4 - Enable kerberos v4 support. Tested only with the Cygnus Network - Security package (CNS). This uses kerberos passphrases for - authentication but does not use the kerberos cookie scheme. + Enable Kerberos IV support. Tested only with the Cygnus Network + Security package (CNS). This uses Kerberos passphrases for + authentication but does not use the Kerberos cookie scheme. --with-kerb5 - Enable kerberos v5 support. Tested against MIT Kerberos V, + Enable Kerberos V support. Tested against MIT Kerberos V, release 1.1, although also expected to work against CNS. This - This uses kerberos passphrases for authentication but does not - use the kerberos cookie scheme. Will not work for Kerberos V + This uses Kerberos passphrases for authentication but does not + use the Kerberos cookie scheme. Will not work for Kerberos V older than version 1.1. --with-authenticate @@ -177,7 +177,7 @@ Special features/options: /etc/pam.conf to obtain syslog output for debugging purposes. --with-AFS - Enable AFS support with kerberos authentication. Should work under + Enable AFS support with Kerberos authentication. Should work under AFS 3.3. If your AFS doesn't have -laudit you should be able to link without it. @@ -275,6 +275,11 @@ Special features/options: --with-otp-only This option is now just an alias for --without-passwd. + --with-stow + Properly handle GNU stow packaging. The sudoers file will + physically live in ${prefix}/etc and /etc/sudoers will be + a symbolic link. + The following options are also configurable at runtime: --with-long-otp-prompt diff --git a/config.h.in b/config.h.in index 66b039c54..b83a6164c 100644 --- a/config.h.in +++ b/config.h.in @@ -442,6 +442,9 @@ */ #undef USE_INSULTS +/* Define if you use stow packaging. */ +#undef USE_STOW + /* Define if you want a different ticket file for each tty. */ #undef USE_TTY_TICKETS @@ -509,6 +512,13 @@ # endif #endif +/* GNU stow needs /etc/sudoers to be a symlink. */ +#ifdef HAVE_STOW +# define stat_sudoers stat +#else +# define stat_sudoers lstat +#endif + /* Solaris doesn't use const qualifiers in PAM. */ #ifdef sun # define PAM_CONST diff --git a/configure b/configure index 507af54fa..1e6db3cb2 100755 --- a/configure +++ b/configure @@ -926,6 +926,7 @@ Optional Packages: --with-goons-insults include the insults from the "Goon Show" --with-secure-path override the user's path with a builtin one --without-interfaces don't try to read the ip addr of ether interfaces + --with-stow properly handle GNU stow packaging Some influential environment variables: CC C compiler command @@ -1419,14 +1420,7 @@ CHECKSIA=true test "$mandir" = '${prefix}/man' && mandir='$(prefix)/man' test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin' test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin' - -if test "$sysconfdir" = '${prefix}/etc'; then - if test "$prefix" = "NONE"; then - sysconfdir='/etc' - else - sysconfdir='$(prefix)/etc' - fi -fi +test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc' @@ -2959,6 +2953,34 @@ else echo "${ECHO_T}yes" >&6 fi; +echo "$as_me:$LINENO: checking whether stow should be used" >&5 +echo $ECHO_N "checking whether stow should be used... $ECHO_C" >&6 + +# Check whether --with-stow or --without-stow was given. +if test "${with_stow+set}" = set; then + withval="$with_stow" + case $with_stow in + yes) echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define USE_STOW 1 +_ACEOF + + ;; + no) echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + *) { { echo "$as_me:$LINENO: error: \"--with-stow does not take an argument.\"" >&5 +echo "$as_me: error: \"--with-stow does not take an argument.\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + echo "$as_me:$LINENO: checking whether to do user authentication by default" >&5 echo $ECHO_N "checking whether to do user authentication by default... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 18c40e719..b297c8f9a 100644 --- a/configure.in +++ b/configure.in @@ -110,7 +110,7 @@ dnl test "$mandir" = '${prefix}/man' && mandir='$(prefix)/man' test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin' test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin' -test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc' +test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc' dnl dnl Deprecated --with options (these all warn or generate an error) @@ -942,6 +942,18 @@ AC_ARG_WITH(interfaces, [ --without-interfaces don't try to read the ip addr ;; esac], AC_MSG_RESULT(yes)) +AC_MSG_CHECKING(whether stow should be used) +AC_ARG_WITH(stow, [ --with-stow properly handle GNU stow packaging], +[case $with_stow in + yes) AC_MSG_RESULT(yes) + AC_DEFINE(USE_STOW, 1, [Define if you use stow packaging.]) + ;; + no) AC_MSG_RESULT(no) + ;; + *) AC_MSG_ERROR(["--with-stow does not take an argument."]) + ;; +esac], AC_MSG_RESULT(no)) + dnl dnl Options for --enable dnl @@ -1937,6 +1949,13 @@ AH_BOTTOM([/* # endif #endif +/* GNU stow needs /etc/sudoers to be a symlink. */ +#ifdef HAVE_STOW +# define stat_sudoers stat +#else +# define stat_sudoers lstat +#endif + /* Solaris doesn't use const qualifiers in PAM. */ #ifdef sun # define PAM_CONST -- 2.40.0