diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 96 | ||||
-rw-r--r-- | defines.h | 17 |
3 files changed, 97 insertions, 20 deletions
@@ -2,6 +2,10 @@ | |||
2 | - (dtucker) [README version.h contrib/caldera/openssh.spec | 2 | - (dtucker) [README version.h contrib/caldera/openssh.spec |
3 | contrib/redhat/openssh.spec contrib/suse/openssh.spec] Pull the version | 3 | contrib/redhat/openssh.spec contrib/suse/openssh.spec] Pull the version |
4 | bumps from the 5.8p2 branch into HEAD. ok djm. | 4 | bumps from the 5.8p2 branch into HEAD. ok djm. |
5 | - (tim) [configure.ac defines.h] Run test program to detect system mail | ||
6 | directory. Add --with-maildir option to override. Fixed OpenServer 6 | ||
7 | getting it wrong. Fixed many systems having MAIL=/var/mail//username | ||
8 | ok dtucker | ||
5 | 9 | ||
6 | 20110529 | 10 | 20110529 |
7 | - (djm) OpenBSD CVS Sync | 11 | - (djm) OpenBSD CVS Sync |
diff --git a/configure.ac b/configure.ac index d56bf6d36..51dea41c1 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.474 2011/05/20 01:45:25 djm Exp $ | 1 | # $Id: configure.ac,v 1.475 2011/06/03 01:17:49 tim Exp $ |
2 | # | 2 | # |
3 | # Copyright (c) 1999-2004 Damien Miller | 3 | # Copyright (c) 1999-2004 Damien Miller |
4 | # | 4 | # |
@@ -15,7 +15,7 @@ | |||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | ||
17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) | 17 | AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) |
18 | AC_REVISION($Revision: 1.474 $) | 18 | AC_REVISION($Revision: 1.475 $) |
19 | AC_CONFIG_SRCDIR([ssh.c]) | 19 | AC_CONFIG_SRCDIR([ssh.c]) |
20 | AC_LANG([C]) | 20 | AC_LANG([C]) |
21 | 21 | ||
@@ -533,7 +533,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) | |||
533 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], | 533 | AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], |
534 | [String used in /etc/passwd to denote locked account]) | 534 | [String used in /etc/passwd to denote locked account]) |
535 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) | 535 | AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) |
536 | MAIL="/var/mail/username" | 536 | maildir="/var/mail" |
537 | LIBS="$LIBS -lsec" | 537 | LIBS="$LIBS -lsec" |
538 | AC_CHECK_LIB([xnet], [t_error], , | 538 | AC_CHECK_LIB([xnet], [t_error], , |
539 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) | 539 | [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) |
@@ -674,7 +674,7 @@ mips-sony-bsd|mips-sony-newsos4) | |||
674 | conf_lastlog_location="/usr/adm/lastlog" | 674 | conf_lastlog_location="/usr/adm/lastlog" |
675 | conf_utmp_location=/etc/utmp | 675 | conf_utmp_location=/etc/utmp |
676 | conf_wtmp_location=/usr/adm/wtmp | 676 | conf_wtmp_location=/usr/adm/wtmp |
677 | MAIL=/usr/spool/mail | 677 | maildir=/usr/spool/mail |
678 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) | 678 | AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) |
679 | AC_DEFINE([BROKEN_REALPATH]) | 679 | AC_DEFINE([BROKEN_REALPATH]) |
680 | AC_DEFINE([USE_PIPES]) | 680 | AC_DEFINE([USE_PIPES]) |
@@ -797,6 +797,7 @@ mips-sony-bsd|mips-sony-newsos4) | |||
797 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) | 797 | AC_DEFINE([PASSWD_NEEDS_USERNAME]) |
798 | case "$host" in | 798 | case "$host" in |
799 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x | 799 | *-*-sysv5SCO_SV*) # SCO OpenServer 6.x |
800 | maildir=/var/spool/mail | ||
800 | TEST_SHELL=/u95/bin/sh | 801 | TEST_SHELL=/u95/bin/sh |
801 | AC_DEFINE([BROKEN_LIBIAF], [1], | 802 | AC_DEFINE([BROKEN_LIBIAF], [1], |
802 | [ia_uinfo routines not supported by OS yet]) | 803 | [ia_uinfo routines not supported by OS yet]) |
@@ -3479,12 +3480,87 @@ else | |||
3479 | AC_SUBST([XAUTH_PATH]) | 3480 | AC_SUBST([XAUTH_PATH]) |
3480 | fi | 3481 | fi |
3481 | 3482 | ||
3482 | # Check for mail directory (last resort if we cannot get it from headers) | 3483 | dnl # --with-maildir=/path/to/mail gets top priority. |
3483 | if test ! -z "$MAIL" ; then | 3484 | dnl # if maildir is set in the platform case statement above we use that. |
3484 | maildir=`dirname $MAIL` | 3485 | dnl # Otherwise we run a program to get the dir from system headers. |
3485 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"], | 3486 | dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL |
3486 | [Set this to your mail directory if you don't have maillock.h]) | 3487 | dnl # If we find _PATH_MAILDIR we do nothing because that is what |
3487 | fi | 3488 | dnl # session.c expects anyway. Otherwise we set to the value found |
3489 | dnl # stripping any trailing slash. If for some strage reason our program | ||
3490 | dnl # does not find what it needs, we default to /var/spool/mail. | ||
3491 | # Check for mail directory | ||
3492 | AC_ARG_WITH([maildir], | ||
3493 | [ --with-maildir=/path/to/mail Specify your system mail directory], | ||
3494 | [ | ||
3495 | if test "X$withval" != X && test "x$withval" != xno && \ | ||
3496 | test "x${withval}" != xyes; then | ||
3497 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], | ||
3498 | [Set this to your mail directory if you do not have _PATH_MAILDIR]) | ||
3499 | fi | ||
3500 | ],[ | ||
3501 | if test "X$maildir" != "X"; then | ||
3502 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) | ||
3503 | else | ||
3504 | AC_MSG_CHECKING([Discovering system mail directory]) | ||
3505 | AC_RUN_IFELSE( | ||
3506 | [AC_LANG_PROGRAM([[ | ||
3507 | #include <stdio.h> | ||
3508 | #include <string.h> | ||
3509 | #ifdef HAVE_PATHS_H | ||
3510 | #include <paths.h> | ||
3511 | #endif | ||
3512 | #ifdef HAVE_MAILLOCK_H | ||
3513 | #include <maillock.h> | ||
3514 | #endif | ||
3515 | #define DATA "conftest.maildir" | ||
3516 | ]], [[ | ||
3517 | FILE *fd; | ||
3518 | int rc; | ||
3519 | |||
3520 | fd = fopen(DATA,"w"); | ||
3521 | if(fd == NULL) | ||
3522 | exit(1); | ||
3523 | |||
3524 | #if defined (_PATH_MAILDIR) | ||
3525 | if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0) | ||
3526 | exit(1); | ||
3527 | #elif defined (MAILDIR) | ||
3528 | if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0) | ||
3529 | exit(1); | ||
3530 | #elif defined (_PATH_MAIL) | ||
3531 | if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0) | ||
3532 | exit(1); | ||
3533 | #else | ||
3534 | exit (2); | ||
3535 | #endif | ||
3536 | |||
3537 | exit(0); | ||
3538 | ]])], | ||
3539 | [ | ||
3540 | maildir_what=`awk -F: '{print $1}' conftest.maildir` | ||
3541 | maildir=`awk -F: '{print $2}' conftest.maildir \ | ||
3542 | | sed 's|/$||'` | ||
3543 | AC_MSG_RESULT([Using: $maildir from $maildir_what]) | ||
3544 | if test "x$maildir_what" != "x_PATH_MAILDIR"; then | ||
3545 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) | ||
3546 | fi | ||
3547 | ], | ||
3548 | [ | ||
3549 | if test "X$ac_status" = "X2";then | ||
3550 | # our test program didn't find it. Default to /var/spool/mail | ||
3551 | AC_MSG_RESULT([Using: default value of /var/spool/mail]) | ||
3552 | AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"]) | ||
3553 | else | ||
3554 | AC_MSG_RESULT([*** not found ***]) | ||
3555 | fi | ||
3556 | ], | ||
3557 | [ | ||
3558 | AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail]) | ||
3559 | ] | ||
3560 | ) | ||
3561 | fi | ||
3562 | ] | ||
3563 | ) # maildir | ||
3488 | 3564 | ||
3489 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then | 3565 | if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then |
3490 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) | 3566 | AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) |
@@ -25,7 +25,7 @@ | |||
25 | #ifndef _DEFINES_H | 25 | #ifndef _DEFINES_H |
26 | #define _DEFINES_H | 26 | #define _DEFINES_H |
27 | 27 | ||
28 | /* $Id: defines.h,v 1.166 2011/05/05 06:06:59 tim Exp $ */ | 28 | /* $Id: defines.h,v 1.167 2011/06/03 01:17:49 tim Exp $ */ |
29 | 29 | ||
30 | 30 | ||
31 | /* Constants */ | 31 | /* Constants */ |
@@ -389,18 +389,15 @@ struct winsize { | |||
389 | # define _PATH_DEVNULL "/dev/null" | 389 | # define _PATH_DEVNULL "/dev/null" |
390 | #endif | 390 | #endif |
391 | 391 | ||
392 | #ifndef MAIL_DIRECTORY | 392 | /* user may have set a different path */ |
393 | # define MAIL_DIRECTORY "/var/spool/mail" | 393 | #if defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) |
394 | #endif | 394 | # undef _PATH_MAILDIR MAILDIR |
395 | #endif /* defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) */ | ||
395 | 396 | ||
396 | #ifndef MAILDIR | 397 | #ifdef MAIL_DIRECTORY |
397 | # define MAILDIR MAIL_DIRECTORY | 398 | # define _PATH_MAILDIR MAIL_DIRECTORY |
398 | #endif | 399 | #endif |
399 | 400 | ||
400 | #if !defined(_PATH_MAILDIR) && defined(MAILDIR) | ||
401 | # define _PATH_MAILDIR MAILDIR | ||
402 | #endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */ | ||
403 | |||
404 | #ifndef _PATH_NOLOGIN | 401 | #ifndef _PATH_NOLOGIN |
405 | # define _PATH_NOLOGIN "/etc/nologin" | 402 | # define _PATH_NOLOGIN "/etc/nologin" |
406 | #endif | 403 | #endif |