- (tim) [configure.ac defines.h] Run test program to detect system mail
directory. Add --with-maildir option to override. Fixed OpenServer 6 getting it wrong. Fixed many systems having MAIL=/var/mail//username ok dtucker
This commit is contained in:
parent
c412c1567b
commit
90f42b0705
|
@ -2,6 +2,10 @@
|
||||||
- (dtucker) [README version.h contrib/caldera/openssh.spec
|
- (dtucker) [README version.h contrib/caldera/openssh.spec
|
||||||
contrib/redhat/openssh.spec contrib/suse/openssh.spec] Pull the version
|
contrib/redhat/openssh.spec contrib/suse/openssh.spec] Pull the version
|
||||||
bumps from the 5.8p2 branch into HEAD. ok djm.
|
bumps from the 5.8p2 branch into HEAD. ok djm.
|
||||||
|
- (tim) [configure.ac defines.h] Run test program to detect system mail
|
||||||
|
directory. Add --with-maildir option to override. Fixed OpenServer 6
|
||||||
|
getting it wrong. Fixed many systems having MAIL=/var/mail//username
|
||||||
|
ok dtucker
|
||||||
|
|
||||||
20110529
|
20110529
|
||||||
- (djm) OpenBSD CVS Sync
|
- (djm) OpenBSD CVS Sync
|
||||||
|
|
96
configure.ac
96
configure.ac
|
@ -1,4 +1,4 @@
|
||||||
# $Id: configure.ac,v 1.474 2011/05/20 01:45:25 djm Exp $
|
# $Id: configure.ac,v 1.475 2011/06/03 01:17:49 tim Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 1999-2004 Damien Miller
|
# Copyright (c) 1999-2004 Damien Miller
|
||||||
#
|
#
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
|
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
|
||||||
AC_REVISION($Revision: 1.474 $)
|
AC_REVISION($Revision: 1.475 $)
|
||||||
AC_CONFIG_SRCDIR([ssh.c])
|
AC_CONFIG_SRCDIR([ssh.c])
|
||||||
AC_LANG([C])
|
AC_LANG([C])
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
|
||||||
AC_DEFINE([LOCKED_PASSWD_STRING], ["*"],
|
AC_DEFINE([LOCKED_PASSWD_STRING], ["*"],
|
||||||
[String used in /etc/passwd to denote locked account])
|
[String used in /etc/passwd to denote locked account])
|
||||||
AC_DEFINE([SPT_TYPE], [SPT_PSTAT])
|
AC_DEFINE([SPT_TYPE], [SPT_PSTAT])
|
||||||
MAIL="/var/mail/username"
|
maildir="/var/mail"
|
||||||
LIBS="$LIBS -lsec"
|
LIBS="$LIBS -lsec"
|
||||||
AC_CHECK_LIB([xnet], [t_error], ,
|
AC_CHECK_LIB([xnet], [t_error], ,
|
||||||
[AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])])
|
[AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])])
|
||||||
|
@ -674,7 +674,7 @@ mips-sony-bsd|mips-sony-newsos4)
|
||||||
conf_lastlog_location="/usr/adm/lastlog"
|
conf_lastlog_location="/usr/adm/lastlog"
|
||||||
conf_utmp_location=/etc/utmp
|
conf_utmp_location=/etc/utmp
|
||||||
conf_wtmp_location=/usr/adm/wtmp
|
conf_wtmp_location=/usr/adm/wtmp
|
||||||
MAIL=/usr/spool/mail
|
maildir=/usr/spool/mail
|
||||||
AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT])
|
AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT])
|
||||||
AC_DEFINE([BROKEN_REALPATH])
|
AC_DEFINE([BROKEN_REALPATH])
|
||||||
AC_DEFINE([USE_PIPES])
|
AC_DEFINE([USE_PIPES])
|
||||||
|
@ -797,6 +797,7 @@ mips-sony-bsd|mips-sony-newsos4)
|
||||||
AC_DEFINE([PASSWD_NEEDS_USERNAME])
|
AC_DEFINE([PASSWD_NEEDS_USERNAME])
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-*-sysv5SCO_SV*) # SCO OpenServer 6.x
|
*-*-sysv5SCO_SV*) # SCO OpenServer 6.x
|
||||||
|
maildir=/var/spool/mail
|
||||||
TEST_SHELL=/u95/bin/sh
|
TEST_SHELL=/u95/bin/sh
|
||||||
AC_DEFINE([BROKEN_LIBIAF], [1],
|
AC_DEFINE([BROKEN_LIBIAF], [1],
|
||||||
[ia_uinfo routines not supported by OS yet])
|
[ia_uinfo routines not supported by OS yet])
|
||||||
|
@ -3479,12 +3480,87 @@ else
|
||||||
AC_SUBST([XAUTH_PATH])
|
AC_SUBST([XAUTH_PATH])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for mail directory (last resort if we cannot get it from headers)
|
dnl # --with-maildir=/path/to/mail gets top priority.
|
||||||
if test ! -z "$MAIL" ; then
|
dnl # if maildir is set in the platform case statement above we use that.
|
||||||
maildir=`dirname $MAIL`
|
dnl # Otherwise we run a program to get the dir from system headers.
|
||||||
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"],
|
dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL
|
||||||
[Set this to your mail directory if you don't have maillock.h])
|
dnl # If we find _PATH_MAILDIR we do nothing because that is what
|
||||||
fi
|
dnl # session.c expects anyway. Otherwise we set to the value found
|
||||||
|
dnl # stripping any trailing slash. If for some strage reason our program
|
||||||
|
dnl # does not find what it needs, we default to /var/spool/mail.
|
||||||
|
# Check for mail directory
|
||||||
|
AC_ARG_WITH([maildir],
|
||||||
|
[ --with-maildir=/path/to/mail Specify your system mail directory],
|
||||||
|
[
|
||||||
|
if test "X$withval" != X && test "x$withval" != xno && \
|
||||||
|
test "x${withval}" != xyes; then
|
||||||
|
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"],
|
||||||
|
[Set this to your mail directory if you do not have _PATH_MAILDIR])
|
||||||
|
fi
|
||||||
|
],[
|
||||||
|
if test "X$maildir" != "X"; then
|
||||||
|
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
|
||||||
|
else
|
||||||
|
AC_MSG_CHECKING([Discovering system mail directory])
|
||||||
|
AC_RUN_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM([[
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifdef HAVE_PATHS_H
|
||||||
|
#include <paths.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_MAILLOCK_H
|
||||||
|
#include <maillock.h>
|
||||||
|
#endif
|
||||||
|
#define DATA "conftest.maildir"
|
||||||
|
]], [[
|
||||||
|
FILE *fd;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
fd = fopen(DATA,"w");
|
||||||
|
if(fd == NULL)
|
||||||
|
exit(1);
|
||||||
|
|
||||||
|
#if defined (_PATH_MAILDIR)
|
||||||
|
if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
|
||||||
|
exit(1);
|
||||||
|
#elif defined (MAILDIR)
|
||||||
|
if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
|
||||||
|
exit(1);
|
||||||
|
#elif defined (_PATH_MAIL)
|
||||||
|
if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
|
||||||
|
exit(1);
|
||||||
|
#else
|
||||||
|
exit (2);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
exit(0);
|
||||||
|
]])],
|
||||||
|
[
|
||||||
|
maildir_what=`awk -F: '{print $1}' conftest.maildir`
|
||||||
|
maildir=`awk -F: '{print $2}' conftest.maildir \
|
||||||
|
| sed 's|/$||'`
|
||||||
|
AC_MSG_RESULT([Using: $maildir from $maildir_what])
|
||||||
|
if test "x$maildir_what" != "x_PATH_MAILDIR"; then
|
||||||
|
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[
|
||||||
|
if test "X$ac_status" = "X2";then
|
||||||
|
# our test program didn't find it. Default to /var/spool/mail
|
||||||
|
AC_MSG_RESULT([Using: default value of /var/spool/mail])
|
||||||
|
AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([*** not found ***])
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
]
|
||||||
|
) # maildir
|
||||||
|
|
||||||
if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
|
if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
|
||||||
AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
|
AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
|
||||||
|
|
17
defines.h
17
defines.h
|
@ -25,7 +25,7 @@
|
||||||
#ifndef _DEFINES_H
|
#ifndef _DEFINES_H
|
||||||
#define _DEFINES_H
|
#define _DEFINES_H
|
||||||
|
|
||||||
/* $Id: defines.h,v 1.166 2011/05/05 06:06:59 tim Exp $ */
|
/* $Id: defines.h,v 1.167 2011/06/03 01:17:49 tim Exp $ */
|
||||||
|
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
|
@ -389,18 +389,15 @@ struct winsize {
|
||||||
# define _PATH_DEVNULL "/dev/null"
|
# define _PATH_DEVNULL "/dev/null"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MAIL_DIRECTORY
|
/* user may have set a different path */
|
||||||
# define MAIL_DIRECTORY "/var/spool/mail"
|
#if defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY)
|
||||||
#endif
|
# undef _PATH_MAILDIR MAILDIR
|
||||||
|
#endif /* defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) */
|
||||||
|
|
||||||
#ifndef MAILDIR
|
#ifdef MAIL_DIRECTORY
|
||||||
# define MAILDIR MAIL_DIRECTORY
|
# define _PATH_MAILDIR MAIL_DIRECTORY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_PATH_MAILDIR) && defined(MAILDIR)
|
|
||||||
# define _PATH_MAILDIR MAILDIR
|
|
||||||
#endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
|
|
||||||
|
|
||||||
#ifndef _PATH_NOLOGIN
|
#ifndef _PATH_NOLOGIN
|
||||||
# define _PATH_NOLOGIN "/etc/nologin"
|
# define _PATH_NOLOGIN "/etc/nologin"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue