From: mwolson_admin Date: Fri, 25 Jan 2008 23:41:28 +0000 (-0500) Subject: Imported upstream version 0.60.2 X-Git-Tag: upstream/0.60.2^0 X-Git-Url: https://git.hcoop.net/hcoop/debian/courier-authlib.git/commitdiff_plain/84870c69e4141e199b73cc5915e13edebc9bc706 Imported upstream version 0.60.2 --- diff --git a/ChangeLog b/ChangeLog index b07b533..90f0a8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +0.60.2 + +2007-10-10 "Johnny C. Lam" + + * liblock/lockdaemon.c: Portability fix for checking the highest + available file descriptor. + 0.60.1 2007-10-06 Anton Dobkin diff --git a/configure b/configure index 2a7fa73..abfc0c7 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for courier-authlib 0.60.1. +# Generated by GNU Autoconf 2.61 for courier-authlib 0.60.2. # # Report bugs to . # @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='courier-authlib' PACKAGE_TARNAME='courier-authlib' -PACKAGE_VERSION='0.60.1' -PACKAGE_STRING='courier-authlib 0.60.1' +PACKAGE_VERSION='0.60.2' +PACKAGE_STRING='courier-authlib 0.60.2' PACKAGE_BUGREPORT='courier-users@lists.sourceforge.net' ac_unique_file="courierauth.h" @@ -1461,7 +1461,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures courier-authlib 0.60.1 to adapt to many kinds of systems. +\`configure' configures courier-authlib 0.60.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1531,7 +1531,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of courier-authlib 0.60.1:";; + short | recursive ) echo "Configuration of courier-authlib 0.60.2:";; esac cat <<\_ACEOF @@ -1667,7 +1667,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -courier-authlib configure 0.60.1 +courier-authlib configure 0.60.2 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1681,7 +1681,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by courier-authlib $as_me 0.60.1, which was +It was created by courier-authlib $as_me 0.60.2, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2376,7 +2376,7 @@ fi # Define the identity of the package. PACKAGE='courier-authlib' - VERSION='0.60.1' + VERSION='0.60.2' cat >>confdefs.h <<_ACEOF @@ -26458,7 +26458,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by courier-authlib $as_me 0.60.1, which was +This file was extended by courier-authlib $as_me 0.60.2, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26511,7 +26511,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -courier-authlib config.status 0.60.1 +courier-authlib config.status 0.60.2 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.in b/configure.in index f607787..47f18ce 100644 --- a/configure.in +++ b/configure.in @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl $Id: configure.in,v 1.152 2007/10/07 18:33:22 mrsam Exp $ +dnl $Id: configure.in,v 1.153 2007/10/14 00:19:54 mrsam Exp $ dnl dnl Copyright 1998 - 2007 Double Precision, Inc. See COPYING for dnl distribution information. AC_PREREQ(2.59) -AC_INIT(courier-authlib, 0.60.1, [courier-users@lists.sourceforge.net]) +AC_INIT(courier-authlib, 0.60.2, [courier-users@lists.sourceforge.net]) AC_CONFIG_SRCDIR([courierauth.h]) AM_CONFIG_HEADER([courier_auth_config.h]) diff --git a/courier-authlib.lpspec b/courier-authlib.lpspec index c29a152..5c4d63b 100644 --- a/courier-authlib.lpspec +++ b/courier-authlib.lpspec @@ -4,7 +4,7 @@ # distribution information. Name: courier-authlib -Version: 0.60.1 +Version: 0.60.2 Release: 1 License: GPL diff --git a/courier-authlib.spec b/courier-authlib.spec index 86da0ce..9296533 100644 --- a/courier-authlib.spec +++ b/courier-authlib.spec @@ -13,7 +13,7 @@ ################################################################################ Name: courier-authlib -Version: 0.60.1 +Version: 0.60.2 Release: 1%{?dist}%{?courier_release} Summary: Courier authentication library diff --git a/liblock/config.h.in b/liblock/config.h.in index 836cf03..921160b 100644 --- a/liblock/config.h.in +++ b/liblock/config.h.in @@ -21,6 +21,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff --git a/liblock/configure b/liblock/configure index 339d597..3e6eafe 100755 --- a/liblock/configure +++ b/liblock/configure @@ -20203,7 +20203,8 @@ fi -for ac_func in setpgrp sysconf + +for ac_func in getdtablesize setpgrp sysconf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/liblock/configure.in b/liblock/configure.in index 5d4bc22..176f10f 100644 --- a/liblock/configure.in +++ b/liblock/configure.in @@ -1,8 +1,8 @@ -dnl $Id: configure.in,v 1.14 2007/09/26 02:36:59 mrsam Exp $ +dnl $Id: configure.in,v 1.15 2007/10/11 01:46:34 mrsam Exp $ dnl dnl Copyright 1998 - 2004 Double Precision, Inc. See COPYING for dnl distribution information. -dnl $Id: configure.in,v 1.14 2007/09/26 02:36:59 mrsam Exp $ +dnl $Id: configure.in,v 1.15 2007/10/11 01:46:34 mrsam Exp $ AC_PREREQ(2.59) AC_INIT(liblock, 0.60, courier-users@lists.sourceforge.net) @@ -80,7 +80,7 @@ fi dnl Checks for library functions. -AC_CHECK_FUNCS(setpgrp sysconf) +AC_CHECK_FUNCS(getdtablesize setpgrp sysconf) AC_CHECK_FUNC(setpgrp, [ AC_FUNC_SETPGRP diff --git a/liblock/lockdaemon.c b/liblock/lockdaemon.c index 5ff83a1..0b0151a 100644 --- a/liblock/lockdaemon.c +++ b/liblock/lockdaemon.c @@ -31,31 +31,9 @@ #include #endif -#ifndef OPEN_MAX -#ifdef HAVE_SYSCONF -#ifdef _SC_OPEN_MAX -#define OPEN_MAX (my_open_max()) - -static int my_open_max() -{ - long n=sysconf(_SC_OPEN_MAX); - - if (n == -1) - n=64; - return n; -} - -#endif -#endif -#endif - -#ifndef OPEN_MAX -#define OPEN_MAX 64 -#endif - #define exit(_a_) _exit(_a_) -static const char rcsid[]="$Id: lockdaemon.c,v 1.13 2007/09/26 02:36:59 mrsam Exp $"; +static const char rcsid[]="$Id: lockdaemon.c,v 1.14 2007/10/11 01:46:34 mrsam Exp $"; static int start1(const char *, int); @@ -133,7 +111,7 @@ int i; static int start1(const char *lockfile, int fd) { -int lockfd; +int lockfd, maxfd; #if HAVE_SETPGRP #if SETPGRP_VOID @@ -168,14 +146,27 @@ int lockfd; lockfd=open(lockfile, O_RDWR|O_CREAT, 0600); } - if (lockfd < 0 || dup2(lockfd, OPEN_MAX-1) != OPEN_MAX-1) +#if HAVE_GETDTABLESIZE + maxfd=getdtablesize()-1; +#elif defined(OPEN_MAX) + maxfd=OPEN_MAX-1; +#elif HAVE_SYSCONF && defined(_SC_OPEN_MAX) + if ((maxfd=sysconf(_SC_OPEN_MAX)) < 0) + maxfd=63; + else if (maxfd > 0) + maxfd--; +#else + maxfd=63; +#endif + + if (lockfd < 0 || dup2(lockfd, maxfd) != maxfd) { perror(lockfile); exit(1); } close(lockfd); - lockfd=OPEN_MAX-1; + lockfd=maxfd; #ifdef FD_CLOEXEC if (fcntl(lockfd, F_SETFD, FD_CLOEXEC) < 0)