opensmtpd-7.7.0p0/0000755000175000001440000000000015010115322007521 5opensmtpd-7.7.0p0/compile0000555000175000001440000001635014764503774011055 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: opensmtpd-7.7.0p0/LICENSE0000644000175000001440000003566714665027057010515 This file is part of the OpenSMTPD software. The licences which components of this software fall under are as follows. First, we will summarize and say that all components are under a BSD licence, or a licence more free than that. OpenSMTPD contains no GPL code. Portable OpenSMTPD is divided in 4 parts: - Original OpenSMTPD - mail.local - openbsd-compat - smtpctl encrypt sub command OpenSMTPD ========= 1) Almost all code is licensed under an ISC-style license, to the following copyright holders: Gilles Chehade Eric Faurot Jacek Masiulaniec Pierre-Yves Ritschard Henning Brauer Esben Norby Markus Friedl Daniel Hartmeier Theo de Raadt Claudio Jeker Reyk Floeter Janne Johansson Alexander Schrijver Marc Balmer Ashish Shukla Ryan Kavanagh Charles Longeau 2) ssl_privsep.c /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ /* * SSL operations needed when running in a privilege separated environment. * Adapted from openssl's ssl_rsa.c by Pierre-Yves Ritschard . */ mail.local ========== 1) mail.local is covered by a 3-clause BSD license, to the following copyright holders: The Regents of the University of California. David Mazieres Theo de Raadt * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. openbsd-compat ============== Most of the OpenBSD compatibility layer is based on the work by Damien Miller for Portable OpenSSH. 1) Almost all code is licensed under an ISC-style license, to the following copyright holders: Internet Software Consortium. David Mazieres Damien Miller Markus Friedl Todd C. Miller Henning Brauer Pierre-Yves Ritschard Reyk Floeter Theo de Raadt Ted Unangst Charles Longeau * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 2) base64.{c,h} in addition to beeing covered by an ISC-style licence, is also covered by this one: * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. 3) Portable OpenSMTPD includes code under the 2-clause BSD license, from the following copyright holders: Ben Lindstrom Damien Miller Marc Espie Tim Rice The NetBSD Foundation, Inc. Jason R. Thorpe? Niels Provos * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4) Some code is under a 3-clause BSD license, from the following copyright holders: The Regents of the University of California. Ian F. Darwin Damien Miller Eric P. Allman * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. 5) Some code is under a 4-clause BSD license, from the following copyright holder: Christos Zoulas * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Christos Zoulas. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6) includes.h, log.h, setresguid.c, xmalloc.c, xmalloc.c * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved * * As far as I am concerned, the code I have written for this software * can be used freely for any purpose. Any derived versions of this * software must be clearly marked as such, and if the derived work is * incompatible with the protocol description in the RFC file, it must be * called by a name other than "ssh" or "Secure Shell". 7) chacha_private.h D. J. Bernstein Public domain. 8) bootstrap (only there in the git repository) # Copyright (c) 2002-2011 Sam Hocevar # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. smtpctl encrypt sub command =========================== smtpctl encrypt sub command is licensed under an ISC-style license, to the following copyright holders: Sunil Nimmagadda Gilles Chehade opensmtpd-7.7.0p0/configure.ac0000644000175000001440000011317515010115272011743 # Copyright (c) 2023 Omar Polo # Copyright (c) 2016 Gilles Chehade # Copyright (c) 1999-2004 Damien Miller # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSMTPD-portable], [7.7.0p0], [bugs@opensmtpd.org], [opensmtpd], [https://www.opensmtpd.org]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_LIBOBJ_DIR([openbsd-compat]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) AC_USE_SYSTEM_EXTENSIONS AM_PROG_AR AC_PROG_CC AC_C_INLINE AC_PROG_INSTALL AC_PROG_EGREP PKG_PROG_PKG_CONFIG AC_PROG_YACC LT_INIT AC_PATH_PROG([CAT], [cat]) AC_PATH_PROG([CHMOD], [chmod]) AC_PATH_PROG([CHOWN], [chown]) AC_PATH_PROG([ZCAT], [zcat]) AC_PATH_PROG([SED], [sed]) # use libbsd by default; these needs to precede any other check, as we # might not need a compat function when using libbsd. AC_ARG_WITH([libbsd], AS_HELP_STRING([--without-libbsd], [Disable libbsd usage])) AS_IF([test "x$with_libbsd" != xno], [ PKG_CHECK_MODULES([LIBBSD], [libbsd-overlay libbsd-ctor], [ CFLAGS="$LIBBSD_CFLAGS $CFLAGS" LDFLAGS="$LIBBSD_LIBS $LDFLAGS" ], [AS_IF([test "x$with_libbsd" = "xyes"], [ AC_MSG_ERROR([libbsd requested but not found]) ])]) ]) need_dash_r= need_libasr=yes pkglibexecdir="$libexecdir/opensmtpd" AS_CASE(["$host"], [*-*-darwin*], [ use_pie=auto AC_DEFINE([SETEUID_BREAKS_SETUID], [1], [define if seteuid breaks setuid]) AC_DEFINE([BROKEN_SETREUID], [1], [define if setreuid is broken]) AC_DEFINE([BROKEN_SETREGID], [1], [define if setregid is broken]) AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV], [Define to a Set Process Title type if your system is supported by bsd-setproctitle.c]) ], [*-*-linux* | *-gnu* | *-k*bsd*-gnu*], [ use_pie=auto AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV]) ], [*-*-netbsd*], [ need_dash_r=yes AM_CFLAGS="$AM_CFLAGS -D_OPENBSD_SOURCE" ], [*-*-openbsd*], [ use_pie=auto need_libasr=no pkglibexecdir="$libexecdir/smtpd" AC_DEFINE([HAVE_ATTRIBUTE__SENTINEL__], [1], [OpenBSD's gcc has sentinel]) AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD's gcc has bounded]) AC_DEFINE([NOOP_ASR_FREEADDRINFO], [0], [OpenBSD doesn't need ASR_FREEADDRINFO]) ], [*-sun-solaris*], [ AC_DEFINE([HAVE_M_DATA], [1], [M_DATA is defined in sys/stream.h included by netinet/in.h]) ]) AC_SUBST([pkglibexecdir]) # XXX arc4random is checked later since some old (pre 3.8) versions of # LibreSSL provide this symbol mistakenly. AC_REPLACE_FUNCS([ \ basename \ clock_gettime \ closefrom \ crypt_checkpass \ daemon \ dirname \ errc \ explicit_bzero \ fgetln \ freezero \ getdtablecount \ getdtablesize \ getopt \ getpeereid \ nanosleep \ pipe2 \ reallocarray \ recallocarray \ res_hnok \ seteuid \ setegid \ setproctitle \ setresuid \ setresgid \ signal \ strlcpy \ strlcat \ strmode \ strndup \ strnlen \ strsep \ strtonum \ timingsafe_memcmp \ usleep \ ]) # TODO: add vasprintf to the above AC_CHECK_FUNCS([ \ dirfd \ getpeerucred \ getspnam \ malloc_conceal \ pledge \ setreuid \ setsid \ sigaction \ strnvis \ sysconf \ ]) AC_CHECK_HEADERS([ \ arpa/nameser_compat.h \ crypt.h \ dirent.h \ endian.h \ fcntl.h \ libkern/OSByteOrder.h \ libutil.h \ limits.h \ login_cap.h \ mach/mach_time.h \ maillock.h \ ndir.h \ netdb.h \ pam/pam_appl.h \ paths.h \ security/pam_appl.h \ shadow.h \ sys/bitypes.h \ sys/dir.h \ sys/endian.h \ sys/file.h \ sys/mount.h \ sys/ndir.h \ sys/pstat.h \ sys/statfs.h \ sys/statvfs.h \ sys/time.h \ sys/un.h \ ucred.h \ util.h \ vis.h \ ]) AS_IF([test "x$need_libasr" = xyes], [ AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/libasr" ]) AM_CONDITIONAL([NEED_LIBASR], [test "x$need_libasr" = xyes]) AS_IF([test "x$ac_cv_func_errc" = xno], [ AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/err_h" ]) AS_IF([test "x$ac_cv_header_paths_h" = xno], [ AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/paths_h" ]) # check for functions that may be provided by a library; need to do # this *after* the libc/libbsd things to avoid picking up unwanted # symbols from libraries. AC_SEARCH_LIBS([basename], [gen], [AC_DEFINE([HAVE_BASENAME], 1, [1 if have basename])], [AC_LIBOBJ([basename])]) AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [1 if have clock_gettime])], [AC_LIBOBJ([clock_gettime])]) AC_SEARCH_LIBS([closefrom], [gen], [ AC_DEFINE([HAVE_CLOSEFROM], 1, [1 if have closefrom]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int r = closefrom(0);]])], [ AC_DEFINE([HAVE_CLOSEFROM_INT], 1, [closefrom returns an int]) ]) ], [AC_LIBOBJ([closefrom])]) AC_SEARCH_LIBS([crypt], [crypt], [AC_DEFINE([HAVE_CRYPT], 1, [1 if have crypt])]) AC_SEARCH_LIBS([crypt_gensalt], [crypt], [AC_DEFINE([HAVE_CRYPT_GENSALT], 1, [1 if have crypt_gensalt])]) AC_SEARCH_LIBS([dirname], [gen], [AC_DEFINE([HAVE_DIRNAME], 1, [1 if have dirname])], [AC_LIBOBJ([dirname])]) AC_SEARCH_LIBS([fmt_scaled], [util], [AC_DEFINE([HAVE_FMT_SCALED], 1, [1 if have fmt_scaled])], [AC_LIBOBJ([fmt_scaled])]) AC_SEARCH_LIBS([fparseln], [util], [AC_DEFINE([HAVE_FPARSELN], 1, [1 if have fparseln])], [AC_LIBOBJ([fparseln])]) AC_SEARCH_LIBS([fts_open], [fts], [AC_DEFINE([HAVE_FTS_OPEN], 1, [1 if have fts_open])], [AC_MSG_ERROR([can't find fts_open(); please install libfts])]) AC_SEARCH_LIBS([inet_net_pton], [resorv], [AC_DEFINE([HAVE_INET_NET_PTON], 1, [1 if have inet_net_pton])], [AC_LIBOBJ([inet_net_pton])]) AC_SEARCH_LIBS([imsg_init], [util imsg], [AC_DEFINE([HAVE_IMSG_INIT], 1, [1 if have imsg_init])], [ AC_LIBOBJ([imsg]) AC_LIBOBJ([imsg-buffer]) ]) AC_SEARCH_LIBS([pidfile], [util], [AC_DEFINE([HAVE_PIDFILE], 1, [1 if have pidfile])], [AC_LIBOBJ([pidfile])]) AC_SEARCH_LIBS([res_hnok], [resolv], [AC_DEFINE([HAVE_RES_HNOK], 1, [1 if have res_hnok])], [ dnl darwin (at least) has res_9_hnok plus #defines dnl to "rename" it to res_hnok. AC_SEARCH_LIBS([res_9_hnok], [resolv], [ AC_DEFINE([HAVE_RES_HNOK], 1, [1 if have res_hnok]) AC_LIBOBJ([res_hnok]) ]) ]) AC_SEARCH_LIBS([res_randomid], [resolv], [AC_DEFINE([HAVE_RES_RANDOMID], 1, [1 if have res_randomid])], [AC_LIBOBJ([res_random])]) AC_SEARCH_LIBS([setsockopt], [socket], [:], [AC_MSG_ERROR([can't find setsockopt])]) AC_SEARCH_LIBS([__b64_pton], [resolv], [AC_DEFINE([HAVE___B64_PTON], 1, [1 if have __b64_pton])]) AC_SEARCH_LIBS([b64_pton], [resolv], [AC_DEFINE([HAVE_b64_PTON], 1, [1 if have b64_pton])]) AC_SEARCH_LIBS([__b64_ntop], [resolv], [AC_DEFINE([HAVE___B64_NTOP], 1, [1 if have __b64_ntop])]) AC_SEARCH_LIBS([b64_ntop], [resolv], [AC_DEFINE([HAVE_b64_NTOP], 1, [1 if have b64_ntop])]) dnl darwin (at least) has these plus #defines in resolv.h AC_SEARCH_LIBS([res_9_b64_pton], [resolv], [AC_DEFINE([HAVE_RES_9_B64_PTON], 1, [1 if have res_9_b64_pton])]) AC_SEARCH_LIBS([res_9_b64_ntop], [resolv], [AC_DEFINE([HAVE_RES_9_B64_NTOP], 1, [1 if have res_9_b64_ntop])]) AS_IF([test "x$ac_cv_search_b64_ntop" = "xno" -a \ "x$ac_cv_search___b64_ntop" = "xno" -a \ "x$ac_cv_search_res_9_b64_pton" = "xno" -a \ "x$ac_cv_search_res_9_b64_ntop" = "xno"], [ AC_LIBOBJ([base64]) ]) dnl NetBSD added an strnvis and unfortunately made it incompatible with the dnl existing one in OpenBSD and Linux's libbsd (the former having existed dnl for over ten years). Despite this incompatibility being reported during dnl development (see http://gnats.netbsd.org/44977) they still shipped it. dnl Even more unfortunately FreeBSD and later MacOS picked up this incompatible dnl implementation. dnl dnl OpenBSD, 2001: strnvis(char *dst, const char *src, size_t dlen, int flag); dnl NetBSD, 2012: strnvis(char *dst, size_t dlen, const char *src, int flag); AS_IF([test "x$ac_cv_func_strnvis" = xyes], [ AC_MSG_CHECKING([for broken strnvis]) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ char buf[128]; return (strnvis(buf, "Hello, world!\n", sizeof(buf), 0)); ]])], [ AC_MSG_RESULT([no]) ], [ AC_MSG_RESULT([yes]) AC_DEFINE([BROKEN_STRNVIS], [1],[argument order is swapped]) AC_LIBOBJ([vis]) ]) CFLAGS="$saved_CFLAGS" ]) AS_IF([test "x$ac_cv_func_strnvis" = xno], [AC_LIBOBJ([vis])]) AC_MSG_CHECKING([for /proc/pid/fd directory]) AS_IF([test -d "/proc/$$/fd"], [ AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/pid/fd]) AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ]) AC_CHECK_TYPES([long long, unsigned long long, long double, u_int, u_char]) AC_CHECK_SIZEOF([short int], [2]) AC_CHECK_SIZEOF([int], [4]) AC_CHECK_SIZEOF([long int], [4]) AC_CHECK_SIZEOF([long long int], [8]) AC_TYPE_INT8_T AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_INTPTR_T AC_TYPE_INTMAX_T AC_TYPE_UINTPTR_T AC_TYPE_UINTMAX_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_OFF_T AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_UID_T TYPE_SOCKLEN_T AC_CHECK_TYPES([sig_atomic_t], [], [], [ #include ]) AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], [], [], [ #include #ifdef HAVE_SYS_BITYPES_H #include #endif #ifdef HAVE_SYS_STATFS_H #include #endif #ifdef HAVE_SYS_STATVFS_H #include #endif ]) AC_CHECK_TYPES([in_addr_t, in_port_t], [], [], [ #include #include ]) AC_CHECK_TYPES([sa_family_t], [], [], [ #include #include #include ]) AC_CHECK_TYPES([struct timespec]) AC_CHECK_TYPES([struct ifgroupreq]) AC_CHECK_TYPES([struct sockaddr_storage], [], [], [ #include #include ]) AC_CHECK_TYPES([struct sockaddr_in6], [], [], [ #include #include ]) AC_CHECK_TYPES([struct in6_addr], [], [], [ #include #include ]) AC_CHECK_TYPES([struct addrinfo], [], [], [ #include #include #include ]) AC_CHECK_TYPES([struct timeval], [], [], [ #include ]) AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [], [ #ifdef HAVE_SYS_TYPES_H #include #endif #include ]) AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, struct passwd.pw_change, struct passwd.pw_expire], [], [], [ #include #include ]) AC_CHECK_MEMBERS([struct stat.st_flags], , , [ #include #include ] ) AC_CHECK_MEMBERS([struct stat.st_mtim], , , [ #include #include ] ) AC_CHECK_MEMBERS([struct stat.st_mtimespec], , , [ #include #include ] ) AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [ #include #include #include ] ) AC_CHECK_MEMBERS([struct sockaddr_storage.ss_len], , , [ #include #include #include ] ) AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], , , [ #include #include #include ] ) AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len], , , [ #include #include #include ] ) AC_CHECK_MEMBERS([struct statfs.f_favail], , , [ #include #include ] ) AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], [], [], [ #include #include ]) AC_CHECK_MEMBERS([struct sockaddr_storage.__ss_family], [], [], [ #include #include ]) AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone], [], [ AC_CHECK_DECLS([timezone, altzone, tzname], [], [ AC_MSG_ERROR([cannot find timezone])], [ #include ] ) ], [ #include ] ) AC_CHECK_MEMBERS([struct DIR.d_type], [], [], [ #include #include ]) AC_CHECK_DECLS([O_NONBLOCK], [], [], [ #include #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif ]) AC_CHECK_DECLS([AF_LOCAL, PF_LOCAL], [], [], [ #include ]) AC_CHECK_DECLS([IPPORT_HILASTAUTO], [], [], [ #include ]) AC_CHECK_DECLS([IPV6_ADDR_SCOPE_INTFACELOCAL], [], [], [ #include #include ]) AC_CHECK_DECLS([WAIT_MYPGRP], [], [], [ #include ]) AC_CHECK_DECLS([LOG_PERROR], [], [], [ #include ]) ### ### EVERYTHING BELOW MUST BE CLEANED AND MOVED ABOVE ### #l150 (without _FORTIFY_SOURCE=2) if test "$GCC" = "yes" -o "$GCC" = "egcs"; then OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option]) OSSH_CHECK_CFLAG_COMPILE([-Wall]) OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) # OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) if test "x$use_toolchain_hardening" = "x1"; then OSSH_CHECK_LDFLAG_LINK([-Wl,-z,relro]) OSSH_CHECK_LDFLAG_LINK([-Wl,-z,now]) OSSH_CHECK_LDFLAG_LINK([-Wl,-z,noexecstack]) # NB. -ftrapv expects certain support functions to be present in # the compiler library (libgcc or similar) to detect integer operations # that can overflow. We must check that the result of enabling it # actually links. The test program compiled/linked includes a number # of integer operations that should exercise this. OSSH_CHECK_CFLAG_LINK([-ftrapv]) fi AC_MSG_CHECKING([gcc version]) GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` case $GCC_VER in 1.*) no_attrib_nonnull=1 ;; 2.8* | 2.9*) no_attrib_nonnull=1 ;; 2.*) no_attrib_nonnull=1 ;; *) ;; esac AC_MSG_RESULT([$GCC_VER]) AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset]) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-builtin-memset" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ char b[10]; memset(b, 0, sizeof(b)); ]])], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" ] ) # -fstack-protector-all doesn't always work for some GCC versions # and/or platforms, so we test if we can. If it's not supported # on a given platform gcc will emit a warning so we use -Werror. if test "x$use_stack_protector" = "x1"; then for t in -fstack-protector-strong -fstack-protector-all \ -fstack-protector; do AC_MSG_CHECKING([if $CC supports $t]) saved_CFLAGS="$CFLAGS" saved_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $t -Werror" LDFLAGS="$LDFLAGS $t -Werror" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ #include ]], [[ char x[256]; snprintf(x, sizeof(x), "XXX"); ]])], [ AC_MSG_RESULT([yes]) CFLAGS="$saved_CFLAGS $t" LDFLAGS="$saved_LDFLAGS $t" AC_MSG_CHECKING([if $t works]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include ]], [[ char x[256]; snprintf(x, sizeof(x), "XXX"); ]])], [ AC_MSG_RESULT([yes]) break ], [ AC_MSG_RESULT([no]) ], [ AC_MSG_WARN([cross compiling: cannot test]) break ] ) ], [ AC_MSG_RESULT([no]) ] ) CFLAGS="$saved_CFLAGS" LDFLAGS="$saved_LDFLAGS" done fi if test -z "$have_llong_max"; then # retry LLONG_MAX with -std=gnu99, needed on some Linuxes unset ac_cv_have_decl_LLONG_MAX saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=gnu99" AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], [CFLAGS="$saved_CFLAGS"], [#include ] ) fi fi AC_MSG_CHECKING([if compiler allows __attribute__ on return types]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #include __attribute__((__unused__)) static void foo(void){return;}]], [[ exit(0); ]])], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1, [compiler does not accept __attribute__ on return types]) ] ) if test "x$no_attrib_nonnull" != "x1"; then AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull]) fi AC_ARG_WITH([rpath], [ --without-rpath Disable auto-added -R linker paths], AS_CASE(["$withval"], [yes], [need_dash_r=yes], [no], [need_dash_r=''] )) AC_ARG_WITH([cflags], [ --with-cflags Specify additional flags to pass to compiler], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then CFLAGS="$CFLAGS $withval" fi ] ) AC_ARG_WITH([cppflags], [ --with-cppflags Specify additional flags to pass to preprocessor] , [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then CPPFLAGS="$CPPFLAGS $withval" fi ] ) AC_ARG_WITH([ldflags], [ --with-ldflags Specify additional flags to pass to linker], [ if test -n "$withval" -a "$withval" != "xno" -a "${withval}" != "yes"; then LDFLAGS="$LDFLAGS $withval" fi ] ) werror_flags= AC_ARG_WITH([Werror], [ --with-Werror Build main code with -Werror], [ if test -n "$withval" -a "$withval" != "no"; then werror_flags="-Werror" if test "${withval}" != "yes"; then werror_flags="$withval" fi fi ] ) AC_ARG_WITH([pie], [ --with-pie Build Position Independent Executables if possible], [ if test "x$withval" = "xno"; then use_pie=no fi if test "x$withval" = "xyes"; then use_pie=yes fi ] ) if test -z "$use_pie"; then use_pie=no fi if test "x$use_toolchain_hardening" != "x1" -a "x$use_pie" = "xauto"; then # Turn off automatic PIE when toolchain hardening is off. use_pie=no fi if test "x$use_pie" = "xauto"; then # Automatic PIE requires gcc >= 4.x AC_MSG_CHECKING([for gcc >= 4.x]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if !defined(__GNUC__) || __GNUC__ < 4 #error gcc is too old #endif ]])], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) use_pie=no ] ) fi if test "x$use_pie" != "xno"; then SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" OSSH_CHECK_CFLAG_COMPILE([-fPIE]) OSSH_CHECK_LDFLAG_LINK([-pie]) # We use both -fPIE and -pie or neither. AC_MSG_CHECKING([whether both -fPIE and -pie are supported]) if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) CFLAGS="$SAVED_CFLAGS" LDFLAGS="$SAVED_LDFLAGS" fi fi # Man pages defaults to mandoc MANTYPE=doc AC_ARG_WITH([mantype], [ --with-mantype=man|cat|doc Set man page type], [ case "$withval" in man|cat|doc) MANTYPE=$withval ;; *) AC_MSG_ERROR([invalid man type: $withval]) ;; esac ] ) AC_SUBST([MANTYPE]) if test "$MANTYPE" = "doc"; then mansubdir=man; else mansubdir=$MANTYPE; fi AC_SUBST([mansubdir]) # Whether to enable BSD auth support AC_ARG_WITH([auth-bsdauth], [ --with-auth-bsdauth Enable bsd_auth(3) authentication support], [ if test "x$withval" != "xno"; then AC_DEFINE([BSD_AUTH], [1], [Define if you have BSD auth support]) BSD_AUTH_MSG=yes fi ] ) PAM_MSG="no" USE_PAM_SERVICE=smtpd AC_ARG_WITH([auth-pam], [ --with-auth-pam=SERVICE Enable PAM authentication support (default=smtpd)], [ if test "x$withval" != "xno"; then if test -n "$withval" -a "x${withval}" != "xyes"; then USE_PAM_SERVICE=$withval fi if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ test "x$ac_cv_header_pam_pam_appl_h" != "xyes"; then AC_MSG_ERROR([PAM headers not found]) fi saved_LIBS="$LIBS" AC_CHECK_LIB([dl], [dlopen], , ) AC_CHECK_LIB([pam], [pam_set_item], , [AC_MSG_ERROR([*** libpam missing])]) AC_CHECK_FUNCS([pam_getenvlist]) AC_CHECK_FUNCS([pam_putenv]) LIBS="$saved_LIBS" PAM_MSG="yes" SMTPDLIBS="$SMTPDLIBS -lpam" AC_DEFINE([USE_PAM], [1], [Define if you want to enable PAM support]) if test "x$ac_cv_lib_dl_dlopen" = "xyes"; then case "$LIBS" in *-ldl*) # libdl already in LIBS ;; *) SMTPDLIBS="$SMTPDLIBS -ldl" ;; esac fi fi ] ) AC_DEFINE_UNQUOTED([USE_PAM_SERVICE], ["$USE_PAM_SERVICE"], [pam service]) AC_SUBST([USE_PAM_SERVICE]) # Check for older PAM if test "x$PAM_MSG" = "xyes"; then # Check PAM strerror arguments (old PAM) AC_MSG_CHECKING([whether pam_strerror takes only one argument]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #if defined(HAVE_SECURITY_PAM_APPL_H) #include #elif defined (HAVE_PAM_PAM_APPL_H) #include #endif ]], [[ (void)pam_strerror((pam_handle_t *)NULL, -1); ]])], [AC_MSG_RESULT([no])], [ AC_DEFINE([HAVE_OLD_PAM], [1], [Define if you have an old version of PAM which takes only one argument to pam_strerror]) AC_MSG_RESULT([yes]) PAM_MSG="yes (old library)" ]) fi SMTPD_USER=_smtpd AC_ARG_WITH([user-smtpd], [ --with-user-smtpd=user Specify non-privileged user for smtpd (default=_smtpd)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_USER=$withval fi ] ) AC_DEFINE_UNQUOTED([SMTPD_USER], ["$SMTPD_USER"], [non-privileged user for privilege separation]) AC_SUBST([SMTPD_USER]) SMTPD_QUEUE_USER=_smtpq AC_ARG_WITH([user-queue], [ --with-user-queue=user Specify non-privileged user for queue process (default=_smtpq)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_QUEUE_USER=$withval fi ] ) AC_DEFINE_UNQUOTED([SMTPD_QUEUE_USER], ["$SMTPD_QUEUE_USER"], [non-privileged user for queue process]) AC_SUBST([SMTPD_QUEUE_USER]) SMTPD_QUEUE_GROUP=_smtpq AC_ARG_WITH([group-queue], [ --with-group-queue=group Specify non-privileged group for offline queue (default=_smtpq)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_QUEUE_GROUP=$withval fi ] ) AC_DEFINE_UNQUOTED([SMTPD_QUEUE_GROUP], ["$SMTPD_QUEUE_GROUP"], [non-privileged group for queue process]) AC_SUBST([SMTPD_QUEUE_GROUP]) # Where to place spooler spooldir=/var/spool/smtpd AC_ARG_WITH([path-queue], [ --with-path-queue=PATH Specify path to queue directory (default=/var/spool/smtpd)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then spooldir=$withval if test ! -d $spooldir; then AC_MSG_WARN([** no $spooldir directory on this system **]) fi fi ] ) AC_DEFINE_UNQUOTED([PATH_SPOOL], ["$spooldir"], [Specify location of spooler]) AC_SUBST([spooldir]) PRIVSEP_PATH=/var/empty AC_ARG_WITH([path-empty], [ --with-path-empty=PATH Specify path to empty directory (default=/var/empty)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then PRIVSEP_PATH=$withval fi ] ) AC_SUBST([PRIVSEP_PATH]) dnl # --with-maildir=/path/to/mail gets top priority. dnl # if maildir is set in the platform case statement above we use that. dnl # Otherwise we run a program to get the dir from system headers. dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL dnl # If we find _PATH_MAILDIR we do nothing because that is what 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([path-mbox], [ --with-path-mbox=PATH Specify path to mbox directory (default=/var/spool/mail)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"], [Set this to your mail directory if you do not have _PATH_MAILDIR]) fi ],[ if test -n "$maildir"; then AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"]) else AC_MSG_CHECKING([system mail directory]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include #include #ifdef HAVE_PATHS_H #include #endif #ifdef HAVE_MAILLOCK_H #include #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([$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([/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 # Where to place smtpd.sock sockdir=/var/run # make sure the directory exists if test ! -d $sockdir; then sockdir=`eval echo ${sysconfdir}` case $sockdir in NONE/*) sockdir=`echo $sockdir | sed "s~NONE~$ac_default_prefix~"` ;; esac fi AC_ARG_WITH([path-socket], [ --with-path-socket=PATH Specify path to smtpd.sock directory (default=/var/run)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then sockdir=$withval if test ! -d $sockdir; then AC_MSG_WARN([** no $sockdir directory on this system **]) fi fi ] ) AC_DEFINE_UNQUOTED([SMTPD_SOCKDIR], ["$sockdir"], [Specify location of smtpd.sock]) AC_SUBST([sockdir]) #l4470 # Where to place smtpd.pid piddir=/var/run AC_MSG_CHECKING([system pid directory]) AC_RUN_IFELSE( [ AC_LANG_PROGRAM([[ #include #include #ifdef HAVE_PATHS_H #include #endif #define DATA "conftest.piddir" ]], [[ #ifdef _PATH_VARRUN FILE *fd; int rc; if ((fd = fopen(DATA,"w")) == NULL) { exit(1); } if ((rc = fprintf(fd ,"%s\n", _PATH_VARRUN)) < 0) { exit(2); } exit(0); #else exit(-1); #endif ]]) ], [ piddir=`cat conftest.piddir` AC_MSG_RESULT([$piddir from paths.h]) ], [ AC_MSG_RESULT([$piddir from default value]) ], [ AC_MSG_RESULT([$piddir from default value]) ] ) AC_ARG_WITH([path-pidfile], [ --with-path-pidfile=PATH Specify path to smtpd.pid directory (default=/var/run)], [ if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then piddir=$withval fi ] ) AC_DEFINE_UNQUOTED([SMTPD_PIDDIR], ["$piddir"], [Specify location of smtpd.pid]) AC_SUBST([piddir]) AC_ARG_WITH([path-CAfile], [ --with-path-CAfile=FILE Specify path to CA certificate], ) AS_IF([test -n "$with_path_CAfile" -a "$with_path_CAfile" != no -a \ "$with_path_CAfile" != yes], [ AC_DEFINE_UNQUOTED([OPENSMTPD_CA_FILE], ["$with_path_CAfile"], [Custom path to a CA file]) ]) dnl make sure we're using the real structure members and not defines AC_CACHE_CHECK([for msg_accrights field in struct msghdr], ac_cv_have_accrights_in_msghdr, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]], [[ #ifdef msg_accrights #error "msg_accrights is a macro" exit(1); #endif struct msghdr m; m.msg_accrights = 0; exit(0); ]])], [ ac_cv_have_accrights_in_msghdr="yes" ], [ ac_cv_have_accrights_in_msghdr="no" ] ) ]) if test "x$ac_cv_have_accrights_in_msghdr" = "xyes"; then AC_DEFINE([HAVE_ACCRIGHTS_IN_MSGHDR], [1], [Define if your system uses access rights style file descriptor passing]) fi AC_CACHE_CHECK([for msg_control field in struct msghdr], ac_cv_have_control_in_msghdr, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]], [[ #ifdef msg_control #error "msg_control is a macro" exit(1); #endif struct msghdr m; m.msg_control = 0; exit(0); ]])], [ ac_cv_have_control_in_msghdr="yes" ], [ ac_cv_have_control_in_msghdr="no" ] ) ]) if test "x$ac_cv_have_control_in_msghdr" = "xyes"; then AC_DEFINE([HAVE_CONTROL_IN_MSGHDR], [1], [Define if your system uses ancillary data style file descriptor passing]) fi AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ extern char *__progname; printf("%s", __progname); ]])], [ ac_cv_libc_defines___progname="yes" ], [ ac_cv_libc_defines___progname="no" ]) ]) if test "x$ac_cv_libc_defines___progname" = "xyes"; then AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) fi AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ printf("%s", __FUNCTION__); ]])], [ ac_cv_cc_implements___FUNCTION__="yes" ], [ ac_cv_cc_implements___FUNCTION__="no" ]) ]) if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes"; then AC_DEFINE([HAVE___FUNCTION__], [1], [Define if compiler implements __FUNCTION__]) fi AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ printf("%s", __func__); ]])], [ ac_cv_cc_implements___func__="yes" ], [ ac_cv_cc_implements___func__="no" ]) ]) if test "x$ac_cv_cc_implements___func__" = "xyes"; then AC_DEFINE([HAVE___func__], [1], [Define if compiler implements __func__]) fi AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include va_list x,y; ]], [[ va_copy(x,y); ]])], [ ac_cv_have_va_copy="yes" ], [ ac_cv_have_va_copy="no" ]) ]) if test "x$ac_cv_have_va_copy" = "xyes"; then AC_DEFINE([HAVE_VA_COPY], [1], [Define if va_copy exists]) fi AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include va_list x,y; ]], [[ __va_copy(x,y); ]])], [ ac_cv_have___va_copy="yes" ], [ ac_cv_have___va_copy="no" ]) ]) if test "x$ac_cv_have___va_copy" = "xyes"; then AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) fi AC_CACHE_CHECK([whether getopt has optreset support], ac_cv_have_getopt_optreset, [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ extern int optreset; optreset = 0; ]])], [ ac_cv_have_getopt_optreset="yes" ], [ ac_cv_have_getopt_optreset="no" ]) ]) if test "x$ac_cv_have_getopt_optreset" = "xyes"; then AC_DEFINE([HAVE_GETOPT_OPTRESET], [1], [Define if your getopt(3) defines and uses optreset]) fi AC_CHECK_DECL([suboptarg], [ AC_DEFINE([HAVE_SUBOPTARG], 1, [1 if have suboptarg]) ], [ AC_LIBOBJ([getsubopt]) ]) # Search for fts AC_ARG_WITH([libfts], [ --with-libfts=PATH Specify path to libfts installation (default: none, part of libc)], [ if test "x$withval" = "xno"; then AC_MSG_ERROR([*** fts is required ***]) elif test "x$withval" != "xyes"; then if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi LIBS="$LIBS -lfts" fi ] ) # Search for libevent saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" AC_ARG_WITH([libevent], [ --with-libevent=PATH Specify path to libevent installation ], [ if test "x$withval" != "xno"; then case "$withval" in # Relative paths ./*|../*) withval="`pwd`/$withval" esac if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi elif test -d "$withval/lib64"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" else LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi ] ) AC_CHECK_HEADER([event.h], ,[AC_MSG_ERROR([*** event.h missing - please install libevent ***])], [#include ]) LIBS="$LIBS -levent" AC_MSG_CHECKING([if programs using libevent functions will link]) AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ #include ]], [[ event_base_new(); ]])], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ] ) # Search for OpenSSL saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" AC_ARG_WITH([libssl], [ --with-libssl=PATH Specify path to libssl installation ], [ if test "x$withval" != "xno"; then case "$withval" in # Relative paths ./*|../*) withval="`pwd`/$withval" esac if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi elif test -d "$withval/lib64"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" else LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi ] ) AC_SEARCH_LIBS([RAND_add], [crypto], [:], [ AC_MSG_ERROR([can't find libcrypto]) ]) AC_SEARCH_LIBS([SSL_CTX_new], [ssl], [:], [ AC_MSG_ERROR([can't find libssl]) ]) # Check arc4random only after libcrypto to avoid issues with old # (pre 3.8) versions of LibreSSL. AC_REPLACE_FUNCS([arc4random]) AC_CHECK_FUNCS([ \ SSL_CTX_use_certificate_chain_mem \ SSL_CTX_load_verify_mem \ X509_LOOKUP_mem \ OPENSSL_posix_to_tm \ OPENSSL_gmtime \ ]) AS_IF([test "x$ac_cv_func_OPENSSL_posix_to_tm" = xno], [ AM_CFLAGS="${AM_CFLAGS} -I\${top_srcdir}/openbsd-compat/openssl/" ]) # Sanity check OpenSSL headers AC_MSG_CHECKING([whether LibreSSL's headers match the library]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include #include #include ]], [[ exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); ]])], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) AC_MSG_ERROR([Your LibreSSL headers do not match your library.]) ], [ AC_MSG_WARN([cross compiling: not checking]) ] ) AC_CHECK_DECL([LIBRESSL_VERSION_NUMBER], , , [#include ]) dnl zlib is required AC_ARG_WITH([libz], [ --with-libz=PATH Specify path to libz installation], [ if test "x$withval" = "xno"; then AC_MSG_ERROR([*** zlib is required ***]) elif test "x$withval" != "xyes"; then if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi ] ) AC_CHECK_HEADER([zlib.h], ,[AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***])]) AC_SEARCH_LIBS([deflate], [z], [:], [ AC_MSG_ERROR([can't find zlib]) ]) AC_ARG_WITH([table-db], [ --with-table-db Enable building of table-db backend (default=no)], [ if test "x$withval" = "xyes"; then use_db_api=1 else use_db_api=0 fi ] ) if test "x$use_db_api" = "x1"; then # Search for libdb AC_CHECK_HEADER(db_185.h, [AC_DEFINE([HAVE_DB_185_H], [], [if you have the header file]) ] , [ AC_CHECK_HEADER(db.h, [AC_DEFINE([HAVE_DB_H], [], [if you have the header file]) ] , [ AC_CHECK_HEADER(db1/db.h, [AC_DEFINE([HAVE_DB1_DB_H], [], [if you have the header file]) ] , [ AC_MSG_ERROR([*** Can't find Berkeley DB headers (see config.log for details) ***]) ])])]) fi save_LIBS="$LIBS" if test "x$use_db_api" = "x1"; then DB_LIB= for libdb in db db1 c; do AC_CHECK_LIB($libdb, dbopen, [ DB_LIB="$libdb"; break; ], AC_CHECK_LIB($libdb, __db185_open, [ DB_LIB="$libdb"; break; ])) done if test -z "$DB_LIB"; then AC_MSG_ERROR([Berkeley DB not found or not built with --enable-185]) fi DB_LIB="-l$DB_LIB" AC_SUBST([DB_LIB]) fi LIBS="$save_LIBS" AM_CONDITIONAL([HAVE_DB_API], [test "x$use_db_api" = "x1"]) AM_COND_IF([HAVE_DB_API], [AC_DEFINE([HAVE_DB_API], [1], [Define to 1 if HAVE_DB_API])]) LIBS="$LIBS ${SMTPDLIBS}" dnl Adding -Werror to CFLAGS early prevents configure tests from running. dnl Add now. AM_CFLAGS="$AM_CFLAGS $werror_flags" AC_SUBST([AM_CFLAGS]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile mk/Makefile mk/mail/Makefile mk/mail/mail.lmtp/Makefile mk/mail/mail.maildir/Makefile mk/mail/mail.mboxfile/Makefile mk/mail/mail.mda/Makefile mk/smtpd/Makefile mk/smtpctl/Makefile mk/smtp/Makefile contrib/Makefile contrib/libexec/Makefile contrib/libexec/mail.local/Makefile contrib/libexec/lockspool/Makefile contrib/libexec/encrypt/Makefile openbsd-compat/Makefile ]) AC_OUTPUT opensmtpd-7.7.0p0/aclocal.m40000644000175000001440000015472715010115277011332 # generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, [m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_COND_IF -*- Autoconf -*- # Copyright (C) 2008-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_COND_IF # _AM_COND_ELSE # _AM_COND_ENDIF # -------------- # These macros are only used for tracing. m4_define([_AM_COND_IF]) m4_define([_AM_COND_ELSE]) m4_define([_AM_COND_ENDIF]) # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) # --------------------------------------- # If the shell condition COND is true, execute IF-TRUE, otherwise execute # IF-FALSE. Allow automake to learn about conditional instantiating macros # (the AC_CONFIG_FOOS). AC_DEFUN([AM_COND_IF], [m4_ifndef([_AM_COND_VALUE_$1], [m4_fatal([$0: no such condition "$1"])])dnl _AM_COND_IF([$1])dnl if test -z "$$1_TRUE"; then : m4_n([$2])[]dnl m4_ifval([$3], [_AM_COND_ELSE([$1])dnl else $3 ])dnl _AM_COND_ENDIF([$1])dnl fi[]dnl ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/aclocal-openssh.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) opensmtpd-7.7.0p0/install-sh0000744000175000001440000003610114764503774011477 #!/bin/sh # install - install a program, script, or datafile scriptversion=2023-11-23.18; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Report bugs to . GNU Automake home page: . General help using GNU software: ." while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: opensmtpd-7.7.0p0/README.md0000644000175000001440000002016315010115272010726 # OpenSMTPD [![Version](https://img.shields.io/badge/Version-7.7.0p0-brihtgreen.svg)](https://github.com/OpenSMTPD/OpenSMTPD/releases/tag/7.7.0p0) [![Coverity Scan analysis](https://scan.coverity.com/projects/278/badge.svg)](https://scan.coverity.com/projects/opensmtpd-opensmtpd) [![Packaging status](https://repology.org/badge/tiny-repos/opensmtpd.svg)](https://repology.org/project/opensmtpd/versions) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://www.isc.org/licenses/) > **Warning** > This repository may be out of date compared to [OpenBSD smtpd source code](https://cvsweb.openbsd.org/src/usr.sbin/smtpd/). Downstream package maintainers should be aware of this when backporting security fixes and other changes. OpenSMTPD is a FREE implementation of the server-side SMTP protocol as defined by [RFC 5321](https://tools.ietf.org/html/rfc5321), with some additional standard extensions. It allows ordinary machines to exchange e-mails with other systems speaking the SMTP protocol. OpenSMTPD runs on various [Unix](https://en.wikipedia.org/wiki/Unix) and Unix-like operating systems including: - Linux - [FreeBSD](https://www.freebsd.org) - [OpenBSD](https://www.openbsd.org) - [NetBSD](https://www.netbsd.org) - [DragonFlyBSD](https://www.dragonflybsd.org) - [macOS](https://en.wikipedia.org/wiki/MacOS) For more information: http://www.opensmtpd.org/portable.html If you are looking for a comprehensive manual on how to build your own mail server visit our [wiki](https://github.com/OpenSMTPD/OpenSMTPD/wiki). ## Get in touch If you want to stay up to day with most recent developments or chat about OpenSMTPD you can: - subscribe to our [mailing list](http://www.opensmtpd.org/list.html) - join the IRC channel: `#opensmtpd` @ [irc.libera.chat](https://libera.chat) - submit a bug report or a feature request here on [GitHub](https://github.com/OpenSMTPD/OpenSMTPD) - visit GitHub's [discussions page](https://github.com/OpenSMTPD/OpenSMTPD/discussions) ## Documentation The manual pages are available [online](https://www.opensmtpd.org/manual.html), which you are encouraged to contribute to. ## Install via package manager Many distributions already provide a packaged version of opensmtpd. All you need to do is install it via your package manager. > **Warning** Some distributions might ship old versions of OpenSMTPD, and some distributions may selectively backport security fixes and other code changes. ### Debian/Ubuntu sudo apt install opensmtpd ### Archlinux Has a [dedicated wiki page](https://wiki.archlinux.org/index.php/OpenSMTPD#Installation) ### Alpine Linux apk install opensmtpd ### Fedora yum install opensmtpd ### macOS OpenSMTPD is available from [MacPorts](https://www.macports.org): port install opensmtpd ## Install via container Container images available at [this repo's packages page.](https://github.com/orgs/OpenSMTPD/packages) ## Install from source ### Install dependencies OpenSMTPD relies on: - [pkgconf](https://github.com/pkgconf/pkgconf) or [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) - [libevent](http://libevent.org/) - [libressl](https://www.libressl.org/) or [OpenSSL](https://www.openssl.org/) When not building from a release tarball (e.g. from the git repository), the following dependencies are needed too: - [autoconf](http://www.gnu.org/software/autoconf/) - [automake](http://www.gnu.org/software/automake/) - [bison](http://www.gnu.org/software/bison/) or [byacc](http://invisible-island.net/byacc/byacc.html) - [libtool](http://www.gnu.org/software/libtool/) By default OpenSMTPD expects latest versions of all dependencies unless noted otherwise. Note that some distributions have different packages for a same library, you should always use the `-dev` or `-devel` package (for example, `libevent-dev` or `libevent-devel`) if you're going to build OpenSMTPD yourself. ### Get the source code Clone from github: git clone https://github.com/OpenSMTPD/OpenSMTPD.git [Download tarball](https://github.com/OpenSMTPD/OpenSMTPD/archive/7.6.0p1.tar.gz) Latest release can always be found [here](https://github.com/OpenSMTPD/OpenSMTPD/releases/latest) ### Compile cd opensmtpd* ./bootstrap # Only if you build from git sources ./configure make sudo make install #### Special notes for macOS Please launch configure with special directive about libevent directory: ./configure --with-libevent=/opt/local Though macOS includes a copy of bison in the bases system, you will need to install a more recent version from, e.g., MacPorts. ### Install sudo make install ### Setup historical interface OpenSMTPD provides a single utility `smtpctl` to control the daemon and the local submission subsystem. To accommodate systems that require historical interfaces such as `sendmail`, `newaliases` or `makemap`, the `smtpctl` utility can operate in compatibility mode if called with the historical name. On mailwrapper-enabled systems, this is achieved by editing `/etc/mailer.conf` and adding the following lines: sendmail /usr/sbin/smtpctl send-mail /usr/sbin/smtpctl mailq /usr/sbin/smtpctl makemap /usr/sbin/smtpctl newaliases /usr/sbin/smtpctl Whereas on systems that don't provide mailwrapper, it can be achieved by setting the appropriate symbolic links: ln -s /usr/sbin/smtpctl sendmail ln -s /usr/sbin/smtpctl send-mail ln -s /usr/sbin/smtpctl mailq ln -s /usr/sbin/smtpctl makemap ln -s /usr/sbin/smtpctl newaliases The OpenSMTPD project leaves it up to the package maintainers to setup the links in their packages as it is very hard for us to accommodate all systems with the preferred method in a clean way. ### Configure `/etc/smtpd.conf` Please have a look at the complete format description of `smtpd.conf` [configuration file](https://man.openbsd.org/smtpd.conf) ### Add OpenSMTPD users To operate, OpenSMTPD requires at least one user, by default `_smtpd`; and preferably two users, by default `_smtpd` and `_smtpq`. Using two users instead of one will increase security by a large factor so... if you want to voluntarily reduce security or you have absolute more faith in our code than we do, by all means use one. The instructions below assume the default users however, the configure script allows overriding these using the options: `--with-user-smtpd`, `--with-user-queue`, and `--with-group-queue`. #### NetBSD, Linux (Debian, Arch Linux, ...) mkdir /var/empty useradd -c "SMTP Daemon" -d /var/empty -s /sbin/nologin _smtpd useradd -c "SMTPD Queue" -d /var/empty -s /sbin/nologin _smtpq #### DragonFlyBSD, FreeBSD pw useradd _smtpd -c "SMTP Daemon" -d /var/empty -s /sbin/nologin pw useradd _smtpq -c "SMTPD Queue" -d /var/empty -s /sbin/nologin #### macOS First we need a group with an unused GID below `500`, list the current ones used: /usr/bin/dscl . -list /Groups PrimaryGroupID | sort -n -k2,2 Add a group - here we have picked `444`: /usr/bin/sudo /usr/bin/dscl . -create /Groups/_smtpd PrimaryGroupID 444 Then the user. Again we need an unused UID below `500`, list the current ones used: /usr/bin/dscl . -list /Users UniqueID | sort -n -k2,2 Add a user - here we have picked `444`: /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd UniqueID 444 /usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd AuthenticationAuthority /usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd PasswordPolicyOptions /usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd dsAttrTypeNative:KerberosKeys /usr/bin/sudo /usr/bin/dscl . -delete /Users/_smtpd dsAttrTypeNative:ShadowHashData /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd RealName "SMTP Daemon" /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd Password "*" /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd PrimaryGroupID 444 /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd NFSHomeDirectory /var/empty /usr/bin/sudo /usr/bin/dscl . -create /Users/_smtpd UserShell /usr/bin/false repeat for the `_smtpq` user. ### Launch smtpd First, kill any running sendmail/exim/qmail/postfix or other. Then: smtpd or in debug and verbose mode smtpd -dv opensmtpd-7.7.0p0/m4/0000755000175000001440000000000015010115321010040 5opensmtpd-7.7.0p0/m4/ltsugar.m40000444000175000001440000001045314764503772011736 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) opensmtpd-7.7.0p0/m4/ltoptions.m40000444000175000001440000003612114764503772012310 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 10 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --enable-aix-soname configure option, and support the # `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. # DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_ENABLE([aix-soname], [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $enableval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --enable-aix-soname]) ;; esac lt_cv_with_aix_soname=$enable_aix_soname], [_AC_ENABLE_IF([with], [aix-soname], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)]) enable_aix_soname=$lt_cv_with_aix_soname]) with_aix_soname=$enable_aix_soname AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --enable-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_ENABLE([pic], [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [dnl Continue to support --with-pic and --without-pic, for backward dnl compatibility. _AC_ENABLE_IF([with], [pic], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])])] ) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) opensmtpd-7.7.0p0/m4/libtool.m40000444000175000001440000113730514764503772011730 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2024 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 63 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), in case it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2024 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' AC_CACHE_CHECK([for -no_fixup_chains linker flag], [lt_cv_support_no_fixup_chains], [ save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" AC_LINK_IFELSE( [AC_LANG_PROGRAM([],[])], lt_cv_support_no_fixup_chains=yes, lt_cv_support_no_fixup_chains=no ) LDFLAGS=$save_LDFLAGS ] ) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains']) fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_REQUIRE([AC_PROG_RANLIB]) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[int test_pointer_size[sizeof (void *) - 5]; ]])], [shlibpath_var=LD_LIBRARY_PATH], [shlibpath_var=LD_32_LIBRARY_PATH]) ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" _LT_COMPILER_PIC($1)='-fPIC' _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(no_undefined_flag, $1)= ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool], [lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BCDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *-mlibc) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; serenity*) ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=no ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; *-mlibc) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; serenity*) ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e. impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=no ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; *-mlibc) _LT_TAGVAR(ld_shlibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; serenity*) ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. if test x-L = x"$p" || test x-R = x"$p" || test x-l = x"$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_PROG([FILECMD], [file], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS opensmtpd-7.7.0p0/m4/aclocal-openssh.m40000644000175000001440000001374314610663500013321 dnl OpenSSH-specific autoconf macros dnl dnl OSSH_CHECK_CFLAG_COMPILE(check_flag[, define_flag]) dnl Check that $CC accepts a flag 'check_flag'. If it is supported append dnl 'define_flag' to $CFLAGS. If 'define_flag' is not specified, then append dnl 'check_flag'. AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ AC_MSG_CHECKING([if $CC supports compile flag $1]) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR $1" _define_flag="$2" test "x$_define_flag" = "x" && _define_flag="$1" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } ]])], [ if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" else AC_MSG_RESULT([yes]) CFLAGS="$saved_CFLAGS $_define_flag" fi], [ AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" ] ) }]) dnl OSSH_CHECK_CFLAG_LINK(check_flag[, define_flag]) dnl Check that $CC accepts a flag 'check_flag'. If it is supported append dnl 'define_flag' to $CFLAGS. If 'define_flag' is not specified, then append dnl 'check_flag'. AC_DEFUN([OSSH_CHECK_CFLAG_LINK], [{ AC_MSG_CHECKING([if $CC supports compile flag $1 and linking succeeds]) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR $1" _define_flag="$2" test "x$_define_flag" = "x" && _define_flag="$1" AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long int p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } ]])], [ if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" else AC_MSG_RESULT([yes]) CFLAGS="$saved_CFLAGS $_define_flag" fi], [ AC_MSG_RESULT([no]) CFLAGS="$saved_CFLAGS" ] ) }]) dnl OSSH_CHECK_LDFLAG_LINK(check_flag[, define_flag]) dnl Check that $LD accepts a flag 'check_flag'. If it is supported append dnl 'define_flag' to $LDFLAGS. If 'define_flag' is not specified, then append dnl 'check_flag'. AC_DEFUN([OSSH_CHECK_LDFLAG_LINK], [{ AC_MSG_CHECKING([if $LD supports link flag $1]) saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $WERROR $1" _define_flag="$2" test "x$_define_flag" = "x" && _define_flag="$1" AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } ]])], [ if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then AC_MSG_RESULT([no]) LDFLAGS="$saved_LDFLAGS" else AC_MSG_RESULT([yes]) LDFLAGS="$saved_LDFLAGS $_define_flag" fi ], [ AC_MSG_RESULT([no]) LDFLAGS="$saved_LDFLAGS" ] ) }]) dnl OSSH_CHECK_HEADER_FOR_FIELD(field, header, symbol) dnl Does AC_EGREP_HEADER on 'header' for the string 'field' dnl If found, set 'symbol' to be defined. Cache the result. dnl TODO: This is not foolproof, better to compile and read from there AC_DEFUN([OSSH_CHECK_HEADER_FOR_FIELD], [ # look for field '$1' in header '$2' dnl This strips characters illegal to m4 from the header filename ossh_safe=`echo "$2" | sed 'y%./+-%__p_%'` dnl ossh_varname="ossh_cv_$ossh_safe""_has_"$1 AC_MSG_CHECKING(for $1 field in $2) AC_CACHE_VAL($ossh_varname, [ AC_EGREP_HEADER($1, $2, [ dnl eval "$ossh_varname=yes" dnl ], [ dnl eval "$ossh_varname=no" dnl ]) dnl ]) ossh_result=`eval 'echo $'"$ossh_varname"` if test -n "`echo $ossh_varname`"; then AC_MSG_RESULT($ossh_result) if test "x$ossh_result" = "xyes"; then AC_DEFINE($3, 1, [Define if you have $1 in $2]) fi else AC_MSG_RESULT(no) fi ]) dnl Check for socklen_t: historically on BSD it is an int, and in dnl POSIX 1g it is a type of its own, but some platforms use different dnl types for the argument to getsockopt, getpeername, etc. So we dnl have to test to find something that will work. AC_DEFUN([TYPE_SOCKLEN_T], [ AC_CHECK_TYPE([socklen_t], ,[ AC_MSG_CHECKING([for socklen_t equivalent]) AC_CACHE_VAL([curl_cv_socklen_t_equiv], [ # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #include #include int getpeername (int, $arg2 *, $t *); ]], [[ $t len; getpeername(0,0,&len); ]]) ],[ curl_cv_socklen_t_equiv="$t" break ]) done done if test "x$curl_cv_socklen_t_equiv" = x; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) fi ]) AC_MSG_RESULT($curl_cv_socklen_t_equiv) AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, [type to use in place of socklen_t if not defined])], [#include #include ]) ]) opensmtpd-7.7.0p0/m4/lt~obsolete.m40000444000175000001440000001400714764503772012626 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) opensmtpd-7.7.0p0/m4/ltversion.m40000444000175000001440000000131214764503772012274 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2024 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4441 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.5.4]) m4_define([LT_PACKAGE_REVISION], [2.5.4]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.5.4' macro_revision='2.5.4' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) opensmtpd-7.7.0p0/ar-lib0000555000175000001440000001336314764503774010574 #! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2019-07-04.01; # UTC # Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat < header file. */ #undef HAVE_ARPA_NAMESER_COMPAT_H /* OpenBSD's gcc has bounded */ #undef HAVE_ATTRIBUTE__BOUNDED__ /* Have attribute nonnull */ #undef HAVE_ATTRIBUTE__NONNULL__ /* OpenBSD's gcc has sentinel */ #undef HAVE_ATTRIBUTE__SENTINEL__ /* 1 if have basename */ #undef HAVE_BASENAME /* 1 if have clock_gettime */ #undef HAVE_CLOCK_GETTIME /* 1 if have closefrom */ #undef HAVE_CLOSEFROM /* closefrom returns an int */ #undef HAVE_CLOSEFROM_INT /* Define if your system uses ancillary data style file descriptor passing */ #undef HAVE_CONTROL_IN_MSGHDR /* 1 if have crypt */ #undef HAVE_CRYPT /* Define to 1 if you have the 'crypt_checkpass' function. */ #undef HAVE_CRYPT_CHECKPASS /* 1 if have crypt_gensalt */ #undef HAVE_CRYPT_GENSALT /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the 'daemon' function. */ #undef HAVE_DAEMON /* if you have the header file */ #undef HAVE_DB1_DB_H /* if you have the header file */ #undef HAVE_DB_185_H /* Define to 1 if HAVE_DB_API */ #undef HAVE_DB_API /* if you have the header file */ #undef HAVE_DB_H /* Define to 1 if you have the declaration of 'AF_LOCAL', and to 0 if you don't. */ #undef HAVE_DECL_AF_LOCAL /* Define to 1 if you have the declaration of 'altzone', and to 0 if you don't. */ #undef HAVE_DECL_ALTZONE /* Define to 1 if you have the declaration of 'IPPORT_HILASTAUTO', and to 0 if you don't. */ #undef HAVE_DECL_IPPORT_HILASTAUTO /* Define to 1 if you have the declaration of 'IPV6_ADDR_SCOPE_INTFACELOCAL', and to 0 if you don't. */ #undef HAVE_DECL_IPV6_ADDR_SCOPE_INTFACELOCAL /* Define to 1 if you have the declaration of 'LOG_PERROR', and to 0 if you don't. */ #undef HAVE_DECL_LOG_PERROR /* Define to 1 if you have the declaration of 'O_NONBLOCK', and to 0 if you don't. */ #undef HAVE_DECL_O_NONBLOCK /* Define to 1 if you have the declaration of 'PF_LOCAL', and to 0 if you don't. */ #undef HAVE_DECL_PF_LOCAL /* Define to 1 if you have the declaration of 'timezone', and to 0 if you don't. */ #undef HAVE_DECL_TIMEZONE /* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME /* Define to 1 if you have the declaration of 'WAIT_MYPGRP', and to 0 if you don't. */ #undef HAVE_DECL_WAIT_MYPGRP /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the 'dirfd' function. */ #undef HAVE_DIRFD /* 1 if have dirname */ #undef HAVE_DIRNAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ENDIAN_H /* Define to 1 if you have the 'errc' function. */ #undef HAVE_ERRC /* Define to 1 if you have the 'explicit_bzero' function. */ #undef HAVE_EXPLICIT_BZERO /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the 'fgetln' function. */ #undef HAVE_FGETLN /* 1 if have fmt_scaled */ #undef HAVE_FMT_SCALED /* 1 if have fparseln */ #undef HAVE_FPARSELN /* Define to 1 if you have the 'freezero' function. */ #undef HAVE_FREEZERO /* Define to 1 if the system has the type 'fsblkcnt_t'. */ #undef HAVE_FSBLKCNT_T /* Define to 1 if the system has the type 'fsfilcnt_t'. */ #undef HAVE_FSFILCNT_T /* 1 if have fts_open */ #undef HAVE_FTS_OPEN /* Define to 1 if you have the 'getdtablecount' function. */ #undef HAVE_GETDTABLECOUNT /* Define to 1 if you have the 'getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the 'getopt' function. */ #undef HAVE_GETOPT /* Define if your getopt(3) defines and uses optreset */ #undef HAVE_GETOPT_OPTRESET /* Define to 1 if you have the 'getpeereid' function. */ #undef HAVE_GETPEEREID /* Define to 1 if you have the 'getpeerucred' function. */ #undef HAVE_GETPEERUCRED /* Define to 1 if you have the 'getspnam' function. */ #undef HAVE_GETSPNAM /* 1 if have imsg_init */ #undef HAVE_IMSG_INIT /* 1 if have inet_net_pton */ #undef HAVE_INET_NET_PTON /* Define to 1 if the system has the type 'intmax_t'. */ #undef HAVE_INTMAX_T /* Define to 1 if the system has the type 'intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if the system has the type 'in_addr_t'. */ #undef HAVE_IN_ADDR_T /* Define to 1 if the system has the type 'in_port_t'. */ #undef HAVE_IN_PORT_T /* Define to 1 if you have the 'dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the header file. */ #undef HAVE_LIBKERN_OSBYTEORDER_H /* Define to 1 if you have the 'pam' library (-lpam). */ #undef HAVE_LIBPAM /* Define to 1 if you have the header file. */ #undef HAVE_LIBUTIL_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOGIN_CAP_H /* Define to 1 if the system has the type 'long double'. */ #undef HAVE_LONG_DOUBLE /* Define to 1 if the system has the type 'long long'. */ #undef HAVE_LONG_LONG /* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACH_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_MAILLOCK_H /* Define to 1 if you have the 'malloc_conceal' function. */ #undef HAVE_MALLOC_CONCEAL /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* M_DATA is defined in sys/stream.h included by netinet/in.h */ #undef HAVE_M_DATA /* Define to 1 if you have the 'nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the header file. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define if you have an old version of PAM which takes only one argument to pam_strerror */ #undef HAVE_OLD_PAM /* Define to 1 if you have the 'OPENSSL_gmtime' function. */ #undef HAVE_OPENSSL_GMTIME /* Define to 1 if you have the 'OPENSSL_posix_to_tm' function. */ #undef HAVE_OPENSSL_POSIX_TO_TM /* Define to 1 if you have the 'pam_getenvlist' function. */ #undef HAVE_PAM_GETENVLIST /* Define to 1 if you have the header file. */ #undef HAVE_PAM_PAM_APPL_H /* Define to 1 if you have the 'pam_putenv' function. */ #undef HAVE_PAM_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_PATHS_H /* 1 if have pidfile */ #undef HAVE_PIDFILE /* Define to 1 if you have the 'pipe2' function. */ #undef HAVE_PIPE2 /* Define to 1 if you have the 'pledge' function. */ #undef HAVE_PLEDGE /* Define if you have /proc/pid/fd */ #undef HAVE_PROC_PID /* Define to 1 if you have the 'reallocarray' function. */ #undef HAVE_REALLOCARRAY /* Define to 1 if you have the 'recallocarray' function. */ #undef HAVE_RECALLOCARRAY /* 1 if have res_9_b64_ntop */ #undef HAVE_RES_9_B64_NTOP /* 1 if have res_9_b64_pton */ #undef HAVE_RES_9_B64_PTON /* 1 if have res_hnok */ #undef HAVE_RES_HNOK /* 1 if have res_randomid */ #undef HAVE_RES_RANDOMID /* Define to 1 if the system has the type 'sa_family_t'. */ #undef HAVE_SA_FAMILY_T /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_H /* Define to 1 if you have the 'setegid' function. */ #undef HAVE_SETEGID /* Define to 1 if you have the 'seteuid' function. */ #undef HAVE_SETEUID /* Define to 1 if you have the 'setproctitle' function. */ #undef HAVE_SETPROCTITLE /* Define to 1 if you have the 'setresgid' function. */ #undef HAVE_SETRESGID /* Define to 1 if you have the 'setresuid' function. */ #undef HAVE_SETRESUID /* Define to 1 if you have the 'setreuid' function. */ #undef HAVE_SETREUID /* Define to 1 if you have the 'setsid' function. */ #undef HAVE_SETSID /* Define to 1 if you have the header file. */ #undef HAVE_SHADOW_H /* Define to 1 if you have the 'sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the 'signal' function. */ #undef HAVE_SIGNAL /* Define to 1 if the system has the type 'sig_atomic_t'. */ #undef HAVE_SIG_ATOMIC_T /* Define to 1 if you have the 'SSL_CTX_load_verify_mem' function. */ #undef HAVE_SSL_CTX_LOAD_VERIFY_MEM /* Define to 1 if you have the 'SSL_CTX_use_certificate_chain_mem' function. */ #undef HAVE_SSL_CTX_USE_CERTIFICATE_CHAIN_MEM /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the 'strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the 'strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the 'strmode' function. */ #undef HAVE_STRMODE /* Define to 1 if you have the 'strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the 'strnlen' function. */ #undef HAVE_STRNLEN /* Define to 1 if you have the 'strnvis' function. */ #undef HAVE_STRNVIS /* Define to 1 if you have the 'strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the 'strtonum' function. */ #undef HAVE_STRTONUM /* Define to 1 if the system has the type 'struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if 'd_type' is a member of 'struct DIR'. */ #undef HAVE_STRUCT_DIR_D_TYPE /* Define to 1 if the system has the type 'struct ifgroupreq'. */ #undef HAVE_STRUCT_IFGROUPREQ /* Define to 1 if the system has the type 'struct in6_addr'. */ #undef HAVE_STRUCT_IN6_ADDR /* Define to 1 if 'pw_change' is a member of 'struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_CHANGE /* Define to 1 if 'pw_class' is a member of 'struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_CLASS /* Define to 1 if 'pw_expire' is a member of 'struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_EXPIRE /* Define to 1 if 'pw_gecos' is a member of 'struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_GECOS /* Define to 1 if the system has the type 'struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6 /* Define to 1 if 'sin6_len' is a member of 'struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN /* Define to 1 if 'sin6_scope_id' is a member of 'struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID /* Define to 1 if 'sin_len' is a member of 'struct sockaddr_in'. */ #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN /* Define to 1 if 'sa_len' is a member of 'struct sockaddr'. */ #undef HAVE_STRUCT_SOCKADDR_SA_LEN /* Define to 1 if the system has the type 'struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if 'ss_family' is a member of 'struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY /* Define to 1 if 'ss_len' is a member of 'struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN /* Define to 1 if '__ss_family' is a member of 'struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY /* Define to 1 if 'f_favail' is a member of 'struct statfs'. */ #undef HAVE_STRUCT_STATFS_F_FAVAIL /* Define to 1 if 'st_flags' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_FLAGS /* Define to 1 if 'st_mtim' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM /* Define to 1 if 'st_mtimespec' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIMESPEC /* Define to 1 if the system has the type 'struct timespec'. */ #undef HAVE_STRUCT_TIMESPEC /* Define to 1 if the system has the type 'struct timeval'. */ #undef HAVE_STRUCT_TIMEVAL /* Define to 1 if 'tm_gmtoff' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF /* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* 1 if have suboptarg */ #undef HAVE_SUBOPTARG /* Define to 1 if you have the 'sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ENDIAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PSTAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the 'timingsafe_memcmp' function. */ #undef HAVE_TIMINGSAFE_MEMCMP /* Define to 1 if you have the header file. */ #undef HAVE_UCRED_H /* Define to 1 if the system has the type 'uintmax_t'. */ #undef HAVE_UINTMAX_T /* Define to 1 if the system has the type 'uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type 'unsigned long long'. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT /* Define to 1 if you have the 'usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the header file. */ #undef HAVE_UTIL_H /* Define to 1 if the system has the type 'u_char'. */ #undef HAVE_U_CHAR /* Define to 1 if the system has the type 'u_int'. */ #undef HAVE_U_INT /* Define if va_copy exists */ #undef HAVE_VA_COPY /* Define to 1 if you have the header file. */ #undef HAVE_VIS_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the 'X509_LOOKUP_mem' function. */ #undef HAVE_X509_LOOKUP_MEM /* 1 if have __b64_ntop */ #undef HAVE___B64_NTOP /* 1 if have __b64_pton */ #undef HAVE___B64_PTON /* Define if compiler implements __FUNCTION__ */ #undef HAVE___FUNCTION__ /* Define if libc defines __progname */ #undef HAVE___PROGNAME /* Define if __va_copy exists */ #undef HAVE___VA_COPY /* Define if compiler implements __func__ */ #undef HAVE___func__ /* 1 if have b64_ntop */ #undef HAVE_b64_NTOP /* 1 if have b64_pton */ #undef HAVE_b64_PTON /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Set this to your mail directory if you do not have _PATH_MAILDIR */ #undef MAIL_DIRECTORY /* OpenBSD doesn't need ASR_FREEADDRINFO */ #undef NOOP_ASR_FREEADDRINFO /* compiler does not accept __attribute__ on return types */ #undef NO_ATTRIBUTE_ON_RETURN_TYPE /* Custom path to a CA file */ #undef OPENSMTPD_CA_FILE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Specify location of spooler */ #undef PATH_SPOOL /* define if seteuid breaks setuid */ #undef SETEUID_BREAKS_SETUID /* The size of 'int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of 'long int', as computed by sizeof. */ #undef SIZEOF_LONG_INT /* The size of 'long long int', as computed by sizeof. */ #undef SIZEOF_LONG_LONG_INT /* The size of 'short int', as computed by sizeof. */ #undef SIZEOF_SHORT_INT /* Specify location of smtpd.pid */ #undef SMTPD_PIDDIR /* non-privileged group for queue process */ #undef SMTPD_QUEUE_GROUP /* non-privileged user for queue process */ #undef SMTPD_QUEUE_USER /* Specify location of smtpd.sock */ #undef SMTPD_SOCKDIR /* non-privileged user for privilege separation */ #undef SMTPD_USER /* Define to a Set Process Title type if your system is supported by bsd-setproctitle.c */ #undef SPT_TYPE /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define if you want to enable PAM support */ #undef USE_PAM /* pam service */ #undef USE_PAM_SERVICE /* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by C23 Annex F. */ #ifndef __STDC_WANT_IEC_60559_EXT__ # undef __STDC_WANT_IEC_60559_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define as 'int' if doesn't define. */ #undef gid_t /* Define to '__inline__' or '__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to the widest signed integer type if and do not define. */ #undef intmax_t /* Define to the type of a signed integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef intptr_t /* Define to 'int' if does not define. */ #undef mode_t /* Define to 'long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define as 'unsigned int' if doesn't define. */ #undef size_t /* type to use in place of socklen_t if not defined */ #undef socklen_t /* Define as 'int' if doesn't define. */ #undef ssize_t /* Define as 'int' if doesn't define. */ #undef uid_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define to the widest unsigned integer type if and do not define. */ #undef uintmax_t /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t opensmtpd-7.7.0p0/configure0000755000175000001440000253503315010115300011357 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for OpenSMTPD-portable 7.7.0p0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and bugs@opensmtpd.org $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi ;; esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' t clear :clear s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OpenSMTPD-portable' PACKAGE_TARNAME='opensmtpd' PACKAGE_VERSION='7.7.0p0' PACKAGE_STRING='OpenSMTPD-portable 7.7.0p0' PACKAGE_BUGREPORT='bugs@opensmtpd.org' PACKAGE_URL='https://www.opensmtpd.org' ac_config_libobj_dir=openbsd-compat # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS AM_CFLAGS HAVE_DB_API_FALSE HAVE_DB_API_TRUE DB_LIB piddir sockdir PRIVSEP_PATH spooldir SMTPD_QUEUE_GROUP SMTPD_QUEUE_USER SMTPD_USER USE_PAM_SERVICE mansubdir MANTYPE NEED_LIBASR_FALSE NEED_LIBASR_TRUE LIBOBJS pkglibexecdir LIBBSD_LIBS LIBBSD_CFLAGS ZCAT CHOWN CHMOD CAT LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL YFLAGS YACC PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG EGREP GREP ac_ct_AR AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static enable_pic with_pic enable_fast_install enable_aix_soname with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_libbsd with_rpath with_cflags with_cppflags with_ldflags with_Werror with_pie with_mantype with_auth_bsdauth with_auth_pam with_user_smtpd with_user_queue with_group_queue with_path_queue with_path_empty with_path_mbox with_path_socket with_path_pidfile with_path_CAfile with_libfts with_libevent with_libssl with_libz with_table_db ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR YACC YFLAGS LT_SYS_LIBRARY_PATH LIBBSD_CFLAGS LIBBSD_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: '$ac_option' Try '$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # 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 OpenSMTPD-portable 7.7.0p0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, 'make install' will install all the files in '$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify an installation prefix other than '$ac_default_prefix' using '--prefix', for instance '--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/opensmtpd] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of OpenSMTPD-portable 7.7.0p0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --without-libbsd Disable libbsd usage --without-rpath Disable auto-added -R linker paths --with-cflags Specify additional flags to pass to compiler --with-cppflags Specify additional flags to pass to preprocessor --with-ldflags Specify additional flags to pass to linker --with-Werror Build main code with -Werror --with-pie Build Position Independent Executables if possible --with-mantype=man|cat|doc Set man page type --with-auth-bsdauth Enable bsd_auth(3) authentication support --with-auth-pam=SERVICE Enable PAM authentication support (default=smtpd) --with-user-smtpd=user Specify non-privileged user for smtpd (default=_smtpd) --with-user-queue=user Specify non-privileged user for queue process (default=_smtpq) --with-group-queue=group Specify non-privileged group for offline queue (default=_smtpq) --with-path-queue=PATH Specify path to queue directory (default=/var/spool/smtpd) --with-path-empty=PATH Specify path to empty directory (default=/var/empty) --with-path-mbox=PATH Specify path to mbox directory (default=/var/spool/mail) --with-path-socket=PATH Specify path to smtpd.sock directory (default=/var/run) --with-path-pidfile=PATH Specify path to smtpd.pid directory (default=/var/run) --with-path-CAfile=FILE Specify path to CA certificate --with-libfts=PATH Specify path to libfts installation (default: none, part of libc) --with-libevent=PATH Specify path to libevent installation --with-libssl=PATH Specify path to libssl installation --with-libz=PATH Specify path to libz installation --with-table-db Enable building of table-db backend (default=no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path YACC The 'Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: 'bison -y', 'byacc', 'yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of '-d' given by some make applications. LT_SYS_LIBRARY_PATH User-defined run-time library search path. LIBBSD_CFLAGS C compiler flags for LIBBSD, overriding pkg-config LIBBSD_LIBS linker flags for LIBBSD, overriding pkg-config Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . OpenSMTPD-portable home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF OpenSMTPD-portable configure 7.7.0p0 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break else case e in #( e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break else case e in #( e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) ac_lo= ac_hi= ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid else case e in #( e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval (void) { return $2; } static unsigned long int ulongval (void) { return $2; } #include #include int main (void) { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &5 printf %s "checking for int$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else case e in #( e) break ;; esac fi done ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else case e in #( e) break ;; esac fi done ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else case e in #( e) eval "$4=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac 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 OpenSMTPD-portable $as_me 7.7.0p0, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See 'config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" # Auxiliary files required by this configure script. ac_aux_files="ltmain.sh ar-lib compile missing install-sh config.guess config.sub" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir ;; esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='opensmtpd' VERSION='7.7.0p0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. # So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See 'config.log' for more details" "$LINENO" 5; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) # catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will # work properly (i.e., refer to 'conftest.exe'), while it won't with # 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See 'config.log' for more details" "$LINENO" 5; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else case e in #( e) ac_cv_safe_to_define___extensions__=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else case e in #( e) MINIX= ;; esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 printf %s "checking the archiver ($AR) interface... " >&6; } if test ${am_cv_ar_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO" then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo (void) {return 0; } $ac_kw foo_t foo (void) {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 printf "%s\n" "$YACC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.5.4' macro_revision='2.5.4' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 printf %s "checking for -no_fixup_chains linker flag... " >&6; } if test ${lt_cv_support_no_fixup_chains+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_support_no_fixup_chains=yes else case e in #( e) lt_cv_support_no_fixup_chains=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_static=yes ;; esac fi # Check whether --enable-pic was given. if test ${enable_pic+y} then : enableval=$enable_pic; lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --enable-aix-soname was given. if test ${enable_aix_soname+y} then : enableval=$enable_aix_soname; case $enableval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$enable_aix_soname else case e in #( e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi ;; esac fi enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; *-mlibc) archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; serenity*) ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_c_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi ='-fPIC' archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc=no no_undefined_flag= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CAT+y} then : printf %s "(cached) " >&6 else case e in #( e) case $CAT in [\\/]* | ?:[\\/]*) ac_cv_path_CAT="$CAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_CAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5 printf "%s\n" "$CAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CHMOD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $CHMOD in [\\/]* | ?:[\\/]*) ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_CHMOD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi CHMOD=$ac_cv_path_CHMOD if test -n "$CHMOD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CHMOD" >&5 printf "%s\n" "$CHMOD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "chown", so it can be a program name with args. set dummy chown; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CHOWN+y} then : printf %s "(cached) " >&6 else case e in #( e) case $CHOWN in [\\/]* | ?:[\\/]*) ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_CHOWN="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi CHOWN=$ac_cv_path_CHOWN if test -n "$CHOWN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CHOWN" >&5 printf "%s\n" "$CHOWN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "zcat", so it can be a program name with args. set dummy zcat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ZCAT+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ZCAT in [\\/]* | ?:[\\/]*) ac_cv_path_ZCAT="$ZCAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ZCAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi ZCAT=$ac_cv_path_ZCAT if test -n "$ZCAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ZCAT" >&5 printf "%s\n" "$ZCAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 printf "%s\n" "$SED" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # use libbsd by default; these needs to precede any other check, as we # might not need a compat function when using libbsd. # Check whether --with-libbsd was given. if test ${with_libbsd+y} then : withval=$with_libbsd; fi if test "x$with_libbsd" != xno then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbsd-overlay libbsd-ctor" >&5 printf %s "checking for libbsd-overlay libbsd-ctor... " >&6; } if test -n "$LIBBSD_CFLAGS"; then pkg_cv_LIBBSD_CFLAGS="$LIBBSD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd-overlay libbsd-ctor\""; } >&5 ($PKG_CONFIG --exists --print-errors "libbsd-overlay libbsd-ctor") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBSD_CFLAGS=`$PKG_CONFIG --cflags "libbsd-overlay libbsd-ctor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBBSD_LIBS"; then pkg_cv_LIBBSD_LIBS="$LIBBSD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd-overlay libbsd-ctor\""; } >&5 ($PKG_CONFIG --exists --print-errors "libbsd-overlay libbsd-ctor") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBBSD_LIBS=`$PKG_CONFIG --libs "libbsd-overlay libbsd-ctor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBBSD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbsd-overlay libbsd-ctor" 2>&1` else LIBBSD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbsd-overlay libbsd-ctor" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBBSD_PKG_ERRORS" >&5 if test "x$with_libbsd" = "xyes" then : as_fn_error $? "libbsd requested but not found" "$LINENO" 5 fi elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if test "x$with_libbsd" = "xyes" then : as_fn_error $? "libbsd requested but not found" "$LINENO" 5 fi else LIBBSD_CFLAGS=$pkg_cv_LIBBSD_CFLAGS LIBBSD_LIBS=$pkg_cv_LIBBSD_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$LIBBSD_CFLAGS $CFLAGS" LDFLAGS="$LIBBSD_LIBS $LDFLAGS" fi fi need_dash_r= need_libasr=yes pkglibexecdir="$libexecdir/opensmtpd" case "$host" in #( *-*-darwin*) : use_pie=auto printf "%s\n" "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h printf "%s\n" "#define BROKEN_SETREUID 1" >>confdefs.h printf "%s\n" "#define BROKEN_SETREGID 1" >>confdefs.h printf "%s\n" "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h ;; #( *-*-linux* | *-gnu* | *-k*bsd*-gnu*) : use_pie=auto printf "%s\n" "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h ;; #( *-*-netbsd*) : need_dash_r=yes AM_CFLAGS="$AM_CFLAGS -D_OPENBSD_SOURCE" ;; #( *-*-openbsd*) : use_pie=auto need_libasr=no pkglibexecdir="$libexecdir/smtpd" printf "%s\n" "#define HAVE_ATTRIBUTE__SENTINEL__ 1" >>confdefs.h printf "%s\n" "#define HAVE_ATTRIBUTE__BOUNDED__ 1" >>confdefs.h printf "%s\n" "#define NOOP_ASR_FREEADDRINFO 0" >>confdefs.h ;; #( *-sun-solaris*) : printf "%s\n" "#define HAVE_M_DATA 1" >>confdefs.h ;; #( *) : ;; esac # XXX arc4random is checked later since some old (pre 3.8) versions of # LibreSSL provide this symbol mistakenly. ac_fn_c_check_func "$LINENO" "basename" "ac_cv_func_basename" if test "x$ac_cv_func_basename" = xyes then : printf "%s\n" "#define HAVE_BASENAME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" basename.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS basename.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes then : printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" clock_gettime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS clock_gettime.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "closefrom" "ac_cv_func_closefrom" if test "x$ac_cv_func_closefrom" = xyes then : printf "%s\n" "#define HAVE_CLOSEFROM 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" closefrom.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS closefrom.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "crypt_checkpass" "ac_cv_func_crypt_checkpass" if test "x$ac_cv_func_crypt_checkpass" = xyes then : printf "%s\n" "#define HAVE_CRYPT_CHECKPASS 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" crypt_checkpass.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS crypt_checkpass.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" if test "x$ac_cv_func_daemon" = xyes then : printf "%s\n" "#define HAVE_DAEMON 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" daemon.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS daemon.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "dirname" "ac_cv_func_dirname" if test "x$ac_cv_func_dirname" = xyes then : printf "%s\n" "#define HAVE_DIRNAME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" dirname.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dirname.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "errc" "ac_cv_func_errc" if test "x$ac_cv_func_errc" = xyes then : printf "%s\n" "#define HAVE_ERRC 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" errc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS errc.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero" if test "x$ac_cv_func_explicit_bzero" = xyes then : printf "%s\n" "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" explicit_bzero.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS explicit_bzero.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "fgetln" "ac_cv_func_fgetln" if test "x$ac_cv_func_fgetln" = xyes then : printf "%s\n" "#define HAVE_FGETLN 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" fgetln.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fgetln.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "freezero" "ac_cv_func_freezero" if test "x$ac_cv_func_freezero" = xyes then : printf "%s\n" "#define HAVE_FREEZERO 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" freezero.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS freezero.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getdtablecount" "ac_cv_func_getdtablecount" if test "x$ac_cv_func_getdtablecount" = xyes then : printf "%s\n" "#define HAVE_GETDTABLECOUNT 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getdtablecount.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getdtablecount.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes then : printf "%s\n" "#define HAVE_GETDTABLESIZE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getdtablesize.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getdtablesize.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" if test "x$ac_cv_func_getopt" = xyes then : printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "getpeereid" "ac_cv_func_getpeereid" if test "x$ac_cv_func_getpeereid" = xyes then : printf "%s\n" "#define HAVE_GETPEEREID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getpeereid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getpeereid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" nanosleep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS nanosleep.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" if test "x$ac_cv_func_pipe2" = xyes then : printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" pipe2.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS pipe2.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray" if test "x$ac_cv_func_reallocarray" = xyes then : printf "%s\n" "#define HAVE_REALLOCARRAY 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" reallocarray.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS reallocarray.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "recallocarray" "ac_cv_func_recallocarray" if test "x$ac_cv_func_recallocarray" = xyes then : printf "%s\n" "#define HAVE_RECALLOCARRAY 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" recallocarray.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS recallocarray.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "res_hnok" "ac_cv_func_res_hnok" if test "x$ac_cv_func_res_hnok" = xyes then : printf "%s\n" "#define HAVE_RES_HNOK 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" res_hnok.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS res_hnok.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "seteuid" "ac_cv_func_seteuid" if test "x$ac_cv_func_seteuid" = xyes then : printf "%s\n" "#define HAVE_SETEUID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" seteuid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS seteuid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "setegid" "ac_cv_func_setegid" if test "x$ac_cv_func_setegid" = xyes then : printf "%s\n" "#define HAVE_SETEGID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" setegid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS setegid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes then : printf "%s\n" "#define HAVE_SETPROCTITLE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" setproctitle.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS setproctitle.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" if test "x$ac_cv_func_setresuid" = xyes then : printf "%s\n" "#define HAVE_SETRESUID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" setresuid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS setresuid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid" if test "x$ac_cv_func_setresgid" = xyes then : printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" setresgid.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS setresgid.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "signal" "ac_cv_func_signal" if test "x$ac_cv_func_signal" = xyes then : printf "%s\n" "#define HAVE_SIGNAL 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" signal.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS signal.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes then : printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes then : printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strlcat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcat.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strmode" "ac_cv_func_strmode" if test "x$ac_cv_func_strmode" = xyes then : printf "%s\n" "#define HAVE_STRMODE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strmode.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strmode.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes then : printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strndup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strndup.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" if test "x$ac_cv_func_strnlen" = xyes then : printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strnlen.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" if test "x$ac_cv_func_strsep" = xyes then : printf "%s\n" "#define HAVE_STRSEP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strsep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strsep.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "strtonum" "ac_cv_func_strtonum" if test "x$ac_cv_func_strtonum" = xyes then : printf "%s\n" "#define HAVE_STRTONUM 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" strtonum.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtonum.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "timingsafe_memcmp" "ac_cv_func_timingsafe_memcmp" if test "x$ac_cv_func_timingsafe_memcmp" = xyes then : printf "%s\n" "#define HAVE_TIMINGSAFE_MEMCMP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" timingsafe_memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS timingsafe_memcmp.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes then : printf "%s\n" "#define HAVE_USLEEP 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" usleep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS usleep.$ac_objext" ;; esac ;; esac fi # TODO: add vasprintf to the above ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" if test "x$ac_cv_func_dirfd" = xyes then : printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getpeerucred" "ac_cv_func_getpeerucred" if test "x$ac_cv_func_getpeerucred" = xyes then : printf "%s\n" "#define HAVE_GETPEERUCRED 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getspnam" "ac_cv_func_getspnam" if test "x$ac_cv_func_getspnam" = xyes then : printf "%s\n" "#define HAVE_GETSPNAM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "malloc_conceal" "ac_cv_func_malloc_conceal" if test "x$ac_cv_func_malloc_conceal" = xyes then : printf "%s\n" "#define HAVE_MALLOC_CONCEAL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pledge" "ac_cv_func_pledge" if test "x$ac_cv_func_pledge" = xyes then : printf "%s\n" "#define HAVE_PLEDGE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setreuid" "ac_cv_func_setreuid" if test "x$ac_cv_func_setreuid" = xyes then : printf "%s\n" "#define HAVE_SETREUID 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" if test "x$ac_cv_func_setsid" = xyes then : printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" if test "x$ac_cv_func_sigaction" = xyes then : printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strnvis" "ac_cv_func_strnvis" if test "x$ac_cv_func_strnvis" = xyes then : printf "%s\n" "#define HAVE_STRNVIS 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes then : printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "arpa/nameser_compat.h" "ac_cv_header_arpa_nameser_compat_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_nameser_compat_h" = xyes then : printf "%s\n" "#define HAVE_ARPA_NAMESER_COMPAT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" if test "x$ac_cv_header_crypt_h" = xyes then : printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" if test "x$ac_cv_header_dirent_h" = xyes then : printf "%s\n" "#define HAVE_DIRENT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" if test "x$ac_cv_header_endian_h" = xyes then : printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes then : printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libkern/OSByteOrder.h" "ac_cv_header_libkern_OSByteOrder_h" "$ac_includes_default" if test "x$ac_cv_header_libkern_OSByteOrder_h" = xyes then : printf "%s\n" "#define HAVE_LIBKERN_OSBYTEORDER_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default" if test "x$ac_cv_header_libutil_h" = xyes then : printf "%s\n" "#define HAVE_LIBUTIL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes then : printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "login_cap.h" "ac_cv_header_login_cap_h" "$ac_includes_default" if test "x$ac_cv_header_login_cap_h" = xyes then : printf "%s\n" "#define HAVE_LOGIN_CAP_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "mach/mach_time.h" "ac_cv_header_mach_mach_time_h" "$ac_includes_default" if test "x$ac_cv_header_mach_mach_time_h" = xyes then : printf "%s\n" "#define HAVE_MACH_MACH_TIME_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "maillock.h" "ac_cv_header_maillock_h" "$ac_includes_default" if test "x$ac_cv_header_maillock_h" = xyes then : printf "%s\n" "#define HAVE_MAILLOCK_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "ndir.h" "ac_cv_header_ndir_h" "$ac_includes_default" if test "x$ac_cv_header_ndir_h" = xyes then : printf "%s\n" "#define HAVE_NDIR_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes then : printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "pam/pam_appl.h" "ac_cv_header_pam_pam_appl_h" "$ac_includes_default" if test "x$ac_cv_header_pam_pam_appl_h" = xyes then : printf "%s\n" "#define HAVE_PAM_PAM_APPL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "paths.h" "ac_cv_header_paths_h" "$ac_includes_default" if test "x$ac_cv_header_paths_h" = xyes then : printf "%s\n" "#define HAVE_PATHS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default" if test "x$ac_cv_header_security_pam_appl_h" = xyes then : printf "%s\n" "#define HAVE_SECURITY_PAM_APPL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default" if test "x$ac_cv_header_shadow_h" = xyes then : printf "%s\n" "#define HAVE_SHADOW_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default" if test "x$ac_cv_header_sys_bitypes_h" = xyes then : printf "%s\n" "#define HAVE_SYS_BITYPES_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/dir.h" "ac_cv_header_sys_dir_h" "$ac_includes_default" if test "x$ac_cv_header_sys_dir_h" = xyes then : printf "%s\n" "#define HAVE_SYS_DIR_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" if test "x$ac_cv_header_sys_endian_h" = xyes then : printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" if test "x$ac_cv_header_sys_file_h" = xyes then : printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mount_h" = xyes then : printf "%s\n" "#define HAVE_SYS_MOUNT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ndir.h" "ac_cv_header_sys_ndir_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ndir_h" = xyes then : printf "%s\n" "#define HAVE_SYS_NDIR_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/pstat.h" "ac_cv_header_sys_pstat_h" "$ac_includes_default" if test "x$ac_cv_header_sys_pstat_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PSTAT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/statfs.h" "ac_cv_header_sys_statfs_h" "$ac_includes_default" if test "x$ac_cv_header_sys_statfs_h" = xyes then : printf "%s\n" "#define HAVE_SYS_STATFS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" if test "x$ac_cv_header_sys_statvfs_h" = xyes then : printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" if test "x$ac_cv_header_sys_un_h" = xyes then : printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "ucred.h" "ac_cv_header_ucred_h" "$ac_includes_default" if test "x$ac_cv_header_ucred_h" = xyes then : printf "%s\n" "#define HAVE_UCRED_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "util.h" "ac_cv_header_util_h" "$ac_includes_default" if test "x$ac_cv_header_util_h" = xyes then : printf "%s\n" "#define HAVE_UTIL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "vis.h" "ac_cv_header_vis_h" "$ac_includes_default" if test "x$ac_cv_header_vis_h" = xyes then : printf "%s\n" "#define HAVE_VIS_H 1" >>confdefs.h fi if test "x$need_libasr" = xyes then : AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/libasr" fi if test "x$need_libasr" = xyes; then NEED_LIBASR_TRUE= NEED_LIBASR_FALSE='#' else NEED_LIBASR_TRUE='#' NEED_LIBASR_FALSE= fi if test "x$ac_cv_func_errc" = xno then : AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/err_h" fi if test "x$ac_cv_header_paths_h" = xno then : AM_CFLAGS="$AM_CFLAGS -I\${top_srcdir}/openbsd-compat/paths_h" fi # check for functions that may be provided by a library; need to do # this *after* the libc/libbsd things to avoid picking up unwanted # symbols from libraries. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing basename" >&5 printf %s "checking for library containing basename... " >&6; } if test ${ac_cv_search_basename+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char basename (void); int main (void) { return basename (); ; return 0; } _ACEOF for ac_lib in '' gen do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_basename=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_basename+y} then : break fi done if test ${ac_cv_search_basename+y} then : else case e in #( e) ac_cv_search_basename=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_basename" >&5 printf "%s\n" "$ac_cv_search_basename" >&6; } ac_res=$ac_cv_search_basename if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_BASENAME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" basename.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS basename.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 printf %s "checking for library containing clock_gettime... " >&6; } if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char clock_gettime (void); int main (void) { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_clock_gettime+y} then : break fi done if test ${ac_cv_search_clock_gettime+y} then : else case e in #( e) ac_cv_search_clock_gettime=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" clock_gettime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS clock_gettime.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing closefrom" >&5 printf %s "checking for library containing closefrom... " >&6; } if test ${ac_cv_search_closefrom+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char closefrom (void); int main (void) { return closefrom (); ; return 0; } _ACEOF for ac_lib in '' gen do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_closefrom=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_closefrom+y} then : break fi done if test ${ac_cv_search_closefrom+y} then : else case e in #( e) ac_cv_search_closefrom=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_closefrom" >&5 printf "%s\n" "$ac_cv_search_closefrom" >&6; } ac_res=$ac_cv_search_closefrom if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_CLOSEFROM 1" >>confdefs.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int r = closefrom(0); int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define HAVE_CLOSEFROM_INT 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext else case e in #( e) case " $LIBOBJS " in *" closefrom.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS closefrom.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 printf %s "checking for library containing crypt... " >&6; } if test ${ac_cv_search_crypt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char crypt (void); int main (void) { return crypt (); ; return 0; } _ACEOF for ac_lib in '' crypt do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_crypt=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_crypt+y} then : break fi done if test ${ac_cv_search_crypt+y} then : else case e in #( e) ac_cv_search_crypt=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 printf "%s\n" "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_CRYPT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt_gensalt" >&5 printf %s "checking for library containing crypt_gensalt... " >&6; } if test ${ac_cv_search_crypt_gensalt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char crypt_gensalt (void); int main (void) { return crypt_gensalt (); ; return 0; } _ACEOF for ac_lib in '' crypt do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_crypt_gensalt=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_crypt_gensalt+y} then : break fi done if test ${ac_cv_search_crypt_gensalt+y} then : else case e in #( e) ac_cv_search_crypt_gensalt=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt_gensalt" >&5 printf "%s\n" "$ac_cv_search_crypt_gensalt" >&6; } ac_res=$ac_cv_search_crypt_gensalt if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_CRYPT_GENSALT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dirname" >&5 printf %s "checking for library containing dirname... " >&6; } if test ${ac_cv_search_dirname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dirname (void); int main (void) { return dirname (); ; return 0; } _ACEOF for ac_lib in '' gen do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dirname=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dirname+y} then : break fi done if test ${ac_cv_search_dirname+y} then : else case e in #( e) ac_cv_search_dirname=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dirname" >&5 printf "%s\n" "$ac_cv_search_dirname" >&6; } ac_res=$ac_cv_search_dirname if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_DIRNAME 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" dirname.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dirname.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing fmt_scaled" >&5 printf %s "checking for library containing fmt_scaled... " >&6; } if test ${ac_cv_search_fmt_scaled+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char fmt_scaled (void); int main (void) { return fmt_scaled (); ; return 0; } _ACEOF for ac_lib in '' util do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_fmt_scaled=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_fmt_scaled+y} then : break fi done if test ${ac_cv_search_fmt_scaled+y} then : else case e in #( e) ac_cv_search_fmt_scaled=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmt_scaled" >&5 printf "%s\n" "$ac_cv_search_fmt_scaled" >&6; } ac_res=$ac_cv_search_fmt_scaled if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_FMT_SCALED 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" fmt_scaled.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fmt_scaled.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing fparseln" >&5 printf %s "checking for library containing fparseln... " >&6; } if test ${ac_cv_search_fparseln+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char fparseln (void); int main (void) { return fparseln (); ; return 0; } _ACEOF for ac_lib in '' util do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_fparseln=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_fparseln+y} then : break fi done if test ${ac_cv_search_fparseln+y} then : else case e in #( e) ac_cv_search_fparseln=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fparseln" >&5 printf "%s\n" "$ac_cv_search_fparseln" >&6; } ac_res=$ac_cv_search_fparseln if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_FPARSELN 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" fparseln.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fparseln.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing fts_open" >&5 printf %s "checking for library containing fts_open... " >&6; } if test ${ac_cv_search_fts_open+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char fts_open (void); int main (void) { return fts_open (); ; return 0; } _ACEOF for ac_lib in '' fts do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_fts_open=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_fts_open+y} then : break fi done if test ${ac_cv_search_fts_open+y} then : else case e in #( e) ac_cv_search_fts_open=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fts_open" >&5 printf "%s\n" "$ac_cv_search_fts_open" >&6; } ac_res=$ac_cv_search_fts_open if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_FTS_OPEN 1" >>confdefs.h else case e in #( e) as_fn_error $? "can't find fts_open(); please install libfts" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_net_pton" >&5 printf %s "checking for library containing inet_net_pton... " >&6; } if test ${ac_cv_search_inet_net_pton+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char inet_net_pton (void); int main (void) { return inet_net_pton (); ; return 0; } _ACEOF for ac_lib in '' resorv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_inet_net_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_inet_net_pton+y} then : break fi done if test ${ac_cv_search_inet_net_pton+y} then : else case e in #( e) ac_cv_search_inet_net_pton=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_net_pton" >&5 printf "%s\n" "$ac_cv_search_inet_net_pton" >&6; } ac_res=$ac_cv_search_inet_net_pton if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_INET_NET_PTON 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" inet_net_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS inet_net_pton.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing imsg_init" >&5 printf %s "checking for library containing imsg_init... " >&6; } if test ${ac_cv_search_imsg_init+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char imsg_init (void); int main (void) { return imsg_init (); ; return 0; } _ACEOF for ac_lib in '' util imsg do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_imsg_init=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_imsg_init+y} then : break fi done if test ${ac_cv_search_imsg_init+y} then : else case e in #( e) ac_cv_search_imsg_init=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_imsg_init" >&5 printf "%s\n" "$ac_cv_search_imsg_init" >&6; } ac_res=$ac_cv_search_imsg_init if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_IMSG_INIT 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" imsg.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS imsg.$ac_objext" ;; esac case " $LIBOBJS " in *" imsg-buffer.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS imsg-buffer.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing pidfile" >&5 printf %s "checking for library containing pidfile... " >&6; } if test ${ac_cv_search_pidfile+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pidfile (void); int main (void) { return pidfile (); ; return 0; } _ACEOF for ac_lib in '' util do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_pidfile=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_pidfile+y} then : break fi done if test ${ac_cv_search_pidfile+y} then : else case e in #( e) ac_cv_search_pidfile=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pidfile" >&5 printf "%s\n" "$ac_cv_search_pidfile" >&6; } ac_res=$ac_cv_search_pidfile if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_PIDFILE 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" pidfile.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS pidfile.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_hnok" >&5 printf %s "checking for library containing res_hnok... " >&6; } if test ${ac_cv_search_res_hnok+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char res_hnok (void); int main (void) { return res_hnok (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_res_hnok=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_res_hnok+y} then : break fi done if test ${ac_cv_search_res_hnok+y} then : else case e in #( e) ac_cv_search_res_hnok=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_hnok" >&5 printf "%s\n" "$ac_cv_search_res_hnok" >&6; } ac_res=$ac_cv_search_res_hnok if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_RES_HNOK 1" >>confdefs.h else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_hnok" >&5 printf %s "checking for library containing res_9_hnok... " >&6; } if test ${ac_cv_search_res_9_hnok+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char res_9_hnok (void); int main (void) { return res_9_hnok (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_res_9_hnok=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_res_9_hnok+y} then : break fi done if test ${ac_cv_search_res_9_hnok+y} then : else case e in #( e) ac_cv_search_res_9_hnok=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_hnok" >&5 printf "%s\n" "$ac_cv_search_res_9_hnok" >&6; } ac_res=$ac_cv_search_res_9_hnok if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_RES_HNOK 1" >>confdefs.h case " $LIBOBJS " in *" res_hnok.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS res_hnok.$ac_objext" ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_randomid" >&5 printf %s "checking for library containing res_randomid... " >&6; } if test ${ac_cv_search_res_randomid+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char res_randomid (void); int main (void) { return res_randomid (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_res_randomid=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_res_randomid+y} then : break fi done if test ${ac_cv_search_res_randomid+y} then : else case e in #( e) ac_cv_search_res_randomid=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_randomid" >&5 printf "%s\n" "$ac_cv_search_res_randomid" >&6; } ac_res=$ac_cv_search_res_randomid if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_RES_RANDOMID 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" res_random.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS res_random.$ac_objext" ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 printf %s "checking for library containing setsockopt... " >&6; } if test ${ac_cv_search_setsockopt+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char setsockopt (void); int main (void) { return setsockopt (); ; return 0; } _ACEOF for ac_lib in '' socket do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_setsockopt=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_setsockopt+y} then : break fi done if test ${ac_cv_search_setsockopt+y} then : else case e in #( e) ac_cv_search_setsockopt=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 printf "%s\n" "$ac_cv_search_setsockopt" >&6; } ac_res=$ac_cv_search_setsockopt if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" : else case e in #( e) as_fn_error $? "can't find setsockopt" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing __b64_pton" >&5 printf %s "checking for library containing __b64_pton... " >&6; } if test ${ac_cv_search___b64_pton+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char __b64_pton (void); int main (void) { return __b64_pton (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search___b64_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search___b64_pton+y} then : break fi done if test ${ac_cv_search___b64_pton+y} then : else case e in #( e) ac_cv_search___b64_pton=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___b64_pton" >&5 printf "%s\n" "$ac_cv_search___b64_pton" >&6; } ac_res=$ac_cv_search___b64_pton if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE___B64_PTON 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing b64_pton" >&5 printf %s "checking for library containing b64_pton... " >&6; } if test ${ac_cv_search_b64_pton+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char b64_pton (void); int main (void) { return b64_pton (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_b64_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_b64_pton+y} then : break fi done if test ${ac_cv_search_b64_pton+y} then : else case e in #( e) ac_cv_search_b64_pton=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_b64_pton" >&5 printf "%s\n" "$ac_cv_search_b64_pton" >&6; } ac_res=$ac_cv_search_b64_pton if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_b64_PTON 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing __b64_ntop" >&5 printf %s "checking for library containing __b64_ntop... " >&6; } if test ${ac_cv_search___b64_ntop+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char __b64_ntop (void); int main (void) { return __b64_ntop (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search___b64_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search___b64_ntop+y} then : break fi done if test ${ac_cv_search___b64_ntop+y} then : else case e in #( e) ac_cv_search___b64_ntop=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___b64_ntop" >&5 printf "%s\n" "$ac_cv_search___b64_ntop" >&6; } ac_res=$ac_cv_search___b64_ntop if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE___B64_NTOP 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing b64_ntop" >&5 printf %s "checking for library containing b64_ntop... " >&6; } if test ${ac_cv_search_b64_ntop+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char b64_ntop (void); int main (void) { return b64_ntop (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_b64_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_b64_ntop+y} then : break fi done if test ${ac_cv_search_b64_ntop+y} then : else case e in #( e) ac_cv_search_b64_ntop=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_b64_ntop" >&5 printf "%s\n" "$ac_cv_search_b64_ntop" >&6; } ac_res=$ac_cv_search_b64_ntop if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_b64_NTOP 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_b64_pton" >&5 printf %s "checking for library containing res_9_b64_pton... " >&6; } if test ${ac_cv_search_res_9_b64_pton+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char res_9_b64_pton (void); int main (void) { return res_9_b64_pton (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_res_9_b64_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_res_9_b64_pton+y} then : break fi done if test ${ac_cv_search_res_9_b64_pton+y} then : else case e in #( e) ac_cv_search_res_9_b64_pton=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_b64_pton" >&5 printf "%s\n" "$ac_cv_search_res_9_b64_pton" >&6; } ac_res=$ac_cv_search_res_9_b64_pton if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_RES_9_B64_PTON 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_b64_ntop" >&5 printf %s "checking for library containing res_9_b64_ntop... " >&6; } if test ${ac_cv_search_res_9_b64_ntop+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char res_9_b64_ntop (void); int main (void) { return res_9_b64_ntop (); ; return 0; } _ACEOF for ac_lib in '' resolv do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_res_9_b64_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_res_9_b64_ntop+y} then : break fi done if test ${ac_cv_search_res_9_b64_ntop+y} then : else case e in #( e) ac_cv_search_res_9_b64_ntop=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_b64_ntop" >&5 printf "%s\n" "$ac_cv_search_res_9_b64_ntop" >&6; } ac_res=$ac_cv_search_res_9_b64_ntop if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_RES_9_B64_NTOP 1" >>confdefs.h fi if test "x$ac_cv_search_b64_ntop" = "xno" -a \ "x$ac_cv_search___b64_ntop" = "xno" -a \ "x$ac_cv_search_res_9_b64_pton" = "xno" -a \ "x$ac_cv_search_res_9_b64_ntop" = "xno" then : case " $LIBOBJS " in *" base64.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS base64.$ac_objext" ;; esac fi if test "x$ac_cv_func_strnvis" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken strnvis" >&5 printf %s "checking for broken strnvis... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { char buf[128]; return (strnvis(buf, "Hello, world!\n", sizeof(buf), 0)); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define BROKEN_STRNVIS 1" >>confdefs.h case " $LIBOBJS " in *" vis.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS vis.$ac_objext" ;; esac ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" fi if test "x$ac_cv_func_strnvis" = xno then : case " $LIBOBJS " in *" vis.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS vis.$ac_objext" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /proc/pid/fd directory" >&5 printf %s "checking for /proc/pid/fd directory... " >&6; } if test -d "/proc/$$/fd" then : printf "%s\n" "#define HAVE_PROC_PID 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" if test "x$ac_cv_type_long_long" = xyes then : printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "unsigned long long" "ac_cv_type_unsigned_long_long" "$ac_includes_default" if test "x$ac_cv_type_unsigned_long_long" = xyes then : printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default" if test "x$ac_cv_type_long_double" = xyes then : printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "u_int" "ac_cv_type_u_int" "$ac_includes_default" if test "x$ac_cv_type_u_int" = xyes then : printf "%s\n" "#define HAVE_U_INT 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "u_char" "ac_cv_type_u_char" "$ac_includes_default" if test "x$ac_cv_type_u_char" = xyes then : printf "%s\n" "#define HAVE_U_CHAR 1" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5 printf %s "checking size of short int... " >&6; } if test ${ac_cv_sizeof_short_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_short_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5 printf "%s\n" "$ac_cv_sizeof_short_int" >&6; } printf "%s\n" "#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 printf %s "checking size of long int... " >&6; } if test ${ac_cv_sizeof_long_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_long_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5 printf "%s\n" "$ac_cv_sizeof_long_int" >&6; } printf "%s\n" "#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 printf %s "checking size of long long int... " >&6; } if test ${ac_cv_sizeof_long_long_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_long_long_int" = yes; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 printf "%s\n" "$ac_cv_sizeof_long_long_int" >&6; } printf "%s\n" "#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int" >>confdefs.h ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h ;; esac ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h ;; esac ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( *) printf "%s\n" "#define int64_t $ac_cv_c_int64_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT8_T 1" >>confdefs.h printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT32_T 1" >>confdefs.h printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) printf "%s\n" "#define _UINT64_T 1" >>confdefs.h printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h ;; esac ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" if test "x$ac_cv_type_intptr_t" = xyes then : printf "%s\n" "#define HAVE_INTPTR_T 1" >>confdefs.h else case e in #( e) for ac_type in 'int' 'long int' 'long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define intptr_t $ac_type" >>confdefs.h ac_type= fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break done ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 printf %s "checking for unsigned long long int... " >&6; } if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_type_unsigned_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* For now, do not test the preprocessor; as of 2007 there are too many implementations with broken preprocessors. Perhaps this can be revisited in 2012. In the meantime, code should not expect #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 ? 1 : -1)]; int i = 63; int main (void) { /* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) | (llmax / ll) | (llmax % ll) | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : else case e in #( e) ac_cv_type_unsigned_long_long_int=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 printf %s "checking for long long int... " >&6; } if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_type_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int if test $ac_cv_type_long_long_int = yes; then if test "$cross_compiling" = yes then : : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX # define HALF \\ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif int main (void) { long long int n = 1; int i; for (i = 0; ; i++) { long long int m = n << i; if (m >> i != n) return 1; if (LLONG_MAX / 2 < m) break; } return 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : else case e in #( e) ac_cv_type_long_long_int=no ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi fi;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 printf "%s\n" "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default" if test "x$ac_cv_type_intmax_t" = xyes then : printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h else case e in #( e) test $ac_cv_type_long_long_int = yes \ && ac_type='long long int' \ || ac_type='long int' printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" if test "x$ac_cv_type_uintptr_t" = xyes then : printf "%s\n" "#define HAVE_UINTPTR_T 1" >>confdefs.h else case e in #( e) for ac_type in 'unsigned int' 'unsigned long int' \ 'unsigned long long int'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : printf "%s\n" "#define uintptr_t $ac_type" >>confdefs.h ac_type= fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test -z "$ac_type" && break done ;; esac fi ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default" if test "x$ac_cv_type_uintmax_t" = xyes then : printf "%s\n" "#define HAVE_UINTMAX_T 1" >>confdefs.h else case e in #( e) test $ac_cv_type_unsigned_long_long_int = yes \ && ac_type='unsigned long long int' \ || ac_type='unsigned long int' printf "%s\n" "#define uintmax_t $ac_type" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else case e in #( e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : else case e in #( e) printf "%s\n" "#define ssize_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : else case e in #( e) printf "%s\n" "#define off_t long int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : else case e in #( e) printf "%s\n" "#define mode_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default " if test "x$ac_cv_type_pid_t" = xyes then : else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else case e in #( e) ac_pid_type='__int64' ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" if test "x$ac_cv_type_uid_t" = xyes then : else case e in #( e) printf "%s\n" "#define uid_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" if test "x$ac_cv_type_gid_t" = xyes then : else case e in #( e) printf "%s\n" "#define gid_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include " if test "x$ac_cv_type_socklen_t" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 printf %s "checking for socklen_t equivalent... " >&6; } if test ${curl_cv_socklen_t_equiv+y} then : printf %s "(cached) " >&6 else case e in #( e) # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int getpeername (int, $arg2 *, $t *); int main (void) { $t len; getpeername(0,0,&len); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : curl_cv_socklen_t_equiv="$t" break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done if test "x$curl_cv_socklen_t_equiv" = x; then as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $curl_cv_socklen_t_equiv" >&5 printf "%s\n" "$curl_cv_socklen_t_equiv" >&6; } printf "%s\n" "#define socklen_t $curl_cv_socklen_t_equiv" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" " #include " if test "x$ac_cv_type_sig_atomic_t" = xyes then : printf "%s\n" "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "fsblkcnt_t" "ac_cv_type_fsblkcnt_t" " #include #ifdef HAVE_SYS_BITYPES_H #include #endif #ifdef HAVE_SYS_STATFS_H #include #endif #ifdef HAVE_SYS_STATVFS_H #include #endif " if test "x$ac_cv_type_fsblkcnt_t" = xyes then : printf "%s\n" "#define HAVE_FSBLKCNT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "fsfilcnt_t" "ac_cv_type_fsfilcnt_t" " #include #ifdef HAVE_SYS_BITYPES_H #include #endif #ifdef HAVE_SYS_STATFS_H #include #endif #ifdef HAVE_SYS_STATVFS_H #include #endif " if test "x$ac_cv_type_fsfilcnt_t" = xyes then : printf "%s\n" "#define HAVE_FSFILCNT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" " #include #include " if test "x$ac_cv_type_in_addr_t" = xyes then : printf "%s\n" "#define HAVE_IN_ADDR_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "in_port_t" "ac_cv_type_in_port_t" " #include #include " if test "x$ac_cv_type_in_port_t" = xyes then : printf "%s\n" "#define HAVE_IN_PORT_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" " #include #include #include " if test "x$ac_cv_type_sa_family_t" = xyes then : printf "%s\n" "#define HAVE_SA_FAMILY_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "$ac_includes_default" if test "x$ac_cv_type_struct_timespec" = xyes then : printf "%s\n" "#define HAVE_STRUCT_TIMESPEC 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct ifgroupreq" "ac_cv_type_struct_ifgroupreq" "$ac_includes_default" if test "x$ac_cv_type_struct_ifgroupreq" = xyes then : printf "%s\n" "#define HAVE_STRUCT_IFGROUPREQ 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" " #include #include " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" " #include #include " if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" " #include #include " if test "x$ac_cv_type_struct_in6_addr" = xyes then : printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" " #include #include #include " if test "x$ac_cv_type_struct_addrinfo" = xyes then : printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "struct timeval" "ac_cv_type_struct_timeval" " #include " if test "x$ac_cv_type_struct_timeval" = xyes then : printf "%s\n" "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" " #ifdef HAVE_SYS_TYPES_H #include #endif #include " if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct passwd" "pw_gecos" "ac_cv_member_struct_passwd_pw_gecos" " #include #include " if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes then : printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_GECOS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct passwd" "pw_class" "ac_cv_member_struct_passwd_pw_class" " #include #include " if test "x$ac_cv_member_struct_passwd_pw_class" = xyes then : printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_CLASS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct passwd" "pw_change" "ac_cv_member_struct_passwd_pw_change" " #include #include " if test "x$ac_cv_member_struct_passwd_pw_change" = xyes then : printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_CHANGE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct passwd" "pw_expire" "ac_cv_member_struct_passwd_pw_expire" " #include #include " if test "x$ac_cv_member_struct_passwd_pw_expire" = xyes then : printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_EXPIRE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" " #include #include " if test "x$ac_cv_member_struct_stat_st_flags" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_FLAGS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim" "ac_cv_member_struct_stat_st_mtim" " #include #include " if test "x$ac_cv_member_struct_stat_st_mtim" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIM 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec" "ac_cv_member_struct_stat_st_mtimespec" " #include #include " if test "x$ac_cv_member_struct_stat_st_mtimespec" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_MTIMESPEC 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" " #include #include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_SA_LEN 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_len" "ac_cv_member_struct_sockaddr_storage_ss_len" " #include #include #include " if test "x$ac_cv_member_struct_sockaddr_storage_ss_len" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" " #include #include #include " if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_len" "ac_cv_member_struct_sockaddr_in6_sin6_len" " #include #include #include " if test "x$ac_cv_member_struct_sockaddr_in6_sin6_len" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct statfs" "f_favail" "ac_cv_member_struct_statfs_f_favail" " #include #include " if test "x$ac_cv_member_struct_statfs_f_favail" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STATFS_F_FAVAIL 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" " #include #include " if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "__ss_family" "ac_cv_member_struct_sockaddr_storage___ss_family" " #include #include " if test "x$ac_cv_member_struct_sockaddr_storage___ss_family" = xyes then : printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" " #include " if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes then : printf "%s\n" "#define HAVE_STRUCT_TM_TM_GMTOFF 1" >>confdefs.h else case e in #( e) ac_fn_check_decl "$LINENO" "timezone" "ac_cv_have_decl_timezone" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_timezone" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_TIMEZONE $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "altzone" "ac_cv_have_decl_altzone" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_altzone" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_ALTZONE $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_tzname" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ;; esac fi ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" " #include " if test "x$ac_cv_member_struct_tm_tm_zone" = xyes then : printf "%s\n" "#define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h else case e in #( e) ac_fn_check_decl "$LINENO" "timezone" "ac_cv_have_decl_timezone" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_timezone" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_TIMEZONE $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "altzone" "ac_cv_have_decl_altzone" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_altzone" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_ALTZONE $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_tzname" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h if test $ac_have_decl = 1 then : else case e in #( e) as_fn_error $? "cannot find timezone" "$LINENO" 5 ;; esac fi ;; esac fi ac_fn_c_check_member "$LINENO" "struct DIR" "d_type" "ac_cv_member_struct_DIR_d_type" " #include #include " if test "x$ac_cv_member_struct_DIR_d_type" = xyes then : printf "%s\n" "#define HAVE_STRUCT_DIR_D_TYPE 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "O_NONBLOCK" "ac_cv_have_decl_O_NONBLOCK" " #include #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_O_NONBLOCK $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "AF_LOCAL" "ac_cv_have_decl_AF_LOCAL" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AF_LOCAL" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_AF_LOCAL $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "PF_LOCAL" "ac_cv_have_decl_PF_LOCAL" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_PF_LOCAL" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_PF_LOCAL $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "IPPORT_HILASTAUTO" "ac_cv_have_decl_IPPORT_HILASTAUTO" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IPPORT_HILASTAUTO" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_IPPORT_HILASTAUTO $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "IPV6_ADDR_SCOPE_INTFACELOCAL" "ac_cv_have_decl_IPV6_ADDR_SCOPE_INTFACELOCAL" " #include #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_IPV6_ADDR_SCOPE_INTFACELOCAL" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_IPV6_ADDR_SCOPE_INTFACELOCAL $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "WAIT_MYPGRP" "ac_cv_have_decl_WAIT_MYPGRP" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_WAIT_MYPGRP" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_WAIT_MYPGRP $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "LOG_PERROR" "ac_cv_have_decl_LOG_PERROR" " #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_LOG_PERROR" = xyes then : ac_have_decl=1 else case e in #( e) ac_have_decl=0 ;; esac fi printf "%s\n" "#define HAVE_DECL_LOG_PERROR $ac_have_decl" >>confdefs.h ### ### EVERYTHING BELOW MUST BE CLEANED AND MOVED ABOVE ### #l150 (without _FORTIFY_SOURCE=2) if test "$GCC" = "yes" -o "$GCC" = "egcs"; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Qunused-arguments" >&5 printf %s "checking if $CC supports compile flag -Qunused-arguments... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Qunused-arguments" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Qunused-arguments" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wunknown-warning-option" >&5 printf %s "checking if $CC supports compile flag -Wunknown-warning-option... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wunknown-warning-option" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wunknown-warning-option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wall" >&5 printf %s "checking if $CC supports compile flag -Wall... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wall" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wpointer-arith" >&5 printf %s "checking if $CC supports compile flag -Wpointer-arith... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wpointer-arith" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wpointer-arith" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wuninitialized" >&5 printf %s "checking if $CC supports compile flag -Wuninitialized... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wuninitialized" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wuninitialized" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wsign-compare" >&5 printf %s "checking if $CC supports compile flag -Wsign-compare... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wsign-compare" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wsign-compare" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wformat-security" >&5 printf %s "checking if $CC supports compile flag -Wformat-security... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wformat-security" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wformat-security" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wsizeof-pointer-memaccess" >&5 printf %s "checking if $CC supports compile flag -Wsizeof-pointer-memaccess... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wsizeof-pointer-memaccess" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wsizeof-pointer-memaccess" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wpointer-sign" >&5 printf %s "checking if $CC supports compile flag -Wpointer-sign... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wpointer-sign" _define_flag="-Wno-pointer-sign" test "x$_define_flag" = "x" && _define_flag="-Wpointer-sign" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -Wunused-result" >&5 printf %s "checking if $CC supports compile flag -Wunused-result... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -Wunused-result" _define_flag="-Wno-unused-result" test "x$_define_flag" = "x" && _define_flag="-Wunused-result" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -fno-strict-aliasing" >&5 printf %s "checking if $CC supports compile flag -fno-strict-aliasing... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -fno-strict-aliasing" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-fno-strict-aliasing" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } # OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) if test "x$use_toolchain_hardening" = "x1"; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,relro" >&5 printf %s "checking if $LD supports link flag -Wl,-z,relro... " >&6; } saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $WERROR -Wl,-z,relro" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wl,-z,relro" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } LDFLAGS="$saved_LDFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,now" >&5 printf %s "checking if $LD supports link flag -Wl,-z,now... " >&6; } saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $WERROR -Wl,-z,now" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wl,-z,now" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } LDFLAGS="$saved_LDFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -Wl,-z,noexecstack" >&5 printf %s "checking if $LD supports link flag -Wl,-z,noexecstack... " >&6; } saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $WERROR -Wl,-z,noexecstack" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-Wl,-z,noexecstack" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } LDFLAGS="$saved_LDFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext } # NB. -ftrapv expects certain support functions to be present in # the compiler library (libgcc or similar) to detect integer operations # that can overflow. We must check that the result of enabling it # actually links. The test program compiled/linked includes a number # of integer operations that should exercise this. { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -ftrapv and linking succeeds" >&5 printf %s "checking if $CC supports compile flag -ftrapv and linking succeeds... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -ftrapv" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-ftrapv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long int p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5 printf %s "checking gcc version... " >&6; } GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` case $GCC_VER in 1.*) no_attrib_nonnull=1 ;; 2.8* | 2.9*) no_attrib_nonnull=1 ;; 2.*) no_attrib_nonnull=1 ;; *) ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GCC_VER" >&5 printf "%s\n" "$GCC_VER" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-builtin-memset" >&5 printf %s "checking if $CC accepts -fno-builtin-memset... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-builtin-memset" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char b[10]; memset(b, 0, sizeof(b)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # -fstack-protector-all doesn't always work for some GCC versions # and/or platforms, so we test if we can. If it's not supported # on a given platform gcc will emit a warning so we use -Werror. if test "x$use_stack_protector" = "x1"; then for t in -fstack-protector-strong -fstack-protector-all \ -fstack-protector; do { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports $t" >&5 printf %s "checking if $CC supports $t... " >&6; } saved_CFLAGS="$CFLAGS" saved_LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS $t -Werror" LDFLAGS="$LDFLAGS $t -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char x[256]; snprintf(x, sizeof(x), "XXX"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $t" LDFLAGS="$saved_LDFLAGS $t" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $t works" >&5 printf %s "checking if $t works... " >&6; } if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: cannot test" >&5 printf "%s\n" "$as_me: WARNING: cross compiling: cannot test" >&2;} break else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char x[256]; snprintf(x, sizeof(x), "XXX"); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } break else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$saved_CFLAGS" LDFLAGS="$saved_LDFLAGS" done fi if test -z "$have_llong_max"; then # retry LLONG_MAX with -std=gnu99, needed on some Linuxes unset ac_cv_have_decl_LLONG_MAX saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -std=gnu99" ac_fn_check_decl "$LINENO" "LLONG_MAX" "ac_cv_have_decl_LLONG_MAX" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_LLONG_MAX" = xyes then : have_llong_max=1 else case e in #( e) CFLAGS="$saved_CFLAGS" ;; esac fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler allows __attribute__ on return types" >&5 printf %s "checking if compiler allows __attribute__ on return types... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include __attribute__((__unused__)) static void foo(void){return;} int main (void) { exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "#define NO_ATTRIBUTE_ON_RETURN_TYPE 1" >>confdefs.h ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "x$no_attrib_nonnull" != "x1"; then printf "%s\n" "#define HAVE_ATTRIBUTE__NONNULL__ 1" >>confdefs.h fi # Check whether --with-rpath was given. if test ${with_rpath+y} then : withval=$with_rpath; case "$withval" in #( yes) : need_dash_r=yes ;; #( no) : need_dash_r='' ;; #( *) : ;; esac fi # Check whether --with-cflags was given. if test ${with_cflags+y} then : withval=$with_cflags; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then CFLAGS="$CFLAGS $withval" fi fi # Check whether --with-cppflags was given. if test ${with_cppflags+y} then : withval=$with_cppflags; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then CPPFLAGS="$CPPFLAGS $withval" fi fi # Check whether --with-ldflags was given. if test ${with_ldflags+y} then : withval=$with_ldflags; if test -n "$withval" -a "$withval" != "xno" -a "${withval}" != "yes"; then LDFLAGS="$LDFLAGS $withval" fi fi werror_flags= # Check whether --with-Werror was given. if test ${with_Werror+y} then : withval=$with_Werror; if test -n "$withval" -a "$withval" != "no"; then werror_flags="-Werror" if test "${withval}" != "yes"; then werror_flags="$withval" fi fi fi # Check whether --with-pie was given. if test ${with_pie+y} then : withval=$with_pie; if test "x$withval" = "xno"; then use_pie=no fi if test "x$withval" = "xyes"; then use_pie=yes fi fi if test -z "$use_pie"; then use_pie=no fi if test "x$use_toolchain_hardening" != "x1" -a "x$use_pie" = "xauto"; then # Turn off automatic PIE when toolchain hardening is off. use_pie=no fi if test "x$use_pie" = "xauto"; then # Automatic PIE requires gcc >= 4.x { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc >= 4.x" >&5 printf %s "checking for gcc >= 4.x... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if !defined(__GNUC__) || __GNUC__ < 4 #error gcc is too old #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } use_pie=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test "x$use_pie" != "xno"; then SAVED_CFLAGS="$CFLAGS" SAVED_LDFLAGS="$LDFLAGS" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC supports compile flag -fPIE" >&5 printf %s "checking if $CC supports compile flag -fPIE... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $WERROR -fPIE" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-fPIE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include /* Trivial function to help test for -fzero-call-used-regs */ void f(int n) {} int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; f(0); printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); /* * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does * not understand comments and we don't use the "fallthrough" attribute * that it's looking for. */ switch(i){ case 0: j += i; /* FALLTHROUGH */ default: j += k; } exit(0); } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$saved_CFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$saved_CFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $LD supports link flag -pie" >&5 printf %s "checking if $LD supports link flag -pie... " >&6; } saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $WERROR -pie" _define_flag="" test "x$_define_flag" = "x" && _define_flag="-pie" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char **argv) { (void)argv; /* Some math to catch -ftrapv problems in the toolchain */ int i = 123 * argc, j = 456 + argc, k = 789 - argc; float l = i * 2.1; double m = l / 0.5; long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; long long p = n * o; printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p); exit(0); } _ACEOF if ac_fn_c_try_link "$LINENO" then : if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } LDFLAGS="$saved_LDFLAGS $_define_flag" fi else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } LDFLAGS="$saved_LDFLAGS" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext } # We use both -fPIE and -pie or neither. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether both -fPIE and -pie are supported" >&5 printf %s "checking whether both -fPIE and -pie are supported... " >&6; } if echo "x $CFLAGS" | grep ' -fPIE' >/dev/null 2>&1 && \ echo "x $LDFLAGS" | grep ' -pie' >/dev/null 2>&1 ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } CFLAGS="$SAVED_CFLAGS" LDFLAGS="$SAVED_LDFLAGS" fi fi # Man pages defaults to mandoc MANTYPE=doc # Check whether --with-mantype was given. if test ${with_mantype+y} then : withval=$with_mantype; case "$withval" in man|cat|doc) MANTYPE=$withval ;; *) as_fn_error $? "invalid man type: $withval" "$LINENO" 5 ;; esac fi if test "$MANTYPE" = "doc"; then mansubdir=man; else mansubdir=$MANTYPE; fi # Whether to enable BSD auth support # Check whether --with-auth-bsdauth was given. if test ${with_auth_bsdauth+y} then : withval=$with_auth_bsdauth; if test "x$withval" != "xno"; then printf "%s\n" "#define BSD_AUTH 1" >>confdefs.h BSD_AUTH_MSG=yes fi fi PAM_MSG="no" USE_PAM_SERVICE=smtpd # Check whether --with-auth-pam was given. if test ${with_auth_pam+y} then : withval=$with_auth_pam; if test "x$withval" != "xno"; then if test -n "$withval" -a "x${withval}" != "xyes"; then USE_PAM_SERVICE=$withval fi if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \ test "x$ac_cv_header_pam_pam_appl_h" != "xyes"; then as_fn_error $? "PAM headers not found" "$LINENO" 5 fi saved_LIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h LIBS="-ldl $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pam_set_item in -lpam" >&5 printf %s "checking for pam_set_item in -lpam... " >&6; } if test ${ac_cv_lib_pam_pam_set_item+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pam_set_item (void); int main (void) { return pam_set_item (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pam_pam_set_item=yes else case e in #( e) ac_cv_lib_pam_pam_set_item=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_set_item" >&5 printf "%s\n" "$ac_cv_lib_pam_pam_set_item" >&6; } if test "x$ac_cv_lib_pam_pam_set_item" = xyes then : printf "%s\n" "#define HAVE_LIBPAM 1" >>confdefs.h LIBS="-lpam $LIBS" else case e in #( e) as_fn_error $? "*** libpam missing" "$LINENO" 5 ;; esac fi ac_fn_c_check_func "$LINENO" "pam_getenvlist" "ac_cv_func_pam_getenvlist" if test "x$ac_cv_func_pam_getenvlist" = xyes then : printf "%s\n" "#define HAVE_PAM_GETENVLIST 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "pam_putenv" "ac_cv_func_pam_putenv" if test "x$ac_cv_func_pam_putenv" = xyes then : printf "%s\n" "#define HAVE_PAM_PUTENV 1" >>confdefs.h fi LIBS="$saved_LIBS" PAM_MSG="yes" SMTPDLIBS="$SMTPDLIBS -lpam" printf "%s\n" "#define USE_PAM 1" >>confdefs.h if test "x$ac_cv_lib_dl_dlopen" = "xyes"; then case "$LIBS" in *-ldl*) # libdl already in LIBS ;; *) SMTPDLIBS="$SMTPDLIBS -ldl" ;; esac fi fi fi printf "%s\n" "#define USE_PAM_SERVICE \"$USE_PAM_SERVICE\"" >>confdefs.h # Check for older PAM if test "x$PAM_MSG" = "xyes"; then # Check PAM strerror arguments (old PAM) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pam_strerror takes only one argument" >&5 printf %s "checking whether pam_strerror takes only one argument... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if defined(HAVE_SECURITY_PAM_APPL_H) #include #elif defined (HAVE_PAM_PAM_APPL_H) #include #endif int main (void) { (void)pam_strerror((pam_handle_t *)NULL, -1); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else case e in #( e) printf "%s\n" "#define HAVE_OLD_PAM 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } PAM_MSG="yes (old library)" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi SMTPD_USER=_smtpd # Check whether --with-user-smtpd was given. if test ${with_user_smtpd+y} then : withval=$with_user_smtpd; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_USER=$withval fi fi printf "%s\n" "#define SMTPD_USER \"$SMTPD_USER\"" >>confdefs.h SMTPD_QUEUE_USER=_smtpq # Check whether --with-user-queue was given. if test ${with_user_queue+y} then : withval=$with_user_queue; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_QUEUE_USER=$withval fi fi printf "%s\n" "#define SMTPD_QUEUE_USER \"$SMTPD_QUEUE_USER\"" >>confdefs.h SMTPD_QUEUE_GROUP=_smtpq # Check whether --with-group-queue was given. if test ${with_group_queue+y} then : withval=$with_group_queue; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then SMTPD_QUEUE_GROUP=$withval fi fi printf "%s\n" "#define SMTPD_QUEUE_GROUP \"$SMTPD_QUEUE_GROUP\"" >>confdefs.h # Where to place spooler spooldir=/var/spool/smtpd # Check whether --with-path-queue was given. if test ${with_path_queue+y} then : withval=$with_path_queue; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then spooldir=$withval if test ! -d $spooldir; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ** no $spooldir directory on this system **" >&5 printf "%s\n" "$as_me: WARNING: ** no $spooldir directory on this system **" >&2;} fi fi fi printf "%s\n" "#define PATH_SPOOL \"$spooldir\"" >>confdefs.h PRIVSEP_PATH=/var/empty # Check whether --with-path-empty was given. if test ${with_path_empty+y} then : withval=$with_path_empty; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then PRIVSEP_PATH=$withval fi fi # Check for mail directory # Check whether --with-path-mbox was given. if test ${with_path_mbox+y} then : withval=$with_path_mbox; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then printf "%s\n" "#define MAIL_DIRECTORY \"$withval\"" >>confdefs.h fi else case e in #( e) if test -n "$maildir"; then printf "%s\n" "#define MAIL_DIRECTORY \"$maildir\"" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system mail directory" >&5 printf %s "checking system mail directory... " >&6; } if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: use --with-maildir=/path/to/mail" >&5 printf "%s\n" "$as_me: WARNING: cross compiling: use --with-maildir=/path/to/mail" >&2;} else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #ifdef HAVE_PATHS_H #include #endif #ifdef HAVE_MAILLOCK_H #include #endif #define DATA "conftest.maildir" int main (void) { 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); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : maildir_what=`awk -F: '{print $1}' conftest.maildir` maildir=`awk -F: '{print $2}' conftest.maildir \ | sed 's|/$||'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $maildir from $maildir_what" >&5 printf "%s\n" "$maildir from $maildir_what" >&6; } if test "x$maildir_what" != "x_PATH_MAILDIR"; then printf "%s\n" "#define MAIL_DIRECTORY \"$maildir\"" >>confdefs.h fi else case e in #( e) if test "X$ac_status" = "X2"; then # our test program didn't find it. Default to /var/spool/mail { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: /var/spool/mail" >&5 printf "%s\n" "/var/spool/mail" >&6; } printf "%s\n" "#define MAIL_DIRECTORY \"/var/spool/mail\"" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: *** not found ***" >&5 printf "%s\n" "*** not found ***" >&6; } fi ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi fi ;; esac fi # maildir # Where to place smtpd.sock sockdir=/var/run # make sure the directory exists if test ! -d $sockdir; then sockdir=`eval echo ${sysconfdir}` case $sockdir in NONE/*) sockdir=`echo $sockdir | sed "s~NONE~$ac_default_prefix~"` ;; esac fi # Check whether --with-path-socket was given. if test ${with_path_socket+y} then : withval=$with_path_socket; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then sockdir=$withval if test ! -d $sockdir; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: ** no $sockdir directory on this system **" >&5 printf "%s\n" "$as_me: WARNING: ** no $sockdir directory on this system **" >&2;} fi fi fi printf "%s\n" "#define SMTPD_SOCKDIR \"$sockdir\"" >>confdefs.h #l4470 # Where to place smtpd.pid piddir=/var/run { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking system pid directory" >&5 printf %s "checking system pid directory... " >&6; } if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $piddir from default value" >&5 printf "%s\n" "$piddir from default value" >&6; } else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifdef HAVE_PATHS_H #include #endif #define DATA "conftest.piddir" int main (void) { #ifdef _PATH_VARRUN FILE *fd; int rc; if ((fd = fopen(DATA,"w")) == NULL) { exit(1); } if ((rc = fprintf(fd ,"%s\n", _PATH_VARRUN)) < 0) { exit(2); } exit(0); #else exit(-1); #endif ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : piddir=`cat conftest.piddir` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $piddir from paths.h" >&5 printf "%s\n" "$piddir from paths.h" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $piddir from default value" >&5 printf "%s\n" "$piddir from default value" >&6; } ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi # Check whether --with-path-pidfile was given. if test ${with_path_pidfile+y} then : withval=$with_path_pidfile; if test -n "$withval" -a "$withval" != "no" -a "${withval}" != "yes"; then piddir=$withval fi fi printf "%s\n" "#define SMTPD_PIDDIR \"$piddir\"" >>confdefs.h # Check whether --with-path-CAfile was given. if test ${with_path_CAfile+y} then : withval=$with_path_CAfile; fi if test -n "$with_path_CAfile" -a "$with_path_CAfile" != no -a \ "$with_path_CAfile" != yes then : printf "%s\n" "#define OPENSMTPD_CA_FILE \"$with_path_CAfile\"" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for msg_accrights field in struct msghdr" >&5 printf %s "checking for msg_accrights field in struct msghdr... " >&6; } if test ${ac_cv_have_accrights_in_msghdr+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { #ifdef msg_accrights #error "msg_accrights is a macro" exit(1); #endif struct msghdr m; m.msg_accrights = 0; exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_have_accrights_in_msghdr="yes" else case e in #( e) ac_cv_have_accrights_in_msghdr="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_accrights_in_msghdr" >&5 printf "%s\n" "$ac_cv_have_accrights_in_msghdr" >&6; } if test "x$ac_cv_have_accrights_in_msghdr" = "xyes"; then printf "%s\n" "#define HAVE_ACCRIGHTS_IN_MSGHDR 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for msg_control field in struct msghdr" >&5 printf %s "checking for msg_control field in struct msghdr... " >&6; } if test ${ac_cv_have_control_in_msghdr+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { #ifdef msg_control #error "msg_control is a macro" exit(1); #endif struct msghdr m; m.msg_control = 0; exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_have_control_in_msghdr="yes" else case e in #( e) ac_cv_have_control_in_msghdr="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_control_in_msghdr" >&5 printf "%s\n" "$ac_cv_have_control_in_msghdr" >&6; } if test "x$ac_cv_have_control_in_msghdr" = "xyes"; then printf "%s\n" "#define HAVE_CONTROL_IN_MSGHDR 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libc defines __progname" >&5 printf %s "checking if libc defines __progname... " >&6; } if test ${ac_cv_libc_defines___progname+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { extern char *__progname; printf("%s", __progname); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_libc_defines___progname="yes" else case e in #( e) ac_cv_libc_defines___progname="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines___progname" >&5 printf "%s\n" "$ac_cv_libc_defines___progname" >&6; } if test "x$ac_cv_libc_defines___progname" = "xyes"; then printf "%s\n" "#define HAVE___PROGNAME 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC implements __FUNCTION__" >&5 printf %s "checking whether $CC implements __FUNCTION__... " >&6; } if test ${ac_cv_cc_implements___FUNCTION__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { printf("%s", __FUNCTION__); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_cc_implements___FUNCTION__="yes" else case e in #( e) ac_cv_cc_implements___FUNCTION__="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_implements___FUNCTION__" >&5 printf "%s\n" "$ac_cv_cc_implements___FUNCTION__" >&6; } if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes"; then printf "%s\n" "#define HAVE___FUNCTION__ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC implements __func__" >&5 printf %s "checking whether $CC implements __func__... " >&6; } if test ${ac_cv_cc_implements___func__+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { printf("%s", __func__); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_cc_implements___func__="yes" else case e in #( e) ac_cv_cc_implements___func__="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cc_implements___func__" >&5 printf "%s\n" "$ac_cv_cc_implements___func__" >&6; } if test "x$ac_cv_cc_implements___func__" = "xyes"; then printf "%s\n" "#define HAVE___func__ 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether va_copy exists" >&5 printf %s "checking whether va_copy exists... " >&6; } if test ${ac_cv_have_va_copy+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include va_list x,y; int main (void) { va_copy(x,y); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_have_va_copy="yes" else case e in #( e) ac_cv_have_va_copy="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_va_copy" >&5 printf "%s\n" "$ac_cv_have_va_copy" >&6; } if test "x$ac_cv_have_va_copy" = "xyes"; then printf "%s\n" "#define HAVE_VA_COPY 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __va_copy exists" >&5 printf %s "checking whether __va_copy exists... " >&6; } if test ${ac_cv_have___va_copy+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include va_list x,y; int main (void) { __va_copy(x,y); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_have___va_copy="yes" else case e in #( e) ac_cv_have___va_copy="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___va_copy" >&5 printf "%s\n" "$ac_cv_have___va_copy" >&6; } if test "x$ac_cv_have___va_copy" = "xyes"; then printf "%s\n" "#define HAVE___VA_COPY 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt has optreset support" >&5 printf %s "checking whether getopt has optreset support... " >&6; } if test ${ac_cv_have_getopt_optreset+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { extern int optreset; optreset = 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_have_getopt_optreset="yes" else case e in #( e) ac_cv_have_getopt_optreset="no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getopt_optreset" >&5 printf "%s\n" "$ac_cv_have_getopt_optreset" >&6; } if test "x$ac_cv_have_getopt_optreset" = "xyes"; then printf "%s\n" "#define HAVE_GETOPT_OPTRESET 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "suboptarg" "ac_cv_have_decl_suboptarg" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_suboptarg" = xyes then : printf "%s\n" "#define HAVE_SUBOPTARG 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" getsubopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getsubopt.$ac_objext" ;; esac ;; esac fi # Search for fts # Check whether --with-libfts was given. if test ${with_libfts+y} then : withval=$with_libfts; if test "x$withval" = "xno"; then as_fn_error $? "*** fts is required ***" "$LINENO" 5 elif test "x$withval" != "xyes"; then if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi LIBS="$LIBS -lfts" fi fi # Search for libevent saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" # Check whether --with-libevent was given. if test ${with_libevent+y} then : withval=$with_libevent; if test "x$withval" != "xno"; then case "$withval" in # Relative paths ./*|../*) withval="`pwd`/$withval" esac if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi elif test -d "$withval/lib64"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" else LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi fi ac_fn_c_check_header_compile "$LINENO" "event.h" "ac_cv_header_event_h" "#include " if test "x$ac_cv_header_event_h" = xyes then : else case e in #( e) as_fn_error $? "*** event.h missing - please install libevent ***" "$LINENO" 5 ;; esac fi LIBS="$LIBS -levent" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if programs using libevent functions will link" >&5 printf %s "checking if programs using libevent functions will link... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { event_base_new(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # Search for OpenSSL saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" # Check whether --with-libssl was given. if test ${with_libssl+y} then : withval=$with_libssl; if test "x$withval" != "xno"; then case "$withval" in # Relative paths ./*|../*) withval="`pwd`/$withval" esac if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi elif test -d "$withval/lib64"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib64 -R${withval}/lib64 ${LDFLAGS}" else LDFLAGS="-L${withval}/lib64 ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing RAND_add" >&5 printf %s "checking for library containing RAND_add... " >&6; } if test ${ac_cv_search_RAND_add+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char RAND_add (void); int main (void) { return RAND_add (); ; return 0; } _ACEOF for ac_lib in '' crypto do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_RAND_add=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_RAND_add+y} then : break fi done if test ${ac_cv_search_RAND_add+y} then : else case e in #( e) ac_cv_search_RAND_add=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_RAND_add" >&5 printf "%s\n" "$ac_cv_search_RAND_add" >&6; } ac_res=$ac_cv_search_RAND_add if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" : else case e in #( e) as_fn_error $? "can't find libcrypto" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_CTX_new" >&5 printf %s "checking for library containing SSL_CTX_new... " >&6; } if test ${ac_cv_search_SSL_CTX_new+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char SSL_CTX_new (void); int main (void) { return SSL_CTX_new (); ; return 0; } _ACEOF for ac_lib in '' ssl do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_SSL_CTX_new=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_SSL_CTX_new+y} then : break fi done if test ${ac_cv_search_SSL_CTX_new+y} then : else case e in #( e) ac_cv_search_SSL_CTX_new=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_CTX_new" >&5 printf "%s\n" "$ac_cv_search_SSL_CTX_new" >&6; } ac_res=$ac_cv_search_SSL_CTX_new if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" : else case e in #( e) as_fn_error $? "can't find libssl" "$LINENO" 5 ;; esac fi # Check arc4random only after libcrypto to avoid issues with old # (pre 3.8) versions of LibreSSL. ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" if test "x$ac_cv_func_arc4random" = xyes then : printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h else case e in #( e) case " $LIBOBJS " in *" arc4random.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arc4random.$ac_objext" ;; esac ;; esac fi ac_fn_c_check_func "$LINENO" "SSL_CTX_use_certificate_chain_mem" "ac_cv_func_SSL_CTX_use_certificate_chain_mem" if test "x$ac_cv_func_SSL_CTX_use_certificate_chain_mem" = xyes then : printf "%s\n" "#define HAVE_SSL_CTX_USE_CERTIFICATE_CHAIN_MEM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "SSL_CTX_load_verify_mem" "ac_cv_func_SSL_CTX_load_verify_mem" if test "x$ac_cv_func_SSL_CTX_load_verify_mem" = xyes then : printf "%s\n" "#define HAVE_SSL_CTX_LOAD_VERIFY_MEM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "X509_LOOKUP_mem" "ac_cv_func_X509_LOOKUP_mem" if test "x$ac_cv_func_X509_LOOKUP_mem" = xyes then : printf "%s\n" "#define HAVE_X509_LOOKUP_MEM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "OPENSSL_posix_to_tm" "ac_cv_func_OPENSSL_posix_to_tm" if test "x$ac_cv_func_OPENSSL_posix_to_tm" = xyes then : printf "%s\n" "#define HAVE_OPENSSL_POSIX_TO_TM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "OPENSSL_gmtime" "ac_cv_func_OPENSSL_gmtime" if test "x$ac_cv_func_OPENSSL_gmtime" = xyes then : printf "%s\n" "#define HAVE_OPENSSL_GMTIME 1" >>confdefs.h fi if test "x$ac_cv_func_OPENSSL_posix_to_tm" = xno then : AM_CFLAGS="${AM_CFLAGS} -I\${top_srcdir}/openbsd-compat/openssl/" fi # Sanity check OpenSSL headers { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether LibreSSL's headers match the library" >&5 printf %s "checking whether LibreSSL's headers match the library... " >&6; } if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5 printf "%s\n" "$as_me: WARNING: cross compiling: not checking" >&2;} else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main (void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Your LibreSSL headers do not match your library." "$LINENO" 5 ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ac_fn_check_decl "$LINENO" "LIBRESSL_VERSION_NUMBER" "ac_cv_have_decl_LIBRESSL_VERSION_NUMBER" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_LIBRESSL_VERSION_NUMBER" = xyes then : fi # Check whether --with-libz was given. if test ${with_libz+y} then : withval=$with_libz; if test "x$withval" = "xno"; then as_fn_error $? "*** zlib is required ***" "$LINENO" 5 elif test "x$withval" != "xyes"; then if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" else LDFLAGS="-L${withval}/lib ${LDFLAGS}" fi else if test -n "${need_dash_r}"; then LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}" else LDFLAGS="-L${withval} ${LDFLAGS}" fi fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include ${CPPFLAGS}" else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi fi ac_fn_c_check_header_compile "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes then : else case e in #( e) as_fn_error $? "*** zlib.h missing - please install first or check config.log ***" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5 printf %s "checking for library containing deflate... " >&6; } if test ${ac_cv_search_deflate+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char deflate (void); int main (void) { return deflate (); ; return 0; } _ACEOF for ac_lib in '' z do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_deflate=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_deflate+y} then : break fi done if test ${ac_cv_search_deflate+y} then : else case e in #( e) ac_cv_search_deflate=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5 printf "%s\n" "$ac_cv_search_deflate" >&6; } ac_res=$ac_cv_search_deflate if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" : else case e in #( e) as_fn_error $? "can't find zlib" "$LINENO" 5 ;; esac fi # Check whether --with-table-db was given. if test ${with_table_db+y} then : withval=$with_table_db; if test "x$withval" = "xyes"; then use_db_api=1 else use_db_api=0 fi fi if test "x$use_db_api" = "x1"; then # Search for libdb ac_fn_c_check_header_compile "$LINENO" "db_185.h" "ac_cv_header_db_185_h" "$ac_includes_default" if test "x$ac_cv_header_db_185_h" = xyes then : printf "%s\n" "#define HAVE_DB_185_H /**/" >>confdefs.h else case e in #( e) ac_fn_c_check_header_compile "$LINENO" "db.h" "ac_cv_header_db_h" "$ac_includes_default" if test "x$ac_cv_header_db_h" = xyes then : printf "%s\n" "#define HAVE_DB_H /**/" >>confdefs.h else case e in #( e) ac_fn_c_check_header_compile "$LINENO" "db1/db.h" "ac_cv_header_db1_db_h" "$ac_includes_default" if test "x$ac_cv_header_db1_db_h" = xyes then : printf "%s\n" "#define HAVE_DB1_DB_H /**/" >>confdefs.h else case e in #( e) as_fn_error $? "*** Can't find Berkeley DB headers (see config.log for details) ***" "$LINENO" 5 ;; esac fi ;; esac fi ;; esac fi fi save_LIBS="$LIBS" if test "x$use_db_api" = "x1"; then DB_LIB= for libdb in db db1 c; do as_ac_Lib=`printf "%s\n" "ac_cv_lib_$libdb""_dbopen" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dbopen in -l$libdb" >&5 printf %s "checking for dbopen in -l$libdb... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-l$libdb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dbopen (void); int main (void) { return dbopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else case e in #( e) eval "$as_ac_Lib=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : DB_LIB="$libdb"; break; else case e in #( e) as_ac_Lib=`printf "%s\n" "ac_cv_lib_$libdb""___db185_open" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __db185_open in -l$libdb" >&5 printf %s "checking for __db185_open in -l$libdb... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-l$libdb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char __db185_open (void); int main (void) { return __db185_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else case e in #( e) eval "$as_ac_Lib=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : DB_LIB="$libdb"; break; fi ;; esac fi done if test -z "$DB_LIB"; then as_fn_error $? "Berkeley DB not found or not built with --enable-185" "$LINENO" 5 fi DB_LIB="-l$DB_LIB" fi LIBS="$save_LIBS" if test "x$use_db_api" = "x1"; then HAVE_DB_API_TRUE= HAVE_DB_API_FALSE='#' else HAVE_DB_API_TRUE='#' HAVE_DB_API_FALSE= fi if test -z "$HAVE_DB_API_TRUE"; then : printf "%s\n" "#define HAVE_DB_API 1" >>confdefs.h fi LIBS="$LIBS ${SMTPDLIBS}" AM_CFLAGS="$AM_CFLAGS $werror_flags" ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile mk/Makefile mk/mail/Makefile mk/mail/mail.lmtp/Makefile mk/mail/mail.maildir/Makefile mk/mail/mail.mboxfile/Makefile mk/mail/mail.mda/Makefile mk/smtpd/Makefile mk/smtpctl/Makefile mk/smtp/Makefile contrib/Makefile contrib/libexec/Makefile contrib/libexec/mail.local/Makefile contrib/libexec/lockspool/Makefile contrib/libexec/encrypt/Makefile openbsd-compat/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NEED_LIBASR_TRUE}" && test -z "${NEED_LIBASR_FALSE}"; then as_fn_error $? "conditional \"NEED_LIBASR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DB_API_TRUE}" && test -z "${HAVE_DB_API_FALSE}"; then as_fn_error $? "conditional \"HAVE_DB_API\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by OpenSMTPD-portable $as_me 7.7.0p0, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ '$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . OpenSMTPD-portable home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ OpenSMTPD-portable config.status 7.7.0p0 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: '$1' Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "mk/Makefile") CONFIG_FILES="$CONFIG_FILES mk/Makefile" ;; "mk/mail/Makefile") CONFIG_FILES="$CONFIG_FILES mk/mail/Makefile" ;; "mk/mail/mail.lmtp/Makefile") CONFIG_FILES="$CONFIG_FILES mk/mail/mail.lmtp/Makefile" ;; "mk/mail/mail.maildir/Makefile") CONFIG_FILES="$CONFIG_FILES mk/mail/mail.maildir/Makefile" ;; "mk/mail/mail.mboxfile/Makefile") CONFIG_FILES="$CONFIG_FILES mk/mail/mail.mboxfile/Makefile" ;; "mk/mail/mail.mda/Makefile") CONFIG_FILES="$CONFIG_FILES mk/mail/mail.mda/Makefile" ;; "mk/smtpd/Makefile") CONFIG_FILES="$CONFIG_FILES mk/smtpd/Makefile" ;; "mk/smtpctl/Makefile") CONFIG_FILES="$CONFIG_FILES mk/smtpctl/Makefile" ;; "mk/smtp/Makefile") CONFIG_FILES="$CONFIG_FILES mk/smtp/Makefile" ;; "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; "contrib/libexec/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/libexec/Makefile" ;; "contrib/libexec/mail.local/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/libexec/mail.local/Makefile" ;; "contrib/libexec/lockspool/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/libexec/lockspool/Makefile" ;; "contrib/libexec/encrypt/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/libexec/encrypt/Makefile" ;; "openbsd-compat/Makefile") CONFIG_FILES="$CONFIG_FILES openbsd-compat/Makefile" ;; *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi opensmtpd-7.7.0p0/mk/0000755000175000001440000000000015010115322010130 5opensmtpd-7.7.0p0/mk/smtpd/0000755000175000001440000000000015010115322011257 5opensmtpd-7.7.0p0/mk/smtpd/Makefile.am0000644000175000001440000002304314764503545013264 # In OpenBSD, smtpd's files are installed this way: # # /etc/mail/smtpd.conf # /usr/sbin/smtpd # # # For OpenSMTPD portable, here's where files are installed: # (assuming PREFIX=/usr/local) # # /usr/local/etc/smtpd.conf # /usr/local/sbin/smtpd include $(top_srcdir)/mk/pathnames sbin_PROGRAMS= smtpd smtpd_SOURCES= $(top_srcdir)/usr.sbin/smtpd/aliases.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/bounce.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ca.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/compress_backend.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/config.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/control.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/dict.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/dispatcher.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/dns.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/esc.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/envelope.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/expand.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/forward.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/iobuf.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/limit.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/lka.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/lka_filter.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/lka_session.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mda.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mda_mbox.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mda_unpriv.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mda_variables.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mproc.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mailaddr.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mta.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mta_session.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/parse.y smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/proxy.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_backend.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/report_smtp.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/resolver.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/rfc5322.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ruleset.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/runq.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/scheduler.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/scheduler_backend.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtp.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtp_session.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtpd.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/srs.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ssl.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/stat_backend.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/to.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/tree.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/util.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/waitq.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ioev.c # backends smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/crypto.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c if HAVE_DB_API smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_db.c endif smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_proc.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_static.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_fs.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_null.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_proc.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_ram.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/scheduler_null.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/scheduler_proc.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/scheduler_ramqueue.c smtpd_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/stat_ramstat.c # libasr if NEED_LIBASR smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/event_asr_run.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_compat.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_debug.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_utils.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/res_search_async.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/res_send_async.c endif # libtls smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/a_time_posix.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_client.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_bio_cb.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_config.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_conninfo.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_keypair.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_server.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_ocsp.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_peer.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_signer.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_util.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_verify.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/by_mem.c smtpd_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/openssl.c AM_CPPFLAGS= -DIO_TLS \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(top_srcdir)/openbsd-compat/libtls \ -I$(srcdir) $(PATHS) @DEFS@ LDADD= $(LIBOBJS) $(DB_LIB) MANPAGES= aliases.5.out forward.5.out smtpd.8.out \ smtpd.conf.5.out smtpd-filters.7.out \ smtpd-tables.7.out table.5.out MANPAGES_IN= $(top_srcdir)/usr.sbin/smtpd/aliases.5 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/forward.5 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/smtpd.8 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/smtpd.conf.5 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/smtpd-filters.7 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/smtpd-tables.7 MANPAGES_IN+= $(top_srcdir)/usr.sbin/smtpd/table.5 CONFIGFILES= smtpd.conf.out CONFIGFILES_IN= $(top_srcdir)/usr.sbin/smtpd/smtpd.conf EXTRA_DIST= $(CONFIGFILES_IN) $(MANPAGES_IN) EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/rfc5322.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/unpack_dns.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/tree.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/smtp.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/smtpd.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/smtpd-api.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/smtpd-defines.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/ioev.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/iobuf.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/log.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/ssl.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/parser.h EXTRA_DIST+= $(top_srcdir)/usr.sbin/smtpd/dict.h PATHSUBS= -e 's|/etc/mail/|$(sysconfdir)/|g' \ -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/local/libexec/smtpd/|$(pkglibexecdir)|g' FIXPATHSCMD= $(SED) $(PATHSUBS) $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi $(CONFIGFILES): $(CONFIGFILES_IN) conffile=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/.out$$//'`; \ $(CAT) $${conffile} > $@ # smtpd.conf # newaliases makemap install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(sysconfdir) $(MKDIR_P) $(DESTDIR)$(bindir) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)7 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 @if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then \ $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \ else \ echo "$(DESTDIR)$(sysconfdir)/smtpd.conf already exists, install will not overwrite"; \ fi $(INSTALL) -m 644 aliases.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5 $(INSTALL) -m 644 forward.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5 $(INSTALL) -m 644 table.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/table.5 $(INSTALL) -m 644 smtpd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/smtpd.8 $(INSTALL) -m 644 smtpd.conf.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/smtpd.conf.5 $(INSTALL) -m 644 smtpd-filters.7.out $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-filters.7 $(INSTALL) -m 644 smtpd-tables.7.out $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-tables.7 rm aliases.5.out forward.5.out table.5.out \ smtpd.8.out smtpd.conf.5.out smtpd-filters.7.out smtpd-tables.7.out smtpd.conf.out uninstall-hook: # XXX to make "make distcheck" happy we need to rm smtpd.conf rm -f $(DESTDIR)$(sysconfdir)/smtpd.conf \ $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/table.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/smtpd.conf.5 \ $(DESTDIR)$(mandir)/$(mansubdir)8/smtpd.8 \ $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-filters.7 \ $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-tables.7 rmdir $(DESTDIR)$(mandir)/$(mansubdir)5 \ $(DESTDIR)$(mandir)/$(mansubdir)7 \ $(DESTDIR)$(mandir)/$(mansubdir)8 2> /dev/null || true opensmtpd-7.7.0p0/mk/smtpd/Makefile.in0000644000175000001440000031602215010115300013244 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # In OpenBSD, smtpd's files are installed this way: # # /etc/mail/smtpd.conf # /usr/sbin/smtpd # # # For OpenSMTPD portable, here's where files are installed: # (assuming PREFIX=/usr/local) # # /usr/local/etc/smtpd.conf # /usr/local/sbin/smtpd VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = smtpd$(EXEEXT) @HAVE_DB_API_TRUE@am__append_1 = $(top_srcdir)/usr.sbin/smtpd/table_db.c # libasr @NEED_LIBASR_TRUE@am__append_2 = $(top_srcdir)/openbsd-compat/event_asr_run.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_compat.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_debug.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_utils.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/res_search_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/res_send_async.c subdir = mk/smtpd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) LIBOBJDIR = ../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am__smtpd_SOURCES_DIST = $(top_srcdir)/usr.sbin/smtpd/aliases.c \ $(top_srcdir)/usr.sbin/smtpd/bounce.c \ $(top_srcdir)/usr.sbin/smtpd/ca.c \ $(top_srcdir)/usr.sbin/smtpd/compress_backend.c \ $(top_srcdir)/usr.sbin/smtpd/config.c \ $(top_srcdir)/usr.sbin/smtpd/control.c \ $(top_srcdir)/usr.sbin/smtpd/dict.c \ $(top_srcdir)/usr.sbin/smtpd/dispatcher.c \ $(top_srcdir)/usr.sbin/smtpd/dns.c \ $(top_srcdir)/usr.sbin/smtpd/esc.c \ $(top_srcdir)/usr.sbin/smtpd/envelope.c \ $(top_srcdir)/usr.sbin/smtpd/expand.c \ $(top_srcdir)/usr.sbin/smtpd/forward.c \ $(top_srcdir)/usr.sbin/smtpd/iobuf.c \ $(top_srcdir)/usr.sbin/smtpd/limit.c \ $(top_srcdir)/usr.sbin/smtpd/lka.c \ $(top_srcdir)/usr.sbin/smtpd/lka_filter.c \ $(top_srcdir)/usr.sbin/smtpd/lka_session.c \ $(top_srcdir)/usr.sbin/smtpd/log.c \ $(top_srcdir)/usr.sbin/smtpd/mda.c \ $(top_srcdir)/usr.sbin/smtpd/mda_mbox.c \ $(top_srcdir)/usr.sbin/smtpd/mda_unpriv.c \ $(top_srcdir)/usr.sbin/smtpd/mda_variables.c \ $(top_srcdir)/usr.sbin/smtpd/mproc.c \ $(top_srcdir)/usr.sbin/smtpd/mailaddr.c \ $(top_srcdir)/usr.sbin/smtpd/mta.c \ $(top_srcdir)/usr.sbin/smtpd/mta_session.c \ $(top_srcdir)/usr.sbin/smtpd/parse.y \ $(top_srcdir)/usr.sbin/smtpd/proxy.c \ $(top_srcdir)/usr.sbin/smtpd/queue.c \ $(top_srcdir)/usr.sbin/smtpd/queue_backend.c \ $(top_srcdir)/usr.sbin/smtpd/report_smtp.c \ $(top_srcdir)/usr.sbin/smtpd/resolver.c \ $(top_srcdir)/usr.sbin/smtpd/rfc5322.c \ $(top_srcdir)/usr.sbin/smtpd/ruleset.c \ $(top_srcdir)/usr.sbin/smtpd/runq.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_backend.c \ $(top_srcdir)/usr.sbin/smtpd/smtp.c \ $(top_srcdir)/usr.sbin/smtpd/smtp_session.c \ $(top_srcdir)/usr.sbin/smtpd/smtpd.c \ $(top_srcdir)/usr.sbin/smtpd/srs.c \ $(top_srcdir)/usr.sbin/smtpd/ssl.c \ $(top_srcdir)/usr.sbin/smtpd/stat_backend.c \ $(top_srcdir)/usr.sbin/smtpd/table.c \ $(top_srcdir)/usr.sbin/smtpd/to.c \ $(top_srcdir)/usr.sbin/smtpd/tree.c \ $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c \ $(top_srcdir)/usr.sbin/smtpd/util.c \ $(top_srcdir)/usr.sbin/smtpd/waitq.c \ $(top_srcdir)/usr.sbin/smtpd/ioev.c \ $(top_srcdir)/usr.sbin/smtpd/crypto.c \ $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c \ $(top_srcdir)/usr.sbin/smtpd/table_db.c \ $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c \ $(top_srcdir)/usr.sbin/smtpd/table_proc.c \ $(top_srcdir)/usr.sbin/smtpd/table_static.c \ $(top_srcdir)/usr.sbin/smtpd/queue_fs.c \ $(top_srcdir)/usr.sbin/smtpd/queue_null.c \ $(top_srcdir)/usr.sbin/smtpd/queue_proc.c \ $(top_srcdir)/usr.sbin/smtpd/queue_ram.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_null.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_proc.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_ramqueue.c \ $(top_srcdir)/usr.sbin/smtpd/stat_ramstat.c \ $(top_srcdir)/openbsd-compat/event_asr_run.c \ $(top_srcdir)/openbsd-compat/libasr/asr.c \ $(top_srcdir)/openbsd-compat/libasr/asr_compat.c \ $(top_srcdir)/openbsd-compat/libasr/asr_debug.c \ $(top_srcdir)/openbsd-compat/libasr/asr_utils.c \ $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c \ $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c \ $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c \ $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c \ $(top_srcdir)/openbsd-compat/libasr/res_search_async.c \ $(top_srcdir)/openbsd-compat/libasr/res_send_async.c \ $(top_srcdir)/openbsd-compat/libtls/a_time_posix.c \ $(top_srcdir)/openbsd-compat/libtls/tls.c \ $(top_srcdir)/openbsd-compat/libtls/tls_client.c \ $(top_srcdir)/openbsd-compat/libtls/tls_bio_cb.c \ $(top_srcdir)/openbsd-compat/libtls/tls_config.c \ $(top_srcdir)/openbsd-compat/libtls/tls_conninfo.c \ $(top_srcdir)/openbsd-compat/libtls/tls_keypair.c \ $(top_srcdir)/openbsd-compat/libtls/tls_server.c \ $(top_srcdir)/openbsd-compat/libtls/tls_ocsp.c \ $(top_srcdir)/openbsd-compat/libtls/tls_peer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_signer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_util.c \ $(top_srcdir)/openbsd-compat/libtls/tls_verify.c \ $(top_srcdir)/openbsd-compat/libtls/by_mem.c \ $(top_srcdir)/openbsd-compat/libtls/openssl.c @HAVE_DB_API_TRUE@am__objects_1 = $(top_builddir)/usr.sbin/smtpd/table_db.$(OBJEXT) @NEED_LIBASR_TRUE@am__objects_2 = $(top_builddir)/openbsd-compat/event_asr_run.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/asr.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/asr_compat.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/asr_debug.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/asr_utils.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/getnameinfo_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/res_search_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/res_send_async.$(OBJEXT) am_smtpd_OBJECTS = $(top_builddir)/usr.sbin/smtpd/aliases.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/bounce.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ca.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/compress_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/config.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/control.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/dict.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/dispatcher.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/dns.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/esc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/envelope.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/expand.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/forward.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/iobuf.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/limit.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/lka.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/lka_filter.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/lka_session.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mda.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mda_mbox.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mda_unpriv.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mda_variables.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mproc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mailaddr.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mta.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/mta_session.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/parse.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/proxy.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/report_smtp.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/resolver.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/rfc5322.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ruleset.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/runq.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/scheduler.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/scheduler_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtp.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtp_session.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpd.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/srs.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ssl.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/stat_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/table.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/to.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/tree.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/unpack_dns.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/util.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/waitq.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ioev.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/crypto.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/compress_gzip.$(OBJEXT) \ $(am__objects_1) \ $(top_builddir)/usr.sbin/smtpd/table_getpwnam.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/table_proc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/table_static.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue_fs.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue_null.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue_proc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/queue_ram.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/scheduler_null.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/scheduler_proc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/scheduler_ramqueue.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/stat_ramstat.$(OBJEXT) \ $(am__objects_2) \ $(top_builddir)/openbsd-compat/libtls/a_time_posix.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_client.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_bio_cb.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_config.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_conninfo.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_keypair.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_server.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_ocsp.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_peer.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_signer.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_util.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_verify.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/by_mem.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/openssl.$(OBJEXT) smtpd_OBJECTS = $(am_smtpd_OBJECTS) smtpd_LDADD = $(LDADD) am__DEPENDENCIES_1 = smtpd_DEPENDENCIES = $(LIBOBJS) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ $(top_builddir)/openbsd-compat/$(DEPDIR)/event_asr_run.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_compat.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_debug.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_utils.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getaddrinfo_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/gethostnamadr_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnameinfo_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnetnamadr_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_search_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_send_async.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/aliases.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/bounce.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ca.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_gzip.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/config.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/control.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/crypto.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dict.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dispatcher.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dns.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/envelope.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/esc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/expand.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/forward.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/limit.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_filter.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_session.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mailaddr.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_mbox.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_unpriv.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_variables.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mproc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta_session.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/parse.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/proxy.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_fs.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_null.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_proc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_ram.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/report_smtp.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/resolver.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/rfc5322.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ruleset.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/runq.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_null.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_proc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_ramqueue.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_session.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpd.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/srs.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_ramstat.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_db.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_getpwnam.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_proc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_static.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/to.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/tree.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/unpack_dns.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/util.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/waitq.Po \ ../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(smtpd_SOURCES) DIST_SOURCES = $(am__smtpd_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c \ $(top_srcdir)/usr.sbin/smtpd/parse.c $(top_srcdir)/ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" # backends # libtls smtpd_SOURCES = $(top_srcdir)/usr.sbin/smtpd/aliases.c \ $(top_srcdir)/usr.sbin/smtpd/bounce.c \ $(top_srcdir)/usr.sbin/smtpd/ca.c \ $(top_srcdir)/usr.sbin/smtpd/compress_backend.c \ $(top_srcdir)/usr.sbin/smtpd/config.c \ $(top_srcdir)/usr.sbin/smtpd/control.c \ $(top_srcdir)/usr.sbin/smtpd/dict.c \ $(top_srcdir)/usr.sbin/smtpd/dispatcher.c \ $(top_srcdir)/usr.sbin/smtpd/dns.c \ $(top_srcdir)/usr.sbin/smtpd/esc.c \ $(top_srcdir)/usr.sbin/smtpd/envelope.c \ $(top_srcdir)/usr.sbin/smtpd/expand.c \ $(top_srcdir)/usr.sbin/smtpd/forward.c \ $(top_srcdir)/usr.sbin/smtpd/iobuf.c \ $(top_srcdir)/usr.sbin/smtpd/limit.c \ $(top_srcdir)/usr.sbin/smtpd/lka.c \ $(top_srcdir)/usr.sbin/smtpd/lka_filter.c \ $(top_srcdir)/usr.sbin/smtpd/lka_session.c \ $(top_srcdir)/usr.sbin/smtpd/log.c \ $(top_srcdir)/usr.sbin/smtpd/mda.c \ $(top_srcdir)/usr.sbin/smtpd/mda_mbox.c \ $(top_srcdir)/usr.sbin/smtpd/mda_unpriv.c \ $(top_srcdir)/usr.sbin/smtpd/mda_variables.c \ $(top_srcdir)/usr.sbin/smtpd/mproc.c \ $(top_srcdir)/usr.sbin/smtpd/mailaddr.c \ $(top_srcdir)/usr.sbin/smtpd/mta.c \ $(top_srcdir)/usr.sbin/smtpd/mta_session.c \ $(top_srcdir)/usr.sbin/smtpd/parse.y \ $(top_srcdir)/usr.sbin/smtpd/proxy.c \ $(top_srcdir)/usr.sbin/smtpd/queue.c \ $(top_srcdir)/usr.sbin/smtpd/queue_backend.c \ $(top_srcdir)/usr.sbin/smtpd/report_smtp.c \ $(top_srcdir)/usr.sbin/smtpd/resolver.c \ $(top_srcdir)/usr.sbin/smtpd/rfc5322.c \ $(top_srcdir)/usr.sbin/smtpd/ruleset.c \ $(top_srcdir)/usr.sbin/smtpd/runq.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_backend.c \ $(top_srcdir)/usr.sbin/smtpd/smtp.c \ $(top_srcdir)/usr.sbin/smtpd/smtp_session.c \ $(top_srcdir)/usr.sbin/smtpd/smtpd.c \ $(top_srcdir)/usr.sbin/smtpd/srs.c \ $(top_srcdir)/usr.sbin/smtpd/ssl.c \ $(top_srcdir)/usr.sbin/smtpd/stat_backend.c \ $(top_srcdir)/usr.sbin/smtpd/table.c \ $(top_srcdir)/usr.sbin/smtpd/to.c \ $(top_srcdir)/usr.sbin/smtpd/tree.c \ $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c \ $(top_srcdir)/usr.sbin/smtpd/util.c \ $(top_srcdir)/usr.sbin/smtpd/waitq.c \ $(top_srcdir)/usr.sbin/smtpd/ioev.c \ $(top_srcdir)/usr.sbin/smtpd/crypto.c \ $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c $(am__append_1) \ $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c \ $(top_srcdir)/usr.sbin/smtpd/table_proc.c \ $(top_srcdir)/usr.sbin/smtpd/table_static.c \ $(top_srcdir)/usr.sbin/smtpd/queue_fs.c \ $(top_srcdir)/usr.sbin/smtpd/queue_null.c \ $(top_srcdir)/usr.sbin/smtpd/queue_proc.c \ $(top_srcdir)/usr.sbin/smtpd/queue_ram.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_null.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_proc.c \ $(top_srcdir)/usr.sbin/smtpd/scheduler_ramqueue.c \ $(top_srcdir)/usr.sbin/smtpd/stat_ramstat.c $(am__append_2) \ $(top_srcdir)/openbsd-compat/libtls/a_time_posix.c \ $(top_srcdir)/openbsd-compat/libtls/tls.c \ $(top_srcdir)/openbsd-compat/libtls/tls_client.c \ $(top_srcdir)/openbsd-compat/libtls/tls_bio_cb.c \ $(top_srcdir)/openbsd-compat/libtls/tls_config.c \ $(top_srcdir)/openbsd-compat/libtls/tls_conninfo.c \ $(top_srcdir)/openbsd-compat/libtls/tls_keypair.c \ $(top_srcdir)/openbsd-compat/libtls/tls_server.c \ $(top_srcdir)/openbsd-compat/libtls/tls_ocsp.c \ $(top_srcdir)/openbsd-compat/libtls/tls_peer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_signer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_util.c \ $(top_srcdir)/openbsd-compat/libtls/tls_verify.c \ $(top_srcdir)/openbsd-compat/libtls/by_mem.c \ $(top_srcdir)/openbsd-compat/libtls/openssl.c AM_CPPFLAGS = -DIO_TLS \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(top_srcdir)/openbsd-compat/libtls \ -I$(srcdir) $(PATHS) @DEFS@ LDADD = $(LIBOBJS) $(DB_LIB) MANPAGES = aliases.5.out forward.5.out smtpd.8.out \ smtpd.conf.5.out smtpd-filters.7.out \ smtpd-tables.7.out table.5.out MANPAGES_IN = $(top_srcdir)/usr.sbin/smtpd/aliases.5 \ $(top_srcdir)/usr.sbin/smtpd/forward.5 \ $(top_srcdir)/usr.sbin/smtpd/smtpd.8 \ $(top_srcdir)/usr.sbin/smtpd/smtpd.conf.5 \ $(top_srcdir)/usr.sbin/smtpd/smtpd-filters.7 \ $(top_srcdir)/usr.sbin/smtpd/smtpd-tables.7 \ $(top_srcdir)/usr.sbin/smtpd/table.5 CONFIGFILES = smtpd.conf.out CONFIGFILES_IN = $(top_srcdir)/usr.sbin/smtpd/smtpd.conf EXTRA_DIST = $(CONFIGFILES_IN) $(MANPAGES_IN) \ $(top_srcdir)/usr.sbin/smtpd/rfc5322.h \ $(top_srcdir)/usr.sbin/smtpd/unpack_dns.h \ $(top_srcdir)/usr.sbin/smtpd/tree.h \ $(top_srcdir)/usr.sbin/smtpd/smtp.h \ $(top_srcdir)/usr.sbin/smtpd/smtpd.h \ $(top_srcdir)/usr.sbin/smtpd/smtpd-api.h \ $(top_srcdir)/usr.sbin/smtpd/smtpd-defines.h \ $(top_srcdir)/usr.sbin/smtpd/ioev.h \ $(top_srcdir)/usr.sbin/smtpd/iobuf.h \ $(top_srcdir)/usr.sbin/smtpd/log.h \ $(top_srcdir)/usr.sbin/smtpd/ssl.h \ $(top_srcdir)/usr.sbin/smtpd/parser.h \ $(top_srcdir)/usr.sbin/smtpd/dict.h PATHSUBS = -e 's|/etc/mail/|$(sysconfdir)/|g' \ -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/local/libexec/smtpd/|$(pkglibexecdir)|g' FIXPATHSCMD = $(SED) $(PATHSUBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/smtpd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/smtpd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../openbsd-compat/ @: > ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/arc4random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/base64.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/basename.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/clock_gettime.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/closefrom.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/daemon.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/dirname.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/errc.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fgetln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fparseln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/freezero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablecount.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablesize.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getpeereid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getsubopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/nanosleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pidfile.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pipe2.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/reallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/recallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_hnok.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setegid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/seteuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setproctitle.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresgid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/signal.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcat.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcpy.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strmode.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strndup.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strnlen.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strsep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strtonum.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/usleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/vis.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/aliases.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/bounce.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ca.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/compress_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/config.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/control.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/dict.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/dispatcher.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/dns.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/esc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/envelope.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/expand.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/forward.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/iobuf.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/limit.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/lka.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/lka_filter.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/lka_session.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mda.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mda_mbox.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mda_unpriv.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mda_variables.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mproc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mailaddr.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mta.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mta_session.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/parse.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/proxy.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/report_smtp.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/resolver.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/rfc5322.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ruleset.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/runq.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/scheduler.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/scheduler_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtp.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtp_session.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpd.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/srs.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ssl.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/stat_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/table.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/to.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/tree.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/unpack_dns.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/util.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/waitq.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ioev.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/crypto.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/compress_gzip.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/table_db.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/table_getpwnam.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/table_proc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/table_static.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue_fs.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue_null.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue_proc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/queue_ram.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/scheduler_null.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/scheduler_proc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/scheduler_ramqueue.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/stat_ramstat.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat @: > $(top_builddir)/openbsd-compat/$(am__dirstamp) $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/event_asr_run.$(OBJEXT): \ $(top_builddir)/openbsd-compat/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libasr @: > $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/asr.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/asr_compat.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/asr_debug.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/asr_utils.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/getnameinfo_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/res_search_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/res_send_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libtls @: > $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libtls/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/a_time_posix.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_client.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_bio_cb.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_config.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_conninfo.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_keypair.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_server.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_ocsp.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_peer.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_signer.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_util.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_verify.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/by_mem.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/openssl.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) smtpd$(EXEEXT): $(smtpd_OBJECTS) $(smtpd_DEPENDENCIES) $(EXTRA_smtpd_DEPENDENCIES) @rm -f smtpd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtpd_OBJECTS) $(smtpd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/*.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/libasr/*.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/libtls/*.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/$(DEPDIR)/event_asr_run.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_compat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getaddrinfo_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/gethostnamadr_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnameinfo_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnetnamadr_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_search_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_send_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/aliases.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/bounce.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ca.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_gzip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/control.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/crypto.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dict.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dispatcher.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/envelope.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/esc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/expand.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/forward.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/limit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_filter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_session.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mailaddr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_mbox.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_unpriv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_variables.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mproc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta_session.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/proxy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_fs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_null.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_proc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_ram.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/report_smtp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/resolver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/rfc5322.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ruleset.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/runq.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_null.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_proc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_ramqueue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_session.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/srs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_ramstat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_db.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_getpwnam.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_proc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_static.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/to.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/tree.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/unpack_dns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/waitq.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libasr/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libtls/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f $(top_srcdir)/usr.sbin/smtpd/parse.c clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/event_asr_run.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_compat.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_debug.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_utils.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getaddrinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/gethostnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnameinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnetnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_search_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_send_async.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/aliases.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/bounce.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ca.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_gzip.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/config.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/control.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/crypto.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dict.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dispatcher.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/envelope.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/esc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/expand.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/forward.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/limit.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_filter.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mailaddr.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_mbox.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_unpriv.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_variables.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mproc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/parse.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/proxy.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_fs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_null.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_ram.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/report_smtp.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/resolver.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/rfc5322.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ruleset.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/runq.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_null.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_ramqueue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpd.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/srs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_ramstat.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_db.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_getpwnam.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_static.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/to.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/tree.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/unpack_dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/util.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/waitq.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/event_asr_run.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_compat.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_debug.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/asr_utils.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getaddrinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/gethostnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnameinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/getnetnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_search_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/res_send_async.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/aliases.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/bounce.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ca.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/compress_gzip.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/config.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/control.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/crypto.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dict.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dispatcher.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/envelope.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/esc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/expand.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/forward.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/limit.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_filter.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/lka_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mailaddr.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_mbox.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_unpriv.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mda_variables.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mproc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mta_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/parse.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/proxy.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_fs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_null.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/queue_ram.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/report_smtp.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/resolver.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/rfc5322.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ruleset.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/runq.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_null.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/scheduler_ramqueue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_session.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpd.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/srs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/stat_ramstat.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_db.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_getpwnam.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/table_static.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/to.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/tree.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/unpack_dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/util.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/waitq.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-sbinPROGRAMS .PRECIOUS: Makefile $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi $(CONFIGFILES): $(CONFIGFILES_IN) conffile=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/.out$$//'`; \ $(CAT) $${conffile} > $@ # smtpd.conf # newaliases makemap install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(sysconfdir) $(MKDIR_P) $(DESTDIR)$(bindir) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)7 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 @if [ ! -f $(DESTDIR)$(sysconfdir)/smtpd.conf ]; then \ $(INSTALL) -m 644 smtpd.conf.out $(DESTDIR)$(sysconfdir)/smtpd.conf; \ else \ echo "$(DESTDIR)$(sysconfdir)/smtpd.conf already exists, install will not overwrite"; \ fi $(INSTALL) -m 644 aliases.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5 $(INSTALL) -m 644 forward.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5 $(INSTALL) -m 644 table.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/table.5 $(INSTALL) -m 644 smtpd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/smtpd.8 $(INSTALL) -m 644 smtpd.conf.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/smtpd.conf.5 $(INSTALL) -m 644 smtpd-filters.7.out $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-filters.7 $(INSTALL) -m 644 smtpd-tables.7.out $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-tables.7 rm aliases.5.out forward.5.out table.5.out \ smtpd.8.out smtpd.conf.5.out smtpd-filters.7.out smtpd-tables.7.out smtpd.conf.out uninstall-hook: # XXX to make "make distcheck" happy we need to rm smtpd.conf rm -f $(DESTDIR)$(sysconfdir)/smtpd.conf \ $(DESTDIR)$(mandir)/$(mansubdir)5/aliases.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/forward.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/table.5 \ $(DESTDIR)$(mandir)/$(mansubdir)5/smtpd.conf.5 \ $(DESTDIR)$(mandir)/$(mansubdir)8/smtpd.8 \ $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-filters.7 \ $(DESTDIR)$(mandir)/$(mansubdir)7/smtpd-tables.7 rmdir $(DESTDIR)$(mandir)/$(mansubdir)5 \ $(DESTDIR)$(mandir)/$(mansubdir)7 \ $(DESTDIR)$(mandir)/$(mansubdir)8 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/smtp/0000755000175000001440000000000015010115322011113 5opensmtpd-7.7.0p0/mk/smtp/Makefile.am0000644000175000001440000000451414764503545013122 include $(top_srcdir)/mk/pathnames bin_PROGRAMS= smtp smtp_SOURCES= $(top_srcdir)/usr.sbin/smtpd/iobuf.c smtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ioev.c smtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c smtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtp_client.c smtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtpc.c smtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/ssl.c # libtls smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/a_time_posix.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_client.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_bio_cb.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_config.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_conninfo.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_keypair.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_server.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_ocsp.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_peer.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_signer.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_util.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/tls_verify.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/by_mem.c smtp_SOURCES+= $(top_srcdir)/openbsd-compat/libtls/openssl.c AM_CPPFLAGS= -DIO_TLS \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(top_srcdir)/openbsd-compat/libtls \ -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LDADD= $(LIBOBJS) MANPAGES= smtp.1.out MANPAGES_IN= $(top_srcdir)/usr.sbin/smtpd/smtp.1 EXTRA_DIST= $(MANPAGES_IN) PATHSUBS= -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/libexec|$(libexecdir)|g' \ -e 's|/etc/mail/|$(sysconfdir)/|g' FIXPATHSCMD= $(SED) $(PATHSUBS) $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)1 $(INSTALL) -m 644 smtp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1 rm smtp.1.out uninstall-hook: rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1 rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 2> /dev/null || true opensmtpd-7.7.0p0/mk/smtp/Makefile.in0000644000175000001440000015446615010115300013114 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = smtp$(EXEEXT) subdir = mk/smtp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) LIBOBJDIR = ../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_smtp_OBJECTS = $(top_builddir)/usr.sbin/smtpd/iobuf.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ioev.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtp_client.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpc.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/ssl.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/a_time_posix.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_client.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_bio_cb.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_config.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_conninfo.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_keypair.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_server.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_ocsp.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_peer.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_signer.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_util.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/tls_verify.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/by_mem.$(OBJEXT) \ $(top_builddir)/openbsd-compat/libtls/openssl.$(OBJEXT) smtp_OBJECTS = $(am_smtp_OBJECTS) smtp_LDADD = $(LDADD) smtp_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_client.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po \ ../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(smtp_SOURCES) DIST_SOURCES = $(smtp_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" # libtls smtp_SOURCES = $(top_srcdir)/usr.sbin/smtpd/iobuf.c \ $(top_srcdir)/usr.sbin/smtpd/ioev.c \ $(top_srcdir)/usr.sbin/smtpd/log.c \ $(top_srcdir)/usr.sbin/smtpd/smtp_client.c \ $(top_srcdir)/usr.sbin/smtpd/smtpc.c \ $(top_srcdir)/usr.sbin/smtpd/ssl.c \ $(top_srcdir)/openbsd-compat/libtls/a_time_posix.c \ $(top_srcdir)/openbsd-compat/libtls/tls.c \ $(top_srcdir)/openbsd-compat/libtls/tls_client.c \ $(top_srcdir)/openbsd-compat/libtls/tls_bio_cb.c \ $(top_srcdir)/openbsd-compat/libtls/tls_config.c \ $(top_srcdir)/openbsd-compat/libtls/tls_conninfo.c \ $(top_srcdir)/openbsd-compat/libtls/tls_keypair.c \ $(top_srcdir)/openbsd-compat/libtls/tls_server.c \ $(top_srcdir)/openbsd-compat/libtls/tls_ocsp.c \ $(top_srcdir)/openbsd-compat/libtls/tls_peer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_signer.c \ $(top_srcdir)/openbsd-compat/libtls/tls_util.c \ $(top_srcdir)/openbsd-compat/libtls/tls_verify.c \ $(top_srcdir)/openbsd-compat/libtls/by_mem.c \ $(top_srcdir)/openbsd-compat/libtls/openssl.c AM_CPPFLAGS = -DIO_TLS \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(top_srcdir)/openbsd-compat/libtls \ -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LDADD = $(LIBOBJS) MANPAGES = smtp.1.out MANPAGES_IN = $(top_srcdir)/usr.sbin/smtpd/smtp.1 EXTRA_DIST = $(MANPAGES_IN) PATHSUBS = -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/libexec|$(libexecdir)|g' \ -e 's|/etc/mail/|$(sysconfdir)/|g' FIXPATHSCMD = $(SED) $(PATHSUBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/smtp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/smtp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../openbsd-compat/ @: > ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/arc4random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/base64.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/basename.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/clock_gettime.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/closefrom.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/daemon.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/dirname.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/errc.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fgetln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fparseln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/freezero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablecount.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablesize.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getpeereid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getsubopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/nanosleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pidfile.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pipe2.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/reallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/recallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_hnok.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setegid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/seteuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setproctitle.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresgid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/signal.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcat.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcpy.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strmode.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strndup.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strnlen.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strsep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strtonum.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/usleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/vis.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/iobuf.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ioev.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtp_client.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/ssl.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libtls @: > $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libtls/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/a_time_posix.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_client.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_bio_cb.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_config.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_conninfo.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_keypair.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_server.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_ocsp.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_peer.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_signer.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_util.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/tls_verify.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/by_mem.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libtls/openssl.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) smtp$(EXEEXT): $(smtp_OBJECTS) $(smtp_DEPENDENCIES) $(EXTRA_smtp_DEPENDENCIES) @rm -f smtp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtp_OBJECTS) $(smtp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/libtls/*.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libtls/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libtls/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_client.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/a_time_posix.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/by_mem.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/openssl.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_bio_cb.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_client.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_config.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_conninfo.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_keypair.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_ocsp.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_peer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_server.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_signer.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_util.Po -rm -f $(top_builddir)/openbsd-compat/libtls/$(DEPDIR)/tls_verify.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/iobuf.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ioev.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtp_client.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/ssl.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-hook .PRECIOUS: Makefile $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)1 $(INSTALL) -m 644 smtp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1 rm smtp.1.out uninstall-hook: rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/smtp.1 rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/Makefile.am0000644000175000001440000000013614610663500012117 SUBDIRS = smtpd SUBDIRS += smtpctl SUBDIRS += mail SUBDIRS += smtp EXTRA_DIST = mdoc2man.awk opensmtpd-7.7.0p0/mk/smtpctl/0000755000175000001440000000000015010115322011616 5opensmtpd-7.7.0p0/mk/smtpctl/Makefile.am0000644000175000001440000001034414764503545013623 include $(top_srcdir)/mk/pathnames sbin_PROGRAMS= smtpctl smtpctl_SOURCES= $(top_srcdir)/usr.sbin/smtpd/enqueue.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/parser.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/envelope.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_backend.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/queue_fs.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/smtpctl.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/spfwalk.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/util.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/compress_backend.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/to.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/expand.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/tree.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/dict.c if HAVE_DB_API smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/config.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/parse.y smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/limit.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_static.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_db.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/table_proc.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/mailaddr.c smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/makemap.c endif smtpctl_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/crypto.c # libasr if NEED_LIBASR smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/event_asr_run.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_compat.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_debug.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/asr_utils.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/res_search_async.c smtpctl_SOURCES+= $(top_srcdir)/openbsd-compat/libasr/res_send_async.c endif smtpctl_CPPFLAGS= -DNO_IO -DCONFIG_MINIMUM \ -DPATH_GZCAT=\"$(ZCAT)\" \ -DPATH_ENCRYPT=\"$(pkglibexecdir)/encrypt\" \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LDADD= $(LIBOBJS) if HAVE_DB_API LDADD+= $(DB_LIB) endif MANPAGES= smtpctl.8.out sendmail.8.out makemap.8.out newaliases.8.out MANPAGES_IN= $(top_srcdir)/usr.sbin/smtpd/smtpctl.8 $(top_srcdir)/usr.sbin/smtpd/sendmail.8 $(top_srcdir)/usr.sbin/smtpd/makemap.8 $(top_srcdir)/usr.sbin/smtpd/newaliases.8 EXTRA_DIST= $(MANPAGES_IN) PATHSUBS= -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/libexec|$(libexecdir)|g' \ -e 's|/etc/mail/|$(sysconfdir)/|g' FIXPATHSCMD= $(SED) $(PATHSUBS) $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 chgrp $(SMTPD_QUEUE_USER) $(DESTDIR)$(sbindir)/smtpctl || true chmod 2555 $(DESTDIR)$(sbindir)/smtpctl || true $(INSTALL) -m 644 smtpctl.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/smtpctl.8 $(INSTALL) -m 644 sendmail.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sendmail.8 $(INSTALL) -m 644 makemap.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/makemap.8 $(INSTALL) -m 644 newaliases.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/newaliases.8 rm smtpctl.8.out sendmail.8.out makemap.8.out newaliases.8.out uninstall-hook: rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/smtpctl.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sendmail.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/makemap.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/newaliases.8 rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 2> /dev/null || true opensmtpd-7.7.0p0/mk/smtpctl/Makefile.in0000644000175000001440000053603315010115300013611 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = smtpctl$(EXEEXT) @HAVE_DB_API_TRUE@am__append_1 = \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/config.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/parse.y \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/limit.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/table.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/table_static.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/table_db.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/table_proc.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/mailaddr.c \ @HAVE_DB_API_TRUE@ $(top_srcdir)/usr.sbin/smtpd/makemap.c # libasr @NEED_LIBASR_TRUE@am__append_2 = $(top_srcdir)/openbsd-compat/event_asr_run.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_compat.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_debug.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/asr_utils.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/res_search_async.c \ @NEED_LIBASR_TRUE@ $(top_srcdir)/openbsd-compat/libasr/res_send_async.c @HAVE_DB_API_TRUE@am__append_3 = $(DB_LIB) subdir = mk/smtpctl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) LIBOBJDIR = ../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am__smtpctl_SOURCES_DIST = $(top_srcdir)/usr.sbin/smtpd/enqueue.c \ $(top_srcdir)/usr.sbin/smtpd/parser.c \ $(top_srcdir)/usr.sbin/smtpd/log.c \ $(top_srcdir)/usr.sbin/smtpd/envelope.c \ $(top_srcdir)/usr.sbin/smtpd/queue_backend.c \ $(top_srcdir)/usr.sbin/smtpd/queue_fs.c \ $(top_srcdir)/usr.sbin/smtpd/smtpctl.c \ $(top_srcdir)/usr.sbin/smtpd/spfwalk.c \ $(top_srcdir)/usr.sbin/smtpd/util.c \ $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c \ $(top_srcdir)/usr.sbin/smtpd/compress_backend.c \ $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c \ $(top_srcdir)/usr.sbin/smtpd/to.c \ $(top_srcdir)/usr.sbin/smtpd/expand.c \ $(top_srcdir)/usr.sbin/smtpd/tree.c \ $(top_srcdir)/usr.sbin/smtpd/dict.c \ $(top_srcdir)/usr.sbin/smtpd/config.c \ $(top_srcdir)/usr.sbin/smtpd/parse.y \ $(top_srcdir)/usr.sbin/smtpd/limit.c \ $(top_srcdir)/usr.sbin/smtpd/table.c \ $(top_srcdir)/usr.sbin/smtpd/table_static.c \ $(top_srcdir)/usr.sbin/smtpd/table_db.c \ $(top_srcdir)/usr.sbin/smtpd/table_getpwnam.c \ $(top_srcdir)/usr.sbin/smtpd/table_proc.c \ $(top_srcdir)/usr.sbin/smtpd/mailaddr.c \ $(top_srcdir)/usr.sbin/smtpd/makemap.c \ $(top_srcdir)/usr.sbin/smtpd/crypto.c \ $(top_srcdir)/openbsd-compat/event_asr_run.c \ $(top_srcdir)/openbsd-compat/libasr/asr.c \ $(top_srcdir)/openbsd-compat/libasr/asr_compat.c \ $(top_srcdir)/openbsd-compat/libasr/asr_debug.c \ $(top_srcdir)/openbsd-compat/libasr/asr_utils.c \ $(top_srcdir)/openbsd-compat/libasr/getaddrinfo_async.c \ $(top_srcdir)/openbsd-compat/libasr/gethostnamadr_async.c \ $(top_srcdir)/openbsd-compat/libasr/getnameinfo_async.c \ $(top_srcdir)/openbsd-compat/libasr/getnetnamadr_async.c \ $(top_srcdir)/openbsd-compat/libasr/res_search_async.c \ $(top_srcdir)/openbsd-compat/libasr/res_send_async.c @HAVE_DB_API_TRUE@am__objects_1 = $(top_builddir)/usr.sbin/smtpd/smtpctl-config.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-table.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.$(OBJEXT) \ @HAVE_DB_API_TRUE@ $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.$(OBJEXT) @NEED_LIBASR_TRUE@am__objects_2 = $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.$(OBJEXT) \ @NEED_LIBASR_TRUE@ $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.$(OBJEXT) am_smtpctl_OBJECTS = \ $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-log.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-util.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-to.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.$(OBJEXT) \ $(am__objects_1) \ $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.$(OBJEXT) \ $(am__objects_2) smtpctl_OBJECTS = $(am_smtpctl_OBJECTS) smtpctl_LDADD = $(LDADD) am__DEPENDENCIES_1 = @HAVE_DB_API_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) smtpctl_DEPENDENCIES = $(LIBOBJS) $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po \ ../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(smtpctl_SOURCES) DIST_SOURCES = $(am__smtpctl_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c \ $(top_srcdir)/usr.sbin/smtpd/parse.c $(top_srcdir)/ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" smtpctl_SOURCES = $(top_srcdir)/usr.sbin/smtpd/enqueue.c \ $(top_srcdir)/usr.sbin/smtpd/parser.c \ $(top_srcdir)/usr.sbin/smtpd/log.c \ $(top_srcdir)/usr.sbin/smtpd/envelope.c \ $(top_srcdir)/usr.sbin/smtpd/queue_backend.c \ $(top_srcdir)/usr.sbin/smtpd/queue_fs.c \ $(top_srcdir)/usr.sbin/smtpd/smtpctl.c \ $(top_srcdir)/usr.sbin/smtpd/spfwalk.c \ $(top_srcdir)/usr.sbin/smtpd/util.c \ $(top_srcdir)/usr.sbin/smtpd/unpack_dns.c \ $(top_srcdir)/usr.sbin/smtpd/compress_backend.c \ $(top_srcdir)/usr.sbin/smtpd/compress_gzip.c \ $(top_srcdir)/usr.sbin/smtpd/to.c \ $(top_srcdir)/usr.sbin/smtpd/expand.c \ $(top_srcdir)/usr.sbin/smtpd/tree.c \ $(top_srcdir)/usr.sbin/smtpd/dict.c $(am__append_1) \ $(top_srcdir)/usr.sbin/smtpd/crypto.c $(am__append_2) smtpctl_CPPFLAGS = -DNO_IO -DCONFIG_MINIMUM \ -DPATH_GZCAT=\"$(ZCAT)\" \ -DPATH_ENCRYPT=\"$(pkglibexecdir)/encrypt\" \ -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat \ -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LDADD = $(LIBOBJS) $(am__append_3) MANPAGES = smtpctl.8.out sendmail.8.out makemap.8.out newaliases.8.out MANPAGES_IN = $(top_srcdir)/usr.sbin/smtpd/smtpctl.8 $(top_srcdir)/usr.sbin/smtpd/sendmail.8 $(top_srcdir)/usr.sbin/smtpd/makemap.8 $(top_srcdir)/usr.sbin/smtpd/newaliases.8 EXTRA_DIST = $(MANPAGES_IN) PATHSUBS = -e 's|/var/run/smtpd.sock|$(sockdir)/smtpd.sock|g' \ -e 's|/usr/libexec|$(libexecdir)|g' \ -e 's|/etc/mail/|$(sysconfdir)/|g' FIXPATHSCMD = $(SED) $(PATHSUBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/smtpctl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/smtpctl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../openbsd-compat/ @: > ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/arc4random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/base64.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/basename.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/clock_gettime.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/closefrom.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/daemon.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/dirname.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/errc.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fgetln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/fparseln.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/freezero.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablecount.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getdtablesize.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getpeereid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/getsubopt.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/imsg.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/nanosleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pidfile.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/pipe2.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/reallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/recallocarray.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_hnok.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/res_random.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setegid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/seteuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setproctitle.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresgid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/setresuid.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/signal.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcat.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strlcpy.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strmode.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strndup.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strnlen.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strsep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/strtonum.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/usleep.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) ../../openbsd-compat/vis.$(OBJEXT): ../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-util.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-to.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-config.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-table.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat @: > $(top_builddir)/openbsd-compat/$(am__dirstamp) $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.$(OBJEXT): \ $(top_builddir)/openbsd-compat/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libasr @: > $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR) @: > $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.$(OBJEXT): \ $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) \ $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) smtpctl$(EXEEXT): $(smtpctl_OBJECTS) $(smtpctl_DEPENDENCIES) $(EXTRA_smtpctl_DEPENDENCIES) @rm -f smtpctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(smtpctl_OBJECTS) $(smtpctl_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/*.$(OBJEXT) -rm -f $(top_builddir)/openbsd-compat/libasr/*.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.o: $(top_builddir)/usr.sbin/smtpd/enqueue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.o `test -f '$(top_builddir)/usr.sbin/smtpd/enqueue.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/enqueue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/enqueue.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.o `test -f '$(top_builddir)/usr.sbin/smtpd/enqueue.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/enqueue.c $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.obj: $(top_builddir)/usr.sbin/smtpd/enqueue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/enqueue.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/enqueue.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/enqueue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/enqueue.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-enqueue.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/enqueue.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/enqueue.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/enqueue.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.o: $(top_builddir)/usr.sbin/smtpd/parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.o `test -f '$(top_builddir)/usr.sbin/smtpd/parser.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/parser.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.o `test -f '$(top_builddir)/usr.sbin/smtpd/parser.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/parser.c $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.obj: $(top_builddir)/usr.sbin/smtpd/parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/parser.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/parser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/parser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/parser.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parser.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/parser.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/parser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/parser.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-log.o: $(top_builddir)/usr.sbin/smtpd/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-log.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-log.o `test -f '$(top_builddir)/usr.sbin/smtpd/log.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/log.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-log.o `test -f '$(top_builddir)/usr.sbin/smtpd/log.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/log.c $(top_builddir)/usr.sbin/smtpd/smtpctl-log.obj: $(top_builddir)/usr.sbin/smtpd/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-log.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-log.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/log.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/log.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/log.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-log.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/log.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/log.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/log.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.o: $(top_builddir)/usr.sbin/smtpd/envelope.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.o `test -f '$(top_builddir)/usr.sbin/smtpd/envelope.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/envelope.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/envelope.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.o `test -f '$(top_builddir)/usr.sbin/smtpd/envelope.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/envelope.c $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.obj: $(top_builddir)/usr.sbin/smtpd/envelope.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/envelope.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/envelope.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/envelope.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/envelope.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-envelope.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/envelope.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/envelope.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/envelope.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.o: $(top_builddir)/usr.sbin/smtpd/queue_backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.o `test -f '$(top_builddir)/usr.sbin/smtpd/queue_backend.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/queue_backend.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/queue_backend.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.o `test -f '$(top_builddir)/usr.sbin/smtpd/queue_backend.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/queue_backend.c $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.obj: $(top_builddir)/usr.sbin/smtpd/queue_backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/queue_backend.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_backend.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/queue_backend.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.o: $(top_builddir)/usr.sbin/smtpd/queue_fs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.o `test -f '$(top_builddir)/usr.sbin/smtpd/queue_fs.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/queue_fs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/queue_fs.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.o `test -f '$(top_builddir)/usr.sbin/smtpd/queue_fs.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/queue_fs.c $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.obj: $(top_builddir)/usr.sbin/smtpd/queue_fs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/queue_fs.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-queue_fs.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/queue_fs.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.o: $(top_builddir)/usr.sbin/smtpd/smtpctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.o `test -f '$(top_builddir)/usr.sbin/smtpd/smtpctl.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/smtpctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/smtpctl.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.o `test -f '$(top_builddir)/usr.sbin/smtpd/smtpctl.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/smtpctl.c $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.obj: $(top_builddir)/usr.sbin/smtpd/smtpctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/smtpctl.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-smtpctl.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/smtpctl.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.o: $(top_builddir)/usr.sbin/smtpd/spfwalk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.o `test -f '$(top_builddir)/usr.sbin/smtpd/spfwalk.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/spfwalk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/spfwalk.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.o `test -f '$(top_builddir)/usr.sbin/smtpd/spfwalk.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/spfwalk.c $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.obj: $(top_builddir)/usr.sbin/smtpd/spfwalk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/spfwalk.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-spfwalk.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/spfwalk.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-util.o: $(top_builddir)/usr.sbin/smtpd/util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-util.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-util.o `test -f '$(top_builddir)/usr.sbin/smtpd/util.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/util.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-util.o `test -f '$(top_builddir)/usr.sbin/smtpd/util.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/util.c $(top_builddir)/usr.sbin/smtpd/smtpctl-util.obj: $(top_builddir)/usr.sbin/smtpd/util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-util.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-util.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/util.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/util.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-util.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/util.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/util.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.o: $(top_builddir)/usr.sbin/smtpd/unpack_dns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.o `test -f '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/unpack_dns.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/unpack_dns.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.o `test -f '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/unpack_dns.c $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.obj: $(top_builddir)/usr.sbin/smtpd/unpack_dns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/unpack_dns.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-unpack_dns.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/unpack_dns.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.o: $(top_builddir)/usr.sbin/smtpd/compress_backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.o `test -f '$(top_builddir)/usr.sbin/smtpd/compress_backend.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/compress_backend.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/compress_backend.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.o `test -f '$(top_builddir)/usr.sbin/smtpd/compress_backend.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/compress_backend.c $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.obj: $(top_builddir)/usr.sbin/smtpd/compress_backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/compress_backend.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_backend.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/compress_backend.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.o: $(top_builddir)/usr.sbin/smtpd/compress_gzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.o `test -f '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/compress_gzip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/compress_gzip.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.o `test -f '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/compress_gzip.c $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.obj: $(top_builddir)/usr.sbin/smtpd/compress_gzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/compress_gzip.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-compress_gzip.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/compress_gzip.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-to.o: $(top_builddir)/usr.sbin/smtpd/to.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-to.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-to.o `test -f '$(top_builddir)/usr.sbin/smtpd/to.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/to.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/to.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-to.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-to.o `test -f '$(top_builddir)/usr.sbin/smtpd/to.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/to.c $(top_builddir)/usr.sbin/smtpd/smtpctl-to.obj: $(top_builddir)/usr.sbin/smtpd/to.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-to.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-to.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/to.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/to.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/to.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/to.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-to.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-to.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/to.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/to.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/to.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.o: $(top_builddir)/usr.sbin/smtpd/expand.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.o `test -f '$(top_builddir)/usr.sbin/smtpd/expand.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/expand.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/expand.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-expand.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.o `test -f '$(top_builddir)/usr.sbin/smtpd/expand.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/expand.c $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.obj: $(top_builddir)/usr.sbin/smtpd/expand.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/expand.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/expand.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/expand.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/expand.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-expand.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-expand.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/expand.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/expand.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/expand.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.o: $(top_builddir)/usr.sbin/smtpd/tree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.o `test -f '$(top_builddir)/usr.sbin/smtpd/tree.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/tree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/tree.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-tree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.o `test -f '$(top_builddir)/usr.sbin/smtpd/tree.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/tree.c $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.obj: $(top_builddir)/usr.sbin/smtpd/tree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/tree.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/tree.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/tree.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/tree.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-tree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-tree.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/tree.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/tree.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/tree.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.o: $(top_builddir)/usr.sbin/smtpd/dict.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.o `test -f '$(top_builddir)/usr.sbin/smtpd/dict.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/dict.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/dict.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-dict.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.o `test -f '$(top_builddir)/usr.sbin/smtpd/dict.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/dict.c $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.obj: $(top_builddir)/usr.sbin/smtpd/dict.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/dict.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/dict.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/dict.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/dict.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-dict.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-dict.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/dict.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/dict.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/dict.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-config.o: $(top_builddir)/usr.sbin/smtpd/config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-config.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-config.o `test -f '$(top_builddir)/usr.sbin/smtpd/config.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/config.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-config.o `test -f '$(top_builddir)/usr.sbin/smtpd/config.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/config.c $(top_builddir)/usr.sbin/smtpd/smtpctl-config.obj: $(top_builddir)/usr.sbin/smtpd/config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-config.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-config.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/config.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/config.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/config.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/config.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-config.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/config.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/config.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/config.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.o: $(top_builddir)/usr.sbin/smtpd/parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.o `test -f '$(top_builddir)/usr.sbin/smtpd/parse.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/parse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/parse.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-parse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.o `test -f '$(top_builddir)/usr.sbin/smtpd/parse.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/parse.c $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.obj: $(top_builddir)/usr.sbin/smtpd/parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/parse.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/parse.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/parse.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/parse.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-parse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-parse.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/parse.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/parse.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/parse.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.o: $(top_builddir)/usr.sbin/smtpd/limit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.o `test -f '$(top_builddir)/usr.sbin/smtpd/limit.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/limit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/limit.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-limit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.o `test -f '$(top_builddir)/usr.sbin/smtpd/limit.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/limit.c $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.obj: $(top_builddir)/usr.sbin/smtpd/limit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/limit.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/limit.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/limit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/limit.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-limit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-limit.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/limit.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/limit.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/limit.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-table.o: $(top_builddir)/usr.sbin/smtpd/table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table.o `test -f '$(top_builddir)/usr.sbin/smtpd/table.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table.o `test -f '$(top_builddir)/usr.sbin/smtpd/table.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table.c $(top_builddir)/usr.sbin/smtpd/smtpctl-table.obj: $(top_builddir)/usr.sbin/smtpd/table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.o: $(top_builddir)/usr.sbin/smtpd/table_static.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_static.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_static.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_static.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_static.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_static.c $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.obj: $(top_builddir)/usr.sbin/smtpd/table_static.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_static.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_static.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_static.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_static.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_static.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_static.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_static.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_static.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.o: $(top_builddir)/usr.sbin/smtpd/table_db.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_db.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_db.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_db.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_db.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_db.c $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.obj: $(top_builddir)/usr.sbin/smtpd/table_db.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_db.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_db.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_db.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_db.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_db.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_db.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_db.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_db.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.o: $(top_builddir)/usr.sbin/smtpd/table_getpwnam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.obj: $(top_builddir)/usr.sbin/smtpd/table_getpwnam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_getpwnam.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_getpwnam.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.o: $(top_builddir)/usr.sbin/smtpd/table_proc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_proc.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_proc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_proc.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.o `test -f '$(top_builddir)/usr.sbin/smtpd/table_proc.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/table_proc.c $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.obj: $(top_builddir)/usr.sbin/smtpd/table_proc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_proc.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_proc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_proc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/table_proc.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-table_proc.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/table_proc.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/table_proc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/table_proc.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.o: $(top_builddir)/usr.sbin/smtpd/mailaddr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.o `test -f '$(top_builddir)/usr.sbin/smtpd/mailaddr.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/mailaddr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/mailaddr.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.o `test -f '$(top_builddir)/usr.sbin/smtpd/mailaddr.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/mailaddr.c $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.obj: $(top_builddir)/usr.sbin/smtpd/mailaddr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/mailaddr.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-mailaddr.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/mailaddr.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.o: $(top_builddir)/usr.sbin/smtpd/makemap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.o `test -f '$(top_builddir)/usr.sbin/smtpd/makemap.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/makemap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/makemap.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.o `test -f '$(top_builddir)/usr.sbin/smtpd/makemap.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/makemap.c $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.obj: $(top_builddir)/usr.sbin/smtpd/makemap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/makemap.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/makemap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/makemap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/makemap.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-makemap.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/makemap.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/makemap.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/makemap.c'; fi` $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.o: $(top_builddir)/usr.sbin/smtpd/crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.o -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.o `test -f '$(top_builddir)/usr.sbin/smtpd/crypto.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/crypto.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/crypto.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.o `test -f '$(top_builddir)/usr.sbin/smtpd/crypto.c' || echo '$(srcdir)/'`$(top_builddir)/usr.sbin/smtpd/crypto.c $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.obj: $(top_builddir)/usr.sbin/smtpd/crypto.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.obj -MD -MP -MF $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Tpo -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/crypto.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/crypto.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/crypto.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Tpo $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/usr.sbin/smtpd/crypto.c' object='$(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/usr.sbin/smtpd/smtpctl-crypto.obj `if test -f '$(top_builddir)/usr.sbin/smtpd/crypto.c'; then $(CYGPATH_W) '$(top_builddir)/usr.sbin/smtpd/crypto.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/usr.sbin/smtpd/crypto.c'; fi` $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.o: $(top_builddir)/openbsd-compat/event_asr_run.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.o -MD -MP -MF $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Tpo -c -o $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.o `test -f '$(top_builddir)/openbsd-compat/event_asr_run.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/event_asr_run.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Tpo $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/event_asr_run.c' object='$(top_builddir)/openbsd-compat/smtpctl-event_asr_run.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.o `test -f '$(top_builddir)/openbsd-compat/event_asr_run.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/event_asr_run.c $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.obj: $(top_builddir)/openbsd-compat/event_asr_run.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.obj -MD -MP -MF $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Tpo -c -o $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.obj `if test -f '$(top_builddir)/openbsd-compat/event_asr_run.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/event_asr_run.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/event_asr_run.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Tpo $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/event_asr_run.c' object='$(top_builddir)/openbsd-compat/smtpctl-event_asr_run.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/smtpctl-event_asr_run.obj `if test -f '$(top_builddir)/openbsd-compat/event_asr_run.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/event_asr_run.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/event_asr_run.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.o: $(top_builddir)/openbsd-compat/libasr/asr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr.c $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.obj: $(top_builddir)/openbsd-compat/libasr/asr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.o: $(top_builddir)/openbsd-compat/libasr/asr_compat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_compat.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_compat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_compat.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_compat.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_compat.c $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.obj: $(top_builddir)/openbsd-compat/libasr/asr_compat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_compat.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_compat.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_compat.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.o: $(top_builddir)/openbsd-compat/libasr/asr_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_debug.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_debug.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_debug.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_debug.c $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.obj: $(top_builddir)/openbsd-compat/libasr/asr_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_debug.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_debug.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_debug.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.o: $(top_builddir)/openbsd-compat/libasr/asr_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_utils.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_utils.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.o `test -f '$(top_builddir)/openbsd-compat/libasr/asr_utils.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/asr_utils.c $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.obj: $(top_builddir)/openbsd-compat/libasr/asr_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/asr_utils.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-asr_utils.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/asr_utils.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.o: $(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.obj: $(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getaddrinfo_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getaddrinfo_async.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.o: $(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.obj: $(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-gethostnamadr_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/gethostnamadr_async.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.o: $(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.obj: $(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnameinfo_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getnameinfo_async.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.o: $(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.obj: $(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-getnetnamadr_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/getnetnamadr_async.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.o: $(top_builddir)/openbsd-compat/libasr/res_search_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/res_search_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/res_search_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/res_search_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/res_search_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/res_search_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.obj: $(top_builddir)/openbsd-compat/libasr/res_search_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/res_search_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_search_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/res_search_async.c'; fi` $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.o: $(top_builddir)/openbsd-compat/libasr/res_send_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.o -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/res_send_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/res_send_async.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/res_send_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.o `test -f '$(top_builddir)/openbsd-compat/libasr/res_send_async.c' || echo '$(srcdir)/'`$(top_builddir)/openbsd-compat/libasr/res_send_async.c $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.obj: $(top_builddir)/openbsd-compat/libasr/res_send_async.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.obj -MD -MP -MF $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Tpo -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Tpo $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/openbsd-compat/libasr/res_send_async.c' object='$(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(smtpctl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(top_builddir)/openbsd-compat/libasr/smtpctl-res_send_async.obj `if test -f '$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; then $(CYGPATH_W) '$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/openbsd-compat/libasr/res_send_async.c'; fi` .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/openbsd-compat/libasr/$(am__dirstamp)" || rm -f $(top_builddir)/openbsd-compat/libasr/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f $(top_srcdir)/usr.sbin/smtpd/parse.c clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/openbsd-compat/$(DEPDIR)/smtpctl-event_asr_run.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_compat.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_debug.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-asr_utils.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getaddrinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-gethostnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnameinfo_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-getnetnamadr_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_search_async.Po -rm -f $(top_builddir)/openbsd-compat/libasr/$(DEPDIR)/smtpctl-res_send_async.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-compress_gzip.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-config.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-crypto.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-dict.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-enqueue.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-envelope.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-expand.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-limit.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-mailaddr.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-makemap.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parse.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-parser.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_backend.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-queue_fs.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-smtpctl.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-spfwalk.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_db.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_getpwnam.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_proc.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-table_static.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-to.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-tree.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-unpack_dns.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/smtpctl-util.Po -rm -f ../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-sbinPROGRAMS .PRECIOUS: Makefile $(MANPAGES): $(MANPAGES_IN) manpage=$(top_srcdir)/usr.sbin/smtpd/`echo $@ | sed 's/\.out$$//'`; \ if test "$(MANTYPE)" = "man"; then \ $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/../mdoc2man.awk > $@; \ else \ $(FIXPATHSCMD) $${manpage} > $@; \ fi install-exec-hook: $(CONFIGFILES) $(MANPAGES) $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 chgrp $(SMTPD_QUEUE_USER) $(DESTDIR)$(sbindir)/smtpctl || true chmod 2555 $(DESTDIR)$(sbindir)/smtpctl || true $(INSTALL) -m 644 smtpctl.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/smtpctl.8 $(INSTALL) -m 644 sendmail.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sendmail.8 $(INSTALL) -m 644 makemap.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/makemap.8 $(INSTALL) -m 644 newaliases.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/newaliases.8 rm smtpctl.8.out sendmail.8.out makemap.8.out newaliases.8.out uninstall-hook: rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/smtpctl.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sendmail.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/makemap.8 rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/newaliases.8 rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/mdoc2man.awk0000644000175000001440000002325114610663500012272 #!/usr/bin/awk # # Copyright (c) 2003 Peter Stuge # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Dramatically overhauled by Tim Kientzle. This version almost # handles library-style pages with Fn, Ft, etc commands. Still # a lot of problems... BEGIN { displaylines = 0 trailer = "" out = "" sep = "" nextsep = " " } # Add a word with appropriate preceding whitespace # Maintain a short queue of the expected upcoming word separators. function add(str) { out=out sep str sep = nextsep nextsep = " " } # Add a word with no following whitespace # Use for opening punctuation such as '(' function addopen(str) { add(str) sep = "" } # Add a word with no preceding whitespace # Use for closing punctuation such as ')' or '.' function addclose(str) { sep = "" add(str) } # Add a word with no space before or after # Use for separating punctuation such as '=' function addpunct(str) { sep = "" add(str) sep = "" } # Emit the current line so far function endline() { addclose(trailer) trailer = "" if(length(out) > 0) { print out out="" } if(displaylines > 0) { displaylines = displaylines - 1 if (displaylines == 0) dispend() } # First word on next line has no preceding whitespace sep = "" } function linecmd(cmd) { endline() add(cmd) endline() } function breakline() { linecmd(".br") } # Start an indented display function dispstart() { linecmd(".RS 4") } # End an indented display function dispend() { linecmd(".RE") } # Collect rest of input line function wtail() { retval="" while(w 0) { sub("^[ \t]*", "", l) if (match(l, "^\"")) { l = substr(l, 2) o = index(l, "\"") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } else { o = match(l, "[ \t]") if (o > 0) { w = substr(l, 1, o-1) l = substr(l, o+1) dest[n++] = w } else { dest[n++] = l l = "" } } } return n-1 } ! /^\./ { out = $0 endline() next } /^\.\\"/ { next } { sub("^\\.","") nwords=splitwords($0, words) # TODO: Instead of iterating 'w' over the array, have a separate # function that returns 'next word' and use that. This will allow # proper handling of double-quoted arguments as well. for(w=1;w<=nwords;w++) { if(match(words[w],"^Li$")) { # Literal; rest of line is unformatted dispstart() displaylines = 1 } else if(match(words[w],"^Dl$")) { # Display literal dispstart() displaylines = 1 } else if(match(words[w],"^Bd$")) { # Begin display if(match(words[w+1],"-literal")) { dispstart() linecmd(".nf") displaylines=10000 w=nwords } } else if(match(words[w],"^Ed$")) { # End display displaylines = 0 dispend() } else if(match(words[w],"^Ns$")) { # Suppress space after next word nextsep = "" } else if(match(words[w],"^No$")) { # Normal text add(words[++w]) } else if(match(words[w],"^Dq$")) { # Quote addopen("``") add(words[++w]) while(w") } else if(match(words[w],"^Dd$")) { date=wtail() next } else if(match(words[w],"^Dt$")) { id=wtail() next } else if(match(words[w],"^Ox$")) { add("OpenBSD") } else if(match(words[w],"^Fx$")) { add("FreeBSD") } else if(match(words[w],"^Nx$")) { add("NetBSD") } else if(match(words[w],"^St$")) { if (match(words[w+1], "^-p1003.1$")) { w++ add("IEEE Std 1003.1 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-96$")) { w++ add("ISO/IEC 9945-1:1996 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-88$")) { w++ add("IEEE Std 1003.1-1988 (``POSIX.1'')") } else if(match(words[w+1], "^-p1003.1-2001$")) { w++ add("IEEE Std 1003.1-2001 (``POSIX.1'')") } else if(match(words[w+1], "^-susv2$")) { w++ add("Version 2 of the Single UNIX Specification (``SUSv2'')") } } else if(match(words[w],"^Ex$")) { if (match(words[w+1], "^-std$")) { w++ add("The \\fB" name "\\fP utility exits 0 on success, and >0 if an error occurs.") } } else if(match(words[w],"^Os$")) { add(".TH " id " \"" date "\" \"" wtail() "\"") } else if(match(words[w],"^Sh$")) { section=wtail() add(".SH " section) linecmd(".ad l") } else if(match(words[w],"^Xr$")) { add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w]) } else if(match(words[w],"^Nm$")) { if(match(section,"SYNOPSIS")) breakline() if(w >= nwords) n=name else if (match(words[w+1], "^[A-Z][a-z]$")) n=name else if (match(words[w+1], "^[.,;:]$")) n=name else { n=words[++w] if(!length(name)) name=n } if(!length(n)) n=name add("\\fB\\%" n "\\fP") } else if(match(words[w],"^Nd$")) { add("\\- " wtail()) } else if(match(words[w],"^Fl$")) { add("\\fB\\-" words[++w] "\\fP") } else if(match(words[w],"^Ar$")) { addopen("\\fI") if(w==nwords) add("file ...\\fP") else add(words[++w] "\\fP") } else if(match(words[w],"^Cm$")) { add("\\fB" words[++w] "\\fP") } else if(match(words[w],"^Op$")) { addopen("[") option=1 trailer="]" trailer } else if(match(words[w],"^Pp$")) { linecmd(".PP") } else if(match(words[w],"^An$")) { endline() } else if(match(words[w],"^Ss$")) { add(".SS") } else if(match(words[w],"^Ft$")) { if (match(section, "SYNOPSIS")) { breakline() } add("\\fI" wtail() "\\fP") if (match(section, "SYNOPSIS")) { breakline() } } else if(match(words[w],"^Fn$")) { ++w F = "\\fB\\%" words[w] "\\fP(" Fsep = "" while(w\\fP") } else if(match(words[w],"^Pa$")) { addopen("\\fI") w++ if(match(words[w],"^\\.")) add("\\&") add(words[w] "\\fP") } else if(match(words[w],"^Dv$")) { add(".BR") } else if(match(words[w],"^Em|Ev$")) { add(".IR") } else if(match(words[w],"^Pq$")) { addopen("(") trailer=")" trailer } else if(match(words[w],"^Aq$")) { addopen("\\%<") trailer=">" trailer } else if(match(words[w],"^Brq$")) { addopen("{") trailer="}" trailer } else if(match(words[w],"^S[xy]$")) { add(".B " wtail()) } else if(match(words[w],"^Ic$")) { add("\\fB") trailer="\\fP" trailer } else if(match(words[w],"^Bl$")) { oldoptlist=optlist linecmd(".RS 5") if(match(words[w+1],"-bullet")) optlist=1 else if(match(words[w+1],"-enum")) { optlist=2 enum=0 } else if(match(words[w+1],"-tag")) optlist=3 else if(match(words[w+1],"-item")) optlist=4 else if(match(words[w+1],"-bullet")) optlist=1 w=nwords } else if(match(words[w],"^El$")) { linecmd(".RE") optlist=oldoptlist } else if(match(words[w],"^It$")&&optlist) { if(optlist==1) add(".IP \\(bu") else if(optlist==2) add(".IP " ++enum ".") else if(optlist==3) { add(".TP") endline() if(match(words[w+1],"^Pa$|^Ev$")) { add(".B") w++ } } else if(optlist==4) add(".IP") } else if(match(words[w],"^Xo$")) { # TODO: Figure out how to handle this } else if(match(words[w],"^Xc$")) { # TODO: Figure out how to handle this } else if(match(words[w],"^[=]$")) { addpunct(words[w]) } else if(match(words[w],"^[[{(]$")) { addopen(words[w]) } else if(match(words[w],"^[\\])}.,;:]$")) { addclose(words[w]) } else { add(words[w]) } } if(match(out,"^\\.[^a-zA-Z]")) sub("^\\.","",out) endline() } opensmtpd-7.7.0p0/mk/mail/0000755000175000001440000000000015010115322011052 5opensmtpd-7.7.0p0/mk/mail/mail.mda/0000755000175000001440000000000015010115322012534 5opensmtpd-7.7.0p0/mk/mail/mail.mda/Makefile.am0000644000175000001440000000063714764503545014545 include $(top_srcdir)/mk/pathnames pkglibexec_PROGRAMS = mail.mda mail_mda_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.mda.c mail_mda_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.mda.8 AM_CPPFLAGS= -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/mk/mail/mail.mda/Makefile.in0000644000175000001440000013305715010115300014526 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = mail.mda$(EXEEXT) subdir = mk/mail/mail.mda ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_mail_mda_OBJECTS = \ $(top_builddir)/usr.sbin/smtpd/mail.mda.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) mail_mda_OBJECTS = $(am_mail_mda_OBJECTS) mail_mda_LDADD = $(LDADD) mail_mda_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mda.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mail_mda_SOURCES) DIST_SOURCES = $(mail_mda_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" mail_mda_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.mda.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.mda.8 AM_CPPFLAGS = -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/mail/mail.mda/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/mail/mail.mda/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mail.mda.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) mail.mda$(EXEEXT): $(mail_mda_OBJECTS) $(mail_mda_DEPENDENCIES) $(EXTRA_mail_mda_DEPENDENCIES) @rm -f mail.mda$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mail_mda_OBJECTS) $(mail_mda_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mda.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mda.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mda.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-pkglibexecPROGRAMS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/mail/mail.maildir/0000755000175000001440000000000015010115322013414 5opensmtpd-7.7.0p0/mk/mail/mail.maildir/Makefile.am0000644000175000001440000000066314764503545015424 include $(top_srcdir)/mk/pathnames pkglibexec_PROGRAMS = mail.maildir mail_maildir_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.maildir.c mail_maildir_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.maildir.8 AM_CPPFLAGS= -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/mk/mail/mail.maildir/Makefile.in0000644000175000001440000013323315010115300015402 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = mail.maildir$(EXEEXT) subdir = mk/mail/mail.maildir ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_mail_maildir_OBJECTS = \ $(top_builddir)/usr.sbin/smtpd/mail.maildir.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) mail_maildir_OBJECTS = $(am_mail_maildir_OBJECTS) mail_maildir_LDADD = $(LDADD) mail_maildir_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.maildir.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mail_maildir_SOURCES) DIST_SOURCES = $(mail_maildir_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" mail_maildir_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.maildir.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.maildir.8 AM_CPPFLAGS = -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/mail/mail.maildir/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/mail/mail.maildir/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mail.maildir.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) mail.maildir$(EXEEXT): $(mail_maildir_OBJECTS) $(mail_maildir_DEPENDENCIES) $(EXTRA_mail_maildir_DEPENDENCIES) @rm -f mail.maildir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mail_maildir_OBJECTS) $(mail_maildir_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.maildir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.maildir.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.maildir.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-pkglibexecPROGRAMS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/mail/mail.lmtp/0000755000175000001440000000000015010115322012747 5opensmtpd-7.7.0p0/mk/mail/mail.lmtp/Makefile.am0000644000175000001440000000064414764503545014756 include $(top_srcdir)/mk/pathnames pkglibexec_PROGRAMS = mail.lmtp mail_lmtp_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.lmtp.c mail_lmtp_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.lmtp.8 AM_CPPFLAGS= -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/mk/mail/mail.lmtp/Makefile.in0000644000175000001440000013311215010115300014731 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = mail.lmtp$(EXEEXT) subdir = mk/mail/mail.lmtp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_mail_lmtp_OBJECTS = \ $(top_builddir)/usr.sbin/smtpd/mail.lmtp.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) mail_lmtp_OBJECTS = $(am_mail_lmtp_OBJECTS) mail_lmtp_LDADD = $(LDADD) mail_lmtp_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.lmtp.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mail_lmtp_SOURCES) DIST_SOURCES = $(mail_lmtp_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" mail_lmtp_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.lmtp.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.lmtp.8 AM_CPPFLAGS = -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/mail/mail.lmtp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/mail/mail.lmtp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mail.lmtp.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) mail.lmtp$(EXEEXT): $(mail_lmtp_OBJECTS) $(mail_lmtp_DEPENDENCIES) $(EXTRA_mail_lmtp_DEPENDENCIES) @rm -f mail.lmtp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mail_lmtp_OBJECTS) $(mail_lmtp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.lmtp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.lmtp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.lmtp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-pkglibexecPROGRAMS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/mail/mail.mboxfile/0000755000175000001440000000000015010115322013600 5opensmtpd-7.7.0p0/mk/mail/mail.mboxfile/Makefile.am0000644000175000001440000000067014764503545015606 include $(top_srcdir)/mk/pathnames pkglibexec_PROGRAMS = mail.mboxfile mail_mboxfile_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.mboxfile.c mail_mboxfile_SOURCES+= $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.mboxfile.8 AM_CPPFLAGS= -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/mk/mail/mail.mboxfile/Makefile.in0000644000175000001440000013326615010115300015574 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = mail.mboxfile$(EXEEXT) subdir = mk/mail/mail.mboxfile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_mail_mboxfile_OBJECTS = \ $(top_builddir)/usr.sbin/smtpd/mail.mboxfile.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) mail_mboxfile_OBJECTS = $(am_mail_mboxfile_OBJECTS) mail_mboxfile_LDADD = $(LDADD) mail_mboxfile_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mboxfile.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mail_mboxfile_SOURCES) DIST_SOURCES = $(mail_mboxfile_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/mk/pathnames \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS = -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" mail_mboxfile_SOURCES = $(top_srcdir)/usr.sbin/smtpd/mail.mboxfile.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = $(top_srcdir)/usr.sbin/smtpd/mail.mboxfile.8 AM_CPPFLAGS = -I$(top_srcdir)/usr.sbin/smtpd \ -I$(top_srcdir)/openbsd-compat LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/mk/pathnames $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/mail/mail.mboxfile/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/mail/mail.mboxfile/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/mk/pathnames $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/mail.mboxfile.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) mail.mboxfile$(EXEEXT): $(mail_mboxfile_OBJECTS) $(mail_mboxfile_DEPENDENCIES) $(EXTRA_mail_mboxfile_DEPENDENCIES) @rm -f mail.mboxfile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mail_mboxfile_OBJECTS) $(mail_mboxfile_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mboxfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mboxfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/mail.mboxfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-pkglibexecPROGRAMS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/mail/Makefile.am0000644000175000001440000000013214610663500013035 SUBDIRS = mail.lmtp SUBDIRS += mail.maildir SUBDIRS += mail.mboxfile SUBDIRS += mail.mda opensmtpd-7.7.0p0/mk/mail/Makefile.in0000644000175000001440000004520515010115300013041 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = mk/mail ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mail.lmtp mail.maildir mail.mboxfile mail.mda all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/mail/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/mail/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/mk/pathnames0000644000175000001440000000061614610663500011771 smtpd_srcdir = $(top_srcdir)/usr.sbin/smtpd compat_srcdir = $(top_srcdir)/openbsd-compat regress_srcdir = $(top_srcdir)/regress/bin PATHS= -DSMTPD_CONFDIR=\"$(sysconfdir)\" \ -DPATH_CHROOT=\"$(PRIVSEP_PATH)\" \ -DPATH_SMTPCTL=\"$(sbindir)/smtpctl\" \ -DPATH_MAILLOCAL=\"$(pkglibexecdir)/mail.local\" \ -DPATH_MAKEMAP=\"$(sbindir)/makemap\" \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" opensmtpd-7.7.0p0/mk/Makefile.in0000644000175000001440000004517215010115300012122 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = mk ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = smtpd smtpctl mail smtp EXTRA_DIST = mdoc2man.awk all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mk/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/usr.sbin/0000755000175000001440000000000015010115322011264 5opensmtpd-7.7.0p0/usr.sbin/smtpd/0000755000175000001440000000000015010115322012413 5opensmtpd-7.7.0p0/usr.sbin/smtpd/mailaddr.c0000644000175000001440000000551314610663500014273 /* $OpenBSD: mailaddr.c,v 1.5 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2015 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static int mailaddr_line_split(char **line, char **ret) { static char buffer[LINE_MAX]; int esc, dq, sq; size_t i; char *s; memset(buffer, 0, sizeof buffer); esc = dq = sq = 0; i = 0; for (s = *line; (*s) && (i < sizeof(buffer)); ++s) { if (esc) { buffer[i++] = *s; esc = 0; continue; } if (*s == '\\') { esc = 1; continue; } if (*s == ',' && !dq && !sq) { *ret = buffer; *line = s+1; return (1); } buffer[i++] = *s; esc = 0; if (*s == '"' && !sq) dq ^= 1; if (*s == '\'' && !dq) sq ^= 1; } if (esc || dq || sq || i == sizeof(buffer)) return (-1); *ret = buffer; *line = s; return (i ? 1 : 0); } int mailaddr_line(struct maddrmap *maddrmap, const char *s) { struct maddrnode mn; char *p, *subrcpt, *buffer; int ret; if ((buffer = strdup(s)) == NULL) return 0; p = buffer; while ((ret = mailaddr_line_split(&p, &subrcpt)) > 0) { subrcpt = strip(subrcpt); if (subrcpt[0] == '\0') continue; if (!text_to_mailaddr(&mn.mailaddr, subrcpt)) { free(buffer); return 0; } log_debug("subrcpt: [%s]", subrcpt); maddrmap_insert(maddrmap, &mn); } free(buffer); if (ret >= 0) return 1; /* expand_line_split() returned < 0 */ return 0; } void maddrmap_init(struct maddrmap *maddrmap) { TAILQ_INIT(&maddrmap->queue); } void maddrmap_insert(struct maddrmap *maddrmap, struct maddrnode *maddrnode) { struct maddrnode *mn; mn = xmemdup(maddrnode, sizeof *maddrnode); TAILQ_INSERT_TAIL(&maddrmap->queue, mn, entries); } void maddrmap_free(struct maddrmap *maddrmap) { struct maddrnode *mn; while ((mn = TAILQ_FIRST(&maddrmap->queue))) { TAILQ_REMOVE(&maddrmap->queue, mn, entries); free(mn); } free(maddrmap); } opensmtpd-7.7.0p0/usr.sbin/smtpd/enqueue.c0000644000175000001440000004754515007615476014212 /* $OpenBSD: enqueue.c,v 1.126 2024/11/21 13:26:25 claudio Exp $ */ /* * Copyright (c) 2005 Henning Brauer * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" extern struct imsgbuf *ibuf; void usage(void); static void build_from(char *, struct passwd *); static int parse_message(FILE *, int, int, FILE *); static void parse_addr(char *, size_t, int); static void parse_addr_terminal(int); static char *qualify_addr(char *); static void rcpt_add(char *); static int open_connection(void); static int get_responses(FILE *, int); static int send_line(FILE *, int, char *, ...) __attribute__((__format__ (printf, 3, 4))); static int enqueue_offline(int, char *[], FILE *, FILE *); static int savedeadletter(struct passwd *, FILE *); extern int srv_connected(void); enum headerfields { HDR_NONE, HDR_FROM, HDR_TO, HDR_CC, HDR_BCC, HDR_SUBJECT, HDR_DATE, HDR_MSGID, HDR_MIME_VERSION, HDR_CONTENT_TYPE, HDR_CONTENT_DISPOSITION, HDR_CONTENT_TRANSFER_ENCODING, HDR_USER_AGENT }; struct { char *word; enum headerfields type; } keywords[] = { { "From:", HDR_FROM }, { "To:", HDR_TO }, { "Cc:", HDR_CC }, { "Bcc:", HDR_BCC }, { "Subject:", HDR_SUBJECT }, { "Date:", HDR_DATE }, { "Message-Id:", HDR_MSGID }, { "MIME-Version:", HDR_MIME_VERSION }, { "Content-Type:", HDR_CONTENT_TYPE }, { "Content-Disposition:", HDR_CONTENT_DISPOSITION }, { "Content-Transfer-Encoding:", HDR_CONTENT_TRANSFER_ENCODING }, { "User-Agent:", HDR_USER_AGENT }, }; #define LINESPLIT 990 #define SMTP_LINELEN 1000 #define TIMEOUTMSG "Timeout\n" #define WSP(c) (c == ' ' || c == '\t') int verbose = 0; static char host[HOST_NAME_MAX+1]; char *user = NULL; time_t timestamp; struct { int fd; char *from; char *fromname; char **rcpts; char *dsn_notify; char *dsn_ret; char *dsn_envid; int rcpt_cnt; int need_linesplit; int saw_date; int saw_msgid; int saw_from; int saw_mime_version; int saw_content_type; int saw_content_disposition; int saw_content_transfer_encoding; int saw_user_agent; int noheader; } msg; struct { uint quote; uint comment; uint esc; uint brackets; size_t wpos; char buf[SMTP_LINELEN]; } pstate; #define QP_TEST_WRAP(fp, buf, linelen, size) do { \ if (((linelen) += (size)) + 1 > 76) { \ fprintf((fp), "=\r\n"); \ if (buf[0] == '.') \ fprintf((fp), "."); \ (linelen) = (size); \ } \ } while (0) /* RFC 2045 section 6.7 */ static void qp_encoded_write(FILE *fp, char *buf) { size_t linelen = 0; for (;buf[0] != '\0' && buf[0] != '\n'; buf++) { /* * Point 3: Any TAB (HT) or SPACE characters on an encoded line * MUST thus be followed on that line by a printable character. * * Ergo, only encode if the next character is EOL. */ if (buf[0] == ' ' || buf[0] == '\t') { if (buf[1] == '\n') { QP_TEST_WRAP(fp, buf, linelen, 3); fprintf(fp, "=%2X", *buf & 0xff); } else { QP_TEST_WRAP(fp, buf, linelen, 1); fprintf(fp, "%c", *buf & 0xff); } /* * Point 1, with exclusion of point 2, skip EBCDIC NOTE. * Do this after whitespace check, else they would match here. */ } else if (!((buf[0] >= 33 && buf[0] <= 60) || (buf[0] >= 62 && buf[0] <= 126))) { QP_TEST_WRAP(fp, buf, linelen, 3); fprintf(fp, "=%2X", *buf & 0xff); /* Point 2: 33 through 60 inclusive, and 62 through 126 */ } else { QP_TEST_WRAP(fp, buf, linelen, 1); fprintf(fp, "%c", *buf); } } fprintf(fp, "\r\n"); } int enqueue(int argc, char *argv[], FILE *ofp) { int i, ch, tflag = 0; char *fake_from = NULL, *buf = NULL; struct passwd *pw; FILE *fp = NULL, *fout; size_t sz = 0, envid_sz = 0; ssize_t len; char *line; int inheaders = 1; int save_argc; char **save_argv; int no_getlogin = 0; memset(&msg, 0, sizeof(msg)); time(×tamp); save_argc = argc; save_argv = argv; while ((ch = getopt(argc, argv, "A:B:b:E::e:F:f:iJ::L:mN:o:p:qr:R:StvV:x")) != -1) { switch (ch) { case 'f': fake_from = optarg; break; case 'F': msg.fromname = optarg; break; case 'N': msg.dsn_notify = optarg; break; case 'r': fake_from = optarg; break; case 'R': msg.dsn_ret = optarg; break; case 'S': no_getlogin = 1; break; case 't': tflag = 1; break; case 'v': verbose = 1; break; case 'V': msg.dsn_envid = optarg; break; /* all remaining: ignored, sendmail compat */ case 'A': case 'B': case 'b': case 'E': case 'e': case 'i': case 'L': case 'm': case 'o': case 'p': case 'x': break; case 'q': /* XXX: implement "process all now" */ return (EX_SOFTWARE); default: usage(); } } argc -= optind; argv += optind; if (getmailname(host, sizeof(host)) == -1) errx(EX_NOHOST, "getmailname"); if (no_getlogin) { if ((pw = getpwuid(getuid())) == NULL) user = "anonymous"; if (pw != NULL) user = xstrdup(pw->pw_name); } else { uid_t ruid = getuid(); if ((user = getlogin()) != NULL && *user != '\0') { if ((pw = getpwnam(user)) == NULL || (ruid != 0 && ruid != pw->pw_uid)) pw = getpwuid(ruid); } else if ((pw = getpwuid(ruid)) == NULL) { user = "anonymous"; } user = xstrdup(pw ? pw->pw_name : user); } build_from(fake_from, pw); while (argc > 0) { rcpt_add(argv[0]); argv++; argc--; } if ((fp = tmpfile()) == NULL) err(EX_UNAVAILABLE, "tmpfile"); msg.noheader = parse_message(stdin, fake_from == NULL, tflag, fp); if (msg.rcpt_cnt == 0) errx(EX_SOFTWARE, "no recipients"); /* init session */ rewind(fp); /* check if working in offline mode */ /* If the server is not running, enqueue the message offline */ if (!srv_connected()) { #if HAVE_PLEDGE if (pledge("stdio", NULL) == -1) err(1, "pledge"); #endif return (enqueue_offline(save_argc, save_argv, fp, ofp)); } if ((msg.fd = open_connection()) == -1) errx(EX_UNAVAILABLE, "server too busy"); #if HAVE_PLEDGE if (pledge("stdio wpath cpath", NULL) == -1) err(1, "pledge"); #endif fout = fdopen(msg.fd, "a+"); if (fout == NULL) err(EX_UNAVAILABLE, "fdopen"); /* * We need to call get_responses after every command because we don't * support PIPELINING on the server-side yet. */ /* banner */ if (!get_responses(fout, 1)) goto fail; if (!send_line(fout, verbose, "EHLO localhost\r\n")) goto fail; if (!get_responses(fout, 1)) goto fail; if (msg.dsn_envid != NULL) envid_sz = strlen(msg.dsn_envid); if (!send_line(fout, verbose, "MAIL FROM:<%s> %s%s %s%s\r\n", msg.from, msg.dsn_ret ? "RET=" : "", msg.dsn_ret ? msg.dsn_ret : "", envid_sz ? "ENVID=" : "", envid_sz ? msg.dsn_envid : "")) goto fail; if (!get_responses(fout, 1)) goto fail; for (i = 0; i < msg.rcpt_cnt; i++) { if (!send_line(fout, verbose, "RCPT TO:<%s> %s%s\r\n", msg.rcpts[i], msg.dsn_notify ? "NOTIFY=" : "", msg.dsn_notify ? msg.dsn_notify : "")) goto fail; if (!get_responses(fout, 1)) goto fail; } if (!send_line(fout, verbose, "DATA\r\n")) goto fail; if (!get_responses(fout, 1)) goto fail; /* add From */ if (!msg.saw_from && !send_line(fout, 0, "From: %s%s<%s>\r\n", msg.fromname ? msg.fromname : "", msg.fromname ? " " : "", msg.from)) goto fail; /* add Date */ if (!msg.saw_date && !send_line(fout, 0, "Date: %s\r\n", time_to_text(timestamp))) goto fail; if (msg.need_linesplit) { /* we will always need to mime encode for long lines */ if (!msg.saw_mime_version && !send_line(fout, 0, "MIME-Version: 1.0\r\n")) goto fail; if (!msg.saw_content_type && !send_line(fout, 0, "Content-Type: text/plain; charset=unknown-8bit\r\n")) goto fail; if (!msg.saw_content_disposition && !send_line(fout, 0, "Content-Disposition: inline\r\n")) goto fail; if (!msg.saw_content_transfer_encoding && !send_line(fout, 0, "Content-Transfer-Encoding: quoted-printable\r\n")) goto fail; } /* add separating newline */ if (msg.noheader) { if (!send_line(fout, 0, "\r\n")) goto fail; inheaders = 0; } for (;;) { if ((len = getline(&buf, &sz, fp)) == -1) { if (feof(fp)) break; else err(EX_UNAVAILABLE, "getline"); } /* newlines have been normalized on first parsing */ if (buf[len-1] != '\n') errx(EX_SOFTWARE, "expect EOL"); len--; if (buf[0] == '.') { if (fputc('.', fout) == EOF) goto fail; } line = buf; if (inheaders) { if (strncasecmp("from ", line, 5) == 0) continue; if (strncasecmp("return-path: ", line, 13) == 0) continue; } if (msg.saw_content_transfer_encoding || msg.noheader || inheaders || !msg.need_linesplit) { if (!send_line(fout, 0, "%.*s\r\n", (int)len, line)) goto fail; if (inheaders && buf[0] == '\n') inheaders = 0; continue; } /* we don't have a content transfer encoding, use our default */ qp_encoded_write(fout, line); } free(buf); if (!send_line(fout, verbose, ".\r\n")) goto fail; if (!get_responses(fout, 1)) goto fail; if (!send_line(fout, verbose, "QUIT\r\n")) goto fail; if (!get_responses(fout, 1)) goto fail; fclose(fp); fclose(fout); exit(EX_OK); fail: if (pw) savedeadletter(pw, fp); exit(EX_SOFTWARE); } static int get_responses(FILE *fin, int n) { char *buf = NULL; size_t sz = 0; ssize_t len; int e, ret = 0; fflush(fin); if ((e = ferror(fin))) { warnx("ferror: %d", e); goto err; } while (n) { if ((len = getline(&buf, &sz, fin)) == -1) { if (ferror(fin)) { warn("getline"); goto err; } else if (feof(fin)) break; else err(EX_UNAVAILABLE, "getline"); } /* account for \r\n linebreaks */ if (len >= 2 && buf[len - 2] == '\r' && buf[len - 1] == '\n') buf[--len - 1] = '\n'; if (len < 4) { warnx("bad response"); goto err; } if (verbose) printf("<<< %.*s", (int)len, buf); if (buf[3] == '-') continue; if (buf[0] != '2' && buf[0] != '3') { warnx("command failed: %.*s", (int)len, buf); goto err; } n--; } ret = 1; err: free(buf); return ret; } static int send_line(FILE *fp, int v, char *fmt, ...) { int ret = 0; va_list ap; va_start(ap, fmt); if (vfprintf(fp, fmt, ap) >= 0) ret = 1; va_end(ap); if (ret && v) { printf(">>> "); va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); } return (ret); } static void build_from(char *fake_from, struct passwd *pw) { char *p; if (fake_from == NULL) msg.from = qualify_addr(user); else { if (fake_from[0] == '<') { if (fake_from[strlen(fake_from) - 1] != '>') errx(1, "leading < but no trailing >"); fake_from[strlen(fake_from) - 1] = 0; p = xstrdup(fake_from + 1); msg.from = qualify_addr(p); free(p); } else msg.from = qualify_addr(fake_from); } if (msg.fromname == NULL && fake_from == NULL && pw != NULL) { int len, apos; len = strcspn(pw->pw_gecos, ","); if ((p = memchr(pw->pw_gecos, '&', len))) { apos = p - pw->pw_gecos; if (asprintf(&msg.fromname, "%.*s%s%.*s", apos, pw->pw_gecos, pw->pw_name, len - apos - 1, p + 1) == -1) err(1, NULL); msg.fromname[apos] = toupper((unsigned char)msg.fromname[apos]); } else { if (asprintf(&msg.fromname, "%.*s", len, pw->pw_gecos) == -1) err(1, NULL); } } } static int parse_message(FILE *fin, int get_from, int tflag, FILE *fout) { char *buf = NULL; size_t sz = 0; ssize_t len; uint i, cur = HDR_NONE; uint header_seen = 0, header_done = 0; memset(&pstate, 0, sizeof(pstate)); for (;;) { if ((len = getline(&buf, &sz, fin)) == -1) { if (feof(fin)) break; else err(EX_UNAVAILABLE, "getline"); } /* account for \r\n linebreaks */ if (len >= 2 && buf[len - 2] == '\r' && buf[len - 1] == '\n') buf[--len - 1] = '\n'; if (len == 1 && buf[0] == '\n') /* end of header */ header_done = 1; if (!WSP(buf[0])) { /* whitespace -> continuation */ if (cur == HDR_FROM) parse_addr_terminal(1); if (cur == HDR_TO || cur == HDR_CC || cur == HDR_BCC) parse_addr_terminal(0); cur = HDR_NONE; } /* not really exact, if we are still in headers */ if (len + (buf[len - 1] == '\n' ? 0 : 1) >= LINESPLIT) msg.need_linesplit = 1; for (i = 0; !header_done && cur == HDR_NONE && i < nitems(keywords); i++) if ((size_t)len > strlen(keywords[i].word) && !strncasecmp(buf, keywords[i].word, strlen(keywords[i].word))) cur = keywords[i].type; if (cur != HDR_NONE) header_seen = 1; if (cur != HDR_BCC) { if (!send_line(fout, 0, "%.*s", (int)len, buf)) err(1, "write error"); if (buf[len - 1] != '\n') { if (fputc('\n', fout) == EOF) err(1, "write error"); } } /* * using From: as envelope sender is not sendmail compatible, * but I really want it that way - maybe needs a knob */ if (cur == HDR_FROM) { msg.saw_from++; if (get_from) parse_addr(buf, len, 1); } if (tflag && (cur == HDR_TO || cur == HDR_CC || cur == HDR_BCC)) parse_addr(buf, len, 0); if (cur == HDR_DATE) msg.saw_date++; if (cur == HDR_MSGID) msg.saw_msgid++; if (cur == HDR_MIME_VERSION) msg.saw_mime_version = 1; if (cur == HDR_CONTENT_TYPE) msg.saw_content_type = 1; if (cur == HDR_CONTENT_DISPOSITION) msg.saw_content_disposition = 1; if (cur == HDR_CONTENT_TRANSFER_ENCODING) msg.saw_content_transfer_encoding = 1; if (cur == HDR_USER_AGENT) msg.saw_user_agent = 1; } free(buf); return (!header_seen); } static void parse_addr(char *s, size_t len, int is_from) { size_t pos = 0; int terminal = 0; /* unless this is a continuation... */ if (!WSP(s[pos]) && s[pos] != ',' && s[pos] != ';') { /* ... skip over everything before the ':' */ for (; pos < len && s[pos] != ':'; pos++) ; /* nothing */ /* ... and check & reset parser state */ parse_addr_terminal(is_from); } /* skip over ':' ',' ';' and whitespace */ for (; pos < len && !pstate.quote && (WSP(s[pos]) || s[pos] == ':' || s[pos] == ',' || s[pos] == ';'); pos++) ; /* nothing */ for (; pos < len; pos++) { if (!pstate.esc && !pstate.quote && s[pos] == '(') pstate.comment++; if (!pstate.comment && !pstate.esc && s[pos] == '"') pstate.quote = !pstate.quote; if (!pstate.comment && !pstate.quote && !pstate.esc) { if (s[pos] == ':') { /* group */ for (pos++; pos < len && WSP(s[pos]); pos++) ; /* nothing */ pstate.wpos = 0; } if (s[pos] == '\n' || s[pos] == '\r') break; if (s[pos] == ',' || s[pos] == ';') { terminal = 1; break; } if (s[pos] == '<') { pstate.brackets = 1; pstate.wpos = 0; } if (pstate.brackets && s[pos] == '>') terminal = 1; } if (!pstate.comment && !terminal && (!(!(pstate.quote || pstate.esc) && (s[pos] == '<' || WSP(s[pos]))))) { if (pstate.wpos >= sizeof(pstate.buf)) errx(1, "address exceeds buffer size"); pstate.buf[pstate.wpos++] = s[pos]; } if (!pstate.quote && pstate.comment && s[pos] == ')') pstate.comment--; if (!pstate.esc && !pstate.comment && s[pos] == '\\') pstate.esc = 1; else pstate.esc = 0; } if (terminal) parse_addr_terminal(is_from); for (; pos < len && (s[pos] == '\r' || s[pos] == '\n'); pos++) ; /* nothing */ if (pos < len) parse_addr(s + pos, len - pos, is_from); } static void parse_addr_terminal(int is_from) { if (pstate.comment || pstate.quote || pstate.esc) errx(1, "syntax error in address"); if (pstate.wpos) { if (pstate.wpos >= sizeof(pstate.buf)) errx(1, "address exceeds buffer size"); pstate.buf[pstate.wpos] = '\0'; if (is_from) msg.from = qualify_addr(pstate.buf); else rcpt_add(pstate.buf); pstate.wpos = 0; } } static char * qualify_addr(char *in) { char *out; if (strlen(in) > 0 && strchr(in, '@') == NULL) { if (asprintf(&out, "%s@%s", in, host) == -1) err(1, "qualify asprintf"); } else out = xstrdup(in); return (out); } static void rcpt_add(char *addr) { void *nrcpts; char *p; int n; n = 1; p = addr; while ((p = strchr(p, ',')) != NULL) { n++; p++; } if ((nrcpts = reallocarray(msg.rcpts, msg.rcpt_cnt + n, sizeof(char *))) == NULL) err(1, "rcpt_add realloc"); msg.rcpts = nrcpts; while (n--) { if ((p = strchr(addr, ',')) != NULL) *p++ = '\0'; msg.rcpts[msg.rcpt_cnt++] = qualify_addr(addr); if (p == NULL) break; addr = p; } } static int open_connection(void) { struct imsg imsg; int fd; int n; imsg_compose(ibuf, IMSG_CTL_SMTP_SESSION, IMSG_VERSION, 0, -1, NULL, 0); if (imsgbuf_flush(ibuf) == -1) err(1, "write error"); while (1) { if ((n = imsgbuf_read(ibuf)) == -1) err(1, "read error"); if (n == 0) errx(1, "pipe closed"); if ((n = imsg_get(ibuf, &imsg)) == -1) errx(1, "imsg_get error"); if (n == 0) continue; switch (imsg.hdr.type) { case IMSG_CTL_OK: break; case IMSG_CTL_FAIL: errx(1, "server disallowed submission request"); default: errx(1, "unexpected imsg reply type"); } fd = imsg_get_fd(&imsg); imsg_free(&imsg); break; } return fd; } static int enqueue_offline(int argc, char *argv[], FILE *ifile, FILE *ofile) { int i, ch; for (i = 1; i < argc; i++) { if (strchr(argv[i], '|') != NULL) { warnx("%s contains illegal character", argv[i]); ftruncate(fileno(ofile), 0); exit(EX_SOFTWARE); } if (fprintf(ofile, "%s%s", i == 1 ? "" : "|", argv[i]) < 0) goto write_error; } if (fputc('\n', ofile) == EOF) goto write_error; while ((ch = fgetc(ifile)) != EOF) { if (fputc(ch, ofile) == EOF) goto write_error; } if (ferror(ifile)) { warn("read error"); ftruncate(fileno(ofile), 0); exit(EX_UNAVAILABLE); } if (fclose(ofile) == EOF) goto write_error; return (EX_TEMPFAIL); write_error: warn("write error"); ftruncate(fileno(ofile), 0); exit(EX_UNAVAILABLE); } static int savedeadletter(struct passwd *pw, FILE *in) { char buffer[PATH_MAX]; FILE *fp; char *buf = NULL; size_t sz = 0; ssize_t len; (void)snprintf(buffer, sizeof buffer, "%s/dead.letter", pw->pw_dir); if (fseek(in, 0, SEEK_SET) != 0) return 0; if ((fp = fopen(buffer, "w")) == NULL) return 0; /* add From */ if (!msg.saw_from) fprintf(fp, "From: %s%s<%s>\n", msg.fromname ? msg.fromname : "", msg.fromname ? " " : "", msg.from); /* add Date */ if (!msg.saw_date) fprintf(fp, "Date: %s\n", time_to_text(timestamp)); if (msg.need_linesplit) { /* we will always need to mime encode for long lines */ if (!msg.saw_mime_version) fprintf(fp, "MIME-Version: 1.0\n"); if (!msg.saw_content_type) fprintf(fp, "Content-Type: text/plain; " "charset=unknown-8bit\n"); if (!msg.saw_content_disposition) fprintf(fp, "Content-Disposition: inline\n"); if (!msg.saw_content_transfer_encoding) fprintf(fp, "Content-Transfer-Encoding: " "quoted-printable\n"); } /* add separating newline */ if (msg.noheader) fprintf(fp, "\n"); while ((len = getline(&buf, &sz, in)) != -1) { if (buf[len - 1] == '\n') buf[len - 1] = '\0'; fprintf(fp, "%s\n", buf); } free(buf); fprintf(fp, "\n"); fclose(fp); return 1; } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd.conf.50000644000175000001440000011143014674615567014533 .\" $OpenBSD: smtpd.conf.5,v 1.272 2024/07/26 06:24:52 jmc Exp $ .\" .\" Copyright (c) 2008 Janne Johansson .\" Copyright (c) 2009 Jacek Masiulaniec .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" .Dd $Mdocdate: July 26 2024 $ .Dt SMTPD.CONF 5 .Os .Sh NAME .Nm smtpd.conf .Nd SMTP daemon configuration file .Sh DESCRIPTION .Nm is the configuration file for the mail daemon .Xr smtpd 8 . .Pp When mail arrives, each .Dq RCPT TO: command generates a mail envelope. If an envelope matches any of a pre-designated set of criteria (using the .Ic match directive), the message is accepted for delivery. A copy of the message, as well as its associated envelopes, is saved in the mail queue and later dispatched according to an associated set of actions (using the .Ic action directive). If an envelope does not match any options, it is rejected. The match rules are evaluated sequentially, with the first match winning. .Pp The format of the configuration file is fairly flexible. The current line can be extended over multiple lines using a backslash .Pq Sq \e . Comments can be put anywhere in the file using a hash mark .Pq Sq # , and extend to the end of the current line. Care should be taken when commenting out multi-line text: the comment is effective until the end of the entire block. Argument names not beginning with a letter, digit, or underscore, as well as reserved words (such as .Ic listen , .Ic match , and .Cm port ) , must be quoted. Arguments containing whitespace should be surrounded by double quotes .Pq \&" . .Pp Macros can be defined that are later expanded in context. Macro names must start with a letter, digit, or underscore, and may contain any of those characters, but may not be reserved words. Macros are not expanded inside quotes. For example: .Bd -literal -offset indent lan_addr = "192.168.0.1" listen on $lan_addr listen on $lan_addr tls auth .Ed .Pp The syntax of .Nm is described below. .Bl -tag -width Ds .It Ic action Ar name method Op Ar options When the queue runner processes an envelope from the mail queue, it carries out the .Ic action .Ar name , selected by the .Ic match No ... Cm action directive when the message was received. The .Ic action directive provides configuration data for delivery attempts. Required lookups are performed at the time of each delivery attempt. Consequently, changing an .Ic action directive or the files it references and restarting the .Xr smtpd 8 daemon causes the changes to take effect for subsequent delivery attempts for the respective dispatcher .Ar name , even for messages that were already stuck in the queue prior to the configuration changes. .Pp The delivery .Ar method parameter may be one of the following: .Bl -tag -width Ds .It Cm expand-only Only accept the message if a delivery method was specified in an aliases or .Pa .forward file. .It Cm forward-only Only accept the message if the recipient results in a remote address after the processing of aliases or forward file. .It Cm lmtp Ar destination Op Cm rcpt-to Deliver the message to an LMTP server at .Ar destination . The location may be expressed as host:port or as a UNIX socket. .Pp Optionally, .Cm rcpt-to might be specified to use the recipient email address (after expansion) instead of the local user in the LMTP session as RCPT TO. .It Cm maildir Oo Ar pathname Oc Op Cm junk Deliver the message to the maildir in .Ar pathname if specified, or by default to .Pa ~/Maildir . .Pp The .Ar pathname may contain format specifiers that are expanded before use .Pq see Sx FORMAT SPECIFIERS . .Pp If the .Cm junk argument is provided, the message will be moved to the .Ql Junk folder if it contains a positive .Ql X-Spam header. This folder will be created under .Ar pathname if it does not yet exist. .It Cm mbox Deliver the message to the user's mbox with .Xr mail.local 8 . .It Cm mda Ar command Delegate the delivery to a .Ar command that receives the message on its standard input .Pq see Sx MDA COMMANDS . .Pp The .Ar command may contain format specifiers that are expanded before use .Pq see Sx FORMAT SPECIFIERS . .It Cm relay Relay the message to another SMTP server. .El .Pp The local delivery methods support additional options: .Bl -tag -width Ds .It Cm alias Pf < Ar table Ns > Use the mapping .Ar table for .Xr aliases 5 expansion. .It Xo .Cm ttl .Sm off .Ar n .Brq Cm s | m | h | d .Sm on .Xc Specify how long a message may remain in the queue. .It Cm user Ar username Specify the .Ar username for performing the delivery, to be looked up with .Xr getpwnam 3 . .Pp This is used for virtual hosting where a single username is in charge of handling delivery for all virtual users. .Pp This option is not usable with the .Cm mbox delivery method. .Pp Only the delivery user's .Pa .forward file will be processed. .It Cm userbase Pf < Ar table Ns > Use the mapping .Ar table for user lookups instead of the .Xr getpwnam 3 function. .Pp The .Cm userbase does not apply to the .Cm user option. .It Cm virtual Pf < Ar table Ns > Use the mapping .Ar table for virtual expansion. The aliasing table format is described in .Xr table 5 . .It Cm wrapper Ar name Use the wrapper specified in .Cm mda wrapper . .El .Pp The relay delivery methods also support additional options: .Bl -tag -width Ds .It Cm backup Operate as a backup mail exchanger delivering messages to any mail exchanger with higher priority. .It Cm backup mx Ar name Operate as a backup mail exchanger delivering messages to any mail exchanger with higher priority than mail exchanger identified as .Ar name . .It Cm ca Ar caname For secure connections, use the certificate authority associated with .Ar caname (declared in a .Ic ca directive) to validate the server's identity. .It Cm helo Ar heloname Advertise .Ar heloname as the hostname to other mail exchangers during the HELO phase. .It Cm helo-src Pf < Ar table Ns > Use the mapping .Ar table to look up a hostname matching the source address, to advertise during the HELO phase. .It Cm domain Pf < Ar domains Ns > Do not perform MX lookups but look up destination domain in .Ar domains and use matching relay url as relay host. .It Cm host Ar relay-url Do not perform MX lookups but relay messages to the relay host described by .Ar relay-url . The format for .Ar relay-url is .Sm off .Op Ar proto No :// Op Ar label No @ .Ar host Op : Ar port . .Sm on The following protocols are available: .Pp .Bl -tag -width "smtp+notls" -compact .It smtp Normal SMTP session with opportunistic STARTTLS (the default). .It smtp+tls Normal SMTP session with mandatory STARTTLS. .It smtp+notls Plain text SMTP session without TLS. .It lmtp LMTP session. .Ar port is required. .It smtps SMTP session with forced TLS on connection. The default port is 465. .El .Pp Unless noted, .Ar port defaults to 25. .Pp The .Ar label corresponds to an entry in a credentials table, as documented in .Xr table 5 . It is used with the .Dq smtp+tls and .Dq smtps protocols for authentication. Server certificates for those protocols are verified by default. .It Cm pki Ar pkiname For secure connections, use the certificate associated with .Ar pkiname (declared in a .Ic pki directive) to prove the client's identity to the remote mail server. .It Cm srs When relaying a mail resulting from a forward, use the Sender Rewriting Scheme to rewrite sender address. .It Cm tls Op Cm no-verify Require TLS to be used when relaying, using mandatory STARTTLS by default. When used with a smarthost, the protocol must not be .Dq smtp+notls:// . If .Cm no-verify is specified, do not require a valid certificate. .It Cm protocols Ar protostr Define the protocol versions to be used for TLS sessions. Refer to the .Xr tls_config_parse_protocols 3 manpage for the format of .Ar protostr . .It Cm ciphers Ar cipherstr Define the list of ciphers that may be used for TLS sessions. Refer to the .Xr tls_config_set_ciphers 3 manpage for the format of .Ar cipherstr . .It Cm auth Pf < Ar table Ns > Use the mapping .Ar table for connecting to .Ar relay-url using credentials. This option is usable only with .Cm host option. The credential table format is described in .Xr table 5 . .It Cm mail-from Ar mailaddr Use .Ar mailaddr as the MAIL FROM address within the SMTP transaction. .It Cm src Ar sourceaddr | Pf < Ar sourceaddr Ns > Use the string or list table .Ar sourceaddr for the source IP address, which is useful on machines with multiple interfaces. If the list contains more than one address, all of them are used in such a way that traffic is routed as efficiently as possible. .El .It Ic admd Ar authservid The Administrative Management Domain this mail server belongs to. The authservid will be forwarded to filters using it to identify or mark authentication-results headers. If omitted, it defaults to the server name. .It Ic bounce Cm warn-interval Ar delay Op , Ar delay ... Send warning messages to the envelope sender when temporary delivery failures cause a message to remain in the queue for longer than .Ar delay . Each .Ar delay parameter consists of a positive decimal integer and a unit .Cm s , m , h , or .Cm d . At most four .Ar delay parameters can be specified. The default is .Qq Ic bounce Cm warn-interval No 4h , sending a single warning after four hours. .It Ic ca Ar caname Cm cert Ar cafile Associate the Certificate Authority (CA) certificate file .Ar cafile with ca entry .Ar caname . The ca entry can be referenced in .Cm listen on and .Cm action ... relay rules. .It Ic filter Ar chain-name Ic chain Brq Ar filter-name Op , Ar ... Register a chain of filters .Ar chain-name , consisting of the filters listed in .Ar filter-name . Filters in a filter chain are executed in order of declaration for each phase that they are registered for. A filter chain may be used in place of a filter for any directive except filter chains themselves. .It Ic filter Ar filter-name Ic phase Ar phase-name Ic match Ar conditions decision Register a filter .Ar filter-name . A .Ar decision about what to do with the mail is taken at phase .Ar phase-name when matching .Ar conditions . Phases, matching conditions, and decisions are described in .Sx MAIL FILTERING , below. .It Ic filter Ar filter-name Ic proc Ar proc-name Register .Qq proc filter .Ar filter-name backed by the .Ar proc-name process. .It Ic filter Ar filter-name Ic proc-exec Ar command Register and execute .Qq proc filter .Ar filter-name from .Ar command , conformant with the .Xr smtpd-filters 7 API. If .Ar command starts with a slash it is executed with an absolute path, otherwise it will be run from .Dq /usr/local/libexec/smtpd/ . .It Ic include Qq Ar pathname Replace this directive with the content of the additional configuration file at the absolute .Ar pathname . .It Ic listen on Ar interface Oo Ar family Oc Op Ar options Listen on the .Ar interface for incoming connections, using the same syntax as .Xr ifconfig 8 . The .Ar interface parameter may also be an interface group, an IP address, or a domain name. Listening can optionally be restricted to a specific address .Ar family , which can be either .Cm inet4 or .Cm inet6 . .Pp The .Ar options are as follows: .Bl -tag -width Ds .It Cm auth Op Pf < Ar authtable Ns > Support SMTPAUTH: clients may only start SMTP transactions after successful authentication. Users are authenticated against either their own normal login credentials or a credentials table .Ar authtable , the format of which is described in .Xr table 5 . .It Cm auth-optional Op Pf < Ar authtable Ns > Support SMTPAUTH optionally: clients need not authenticate, but may do so. This allows a .Ic listen on directive to both accept incoming mail from untrusted senders and permit outgoing mail from authenticated users (using .Cm match auth ) . It can be used in situations where it is not possible to listen on a separate port (usually the submission port, 587) for users to authenticate. .It Ic ca Ar caname For secure connections, use the CA certificate associated with .Ar caname (declared in a .Ic ca directive) as the CA certificate when verifying client certificates. .It Ic filter Ar name Apply filter .Ar name on connections handled by this listener. .It Cm hostname Ar hostname Use .Ar hostname in the greeting banner instead of the default server name. .It Cm hostnames Pf < Ar names Ns > Override the server name for specific addresses. The .Ar names table contains a mapping of IP addresses to hostnames. If the address on which the connection arrives appears in the mapping, the associated hostname is used. .It Cm mask-src Omit the .Sy from part when prepending .Dq Received headers. .It Cm no-dsn Disable the DSN (Delivery Status Notification) extension. .It Cm pki Ar pkiname For secure connections, use the certificate associated with .Ar pkiname (declared in a .Ic pki directive) to prove a mail server's identity. This option can be used multiple times to provide alternate certificates for SNI. .It Cm port Op Ar port Listen on the given .Ar port instead of the default port 25. .It Cm proxy-v2 Support the PROXYv2 protocol, appropriately rewriting the source address received from proxy. .It Cm received-auth In .Dq Received headers, report whether the session was authenticated and by which local user. .It Cm senders Pf < Ar users Ns > Op Cm masquerade Look up the authenticated user in the .Ar users mapping table to find the email addresses that user is allowed to submit mail as. In addition, if the .Cm masquerade option is provided, the From header is rewritten to match the sender provided in the SMTP session. .It Cm smtps Support SMTPS, by default on port 465. Mutually exclusive with .Cm tls . .It Cm tag Ar tag Clients connecting to the listener are tagged with the given .Ar tag . .It Cm tls Support STARTTLS, by default on port 25. Mutually exclusive with .Cm smtps . .It Cm tls-require Op Cm verify Like .Cm tls , but force clients to establish a secure connection before being allowed to start an SMTP transaction. With the .Cm verify option, clients must also provide a valid certificate to establish an SMTP session. .It Cm protocols Ar protostr Define the protocol versions to be used for TLS sessions. Refer to the .Xr tls_config_parse_protocols 3 manpage for the format of .Ar protostr . .It Cm ciphers Ar cipherstr Define the list of ciphers that may be used for TLS sessions. Refer to the .Xr tls_config_set_ciphers 3 manpage for the format of .Ar cipherstr . .El .It Ic listen on Cm socket Op Ar options Listen for incoming SMTP connections on the Unix domain socket .Pa /var/run/smtpd.sock . This is done by default, even if the directive is absent. .Pp The .Ar options are as follows: .Bl -tag -width Ds .It Ic filter Ar name Apply filter .Ar name on connections handled by this listener. .It Cm mask-src Omit the .Sy from part when prepending .Dq Received headers. .It Cm no-dsn Disable the DSN (Delivery Status Notification) extension. .It Cm tag Ar tag Clients connecting to the listener are tagged with the given .Ar tag . .El .It Ic match Ar options Cm action Ar name If at least one mail envelope matches the .Ar options of one .Ic match Cm action directive, receive the incoming message, put a copy into each matching envelope, and atomically save the envelopes to the mail spool for later processing by the respective dispatcher .Ar name . .Pp The following matching options are supported and can all be negated: .Bl -tag -width Ds .It Xo .Op Ic \&! .Cm for any .Xc Specify that session may address any destination. .It Xo .Op Ic \&! .Cm for local .Xc Specify that session may address any local domain. This is the default, and may be omitted. .It Xo .Op Ic \&! .Cm for domain .Ar domain | Pf < Ar domain Ns > .Xc Specify that session may address the string or list table .Ar domain . .It Xo .Op Ic \&! .Cm for domain regex .Ar domain | Pf < Ar domain Ns > .Xc Specify that session may address the regex or regex table .Ar domain . .It Xo .Op Ic \&! .Cm for rcpt-to .Ar recipient | Pf < Ar recipient Ns > .Xc Specify that session may address the string or list table .Ar recipient . .It Xo .Op Ic \&! .Cm for rcpt-to regex .Ar recipient | Pf < Ar recipient Ns > .Xc Specify that session may address the regex or regex table .Ar recipient . .It Xo .Op Ic \&! .Cm from any .Xc Specify that session may originate from any source. .It Xo .Op Ic \&! .Cm from auth .Xc Specify that session may originate from any authenticated user, no matter the source IP address. .It Xo .Op Ic \&! .Cm from auth .Ar user | Pf < Ar user Ns > .Xc Specify that session may originate from authenticated user or user list .Ar user , no matter the source IP address. .It Xo .Op Ic \&! .Cm from auth regex .Ar user | Pf < Ar user Ns > .Xc Specify that session may originate from authenticated regex or regex list .Ar user , no matter the source IP address. .It Xo .Op Ic \&! .Cm from local .Xc Specify that session may only originate from a local IP address, or from the local enqueuer. This is the default, and may be omitted. .It Xo .Op Ic \&! .Cm from mail-from .Ar sender | Pf < Ar sender Ns > .Xc Specify that session may originate from sender or sender list .Ar sender , no matter the source IP address. .It Xo .Op Ic \&! .Cm from mail-from regex .Ar sender | Pf < Ar sender Ns > .Xc Specify that session may originate from regex or regex list .Ar sender , no matter the source IP address. .It Xo .Op Ic \&! .Cm from rdns .Xc Specify that session may only originate from an IP address that resolves to a reverse DNS. .It Xo .Op Ic \&! .Cm from rdns .Ar hostname | Pf < Ar hostname Ns > .Xc Specify that session may only originate from an IP address that resolves to a reverse DNS matching string or list string .Ar hostname . .It Xo .Op Ic \&! .Cm from rdns regex .Ar hostname | Pf < Ar hostname Ns > .Xc Specify that session may only originate from an IP address that resolves to a reverse DNS matching regex or list regex .Ar hostname . .It Xo .Op Ic \&! .Cm from socket .Xc Specify that session may only originate from the local enqueuer. .It Xo .Op Ic \&! .Cm from src .Ar address | Pf < Ar address Ns > .Xc Specify that session may only originate from string or list table .Ar address which can be a specific address or a subnet expressed in CIDR-notation. .It Xo .Op Ic \&! .Cm from src regex .Ar address | Pf < Ar address Ns > .Xc Specify that session may only originate from regex or regex table .Ar address which can be a specific address or a subnet expressed in CIDR-notation. .El .Pp In addition, the following transaction options may be matched: .Bl -tag -width Ds .It Xo .Op Ic \&! .Cm auth .Xc Matches transactions which have been authenticated. .It Xo .Op Ic \&! .Cm auth .Ar username | Pf < Ar username Ns > .Xc Matches transactions which have been authenticated for user or user list .Ar username . .It Xo .Op Ic \&! .Cm auth regex .Ar username | Pf < Ar username Ns > .Xc Matches transactions which have been authenticated for regex or regex list .Ar username . .It Xo .Op Ic \&! .Cm helo .Ar helo-name | Pf < Ar helo-name Ns > .Xc Specify that session's HELO / EHLO should match the string or list table .Ar helo-name . .It Xo .Op Ic \&! .Cm helo regex .Ar helo-name | Pf < Ar helo-name Ns > .Xc Specify that session's HELO / EHLO should match the regex or regex table .Ar helo-name . .It Xo .Op Ic \&! .Cm mail-from .Ar sender | Pf < Ar sender Ns > .Xc Specify that transaction's MAIL FROM should match the string or list table .Ar sender . .It Xo .Op Ic \&! .Cm mail-from regex .Ar sender | Pf < Ar sender Ns > .Xc Specify that transaction's MAIL FROM should match the regex or regex table .Ar sender . .It Xo .Op Ic \&! .Cm rcpt-to .Ar recipient | Pf < Ar recipient Ns > .Xc Specify that transaction's RCPT TO should match the string or list table .Ar recipient . .It Xo .Op Ic \&! .Cm rcpt-to regex .Ar recipient | Pf < Ar recipient Ns > .Xc Specify that transaction's RCPT TO should match the regex or regex table .Ar recipient . .It Xo .Op Ic \&! .Cm tag Ar tag .Xc Matches transactions tagged with the given .Ar tag . .It Xo .Op Ic \&! .Cm tag regex Ar tag .Xc Matches transactions tagged with the given .Ar tag regex. .It Xo .Op Ic \&! .Cm tls .Xc Specify that transaction should take place in a TLS channel. .El .It Ic match Ar options Cm reject Reject the incoming message during the SMTP dialogue. The same .Ar options are supported as for the .Ic match Cm action directive. .It Ic mda Cm wrapper Ar name command Associate .Ar command with the mail delivery agent wrapper named .Ar name . When a local delivery specifies a wrapper, the .Ar command associated with the wrapper will be executed instead. The command may contain format specifiers .Pq see Sx FORMAT SPECIFIERS . .It Ic mta Cm max-deferred Ar number When delivery to a given host is suspended due to temporary failures, cache at most .Ar number envelopes for that host such that they can be delivered as soon as another delivery succeeds to that host. The default is 100. .It Ic pki Ar pkiname Cm cert Ar certfile Associate certificate file .Ar certfile with pki entry .Ar pkiname . The pki entry defines a keypair configuration that can be referenced in listener rules and relay actions. .Pp A certificate chain may be created by appending one or many certificates, including a Certificate Authority certificate, to .Ar certfile . The creation of certificates is documented in .Xr starttls 8 . .It Ic pki Ar pkiname Cm key Ar keyfile Associate the key located in .Ar keyfile with pki entry .Ar pkiname . .It Ic pki Ar pkiname Cm dhe Ar params Specify the DHE parameters to use for DHE cipher suites with pki entry .Ar pkiname . Valid parameter values are .Cm none , .Cm legacy , and .Cm auto . For .Cm legacy , a fixed key length of 1024 bits is used, whereas for .Cm auto , the key length is determined automatically. The default is .Cm none , which disables DHE cipher suites. .It Ic proc Ar proc-name Ar command Register an external process named .Ar proc-name from .Ar command , conformant with the .Xr smtpd-filters 7 API. Such processes may be used to share the same instance between multiple filters. If .Ar command starts with a slash it is executed with an absolute path, otherwise it will be run from .Dq /usr/local/libexec/smtpd/ . .It Ic queue Cm compression Store queue files in a compressed format. This may be useful to save disk space. .It Ic queue Cm encryption Op Ar key Encrypt queue files with .Xr EVP_aes_256_gcm 3 . If no .Ar key is specified, it is read with .Xr getpass 3 . If the string .Cm stdin or a single dash .Pq Ql - is given instead of a .Ar key , the key is read from the standard input. .It Ic queue Cm ttl Ar delay Set the default expiration time for temporarily undeliverable messages, given as a positive decimal integer followed by a unit .Cm s , m , h , or .Cm d . The default is four days .Pq 4d . .It Ic smtp Cm ciphers Ar control Set the .Ar control string for .Xr SSL_CTX_set_cipher_list 3 . The default is .Qq HIGH:!aNULL:!MD5 . .It Ic smtp limit Cm max-mails Ar count Limit the number of messages to .Ar count for each session. The default is 100. .It Ic smtp limit Cm max-rcpt Ar count Limit the number of recipients to .Ar count for each transaction. The default is 1000. .It Ic smtp Cm max-message-size Ar size Reject messages larger than .Ar size , given as a positive number of bytes or as a string to be parsed with .Xr scan_scaled 3 . The default is .Qq 35M . .It Ic smtp Cm sub-addr-delim Ar character When resolving the local part of a local email address, ignore the ASCII .Ar character and all characters following it. The default is .Ql + . .It Ic srs Cm key Ar secret Set the secret key to use for SRS, the Sender Rewriting Scheme. .It Ic srs Cm key backup Ar secret Set a backup secret key to use as a fallback for SRS. This can be used to implement SRS key rotation. .It Ic srs Cm ttl Ar delay Set the time-to-live delay for SRS envelopes. After this delay, a bounce reply to the SRS address will be discarded to limit risks of forged addresses. The default is four days .Pq 4d . .It Ic table Ar name Oo Ar type : Oc Ns Ar pathname Tables provide additional configuration information for .Xr smtpd 8 in the form of lists or key-value mappings. The format of the entries depends on what the table is used for. Refer to .Xr table 5 for the exhaustive documentation. .Pp Each table is identified by an arbitrary, unique .Ar name . .Pp If the .Ar type is .Cm db , information is stored in a file created with .Xr makemap 8 ; if it is .Cm file or omitted, information is stored in a plain text file using the format described in .Xr table 5 . The .Ar pathname to the file must be absolute. .It Ic table Ar name Brq Ar value Op , Ar ... Instead of using a separate file, declare a list table containing the given static .Ar value Ns s . The table must contain at least one value and may declare multiple values as a comma-separated (whitespace optional) list. .It Ic table Ar name Brq Ar key Ns = Ns Ar value Op , Ar ... Instead of using a separate file, declare a mapping table containing the given static .Ar key Ns - Ns Ar value pairs. The table must contain at least one key-value pair and may declare multiple pairs as a comma-separated (whitespace optional) list. .El .Ss MAIL FILTERING In a regular workflow, .Xr smtpd 8 may accept or reject a message based only on the content of envelopes. Its decisions are about the handling of the message, not about the handling of an active session. .Pp Filtering extends the decision making process by allowing .Xr smtpd 8 to stop at each phase of an SMTP session, check that conditions are met, then decide if a session is allowed to move forward. .Pp With filtering, a session may be interrupted at any phase before an envelope is complete. A message may also be rejected after being submitted, regardless of whether the envelope was accepted or not. .Pp The following phases are currently supported: .Bl -column mail-from -offset indent .It connect Ta upon connection, before a banner is displayed .It helo Ta after HELO command is submitted .It ehlo Ta after EHLO command is submitted .It mail-from Ta after MAIL FROM command is submitted .It rcpt-to Ta after RCPT TO command is submitted .It data Ta after DATA command is submitted .It commit Ta after message is fully is submitted .El .Pp At each phase, various conditions may be matched. The fcrdns, rdns, and src data are available in all phases, but other data must have been already submitted before they are available. .Bl -column XXXXXXXXXXXXXXXXXXXXX -offset indent .It fcrdns Ta forward-confirmed reverse DNS is valid .It rdns Ta session has a reverse DNS .It rdns Pf < Ar table Ns > Ta session has a reverse DNS in table .It src Pf < Ar table Ns > Ta source address is in table .It helo Pf < Ar table Ns > Ta helo name is in table .It auth Ta session is authenticated .It auth Pf < Ar table Ns > Ta session username is in table .It mail-from Pf < Ar table Ns > Ta sender address is in table .It rcpt-to Pf < Ar table Ns > Ta recipient address is in table .El .Pp These conditions may all be negated by prefixing them with an exclamation mark: .Bl -column XXXXXXXXXXXXXXXXXXXXX -offset indent .It !fcrdns Ta forward-confirmed reverse DNS is invalid .El .Pp Any conditions using a table may indicate that the table contains regular expressions by prefixing the table name with the keyword regex. .Bl -column XXXXXXXXXXXXXXXXXXXXX -offset indent .It helo regex Pf < Ar table Ns > Ta helo name matches a regex in table .El .Pp Finally, a number of decisions may be taken: .Bl -column XXXXXXXXXXXXXXXXXXXXX -offset indent .It bypass Ta the session or transaction bypasses filters .It disconnect Ar message Ta the session is disconnected with message .It junk Ta the session or transaction is junked, i.e., an .Ql X-Spam: yes header is added to any messages .It reject Ar message Ta the command is rejected with message .It rewrite Ar value Ta the command parameter is rewritten with value .El .Pp Decisions that involve a message require that the message be RFC valid, meaning that they should either start with a 4xx or 5xx status code. Decisions can be taken at any phase, though junking can only happen before a message is committed. .Ss FORMAT SPECIFIERS Some configuration directives support expansion of their parameters at runtime. Such directives (for example .Ic action Cm maildir , .Ic action Cm mda ) may use format specifiers which are expanded before delivery or relaying. The following formats are currently supported: .Bl -column %{user.directory} -offset indent .It %{sender} Ta sender email address, may be empty string .It %{sender.user} Ta user part of the sender email address, may be empty .It %{sender.domain} Ta domain part of the sender email address, may be empty .It %{rcpt} Ta recipient email address .It %{rcpt.user} Ta user part of the recipient email address .It %{rcpt.domain} Ta domain part of the recipient email address .It %{dest} Ta recipient email address after expansion .It %{dest.user} Ta user part after expansion .It %{dest.domain} Ta domain part after expansion .It %{user.username} Ta local user .It %{user.directory} Ta home directory of the local user .It %{mbox.from} Ta name used in mbox From separator lines .It %{mda} Ta mda command, only available for mda wrappers .El .Pp Expansion formats also support partial expansion using the optional bracket notations with substring offset. For example, with recipient domain .Dq example.org : .Bl -column %{rcpt.domain[0:-4]} -offset indent .It %{rcpt.domain[0]} Ta expands to Dq e .It %{rcpt.domain[1]} Ta expands to Dq x .It %{rcpt.domain[8:]} Ta expands to Dq org .It %{rcpt.domain[-3:]} Ta expands to Dq org .It %{rcpt.domain[0:6]} Ta expands to Dq example .It %{rcpt.domain[0:-4]} Ta expands to Dq example .El .Pp In addition, modifiers may be applied to the token. For example, with recipient .Dq User+Tag@Example.org : .Bl -column %{rcpt:lowercase|strip} -offset indent .It %{rcpt:lowercase} Ta expands to Dq user+tag@example.org .It %{rcpt:uppercase} Ta expands to Dq USER+TAG@EXAMPLE.ORG .It %{rcpt:strip} Ta expands to Dq User@Example.org .It %{rcpt:lowercase|strip} Ta expands to Dq user@example.org .El .Pp For security concerns, expanded values are sanitized and potentially dangerous characters are replaced with .Sq \&: . In situations where they are desirable, the .Dq raw modifier may be applied. For example, with recipient .Dq user+t?g@example.org : .Bl -column %{rcpt:raw} -offset indent .It %{rcpt} Ta expands to Dq user+t:g@example.org .It %{rcpt:raw} Ta expands to Dq user+t?g@example.org .El .Ss MDA COMMANDS When an action delivery method is .Cm mda , .Xr smtpd 8 runs the associated command for the delivery with the mail content provided via standard input. The command is expected to read all the mail content. .Pp The exit code of the command reports the outcome of the delivery: status 0 .Pq Dv EX_OK is a successful delivery; status 71 .Pq Dv EX_OSERR and 75 .Pq Dv EX_TEMPFAIL are temporary failures; and all other exit status are considered permanent failures. .Pp The following environment variables are set: .Pp .Bl -tag -width ORIGINAL_RECIPIENT -compact .It Ev DOMAIN The recipient domain. .It Ev EXTENSION The sub address of the recipient (may be unset). .It Ev HOME The delivery user's login directory. .It Ev LOCAL The local part of the recipient user address. .It Ev LOGNAME The login name of the user. .It Ev ORIGINAL_RECIPIENT The address of the original recipient. .It Ev PATH Set to .Ev _PATH_DEFPATH . Traditionally .Pa /usr/bin:/bin , but expanded to include .Pa /usr/sbin , .Pa /sbin , .Pa /usr/X11R6/bin , .Pa /usr/local/bin , and .Pa /usr/local/sbin in .Ox . .It Ev RECIPIENT The address of the final recipient. .It Ev SENDER The address of the sender (might be empty). .It Ev SHELL Set to .Pa /bin/sh . .It Ev USER Synonym of .Ev LOGNAME for backwards compatibility. .El .Sh FILES .Bl -tag -width "/etc/mail/smtpd.confXXX" -compact .It Pa /etc/mail/smtpd.conf Default .Xr smtpd 8 configuration file. .It Pa /etc/mail/mailname If this file exists, the first line is used as the server name. Otherwise, the server name is derived from the local hostname returned by .Xr gethostname 3 , either directly if it is a fully qualified domain name, or by retrieving the associated canonical name through .Xr getaddrinfo 3 . .It Pa /var/run/smtpd.sock Unix domain socket for incoming SMTP connections. .It Pa /var/spool/smtpd/ Spool directories for mail during processing. .El .Sh EXAMPLES The default .Nm file which ships with .Ox listens on the loopback network interface .Pq Pa lo0 and allows for mail from users and daemons on the local machine, as well as permitting email to remote servers. Some more complex configurations are given below. .Pp This first example is similar to the default configuration, but all outgoing mail is forwarded to a remote SMTP server. A secrets file is needed to specify a username and password: .Bd -literal -offset indent # touch /etc/mail/secrets # chmod 640 /etc/mail/secrets # chown root:_smtpd /etc/mail/secrets # echo "bob username:password" > /etc/mail/secrets .Ed .Pp .Nm would look like this: .Bd -literal -offset indent table aliases file:/etc/mail/aliases table secrets file:/etc/mail/secrets listen on lo0 action "local_mail" mbox alias action "outbound" relay host smtp+tls://bob@smtp.example.com \e auth match from local for local action "local_mail" match from local for any action "outbound" .Ed .Pp In this second example, the aim is to permit mail delivery and relaying only for users that can authenticate (using their normal login credentials). An RSA certificate must be provided to prove the server's identity. The mail server listens on all interfaces the default routes point to. Mail with a local destination is sent to an external MDA. First, the RSA certificate is created: .Bd -literal -offset indent # openssl genrsa \-out /etc/ssl/private/mail.example.com.key 4096 # openssl req \-new \-x509 \-key /etc/ssl/private/mail.example.com.key \e \-out /etc/ssl/mail.example.com.crt \-days 365 # chmod 600 /etc/ssl/mail.example.com.crt # chmod 600 /etc/ssl/private/mail.example.com.key .Ed .Pp In the example above, a certificate valid for one year was created. The configuration file would look like this: .Bd -literal -offset indent pki mail.example.com cert "/etc/ssl/mail.example.com.crt" pki mail.example.com key "/etc/ssl/private/mail.example.com.key" table aliases file:/etc/mail/aliases listen on lo0 listen on egress tls pki mail.example.com auth action mda_with_aliases mda "/path/to/mda \-f \-" alias action mda_without_aliases mda "/path/to/mda \-f \-" action "outbound" relay match for local action mda_with_aliases match from any for domain example.com action mda_without_aliases match for any action "outbound" match auth from any for any action "outbound" .Ed .Pp For sites that wish to sign messages using DKIM, the following example uses .Sy opensmtpd-filter-dkimsign for DKIM signing: .Bd -literal -offset indent table aliases file:/etc/mail/aliases filter "dkimsign" proc-exec "filter-dkimsign -d -s \e -k /etc/mail/dkim/private.key" user _dkimsign group _dkimsign listen on socket filter "dkimsign" listen on lo0 filter "dkimsign" action "local_mail" mbox alias action "outbound" relay match for local action "local_mail" match for any action "outbound" .Ed .Pp Alternatively, the .Sy opensmtpd-filter-rspamd package may be used to provide integration with .Sy rspamd , a third-party daemon which provides multiple antispam features as well as DKIM signing. As well as configuring .Sy rspamd itself, it requires use of the .Cm proc-exec keyword: .Bd -literal -offset indent filter "rspamd" proc-exec "filter-rspamd" .Ed .Pp Sites that accept non-local messages may be able to cut down on the volume of spam received by rejecting forged messages that claim to be from the local domain. The following example uses a list table .Em other-relays to specify the IP addresses of relays that may legitimately originate mail with the owner's domain as the sender. .Bd -literal -offset indent table aliases file:/etc/mail/aliases table other-relays file:/etc/mail/other-relays listen on lo0 listen on egress action "local_mail" mbox alias action "outbound" relay match for local action "local_mail" match for any action "outbound" match !from src mail\-from "@example.com" for any \e reject match from any for domain example.com action "local_mail" .Ed .Sh SEE ALSO .Xr mailer.conf 5 , .Xr table 5 , .Xr smtpd-filters 7 , .Xr makemap 8 , .Xr smtpd 8 .Sh HISTORY .Xr smtpd 8 first appeared in .Ox 4.6 . opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd.h0000644000175000001440000012725715007617615013673 /* $OpenBSD: smtpd.h,v 1.686 2024/06/02 23:26:39 jsg Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) #endif #include #include #include #include #include #include #include #include #include "smtpd-defines.h" #include "smtpd-api.h" #include "ioev.h" #define CHECK_IMSG_DATA_SIZE(imsg, expected_sz) do { \ if ((imsg)->hdr.len - IMSG_HEADER_SIZE != (expected_sz)) \ fatalx("smtpd: imsg %d: data size expected %zd got %zd",\ (imsg)->hdr.type, \ (expected_sz), (imsg)->hdr.len - IMSG_HEADER_SIZE); \ } while (0) #ifndef SMTPD_CONFDIR #define SMTPD_CONFDIR "/etc" #endif #define CONF_FILE SMTPD_CONFDIR "/smtpd.conf" #define MAILNAME_FILE SMTPD_CONFDIR "/mailname" #define MAX_HOPS_COUNT 100 #define DEFAULT_MAX_BODY_SIZE (35*1024*1024) #define EXPAND_BUFFER 1024 #define SMTPD_QUEUE_EXPIRY (4 * 24 * 60 * 60) #ifndef SMTPD_USER #define SMTPD_USER "_smtpd" #endif #ifndef SMTPD_QUEUE_USER #define SMTPD_QUEUE_USER "_smtpq" #endif #ifndef SMTPD_SOCKDIR #define SMTPD_SOCKDIR "/var/run" #endif #define SMTPD_SOCKET SMTPD_SOCKDIR "/smtpd.sock" #ifndef SMTPD_NAME #define SMTPD_NAME "OpenSMTPD" #endif #define SMTPD_VERSION "7.7.0-portable" #define SMTPD_SESSION_TIMEOUT 300 #define SMTPD_BACKLOG 5 #ifndef PATH_SMTPCTL #define PATH_SMTPCTL "/usr/sbin/smtpctl" #endif #define PATH_OFFLINE "/offline" #define PATH_PURGE "/purge" #define PATH_TEMPORARY "/temporary" #ifndef PATH_LIBEXEC #define PATH_LIBEXEC "/usr/local/libexec/smtpd" #endif /* * RFC 5322 defines these characters as valid, some of them are * potentially dangerous and need to be escaped. */ #define MAILADDR_ALLOWED "!#$%&'*/?^`{|}~+-=_" #define MAILADDR_ESCAPE "!#$%&'*?`{|}~" #define F_STARTTLS 0x01 #define F_SMTPS 0x02 #define F_SSL (F_STARTTLS | F_SMTPS) #define F_AUTH 0x08 #define F_STARTTLS_REQUIRE 0x20 #define F_AUTH_REQUIRE 0x40 #define F_MASK_SOURCE 0x100 #define F_TLS_VERIFY 0x200 #define F_EXT_DSN 0x400 #define F_RECEIVEDAUTH 0x800 #define F_MASQUERADE 0x1000 #define F_FILTERED 0x2000 #define F_PROXY 0x4000 #define RELAY_TLS_OPPORTUNISTIC 0 #define RELAY_TLS_STARTTLS 1 #define RELAY_TLS_SMTPS 2 #define RELAY_TLS_NO 3 #define RELAY_AUTH 0x08 #define RELAY_LMTP 0x80 #define MTA_EXT_DSN 0x400 #define P_SENDMAIL 0 #define P_NEWALIASES 1 #define P_MAKEMAP 2 struct userinfo { char username[SMTPD_VUSERNAME_SIZE]; char directory[PATH_MAX]; uid_t uid; gid_t gid; }; struct netaddr { struct sockaddr_storage ss; int bits; }; struct relayhost { uint16_t flags; int tls; char hostname[HOST_NAME_MAX+1]; uint16_t port; char authlabel[PATH_MAX]; }; struct credentials { char username[LINE_MAX]; char password[LINE_MAX]; }; struct destination { char name[HOST_NAME_MAX+1]; }; struct source { struct sockaddr_storage addr; }; struct addrname { struct sockaddr_storage addr; char name[HOST_NAME_MAX+1]; }; union lookup { struct expand *expand; struct credentials creds; struct netaddr netaddr; struct source source; struct destination domain; struct userinfo userinfo; struct mailaddr mailaddr; struct addrname addrname; struct maddrmap *maddrmap; char relayhost[LINE_MAX]; }; /* * Bump IMSG_VERSION whenever a change is made to enum imsg_type. * This will ensure that we can never use a wrong version of smtpctl with smtpd. */ #define IMSG_VERSION 16 enum imsg_type { IMSG_NONE, IMSG_CTL_OK, IMSG_CTL_FAIL, IMSG_CTL_GET_DIGEST, IMSG_CTL_GET_STATS, IMSG_CTL_LIST_MESSAGES, IMSG_CTL_LIST_ENVELOPES, IMSG_CTL_MTA_SHOW_HOSTS, IMSG_CTL_MTA_SHOW_RELAYS, IMSG_CTL_MTA_SHOW_ROUTES, IMSG_CTL_MTA_SHOW_HOSTSTATS, IMSG_CTL_MTA_BLOCK, IMSG_CTL_MTA_UNBLOCK, IMSG_CTL_MTA_SHOW_BLOCK, IMSG_CTL_PAUSE_EVP, IMSG_CTL_PAUSE_MDA, IMSG_CTL_PAUSE_MTA, IMSG_CTL_PAUSE_SMTP, IMSG_CTL_PROFILE, IMSG_CTL_PROFILE_DISABLE, IMSG_CTL_PROFILE_ENABLE, IMSG_CTL_RESUME_EVP, IMSG_CTL_RESUME_MDA, IMSG_CTL_RESUME_MTA, IMSG_CTL_RESUME_SMTP, IMSG_CTL_RESUME_ROUTE, IMSG_CTL_REMOVE, IMSG_CTL_SCHEDULE, IMSG_CTL_SHOW_STATUS, IMSG_CTL_TRACE_DISABLE, IMSG_CTL_TRACE_ENABLE, IMSG_CTL_UPDATE_TABLE, IMSG_CTL_VERBOSE, IMSG_CTL_DISCOVER_EVPID, IMSG_CTL_DISCOVER_MSGID, IMSG_CTL_SMTP_SESSION, IMSG_GETADDRINFO, IMSG_GETADDRINFO_END, IMSG_GETNAMEINFO, IMSG_RES_QUERY, IMSG_SETUP_KEY, IMSG_SETUP_PEER, IMSG_SETUP_DONE, IMSG_CONF_START, IMSG_CONF_END, IMSG_STAT_INCREMENT, IMSG_STAT_DECREMENT, IMSG_STAT_SET, IMSG_LKA_AUTHENTICATE, IMSG_LKA_OPEN_FORWARD, IMSG_LKA_ENVELOPE_SUBMIT, IMSG_LKA_ENVELOPE_COMMIT, IMSG_QUEUE_DELIVER, IMSG_QUEUE_DELIVERY_OK, IMSG_QUEUE_DELIVERY_TEMPFAIL, IMSG_QUEUE_DELIVERY_PERMFAIL, IMSG_QUEUE_DELIVERY_LOOP, IMSG_QUEUE_DISCOVER_EVPID, IMSG_QUEUE_DISCOVER_MSGID, IMSG_QUEUE_ENVELOPE_ACK, IMSG_QUEUE_ENVELOPE_COMMIT, IMSG_QUEUE_ENVELOPE_REMOVE, IMSG_QUEUE_ENVELOPE_SCHEDULE, IMSG_QUEUE_ENVELOPE_SUBMIT, IMSG_QUEUE_HOLDQ_HOLD, IMSG_QUEUE_HOLDQ_RELEASE, IMSG_QUEUE_MESSAGE_COMMIT, IMSG_QUEUE_MESSAGE_ROLLBACK, IMSG_QUEUE_SMTP_SESSION, IMSG_QUEUE_TRANSFER, IMSG_MDA_DELIVERY_OK, IMSG_MDA_DELIVERY_TEMPFAIL, IMSG_MDA_DELIVERY_PERMFAIL, IMSG_MDA_DELIVERY_LOOP, IMSG_MDA_DELIVERY_HOLD, IMSG_MDA_DONE, IMSG_MDA_FORK, IMSG_MDA_HOLDQ_RELEASE, IMSG_MDA_LOOKUP_USERINFO, IMSG_MDA_KILL, IMSG_MDA_OPEN_MESSAGE, IMSG_MTA_DELIVERY_OK, IMSG_MTA_DELIVERY_TEMPFAIL, IMSG_MTA_DELIVERY_PERMFAIL, IMSG_MTA_DELIVERY_LOOP, IMSG_MTA_DELIVERY_HOLD, IMSG_MTA_DNS_HOST, IMSG_MTA_DNS_HOST_END, IMSG_MTA_DNS_MX, IMSG_MTA_DNS_MX_PREFERENCE, IMSG_MTA_HOLDQ_RELEASE, IMSG_MTA_LOOKUP_CREDENTIALS, IMSG_MTA_LOOKUP_SOURCE, IMSG_MTA_LOOKUP_HELO, IMSG_MTA_LOOKUP_SMARTHOST, IMSG_MTA_OPEN_MESSAGE, IMSG_MTA_SCHEDULE, IMSG_SCHED_ENVELOPE_BOUNCE, IMSG_SCHED_ENVELOPE_DELIVER, IMSG_SCHED_ENVELOPE_EXPIRE, IMSG_SCHED_ENVELOPE_INJECT, IMSG_SCHED_ENVELOPE_REMOVE, IMSG_SCHED_ENVELOPE_TRANSFER, IMSG_SMTP_AUTHENTICATE, IMSG_SMTP_MESSAGE_COMMIT, IMSG_SMTP_MESSAGE_CREATE, IMSG_SMTP_MESSAGE_ROLLBACK, IMSG_SMTP_MESSAGE_OPEN, IMSG_SMTP_CHECK_SENDER, IMSG_SMTP_EXPAND_RCPT, IMSG_SMTP_LOOKUP_HELO, IMSG_SMTP_REQ_CONNECT, IMSG_SMTP_REQ_HELO, IMSG_SMTP_REQ_MAIL, IMSG_SMTP_REQ_RCPT, IMSG_SMTP_REQ_DATA, IMSG_SMTP_REQ_EOM, IMSG_SMTP_EVENT_RSET, IMSG_SMTP_EVENT_COMMIT, IMSG_SMTP_EVENT_ROLLBACK, IMSG_SMTP_EVENT_DISCONNECT, IMSG_LKA_PROCESSOR_FORK, IMSG_LKA_PROCESSOR_ERRFD, IMSG_REPORT_SMTP_LINK_CONNECT, IMSG_REPORT_SMTP_LINK_DISCONNECT, IMSG_REPORT_SMTP_LINK_GREETING, IMSG_REPORT_SMTP_LINK_IDENTIFY, IMSG_REPORT_SMTP_LINK_TLS, IMSG_REPORT_SMTP_LINK_AUTH, IMSG_REPORT_SMTP_TX_RESET, IMSG_REPORT_SMTP_TX_BEGIN, IMSG_REPORT_SMTP_TX_MAIL, IMSG_REPORT_SMTP_TX_RCPT, IMSG_REPORT_SMTP_TX_ENVELOPE, IMSG_REPORT_SMTP_TX_DATA, IMSG_REPORT_SMTP_TX_COMMIT, IMSG_REPORT_SMTP_TX_ROLLBACK, IMSG_REPORT_SMTP_PROTOCOL_CLIENT, IMSG_REPORT_SMTP_PROTOCOL_SERVER, IMSG_REPORT_SMTP_FILTER_RESPONSE, IMSG_REPORT_SMTP_TIMEOUT, IMSG_FILTER_SMTP_BEGIN, IMSG_FILTER_SMTP_END, IMSG_FILTER_SMTP_PROTOCOL, IMSG_FILTER_SMTP_DATA_BEGIN, IMSG_FILTER_SMTP_DATA_END, IMSG_CA_RSA_PRIVENC, IMSG_CA_RSA_PRIVDEC, IMSG_CA_ECDSA_SIGN, }; enum smtp_proc_type { PROC_PARENT = 0, PROC_LKA, PROC_QUEUE, PROC_CONTROL, PROC_SCHEDULER, PROC_DISPATCHER, PROC_CA, PROC_PROCESSOR, PROC_CLIENT, }; enum table_type { T_NONE = 0, T_DYNAMIC = 0x01, /* table with external source */ T_LIST = 0x02, /* table holding a list */ T_HASH = 0x04, /* table holding a hash table */ }; struct table { char t_name[LINE_MAX]; enum table_type t_type; char t_config[PATH_MAX]; unsigned int t_services; void *t_handle; struct table_backend *t_backend; }; struct table_backend { const char *name; const unsigned int services; int (*config)(struct table *); int (*add)(struct table *, const char *, const char *); void (*dump)(struct table *); int (*open)(struct table *); int (*update)(struct table *); void (*close)(struct table *); int (*lookup)(struct table *, enum table_service, const char *, char **); int (*fetch)(struct table *, enum table_service, char **); }; enum bounce_type { B_FAILED, B_DELAYED, B_DELIVERED }; enum dsn_ret { DSN_RETFULL = 1, DSN_RETHDRS }; struct delivery_bounce { enum bounce_type type; time_t delay; time_t ttl; enum dsn_ret dsn_ret; int mta_without_dsn; }; enum expand_type { EXPAND_INVALID, EXPAND_USERNAME, EXPAND_FILENAME, EXPAND_FILTER, EXPAND_INCLUDE, EXPAND_ADDRESS, EXPAND_ERROR, }; enum filter_phase { FILTER_CONNECT, FILTER_HELO, FILTER_EHLO, FILTER_STARTTLS, FILTER_AUTH, FILTER_MAIL_FROM, FILTER_RCPT_TO, FILTER_DATA, FILTER_DATA_LINE, FILTER_RSET, FILTER_QUIT, FILTER_NOOP, FILTER_HELP, FILTER_WIZ, FILTER_COMMIT, FILTER_PHASES_COUNT /* must be last */ }; struct expandnode { RB_ENTRY(expandnode) entry; TAILQ_ENTRY(expandnode) tq_entry; enum expand_type type; int sameuser; int realuser; uid_t realuser_uid; int forwarded; struct rule *rule; struct expandnode *parent; unsigned int depth; union { /* * user field handles both expansion user and system user * so we MUST make it large enough to fit a mailaddr user */ char user[SMTPD_MAXLOCALPARTSIZE]; char buffer[EXPAND_BUFFER]; struct mailaddr mailaddr; } u; char subaddress[SMTPD_SUBADDRESS_SIZE]; }; struct expand { RB_HEAD(expandtree, expandnode) tree; TAILQ_HEAD(xnodes, expandnode) *queue; size_t nb_nodes; struct rule *rule; struct expandnode *parent; }; struct maddrnode { TAILQ_ENTRY(maddrnode) entries; struct mailaddr mailaddr; }; struct maddrmap { TAILQ_HEAD(xmaddr, maddrnode) queue; }; #define DSN_SUCCESS 0x01 #define DSN_FAILURE 0x02 #define DSN_DELAY 0x04 #define DSN_NEVER 0x08 #define DSN_ENVID_LEN 100 #define DSN_ORCPT_LEN 500 #define SMTPD_ENVELOPE_VERSION 3 struct envelope { TAILQ_ENTRY(envelope) entry; char dispatcher[HOST_NAME_MAX+1]; char tag[SMTPD_TAG_SIZE]; uint32_t version; uint64_t id; enum envelope_flags flags; char smtpname[HOST_NAME_MAX+1]; char helo[HOST_NAME_MAX+1]; char hostname[HOST_NAME_MAX+1]; char username[SMTPD_MAXMAILADDRSIZE]; char errorline[LINE_MAX]; struct sockaddr_storage ss; struct mailaddr sender; struct mailaddr rcpt; struct mailaddr dest; char mda_user[SMTPD_VUSERNAME_SIZE]; char mda_subaddress[SMTPD_SUBADDRESS_SIZE]; char mda_exec[LINE_MAX]; enum delivery_type type; union { struct delivery_bounce bounce; } agent; uint16_t retry; time_t creation; time_t ttl; time_t lasttry; time_t nexttry; time_t lastbounce; char dsn_orcpt[DSN_ORCPT_LEN+1]; char dsn_envid[DSN_ENVID_LEN+1]; uint8_t dsn_notify; enum dsn_ret dsn_ret; uint8_t esc_class; uint8_t esc_code; }; struct listener { uint16_t flags; int fd; struct sockaddr_storage ss; in_port_t port; struct timeval timeout; struct event ev; char filter_name[PATH_MAX]; char pki_name[PATH_MAX]; char ca_name[PATH_MAX]; char tag[SMTPD_TAG_SIZE]; char authtable[LINE_MAX]; char hostname[HOST_NAME_MAX+1]; char hostnametable[PATH_MAX]; char sendertable[PATH_MAX]; TAILQ_ENTRY(listener) entry; int local; /* there must be a better way */ char *tls_protocols; char *tls_ciphers; struct tls *tls; struct pki **pki; int pkicount; }; struct smtpd { char sc_conffile[PATH_MAX]; size_t sc_maxsize; #define SMTPD_OPT_VERBOSE 0x00000001 #define SMTPD_OPT_NOACTION 0x00000002 uint32_t sc_opts; #define SMTPD_EXITING 0x00000001 /* unused */ #define SMTPD_MDA_PAUSED 0x00000002 #define SMTPD_MTA_PAUSED 0x00000004 #define SMTPD_SMTP_PAUSED 0x00000008 #define SMTPD_MDA_BUSY 0x00000010 #define SMTPD_MTA_BUSY 0x00000020 #define SMTPD_BOUNCE_BUSY 0x00000040 #define SMTPD_SMTP_DISABLED 0x00000080 uint32_t sc_flags; #define QUEUE_COMPRESSION 0x00000001 #define QUEUE_ENCRYPTION 0x00000002 #define QUEUE_EVPCACHE 0x00000004 uint32_t sc_queue_flags; char *sc_queue_key; size_t sc_queue_evpcache_size; size_t sc_session_max_rcpt; size_t sc_session_max_mails; struct dict *sc_mda_wrappers; size_t sc_mda_max_session; size_t sc_mda_max_user_session; size_t sc_mda_task_hiwat; size_t sc_mda_task_lowat; size_t sc_mda_task_release; size_t sc_mta_max_deferred; size_t sc_scheduler_max_inflight; size_t sc_scheduler_max_evp_batch_size; size_t sc_scheduler_max_msg_batch_size; size_t sc_scheduler_max_schedule; struct dict *sc_filter_processes_dict; int sc_ttl; #define MAX_BOUNCE_WARN 4 time_t sc_bounce_warn[MAX_BOUNCE_WARN]; char sc_hostname[HOST_NAME_MAX+1]; struct stat_backend *sc_stat; struct compress_backend *sc_comp; time_t sc_uptime; /* This is a listener for a local socket used by smtp_enqueue(). */ struct listener *sc_sock_listener; TAILQ_HEAD(listenerlist, listener) *sc_listeners; TAILQ_HEAD(rulelist, rule) *sc_rules; struct dict *sc_filters_dict; struct dict *sc_dispatchers; struct dispatcher *sc_dispatcher_bounce; struct dict *sc_ca_dict; struct dict *sc_pki_dict; struct dict *sc_ssl_dict; struct dict *sc_tables_dict; /* keyed lookup */ struct dict *sc_limits_dict; char *sc_tls_ciphers; char *sc_subaddressing_delim; char *sc_srs_key; char *sc_srs_key_backup; int sc_srs_ttl; char *sc_admd; }; #define TRACE_DEBUG 0x0001 #define TRACE_IMSG 0x0002 #define TRACE_IO 0x0004 #define TRACE_SMTP 0x0008 #define TRACE_FILTERS 0x0010 #define TRACE_MTA 0x0020 #define TRACE_BOUNCE 0x0040 #define TRACE_SCHEDULER 0x0080 #define TRACE_LOOKUP 0x0100 #define TRACE_STAT 0x0200 #define TRACE_RULES 0x0400 #define TRACE_MPROC 0x0800 #define TRACE_EXPAND 0x1000 #define TRACE_TABLES 0x2000 #define TRACE_QUEUE 0x4000 #define PROFILE_TOSTAT 0x0001 #define PROFILE_IMSG 0x0002 #define PROFILE_QUEUE 0x0004 struct forward_req { uint64_t id; uint8_t status; char user[SMTPD_VUSERNAME_SIZE]; uid_t uid; gid_t gid; char directory[PATH_MAX]; }; struct deliver { char dispatcher[EXPAND_BUFFER]; struct mailaddr sender; struct mailaddr rcpt; struct mailaddr dest; char mda_subaddress[SMTPD_SUBADDRESS_SIZE]; char mda_exec[LINE_MAX]; struct userinfo userinfo; }; struct mta_host { SPLAY_ENTRY(mta_host) entry; struct sockaddr *sa; char *ptrname; int refcount; size_t nconn; time_t lastconn; time_t lastptrquery; #define HOST_IGNORE 0x01 int flags; }; struct mta_mx { TAILQ_ENTRY(mta_mx) entry; struct mta_host *host; char *mxname; int preference; }; struct mta_domain { SPLAY_ENTRY(mta_domain) entry; char *name; int as_host; TAILQ_HEAD(, mta_mx) mxs; int mxstatus; int refcount; size_t nconn; time_t lastconn; time_t lastmxquery; }; struct mta_source { SPLAY_ENTRY(mta_source) entry; struct sockaddr *sa; int refcount; size_t nconn; time_t lastconn; }; struct mta_connector { struct mta_source *source; struct mta_relay *relay; #define CONNECTOR_ERROR_FAMILY 0x0001 #define CONNECTOR_ERROR_SOURCE 0x0002 #define CONNECTOR_ERROR_MX 0x0004 #define CONNECTOR_ERROR_ROUTE_NET 0x0008 #define CONNECTOR_ERROR_ROUTE_SMTP 0x0010 #define CONNECTOR_ERROR_ROUTE 0x0018 #define CONNECTOR_ERROR_BLOCKED 0x0020 #define CONNECTOR_ERROR 0x00ff #define CONNECTOR_LIMIT_HOST 0x0100 #define CONNECTOR_LIMIT_ROUTE 0x0200 #define CONNECTOR_LIMIT_SOURCE 0x0400 #define CONNECTOR_LIMIT_RELAY 0x0800 #define CONNECTOR_LIMIT_CONN 0x1000 #define CONNECTOR_LIMIT_DOMAIN 0x2000 #define CONNECTOR_LIMIT 0xff00 #define CONNECTOR_NEW 0x10000 #define CONNECTOR_WAIT 0x20000 int flags; int refcount; size_t nconn; time_t lastconn; }; struct mta_route { SPLAY_ENTRY(mta_route) entry; uint64_t id; struct mta_source *src; struct mta_host *dst; #define ROUTE_NEW 0x01 #define ROUTE_RUNQ 0x02 #define ROUTE_KEEPALIVE 0x04 #define ROUTE_DISABLED 0xf0 #define ROUTE_DISABLED_NET 0x10 #define ROUTE_DISABLED_SMTP 0x20 int flags; int nerror; int penalty; int refcount; size_t nconn; time_t lastconn; time_t lastdisc; time_t lastpenalty; }; struct mta_limits { size_t maxconn_per_host; size_t maxconn_per_route; size_t maxconn_per_source; size_t maxconn_per_connector; size_t maxconn_per_relay; size_t maxconn_per_domain; time_t conndelay_host; time_t conndelay_route; time_t conndelay_source; time_t conndelay_connector; time_t conndelay_relay; time_t conndelay_domain; time_t discdelay_route; size_t max_mail_per_session; time_t sessdelay_transaction; time_t sessdelay_keepalive; size_t max_failures_per_session; int family; int task_hiwat; int task_lowat; int task_release; }; struct mta_relay { SPLAY_ENTRY(mta_relay) entry; uint64_t id; struct dispatcher *dispatcher; struct mta_domain *domain; struct mta_limits *limits; int tls; int flags; char *backupname; int backuppref; char *sourcetable; uint16_t port; char *pki_name; char *ca_name; char *authtable; char *authlabel; char *helotable; char *heloname; char *secret; int srs; int state; size_t ntask; TAILQ_HEAD(, mta_task) tasks; struct tree connectors; size_t sourceloop; time_t lastsource; time_t nextsource; int fail; char *failstr; #define RELAY_WAIT_MX 0x01 #define RELAY_WAIT_PREFERENCE 0x02 #define RELAY_WAIT_SECRET 0x04 #define RELAY_WAIT_LIMITS 0x08 #define RELAY_WAIT_SOURCE 0x10 #define RELAY_WAIT_CONNECTOR 0x20 #define RELAY_WAIT_SMARTHOST 0x40 #define RELAY_WAITMASK 0x7f int status; int refcount; size_t nconn; size_t nconn_ready; time_t lastconn; }; struct mta_envelope { TAILQ_ENTRY(mta_envelope) entry; uint64_t id; uint64_t session; time_t creation; char *smtpname; char *dest; char *rcpt; struct mta_task *task; int delivery; int ext; char *dsn_orcpt; char dsn_envid[DSN_ENVID_LEN+1]; uint8_t dsn_notify; enum dsn_ret dsn_ret; char status[LINE_MAX]; }; struct mta_task { TAILQ_ENTRY(mta_task) entry; struct mta_relay *relay; uint32_t msgid; TAILQ_HEAD(, mta_envelope) envelopes; char *sender; }; struct passwd; struct queue_backend { int (*init)(struct passwd *, int, const char *); }; struct compress_backend { size_t (*compress_chunk)(void *, size_t, void *, size_t); size_t (*uncompress_chunk)(void *, size_t, void *, size_t); int (*compress_file)(FILE *, FILE *); int (*uncompress_file)(FILE *, FILE *); }; /* auth structures */ enum auth_type { AUTH_BSD, AUTH_PWD, }; struct auth_backend { int (*authenticate)(char *, char *); }; struct scheduler_backend { int (*init)(const char *); int (*insert)(struct scheduler_info *); size_t (*commit)(uint32_t); size_t (*rollback)(uint32_t); int (*update)(struct scheduler_info *); int (*delete)(uint64_t); int (*hold)(uint64_t, uint64_t); int (*release)(int, uint64_t, int); int (*batch)(int, int*, size_t*, uint64_t*, int*); size_t (*messages)(uint32_t, uint32_t *, size_t); size_t (*envelopes)(uint64_t, struct evpstate *, size_t); int (*schedule)(uint64_t); int (*remove)(uint64_t); int (*suspend)(uint64_t); int (*resume)(uint64_t); int (*query)(uint64_t); }; enum stat_type { STAT_COUNTER, STAT_TIMESTAMP, STAT_TIMEVAL, STAT_TIMESPEC, }; struct stat_value { enum stat_type type; union stat_v { size_t counter; time_t timestamp; struct timeval tv; struct timespec ts; } u; }; #define STAT_KEY_SIZE 1024 struct stat_kv { void *iter; char key[STAT_KEY_SIZE]; struct stat_value val; }; struct stat_backend { void (*init)(void); void (*close)(void); void (*increment)(const char *, size_t); void (*decrement)(const char *, size_t); void (*set)(const char *, const struct stat_value *); int (*iter)(void **, char **, struct stat_value *); }; struct stat_digest { time_t startup; time_t timestamp; size_t clt_connect; size_t clt_disconnect; size_t evp_enqueued; size_t evp_dequeued; size_t evp_expired; size_t evp_removed; size_t evp_bounce; size_t dlv_ok; size_t dlv_permfail; size_t dlv_tempfail; size_t dlv_loop; }; struct mproc { pid_t pid; char *name; int proc; void (*handler)(struct mproc *, struct imsg *); struct imsgbuf imsgbuf; char *m_buf; size_t m_alloc; size_t m_pos; uint32_t m_type; uint32_t m_peerid; pid_t m_pid; int m_fd; int enable; short events; struct event ev; void *data; }; struct msg { const uint8_t *pos; const uint8_t *end; }; extern enum smtp_proc_type smtpd_process; extern int tracing; extern int foreground_log; extern int profiling; extern struct mproc *p_control; extern struct mproc *p_parent; extern struct mproc *p_lka; extern struct mproc *p_queue; extern struct mproc *p_scheduler; extern struct mproc *p_dispatcher; extern struct mproc *p_ca; extern struct smtpd *env; extern void (*imsg_callback)(struct mproc *, struct imsg *); /* inter-process structures */ struct bounce_req_msg { uint64_t evpid; time_t timestamp; struct delivery_bounce bounce; }; enum dns_error { DNS_OK = 0, DNS_RETRY, DNS_EINVAL, DNS_ENONAME, DNS_ENOTFOUND, /* RFC 7505 */ DNS_NULLMX, }; enum lka_resp_status { LKA_OK, LKA_TEMPFAIL, LKA_PERMFAIL }; enum filter_type { FILTER_TYPE_BUILTIN, FILTER_TYPE_PROC, FILTER_TYPE_CHAIN, }; enum filter_subsystem { FILTER_SUBSYSTEM_SMTP_IN = 1<<0, FILTER_SUBSYSTEM_SMTP_OUT = 1<<1, }; struct filter_proc { const char *command; const char *user; const char *group; const char *chroot; int errfd; enum filter_subsystem filter_subsystem; }; struct filter_config { char *name; enum filter_subsystem filter_subsystem; enum filter_type filter_type; enum filter_phase phase; char *reject; char *disconnect; char *rewrite; char *report; uint8_t junk; uint8_t bypass; char *proc; const char **chain; size_t chain_size; struct dict chain_procs; int8_t not_fcrdns; int8_t fcrdns; int8_t not_rdns; int8_t rdns; int8_t not_rdns_table; struct table *rdns_table; int8_t not_rdns_regex; struct table *rdns_regex; int8_t not_src_table; struct table *src_table; int8_t not_src_regex; struct table *src_regex; int8_t not_helo_table; struct table *helo_table; int8_t not_helo_regex; struct table *helo_regex; int8_t not_auth; int8_t auth; int8_t not_auth_table; struct table *auth_table; int8_t not_auth_regex; struct table *auth_regex; int8_t not_mail_from_table; struct table *mail_from_table; int8_t not_mail_from_regex; struct table *mail_from_regex; int8_t not_rcpt_to_table; struct table *rcpt_to_table; int8_t not_rcpt_to_regex; struct table *rcpt_to_regex; }; enum filter_status { FILTER_PROCEED, FILTER_REPORT, FILTER_REWRITE, FILTER_REJECT, FILTER_DISCONNECT, FILTER_JUNK, }; enum ca_resp_status { CA_OK, CA_FAIL }; enum mda_resp_status { MDA_OK, MDA_TEMPFAIL, MDA_PERMFAIL }; struct msg_walkinfo { struct event ev; uint32_t msgid; uint32_t peerid; size_t n_evp; void *data; int done; }; enum dispatcher_type { DISPATCHER_LOCAL, DISPATCHER_REMOTE, DISPATCHER_BOUNCE, }; struct dispatcher_local { uint8_t is_mbox; /* only for MBOX */ uint8_t expand_only; uint8_t forward_only; char *mda_wrapper; char *command; char *table_alias; char *table_virtual; char *table_userbase; char *user; }; struct dispatcher_remote { char *helo; char *helo_source; char *source; struct tls_config *tls_config; char *ca; char *pki; char *mail_from; char *smarthost; int smarthost_domain; char *auth; int tls_required; int tls_verify; char *tls_protocols; char *tls_ciphers; int backup; char *backupmx; char *filtername; int srs; }; struct dispatcher_bounce { }; struct dispatcher { enum dispatcher_type type; union dispatcher_agent { struct dispatcher_local local; struct dispatcher_remote remote; struct dispatcher_bounce bounce; } u; time_t ttl; }; struct rule { TAILQ_ENTRY(rule) r_entry; uint8_t reject; int8_t flag_tag; int8_t flag_from; int8_t flag_for; int8_t flag_from_rdns; int8_t flag_from_socket; int8_t flag_tag_regex; int8_t flag_from_regex; int8_t flag_for_regex; int8_t flag_smtp_helo; int8_t flag_smtp_starttls; int8_t flag_smtp_auth; int8_t flag_smtp_mail_from; int8_t flag_smtp_rcpt_to; int8_t flag_smtp_helo_regex; int8_t flag_smtp_starttls_regex; int8_t flag_smtp_auth_regex; int8_t flag_smtp_mail_from_regex; int8_t flag_smtp_rcpt_to_regex; char *table_tag; char *table_from; char *table_for; char *table_smtp_helo; char *table_smtp_auth; char *table_smtp_mail_from; char *table_smtp_rcpt_to; char *dispatcher; }; /* aliases.c */ int aliases_get(struct expand *, const char *); int aliases_virtual_get(struct expand *, const struct mailaddr *); /* bounce.c */ void bounce_add(uint64_t); void bounce_fd(int); /* ca.c */ int ca(void); int ca_X509_verify(void *, void *, const char *, const char *, const char **); void ca_imsg(struct mproc *, struct imsg *); void ca_init(void); void ca_engine_init(void); /* compress_backend.c */ struct compress_backend *compress_backend_lookup(const char *); size_t compress_chunk(void *, size_t, void *, size_t); size_t uncompress_chunk(void *, size_t, void *, size_t); int compress_file(FILE *, FILE *); int uncompress_file(FILE *, FILE *); /* config.c */ #define PURGE_LISTENERS 0x01 #define PURGE_TABLES 0x02 #define PURGE_RULES 0x04 #define PURGE_PKI 0x08 #define PURGE_PKI_KEYS 0x10 #define PURGE_DISPATCHERS 0x20 #define PURGE_EVERYTHING 0xff struct smtpd *config_default(void); void purge_config(uint8_t); void config_process(enum smtp_proc_type); void config_peer(enum smtp_proc_type); /* control.c */ int control(void); int control_create_socket(void); /* crypto.c */ int crypto_setup(const char *, size_t); int crypto_encrypt_file(FILE *, FILE *); int crypto_decrypt_file(FILE *, FILE *); size_t crypto_encrypt_buffer(const char *, size_t, char *, size_t); size_t crypto_decrypt_buffer(const char *, size_t, char *, size_t); /* dns.c */ void dns_imsg(struct mproc *, struct imsg *); /* enqueue.c */ int enqueue(int, char **, FILE *); /* envelope.c */ void envelope_set_errormsg(struct envelope *, char *, ...) __attribute__((__format__ (printf, 2, 3))); void envelope_set_esc_class(struct envelope *, enum enhanced_status_class); void envelope_set_esc_code(struct envelope *, enum enhanced_status_code); int envelope_load_buffer(struct envelope *, const char *, size_t); int envelope_dump_buffer(const struct envelope *, char *, size_t); /* expand.c */ int expand_cmp(struct expandnode *, struct expandnode *); void expand_insert(struct expand *, struct expandnode *); struct expandnode *expand_lookup(struct expand *, struct expandnode *); void expand_clear(struct expand *); void expand_free(struct expand *); int expand_line(struct expand *, const char *, int); int expand_to_text(struct expand *, char *, size_t); RB_PROTOTYPE(expandtree, expandnode, nodes, expand_cmp); /* forward.c */ int forwards_get(int, struct expand *); /* limit.c */ void limit_mta_set_defaults(struct mta_limits *); int limit_mta_set(struct mta_limits *, const char*, int64_t); /* lka.c */ int lka(void); /* lka_proc.c */ int lka_proc_ready(void); void lka_proc_forked(const char *, uint32_t, int); void lka_proc_errfd(const char *, int); struct io *lka_proc_get_io(const char *); /* lka_report.c */ void lka_report_init(void); void lka_report_register_hook(const char *, const char *); void lka_report_smtp_link_connect(const char *, struct timeval *, uint64_t, const char *, int, const struct sockaddr_storage *, const struct sockaddr_storage *); void lka_report_smtp_link_disconnect(const char *, struct timeval *, uint64_t); void lka_report_smtp_link_greeting(const char *, uint64_t, struct timeval *, const char *); void lka_report_smtp_link_identify(const char *, struct timeval *, uint64_t, const char *, const char *); void lka_report_smtp_link_tls(const char *, struct timeval *, uint64_t, const char *); void lka_report_smtp_link_auth(const char *, struct timeval *, uint64_t, const char *, const char *); void lka_report_smtp_tx_reset(const char *, struct timeval *, uint64_t, uint32_t); void lka_report_smtp_tx_begin(const char *, struct timeval *, uint64_t, uint32_t); void lka_report_smtp_tx_mail(const char *, struct timeval *, uint64_t, uint32_t, const char *, int); void lka_report_smtp_tx_rcpt(const char *, struct timeval *, uint64_t, uint32_t, const char *, int); void lka_report_smtp_tx_envelope(const char *, struct timeval *, uint64_t, uint32_t, uint64_t); void lka_report_smtp_tx_commit(const char *, struct timeval *, uint64_t, uint32_t, size_t); void lka_report_smtp_tx_data(const char *, struct timeval *, uint64_t, uint32_t, int); void lka_report_smtp_tx_rollback(const char *, struct timeval *, uint64_t, uint32_t); void lka_report_smtp_protocol_client(const char *, struct timeval *, uint64_t, const char *); void lka_report_smtp_protocol_server(const char *, struct timeval *, uint64_t, const char *); void lka_report_smtp_filter_response(const char *, struct timeval *, uint64_t, int, int, const char *); void lka_report_smtp_timeout(const char *, struct timeval *, uint64_t); void lka_report_filter_report(uint64_t, const char *, int, const char *, struct timeval *, const char *); void lka_report_proc(const char *, const char *); /* lka_filter.c */ void lka_filter_init(void); void lka_filter_register_hook(const char *, const char *); void lka_filter_ready(void); int lka_filter_proc_in_session(uint64_t, const char *); void lka_filter_begin(uint64_t, const char *); void lka_filter_end(uint64_t); void lka_filter_protocol(uint64_t, enum filter_phase, const char *); void lka_filter_data_begin(uint64_t); void lka_filter_data_end(uint64_t); /* lka_session.c */ void lka_session(uint64_t, struct envelope *); void lka_session_forward_reply(struct forward_req *, int); /* log.c */ void vlog(int, const char *, va_list); void logit(int, const char *, ...) __attribute__((format (printf, 2, 3))); /* mda.c */ void mda_postfork(void); void mda_postprivdrop(void); void mda_imsg(struct mproc *, struct imsg *); /* mda_mbox.c */ void mda_mbox_init(struct deliver *); void mda_mbox(struct deliver *); /* mda_unpriv.c */ void mda_unpriv(struct dispatcher *, struct deliver *, const char *, const char *); /* mda_variables.c */ ssize_t mda_expand_format(char *, size_t, const struct deliver *, const struct userinfo *, const char *); /* makemap.c */ int makemap(int, int, char **); /* mailaddr.c */ int mailaddr_line(struct maddrmap *, const char *); void maddrmap_init(struct maddrmap *); void maddrmap_insert(struct maddrmap *, struct maddrnode *); void maddrmap_free(struct maddrmap *); /* mproc.c */ int mproc_fork(struct mproc *, const char*, char **); void mproc_init(struct mproc *, int); void mproc_clear(struct mproc *); void mproc_enable(struct mproc *); void mproc_disable(struct mproc *); void mproc_event_add(struct mproc *); void m_compose(struct mproc *, uint32_t, uint32_t, pid_t, int, void *, size_t); void m_composev(struct mproc *, uint32_t, uint32_t, pid_t, int, const struct iovec *, int); void m_forward(struct mproc *, struct imsg *); void m_create(struct mproc *, uint32_t, uint32_t, pid_t, int); void m_add(struct mproc *, const void *, size_t); void m_add_int(struct mproc *, int); void m_add_u32(struct mproc *, uint32_t); void m_add_size(struct mproc *, size_t); void m_add_time(struct mproc *, time_t); void m_add_timeval(struct mproc *, struct timeval *tv); void m_add_string(struct mproc *, const char *); void m_add_data(struct mproc *, const void *, size_t); void m_add_evpid(struct mproc *, uint64_t); void m_add_msgid(struct mproc *, uint32_t); void m_add_id(struct mproc *, uint64_t); void m_add_sockaddr(struct mproc *, const struct sockaddr *); void m_add_mailaddr(struct mproc *, const struct mailaddr *); void m_add_envelope(struct mproc *, const struct envelope *); void m_add_params(struct mproc *, struct dict *); void m_close(struct mproc *); void m_flush(struct mproc *); void m_msg(struct msg *, struct imsg *); int m_is_eom(struct msg *); void m_end(struct msg *); void m_get_int(struct msg *, int *); void m_get_size(struct msg *, size_t *); void m_get_u32(struct msg *, uint32_t *); void m_get_time(struct msg *, time_t *); void m_get_timeval(struct msg *, struct timeval *); void m_get_string(struct msg *, const char **); void m_get_data(struct msg *, const void **, size_t *); void m_get_evpid(struct msg *, uint64_t *); void m_get_msgid(struct msg *, uint32_t *); void m_get_id(struct msg *, uint64_t *); void m_get_sockaddr(struct msg *, struct sockaddr *); void m_get_mailaddr(struct msg *, struct mailaddr *); void m_get_envelope(struct msg *, struct envelope *); void m_get_params(struct msg *, struct dict *); void m_clear_params(struct dict *); /* mta.c */ void mta_postfork(void); void mta_postprivdrop(void); void mta_imsg(struct mproc *, struct imsg *); void mta_route_ok(struct mta_relay *, struct mta_route *); void mta_route_error(struct mta_relay *, struct mta_route *); void mta_route_down(struct mta_relay *, struct mta_route *); void mta_route_collect(struct mta_relay *, struct mta_route *); void mta_source_error(struct mta_relay *, struct mta_route *, const char *); void mta_delivery_log(struct mta_envelope *, const char *, const char *, int, const char *); void mta_delivery_notify(struct mta_envelope *); struct mta_task *mta_route_next_task(struct mta_relay *, struct mta_route *); const char *mta_host_to_text(struct mta_host *); const char *mta_relay_to_text(struct mta_relay *); /* mta_session.c */ void mta_session(struct mta_relay *, struct mta_route *, const char *); void mta_session_imsg(struct mproc *, struct imsg *); /* parse.y */ int parse_config(struct smtpd *, const char *, int); int cmdline_symset(char *); /* queue.c */ int queue(void); /* queue_backend.c */ uint32_t queue_generate_msgid(void); uint64_t queue_generate_evpid(uint32_t); int queue_init(const char *, int); int queue_close(void); int queue_message_create(uint32_t *); int queue_message_delete(uint32_t); int queue_message_commit(uint32_t); int queue_message_fd_r(uint32_t); int queue_message_fd_rw(uint32_t); int queue_envelope_create(struct envelope *); int queue_envelope_delete(uint64_t); int queue_envelope_load(uint64_t, struct envelope *); int queue_envelope_update(struct envelope *); int queue_envelope_walk(struct envelope *); int queue_message_walk(struct envelope *, uint32_t, int *, void **); /* report_smtp.c */ void report_smtp_link_connect(const char *, uint64_t, const char *, int, const struct sockaddr_storage *, const struct sockaddr_storage *); void report_smtp_link_disconnect(const char *, uint64_t); void report_smtp_link_greeting(const char *, uint64_t, const char *); void report_smtp_link_identify(const char *, uint64_t, const char *, const char *); void report_smtp_link_tls(const char *, uint64_t, const char *); void report_smtp_link_auth(const char *, uint64_t, const char *, const char *); void report_smtp_tx_reset(const char *, uint64_t, uint32_t); void report_smtp_tx_begin(const char *, uint64_t, uint32_t); void report_smtp_tx_mail(const char *, uint64_t, uint32_t, const char *, int); void report_smtp_tx_rcpt(const char *, uint64_t, uint32_t, const char *, int); void report_smtp_tx_envelope(const char *, uint64_t, uint32_t, uint64_t); void report_smtp_tx_data(const char *, uint64_t, uint32_t, int); void report_smtp_tx_commit(const char *, uint64_t, uint32_t, size_t); void report_smtp_tx_rollback(const char *, uint64_t, uint32_t); void report_smtp_protocol_client(const char *, uint64_t, const char *); void report_smtp_protocol_server(const char *, uint64_t, const char *); void report_smtp_filter_response(const char *, uint64_t, int, int, const char *); void report_smtp_timeout(const char *, uint64_t); /* ruleset.c */ struct rule *ruleset_match(const struct envelope *); /* scheduler.c */ int scheduler(void); /* scheduler_bakend.c */ struct scheduler_backend *scheduler_backend_lookup(const char *); void scheduler_info(struct scheduler_info *, struct envelope *); /* dispatcher.c */ int dispatcher(void); void dispatcher_imsg(struct mproc *, struct imsg *); /* resolver.c */ void resolver_getaddrinfo(const char *, const char *, const struct addrinfo *, void(*)(void *, int, struct addrinfo*), void *); void resolver_getnameinfo(const struct sockaddr *, int, void(*)(void *, int, const char *, const char *), void *); void resolver_res_query(const char *, int, int, void (*cb)(void *, int, int, int, const void *, int), void *); void resolver_dispatch_request(struct mproc *, struct imsg *); void resolver_dispatch_result(struct mproc *, struct imsg *); /* smtp.c */ void smtp_postfork(void); void smtp_postprivdrop(void); void smtp_imsg(struct mproc *, struct imsg *); void smtp_configure(void); void smtp_collect(void); /* smtp_session.c */ int smtp_session(struct listener *, int, const struct sockaddr_storage *, const char *, struct io *); void smtp_session_imsg(struct mproc *, struct imsg *); /* smtpd.c */ void imsg_dispatch(struct mproc *, struct imsg *); const char *proc_name(enum smtp_proc_type); const char *proc_title(enum smtp_proc_type); const char *imsg_to_str(int); void log_imsg(int, int, struct imsg *); int fork_proc_backend(const char *, const char *, const char *, int); /* srs.c */ const char *srs_encode(const char *, const char *); const char *srs_decode(const char *); /* stat_backend.c */ struct stat_backend *stat_backend_lookup(const char *); void stat_increment(const char *, size_t); void stat_decrement(const char *, size_t); void stat_set(const char *, const struct stat_value *); struct stat_value *stat_counter(size_t); struct stat_value *stat_timestamp(time_t); struct stat_value *stat_timeval(struct timeval *); struct stat_value *stat_timespec(struct timespec *); /* table.c */ const char *table_service_name(enum table_service); int table_service_from_name(const char *); struct table *table_find(struct smtpd *, const char *); struct table *table_create(struct smtpd *, const char *, const char *, const char *); int table_config(struct table *); int table_open(struct table *); int table_update(struct table *); void table_close(struct table *); void table_dump(struct table *); int table_check_use(struct table *, uint32_t, uint32_t); int table_check_type(struct table *, uint32_t); int table_check_service(struct table *, uint32_t); int table_match(struct table *, enum table_service, const char *); int table_lookup(struct table *, enum table_service, const char *, union lookup *); int table_fetch(struct table *, enum table_service, union lookup *); void table_destroy(struct smtpd *, struct table *); void table_add(struct table *, const char *, const char *); int table_domain_match(const char *, const char *); int table_netaddr_match(const char *, const char *); int table_mailaddr_match(const char *, const char *); int table_regex_match(const char *, const char *); void table_open_all(struct smtpd *); void table_dump_all(struct smtpd *); void table_close_all(struct smtpd *); /* to.c */ int text_to_netaddr(struct netaddr *, const char *); int text_to_mailaddr(struct mailaddr *, const char *); int text_to_relayhost(struct relayhost *, const char *); int text_to_userinfo(struct userinfo *, const char *); int text_to_credentials(struct credentials *, const char *); int text_to_expandnode(struct expandnode *, const char *); uint64_t text_to_evpid(const char *); uint32_t text_to_msgid(const char *); const char *sa_to_text(const struct sockaddr *); const char *ss_to_text(const struct sockaddr_storage *); const char *time_to_text(time_t); const char *duration_to_text(time_t); const char *rule_to_text(struct rule *); const char *sockaddr_to_text(const struct sockaddr *); const char *mailaddr_to_text(const struct mailaddr *); const char *expandnode_to_text(struct expandnode *); const char *tls_to_text(struct tls *); /* util.c */ typedef struct arglist arglist; struct arglist { char **list; uint num; uint nalloc; }; void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3))); int bsnprintf(char *, size_t, const char *, ...) __attribute__((format (printf, 3, 4))); int safe_fclose(FILE *); int hostname_match(const char *, const char *); int mailaddr_match(const struct mailaddr *, const struct mailaddr *); int valid_localpart(const char *); int valid_domainpart(const char *); int valid_domainname(const char *); int valid_smtp_response(const char *); int valid_xtext(const char *); int secure_file(int, char *, char *, uid_t, int); int lowercase(char *, const char *, size_t); void xlowercase(char *, const char *, size_t); int uppercase(char *, const char *, size_t); uint64_t generate_uid(void); int ckdir(const char *, mode_t, uid_t, gid_t, int); int rmtree(char *, int); int mvpurge(char *, char *); int mktmpfile(void); const char *parse_smtp_response(char *, size_t, char **, int *); int xasprintf(char **, const char *, ...) __attribute__((__format__ (printf, 2, 3))); void *xmalloc(size_t); void *xcalloc(size_t, size_t); char *xstrdup(const char *); void *xmemdup(const void *, size_t); char *strip(char *); int io_xprint(struct io *, const char *); int io_xprintf(struct io *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); int session_socket_error(int); int getmailname(char *, size_t); int base64_encode(unsigned char const *, size_t, char *, size_t); int base64_decode(char const *, unsigned char *, size_t); int base64_encode_rfc3548(unsigned char const *, size_t, char *, size_t); void xclosefrom(int); void log_trace_verbose(int); void log_trace0(const char *, ...) __attribute__((format (printf, 1, 2))); #define log_trace(m, ...) do { if (tracing & (m)) log_trace0(__VA_ARGS__); } while (0) int parse_table_line(FILE *, char **, size_t *, int *, char **, char **, int *); /* waitq.c */ int waitq_wait(void *, void (*)(void *, void *, void *), void *); void waitq_run(void *, void *); /* runq.c */ struct runq; int runq_init(struct runq **, void (*)(struct runq *, void *)); int runq_schedule(struct runq *, time_t, void *); int runq_schedule_at(struct runq *, time_t, void *); int runq_cancel(struct runq *, void *); int runq_pending(struct runq *, void *, time_t *); /* On OpenBSD we just use freeaddrinfo() */ #if defined(NOOP_ASR_FREEADDRINFO) #define asr_freeaddrinfo(x) freeaddrinfo(x) #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd-api.h0000644000175000001440000002053514674615567014446 /* $OpenBSD: smtpd-api.h,v 1.37 2024/06/09 10:13:05 gilles Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _SMTPD_API_H_ #define _SMTPD_API_H_ #include "dict.h" #include "tree.h" struct mailaddr { char user[SMTPD_MAXLOCALPARTSIZE]; char domain[SMTPD_MAXDOMAINPARTSIZE]; }; #define PROC_QUEUE_API_VERSION 2 enum { PROC_QUEUE_OK, PROC_QUEUE_FAIL, PROC_QUEUE_INIT, PROC_QUEUE_CLOSE, PROC_QUEUE_MESSAGE_CREATE, PROC_QUEUE_MESSAGE_DELETE, PROC_QUEUE_MESSAGE_COMMIT, PROC_QUEUE_MESSAGE_FD_R, PROC_QUEUE_ENVELOPE_CREATE, PROC_QUEUE_ENVELOPE_DELETE, PROC_QUEUE_ENVELOPE_LOAD, PROC_QUEUE_ENVELOPE_UPDATE, PROC_QUEUE_ENVELOPE_WALK, }; #define PROC_SCHEDULER_API_VERSION 2 struct scheduler_info; enum { PROC_SCHEDULER_OK, PROC_SCHEDULER_FAIL, PROC_SCHEDULER_INIT, PROC_SCHEDULER_INSERT, PROC_SCHEDULER_COMMIT, PROC_SCHEDULER_ROLLBACK, PROC_SCHEDULER_UPDATE, PROC_SCHEDULER_DELETE, PROC_SCHEDULER_HOLD, PROC_SCHEDULER_RELEASE, PROC_SCHEDULER_BATCH, PROC_SCHEDULER_MESSAGES, PROC_SCHEDULER_ENVELOPES, PROC_SCHEDULER_SCHEDULE, PROC_SCHEDULER_REMOVE, PROC_SCHEDULER_SUSPEND, PROC_SCHEDULER_RESUME, }; enum envelope_flags { EF_AUTHENTICATED = 0x01, EF_BOUNCE = 0x02, EF_INTERNAL = 0x04, /* Internal expansion forward */ /* runstate, not saved on disk */ EF_PENDING = 0x10, EF_INFLIGHT = 0x20, EF_SUSPEND = 0x40, EF_HOLD = 0x80, }; struct evpstate { uint64_t evpid; uint16_t flags; uint16_t retry; time_t time; }; enum delivery_type { D_MDA, D_MTA, D_BOUNCE, }; struct scheduler_info { uint64_t evpid; enum delivery_type type; uint16_t retry; time_t creation; time_t ttl; time_t lasttry; time_t lastbounce; time_t nexttry; }; #define SCHED_REMOVE 0x01 #define SCHED_EXPIRE 0x02 #define SCHED_UPDATE 0x04 #define SCHED_BOUNCE 0x08 #define SCHED_MDA 0x10 #define SCHED_MTA 0x20 #define PROC_TABLE_API_VERSION 2 struct table_open_params { uint32_t version; char name[LINE_MAX]; }; enum table_service { K_NONE = 0x000, K_ALIAS = 0x001, /* returns struct expand */ K_DOMAIN = 0x002, /* returns struct destination */ K_CREDENTIALS = 0x004, /* returns struct credentials */ K_NETADDR = 0x008, /* returns struct netaddr */ K_USERINFO = 0x010, /* returns struct userinfo */ K_SOURCE = 0x020, /* returns struct source */ K_MAILADDR = 0x040, /* returns struct mailaddr */ K_ADDRNAME = 0x080, /* returns struct addrname */ K_MAILADDRMAP = 0x100, /* returns struct maddrmap */ K_RELAYHOST = 0x200, /* returns struct relayhost */ K_STRING = 0x400, K_REGEX = 0x800, K_AUTH = 0x1000, }; #define K_ANY 0xffff enum { PROC_TABLE_OK, PROC_TABLE_FAIL, PROC_TABLE_OPEN, PROC_TABLE_CLOSE, PROC_TABLE_UPDATE, PROC_TABLE_CHECK, PROC_TABLE_LOOKUP, PROC_TABLE_FETCH, }; enum enhanced_status_code { /* 0.0 */ ESC_OTHER_STATUS = 00, /* 1.x */ ESC_OTHER_ADDRESS_STATUS = 10, ESC_BAD_DESTINATION_MAILBOX_ADDRESS = 11, ESC_BAD_DESTINATION_SYSTEM_ADDRESS = 12, ESC_BAD_DESTINATION_MAILBOX_ADDRESS_SYNTAX = 13, ESC_DESTINATION_MAILBOX_ADDRESS_AMBIGUOUS = 14, ESC_DESTINATION_ADDRESS_VALID = 15, ESC_DESTINATION_MAILBOX_HAS_MOVED = 16, ESC_BAD_SENDER_MAILBOX_ADDRESS_SYNTAX = 17, ESC_BAD_SENDER_SYSTEM_ADDRESS = 18, /* 2.x */ ESC_OTHER_MAILBOX_STATUS = 20, ESC_MAILBOX_DISABLED = 21, ESC_MAILBOX_FULL = 22, ESC_MESSAGE_LENGTH_TOO_LARGE = 23, ESC_MAILING_LIST_EXPANSION_PROBLEM = 24, /* 3.x */ ESC_OTHER_MAIL_SYSTEM_STATUS = 30, ESC_MAIL_SYSTEM_FULL = 31, ESC_SYSTEM_NOT_ACCEPTING_MESSAGES = 32, ESC_SYSTEM_NOT_CAPABLE_OF_SELECTED_FEATURES = 33, ESC_MESSAGE_TOO_BIG_FOR_SYSTEM = 34, ESC_SYSTEM_INCORRECTLY_CONFIGURED = 35, /* 4.x */ ESC_OTHER_NETWORK_ROUTING_STATUS = 40, ESC_NO_ANSWER_FROM_HOST = 41, ESC_BAD_CONNECTION = 42, ESC_DIRECTORY_SERVER_FAILURE = 43, ESC_UNABLE_TO_ROUTE = 44, ESC_MAIL_SYSTEM_CONGESTION = 45, ESC_ROUTING_LOOP_DETECTED = 46, ESC_DELIVERY_TIME_EXPIRED = 47, /* 5.x */ ESC_INVALID_RECIPIENT = 50, ESC_INVALID_COMMAND = 51, ESC_SYNTAX_ERROR = 52, ESC_TOO_MANY_RECIPIENTS = 53, ESC_INVALID_COMMAND_ARGUMENTS = 54, ESC_WRONG_PROTOCOL_VERSION = 55, /* 6.x */ ESC_OTHER_MEDIA_ERROR = 60, ESC_MEDIA_NOT_SUPPORTED = 61, ESC_CONVERSION_REQUIRED_AND_PROHIBITED = 62, ESC_CONVERSION_REQUIRED_BUT_NOT_SUPPORTED = 63, ESC_CONVERSION_WITH_LOSS_PERFORMED = 64, ESC_CONVERSION_FAILED = 65, /* 7.x */ ESC_OTHER_SECURITY_STATUS = 70, ESC_DELIVERY_NOT_AUTHORIZED_MESSAGE_REFUSED = 71, ESC_MAILING_LIST_EXPANSION_PROHIBITED = 72, ESC_SECURITY_CONVERSION_REQUIRED_NOT_POSSIBLE = 73, ESC_SECURITY_FEATURES_NOT_SUPPORTED = 74, ESC_CRYPTOGRAPHIC_FAILURE = 75, ESC_CRYPTOGRAPHIC_ALGORITHM_NOT_SUPPORTED = 76, ESC_MESSAGE_INTEGRITY_FAILURE = 77, }; enum enhanced_status_class { ESC_STATUS_OK = 2, ESC_STATUS_TEMPFAIL = 4, ESC_STATUS_PERMFAIL = 5, }; static inline uint32_t evpid_to_msgid(uint64_t evpid) { return (evpid >> 32); } static inline uint64_t msgid_to_evpid(uint32_t msgid) { return ((uint64_t)msgid << 32); } /* esc.c */ const char *esc_code(enum enhanced_status_class, enum enhanced_status_code); const char *esc_description(enum enhanced_status_code); /* queue */ void queue_api_on_close(int(*)(void)); void queue_api_on_message_create(int(*)(uint32_t *)); void queue_api_on_message_commit(int(*)(uint32_t, const char*)); void queue_api_on_message_delete(int(*)(uint32_t)); void queue_api_on_message_fd_r(int(*)(uint32_t)); void queue_api_on_envelope_create(int(*)(uint32_t, const char *, size_t, uint64_t *)); void queue_api_on_envelope_delete(int(*)(uint64_t)); void queue_api_on_envelope_update(int(*)(uint64_t, const char *, size_t)); void queue_api_on_envelope_load(int(*)(uint64_t, char *, size_t)); void queue_api_on_envelope_walk(int(*)(uint64_t *, char *, size_t)); void queue_api_on_message_walk(int(*)(uint64_t *, char *, size_t, uint32_t, int *, void **)); void queue_api_no_chroot(void); void queue_api_set_chroot(const char *); void queue_api_set_user(const char *); int queue_api_dispatch(void); /* scheduler */ void scheduler_api_on_init(int(*)(void)); void scheduler_api_on_insert(int(*)(struct scheduler_info *)); void scheduler_api_on_commit(size_t(*)(uint32_t)); void scheduler_api_on_rollback(size_t(*)(uint32_t)); void scheduler_api_on_update(int(*)(struct scheduler_info *)); void scheduler_api_on_delete(int(*)(uint64_t)); void scheduler_api_on_hold(int(*)(uint64_t, uint64_t)); void scheduler_api_on_release(int(*)(int, uint64_t, int)); void scheduler_api_on_batch(int(*)(int, int *, size_t *, uint64_t *, int *)); void scheduler_api_on_messages(size_t(*)(uint32_t, uint32_t *, size_t)); void scheduler_api_on_envelopes(size_t(*)(uint64_t, struct evpstate *, size_t)); void scheduler_api_on_schedule(int(*)(uint64_t)); void scheduler_api_on_remove(int(*)(uint64_t)); void scheduler_api_on_suspend(int(*)(uint64_t)); void scheduler_api_on_resume(int(*)(uint64_t)); void scheduler_api_no_chroot(void); void scheduler_api_set_chroot(const char *); void scheduler_api_set_user(const char *); int scheduler_api_dispatch(void); /* table */ void table_api_on_update(int(*)(void)); void table_api_on_check(int(*)(int, struct dict *, const char *)); void table_api_on_lookup(int(*)(int, struct dict *, const char *, char *, size_t)); void table_api_on_fetch(int(*)(int, struct dict *, char *, size_t)); int table_api_dispatch(void); const char *table_api_get_name(void); #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/compress_backend.c0000644000175000001440000000347314610663500016023 /* $OpenBSD: compress_backend.c,v 1.10 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2012 Charles Longeau * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "smtpd.h" #define BUFFER_SIZE 16364 extern struct compress_backend compress_gzip; struct compress_backend * compress_backend_lookup(const char *name) { if (!strcmp(name, "gzip")) return &compress_gzip; return NULL; } size_t compress_chunk(void *ib, size_t ibsz, void *ob, size_t obsz) { return (env->sc_comp->compress_chunk(ib, ibsz, ob, obsz)); } size_t uncompress_chunk(void *ib, size_t ibsz, void *ob, size_t obsz) { return (env->sc_comp->uncompress_chunk(ib, ibsz, ob, obsz)); } int compress_file(FILE *ifile, FILE *ofile) { return (env->sc_comp->compress_file(ifile, ofile)); } int uncompress_file(FILE *ifile, FILE *ofile) { return (env->sc_comp->uncompress_file(ifile, ofile)); } opensmtpd-7.7.0p0/usr.sbin/smtpd/bounce.c0000644000175000001440000004513614610663500013776 /* $OpenBSD: bounce.c,v 1.90 2023/05/31 16:51:46 op Exp $ */ /* * Copyright (c) 2009 Gilles Chehade * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define BOUNCE_MAXRUN 2 #define BOUNCE_HIWAT 65535 enum { BOUNCE_EHLO, BOUNCE_MAIL, BOUNCE_RCPT, BOUNCE_DATA, BOUNCE_DATA_NOTICE, BOUNCE_DATA_MESSAGE, BOUNCE_DATA_END, BOUNCE_QUIT, BOUNCE_CLOSE, }; struct bounce_envelope { TAILQ_ENTRY(bounce_envelope) entry; uint64_t id; struct mailaddr dest; char *report; uint8_t esc_class; uint8_t esc_code; }; struct bounce_message { SPLAY_ENTRY(bounce_message) sp_entry; TAILQ_ENTRY(bounce_message) entry; uint32_t msgid; struct delivery_bounce bounce; char *smtpname; char *to; time_t timeout; TAILQ_HEAD(, bounce_envelope) envelopes; }; struct bounce_session { char *smtpname; struct bounce_message *msg; FILE *msgfp; int state; struct io *io; uint64_t boundary; }; SPLAY_HEAD(bounce_message_tree, bounce_message); static int bounce_message_cmp(const struct bounce_message *, const struct bounce_message *); SPLAY_PROTOTYPE(bounce_message_tree, bounce_message, sp_entry, bounce_message_cmp); static void bounce_drain(void); static void bounce_send(struct bounce_session *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); static int bounce_next_message(struct bounce_session *); static int bounce_next(struct bounce_session *); static void bounce_delivery(struct bounce_message *, int, const char *); static void bounce_status(struct bounce_session *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); static void bounce_io(struct io *, int, void *); static void bounce_timeout(int, short, void *); static void bounce_free(struct bounce_session *); static const char *action_str(const struct delivery_bounce *); static struct tree wait_fd; static struct bounce_message_tree messages; static TAILQ_HEAD(, bounce_message) pending; static int nmessage = 0; static int running = 0; static struct event ev_timer; static void bounce_init(void) { static int init = 0; if (init == 0) { TAILQ_INIT(&pending); SPLAY_INIT(&messages); tree_init(&wait_fd); evtimer_set(&ev_timer, bounce_timeout, NULL); init = 1; } } void bounce_add(uint64_t evpid) { char buf[LINE_MAX], *line; struct envelope evp; struct bounce_message key, *msg; struct bounce_envelope *be; bounce_init(); if (queue_envelope_load(evpid, &evp) == 0) { m_create(p_scheduler, IMSG_QUEUE_DELIVERY_PERMFAIL, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_close(p_scheduler); return; } if (evp.type != D_BOUNCE) fatalx("bounce: evp:%016" PRIx64 " is not of type D_BOUNCE!", evp.id); key.msgid = evpid_to_msgid(evpid); key.bounce = evp.agent.bounce; key.smtpname = evp.smtpname; switch (evp.esc_class) { case ESC_STATUS_OK: key.bounce.type = B_DELIVERED; break; case ESC_STATUS_TEMPFAIL: key.bounce.type = B_DELAYED; break; default: key.bounce.type = B_FAILED; } key.bounce.dsn_ret = evp.dsn_ret; key.bounce.ttl = evp.ttl; msg = SPLAY_FIND(bounce_message_tree, &messages, &key); if (msg == NULL) { msg = xcalloc(1, sizeof(*msg)); msg->msgid = key.msgid; msg->bounce = key.bounce; TAILQ_INIT(&msg->envelopes); msg->smtpname = xstrdup(evp.smtpname); (void)snprintf(buf, sizeof(buf), "%s@%s", evp.sender.user, evp.sender.domain); msg->to = xstrdup(buf); nmessage += 1; SPLAY_INSERT(bounce_message_tree, &messages, msg); log_debug("debug: bounce: new message %08" PRIx32, msg->msgid); stat_increment("bounce.message", 1); } else TAILQ_REMOVE(&pending, msg, entry); line = evp.errorline; if (strlen(line) > 4 && (*line == '1' || *line == '6')) line += 4; (void)snprintf(buf, sizeof(buf), "%s@%s: %s", evp.dest.user, evp.dest.domain, line); be = xmalloc(sizeof *be); be->id = evpid; be->report = xstrdup(buf); (void)strlcpy(be->dest.user, evp.dest.user, sizeof(be->dest.user)); (void)strlcpy(be->dest.domain, evp.dest.domain, sizeof(be->dest.domain)); be->esc_class = evp.esc_class; be->esc_code = evp.esc_code; TAILQ_INSERT_TAIL(&msg->envelopes, be, entry); log_debug("debug: bounce: adding report %16"PRIx64": %s", be->id, be->report); msg->timeout = time(NULL) + 1; TAILQ_INSERT_TAIL(&pending, msg, entry); stat_increment("bounce.envelope", 1); bounce_drain(); } void bounce_fd(int fd) { struct bounce_session *s; struct bounce_message *msg; log_debug("debug: bounce: got enqueue socket %d", fd); if (fd == -1 || TAILQ_EMPTY(&pending)) { log_debug("debug: bounce: cancelling"); if (fd != -1) close(fd); running -= 1; bounce_drain(); return; } msg = TAILQ_FIRST(&pending); s = xcalloc(1, sizeof(*s)); s->smtpname = xstrdup(msg->smtpname); s->state = BOUNCE_EHLO; s->io = io_new(); io_set_callback(s->io, bounce_io, s); io_set_fd(s->io, fd); io_set_timeout(s->io, 30000); io_set_read(s->io); s->boundary = generate_uid(); log_debug("debug: bounce: new session %p", s); stat_increment("bounce.session", 1); } static void bounce_timeout(int fd, short ev, void *arg) { log_debug("debug: bounce: timeout"); bounce_drain(); } static void bounce_drain(void) { struct bounce_message *msg; struct timeval tv; time_t t; log_debug("debug: bounce: drain: nmessage=%d running=%d", nmessage, running); while (1) { if (running >= BOUNCE_MAXRUN) { log_debug("debug: bounce: max session reached"); return; } if (nmessage == 0) { log_debug("debug: bounce: no more messages"); return; } if (running >= nmessage) { log_debug("debug: bounce: enough sessions running"); return; } if ((msg = TAILQ_FIRST(&pending)) == NULL) { log_debug("debug: bounce: no more pending messages"); return; } t = time(NULL); if (msg->timeout > t) { log_debug("debug: bounce: next message not ready yet"); if (!evtimer_pending(&ev_timer, NULL)) { log_debug("debug: bounce: setting timer"); tv.tv_sec = msg->timeout - t; tv.tv_usec = 0; evtimer_add(&ev_timer, &tv); } return; } log_debug("debug: bounce: requesting new enqueue socket..."); m_compose(p_dispatcher, IMSG_QUEUE_SMTP_SESSION, 0, 0, -1, NULL, 0); running += 1; } } static void bounce_send(struct bounce_session *s, const char *fmt, ...) { va_list ap; char *p; int len; va_start(ap, fmt); if ((len = vasprintf(&p, fmt, ap)) == -1) fatal("bounce: vasprintf"); va_end(ap); log_trace(TRACE_BOUNCE, "bounce: %p: >>> %s", s, p); io_xprintf(s->io, "%s\r\n", p); free(p); } static const char * bounce_duration(long long d) { static char buf[32]; if (d < 60) { (void)snprintf(buf, sizeof buf, "%lld second%s", d, (d == 1) ? "" : "s"); } else if (d < 3600) { d = d / 60; (void)snprintf(buf, sizeof buf, "%lld minute%s", d, (d == 1) ? "" : "s"); } else if (d < 3600 * 24) { d = d / 3600; (void)snprintf(buf, sizeof buf, "%lld hour%s", d, (d == 1) ? "" : "s"); } else { d = d / (3600 * 24); (void)snprintf(buf, sizeof buf, "%lld day%s", d, (d == 1) ? "" : "s"); } return (buf); } #define NOTICE_INTRO \ " Hi!\r\n\r\n" \ " This is the MAILER-DAEMON, please DO NOT REPLY to this email.\r\n" const char *notice_error = " An error has occurred while attempting to deliver a message for\r\n" " the following list of recipients:\r\n\r\n"; const char *notice_warning = " A message is delayed for more than %s for the following\r\n" " list of recipients:\r\n\r\n"; const char *notice_warning2 = " Please note that this is only a temporary failure report.\r\n" " The message is kept in the queue for up to %s.\r\n" " You DO NOT NEED to re-send the message to these recipients.\r\n\r\n"; const char *notice_success = " Your message was successfully delivered to these recipients.\r\n\r\n"; const char *notice_relay = " Your message was relayed to these recipients.\r\n\r\n"; static int bounce_next_message(struct bounce_session *s) { struct bounce_message *msg; char buf[LINE_MAX]; int fd; time_t now; again: now = time(NULL); TAILQ_FOREACH(msg, &pending, entry) { if (msg->timeout > now) continue; if (strcmp(msg->smtpname, s->smtpname)) continue; break; } if (msg == NULL) return (0); TAILQ_REMOVE(&pending, msg, entry); SPLAY_REMOVE(bounce_message_tree, &messages, msg); if ((fd = queue_message_fd_r(msg->msgid)) == -1) { bounce_delivery(msg, IMSG_QUEUE_DELIVERY_TEMPFAIL, "Could not open message fd"); goto again; } if ((s->msgfp = fdopen(fd, "r")) == NULL) { (void)snprintf(buf, sizeof(buf), "fdopen: %s", strerror(errno)); log_warn("warn: bounce: fdopen"); close(fd); bounce_delivery(msg, IMSG_QUEUE_DELIVERY_TEMPFAIL, buf); goto again; } s->msg = msg; return (1); } static int bounce_next(struct bounce_session *s) { struct bounce_envelope *evp; char *line = NULL; size_t n, sz = 0; ssize_t len; switch (s->state) { case BOUNCE_EHLO: bounce_send(s, "EHLO %s", s->smtpname); s->state = BOUNCE_MAIL; break; case BOUNCE_MAIL: case BOUNCE_DATA_END: log_debug("debug: bounce: %p: getting next message...", s); if (bounce_next_message(s) == 0) { log_debug("debug: bounce: %p: no more messages", s); bounce_send(s, "QUIT"); s->state = BOUNCE_CLOSE; break; } log_debug("debug: bounce: %p: found message %08"PRIx32, s, s->msg->msgid); bounce_send(s, "MAIL FROM: <>"); s->state = BOUNCE_RCPT; break; case BOUNCE_RCPT: bounce_send(s, "RCPT TO: <%s>", s->msg->to); s->state = BOUNCE_DATA; break; case BOUNCE_DATA: bounce_send(s, "DATA"); s->state = BOUNCE_DATA_NOTICE; break; case BOUNCE_DATA_NOTICE: /* Construct an appropriate notice. */ io_xprintf(s->io, "Subject: Delivery status notification: %s\r\n" "From: Mailer Daemon \r\n" "To: %s\r\n" "Date: %s\r\n" "MIME-Version: 1.0\r\n" "Content-Type: multipart/mixed;" "boundary=\"%16" PRIu64 "/%s\"\r\n" "\r\n" "This is a MIME-encapsulated message.\r\n" "\r\n", action_str(&s->msg->bounce), s->smtpname, s->msg->to, time_to_text(time(NULL)), s->boundary, s->smtpname); io_xprintf(s->io, "--%16" PRIu64 "/%s\r\n" "Content-Description: Notification\r\n" "Content-Type: text/plain; charset=us-ascii\r\n" "\r\n" NOTICE_INTRO "\r\n", s->boundary, s->smtpname); switch (s->msg->bounce.type) { case B_FAILED: io_xprint(s->io, notice_error); break; case B_DELAYED: io_xprintf(s->io, notice_warning, bounce_duration(s->msg->bounce.delay)); break; case B_DELIVERED: io_xprint(s->io, s->msg->bounce.mta_without_dsn ? notice_relay : notice_success); break; default: log_warn("warn: bounce: unknown bounce_type"); } TAILQ_FOREACH(evp, &s->msg->envelopes, entry) { io_xprint(s->io, evp->report); io_xprint(s->io, "\r\n"); } io_xprint(s->io, "\r\n"); if (s->msg->bounce.type == B_DELAYED) io_xprintf(s->io, notice_warning2, bounce_duration(s->msg->bounce.ttl)); io_xprintf(s->io, " Below is a copy of the original message:\r\n" "\r\n"); io_xprintf(s->io, "--%16" PRIu64 "/%s\r\n" "Content-Description: Delivery Report\r\n" "Content-Type: message/delivery-status\r\n" "\r\n", s->boundary, s->smtpname); io_xprintf(s->io, "Reporting-MTA: dns; %s\r\n" "\r\n", s->smtpname); TAILQ_FOREACH(evp, &s->msg->envelopes, entry) { io_xprintf(s->io, "Final-Recipient: rfc822; %s@%s\r\n" "Action: %s\r\n" "Status: %s\r\n" "\r\n", evp->dest.user, evp->dest.domain, action_str(&s->msg->bounce), esc_code(evp->esc_class, evp->esc_code)); } log_trace(TRACE_BOUNCE, "bounce: %p: >>> [... %zu bytes ...]", s, io_queued(s->io)); s->state = BOUNCE_DATA_MESSAGE; break; case BOUNCE_DATA_MESSAGE: io_xprintf(s->io, "--%16" PRIu64 "/%s\r\n" "Content-Description: Message headers\r\n" "Content-Type: text/rfc822-headers\r\n" "\r\n", s->boundary, s->smtpname); n = io_queued(s->io); while (io_queued(s->io) < BOUNCE_HIWAT) { if ((len = getline(&line, &sz, s->msgfp)) == -1) break; if (len == 1 && line[0] == '\n' && /* end of headers */ (s->msg->bounce.type != B_FAILED || s->msg->bounce.dsn_ret != DSN_RETFULL)) { free(line); fclose(s->msgfp); s->msgfp = NULL; io_xprintf(s->io, "\r\n--%16" PRIu64 "/%s--\r\n", s->boundary, s->smtpname); bounce_send(s, "."); s->state = BOUNCE_DATA_END; return (0); } line[len - 1] = '\0'; io_xprintf(s->io, "%s%s\r\n", (len == 2 && line[0] == '.') ? "." : "", line); } free(line); if (ferror(s->msgfp)) { fclose(s->msgfp); s->msgfp = NULL; bounce_delivery(s->msg, IMSG_QUEUE_DELIVERY_TEMPFAIL, "Error reading message"); s->msg = NULL; return (-1); } io_xprintf(s->io, "\r\n--%16" PRIu64 "/%s--\r\n", s->boundary, s->smtpname); log_trace(TRACE_BOUNCE, "bounce: %p: >>> [... %zu bytes ...]", s, io_queued(s->io) - n); if (feof(s->msgfp)) { fclose(s->msgfp); s->msgfp = NULL; bounce_send(s, "."); s->state = BOUNCE_DATA_END; } break; case BOUNCE_QUIT: bounce_send(s, "QUIT"); s->state = BOUNCE_CLOSE; break; default: fatalx("bounce: bad state"); } return (0); } static void bounce_delivery(struct bounce_message *msg, int delivery, const char *status) { struct bounce_envelope *be; struct envelope evp; size_t n; const char *f; n = 0; while ((be = TAILQ_FIRST(&msg->envelopes))) { if (delivery == IMSG_QUEUE_DELIVERY_TEMPFAIL) { if (queue_envelope_load(be->id, &evp) == 0) { fatalx("could not reload envelope!"); } evp.retry++; evp.lasttry = msg->timeout; envelope_set_errormsg(&evp, "%s", status); queue_envelope_update(&evp); m_create(p_scheduler, delivery, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); } else { m_create(p_scheduler, delivery, 0, 0, -1); m_add_evpid(p_scheduler, be->id); m_close(p_scheduler); queue_envelope_delete(be->id); } TAILQ_REMOVE(&msg->envelopes, be, entry); free(be->report); free(be); n += 1; } if (delivery == IMSG_QUEUE_DELIVERY_TEMPFAIL) f = "TempFail"; else if (delivery == IMSG_QUEUE_DELIVERY_PERMFAIL) f = "PermFail"; else f = NULL; if (f) log_warnx("warn: %s injecting failure report on message %08" PRIx32 " to <%s> for %zu envelope%s: %s", f, msg->msgid, msg->to, n, n > 1 ? "s":"", status); nmessage -= 1; stat_decrement("bounce.message", 1); stat_decrement("bounce.envelope", n); free(msg->smtpname); free(msg->to); free(msg); } static void bounce_status(struct bounce_session *s, const char *fmt, ...) { va_list ap; char *status; int len, delivery; /* Ignore if there is no message */ if (s->msg == NULL) return; va_start(ap, fmt); if ((len = vasprintf(&status, fmt, ap)) == -1) fatal("bounce: vasprintf"); va_end(ap); if (*status == '2') delivery = IMSG_QUEUE_DELIVERY_OK; else if (*status == '5' || *status == '6') delivery = IMSG_QUEUE_DELIVERY_PERMFAIL; else delivery = IMSG_QUEUE_DELIVERY_TEMPFAIL; bounce_delivery(s->msg, delivery, status); s->msg = NULL; if (s->msgfp) fclose(s->msgfp); free(status); } static void bounce_free(struct bounce_session *s) { log_debug("debug: bounce: %p: deleting session", s); io_free(s->io); free(s->smtpname); free(s); running -= 1; stat_decrement("bounce.session", 1); bounce_drain(); } static void bounce_io(struct io *io, int evt, void *arg) { struct bounce_session *s = arg; const char *error; char *line, *msg; int cont; size_t len; log_trace(TRACE_IO, "bounce: %p: %s %s", s, io_strevent(evt), io_strio(io)); switch (evt) { case IO_DATAIN: nextline: line = io_getline(s->io, &len); if (line == NULL && io_datalen(s->io) >= LINE_MAX) { bounce_status(s, "Input too long"); bounce_free(s); return; } if (line == NULL) break; /* Strip trailing '\r' */ if (len && line[len - 1] == '\r') line[--len] = '\0'; log_trace(TRACE_BOUNCE, "bounce: %p: <<< %s", s, line); if ((error = parse_smtp_response(line, len, &msg, &cont))) { bounce_status(s, "Bad response: %s", error); bounce_free(s); return; } if (cont) goto nextline; if (s->state == BOUNCE_CLOSE) { bounce_free(s); return; } if (line[0] != '2' && line[0] != '3') { /* fail */ bounce_status(s, "%s", line); s->state = BOUNCE_QUIT; } else if (s->state == BOUNCE_DATA_END) { /* accepted */ bounce_status(s, "%s", line); } if (bounce_next(s) == -1) { bounce_free(s); return; } io_set_write(io); break; case IO_LOWAT: if (s->state == BOUNCE_DATA_MESSAGE) if (bounce_next(s) == -1) { bounce_free(s); return; } if (io_queued(s->io) == 0) io_set_read(io); break; default: bounce_status(s, "442 i/o error %d", evt); bounce_free(s); break; } } static int bounce_message_cmp(const struct bounce_message *a, const struct bounce_message *b) { int r; if (a->msgid < b->msgid) return (-1); if (a->msgid > b->msgid) return (1); if ((r = strcmp(a->smtpname, b->smtpname))) return (r); return memcmp(&a->bounce, &b->bounce, sizeof (a->bounce)); } static const char * action_str(const struct delivery_bounce *b) { switch (b->type) { case B_FAILED: return ("failed"); case B_DELAYED: return ("delayed"); case B_DELIVERED: if (b->mta_without_dsn) return ("relayed"); return ("delivered"); default: log_warn("warn: bounce: unknown bounce_type"); return (""); } } SPLAY_GENERATE(bounce_message_tree, bounce_message, sp_entry, bounce_message_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/ruleset.c0000644000175000001440000001341714610663500014203 /* $OpenBSD: ruleset.c,v 1.48 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2009 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include "smtpd.h" #define MATCH_RESULT(r, neg) ((r) == -1 ? -1 : ((neg) < 0 ? !(r) : (r))) static int ruleset_match_tag(struct rule *r, const struct envelope *evp) { int ret; struct table *table; enum table_service service = K_STRING; if (!r->flag_tag) return 1; if (r->flag_tag_regex) service = K_REGEX; table = table_find(env, r->table_tag); ret = table_match(table, service, evp->tag); return MATCH_RESULT(ret, r->flag_tag); } static int ruleset_match_from(struct rule *r, const struct envelope *evp) { int ret; int has_rdns; const char *key; struct table *table; enum table_service service = K_NETADDR; if (!r->flag_from) return 1; if (evp->flags & EF_INTERNAL) { /* if expanded from an empty table_from, skip rule * if no table */ if (r->table_from == NULL) return 0; key = "local"; } else if (r->flag_from_rdns) { has_rdns = strcmp(evp->hostname, "") != 0; if (r->table_from == NULL) return MATCH_RESULT(has_rdns, r->flag_from); if (!has_rdns) return 0; key = evp->hostname; } else { key = ss_to_text(&evp->ss); if (r->flag_from_socket) { if (strcmp(key, "local") == 0) return MATCH_RESULT(1, r->flag_from); else return r->flag_from < 0 ? 1 : 0; } } if (r->flag_from_regex) service = K_REGEX; table = table_find(env, r->table_from); ret = table_match(table, service, key); return MATCH_RESULT(ret, r->flag_from); } static int ruleset_match_to(struct rule *r, const struct envelope *evp) { int ret; struct table *table; enum table_service service = K_DOMAIN; if (!r->flag_for) return 1; if (r->flag_for_regex) service = K_REGEX; table = table_find(env, r->table_for); ret = table_match(table, service, evp->dest.domain); return MATCH_RESULT(ret, r->flag_for); } static int ruleset_match_smtp_helo(struct rule *r, const struct envelope *evp) { int ret; struct table *table; enum table_service service = K_DOMAIN; if (!r->flag_smtp_helo) return 1; if (r->flag_smtp_helo_regex) service = K_REGEX; table = table_find(env, r->table_smtp_helo); ret = table_match(table, service, evp->helo); return MATCH_RESULT(ret, r->flag_smtp_helo); } static int ruleset_match_smtp_starttls(struct rule *r, const struct envelope *evp) { if (!r->flag_smtp_starttls) return 1; /* XXX - not until TLS flag is added to envelope */ return -1; } static int ruleset_match_smtp_auth(struct rule *r, const struct envelope *evp) { int ret; struct table *table; enum table_service service; if (!r->flag_smtp_auth) return 1; if (!(evp->flags & EF_AUTHENTICATED)) ret = 0; else if (r->table_smtp_auth) { if (r->flag_smtp_auth_regex) service = K_REGEX; else service = strchr(evp->username, '@') ? K_MAILADDR : K_STRING; table = table_find(env, r->table_smtp_auth); ret = table_match(table, service, evp->username); } else ret = 1; return MATCH_RESULT(ret, r->flag_smtp_auth); } static int ruleset_match_smtp_mail_from(struct rule *r, const struct envelope *evp) { int ret; const char *key; struct table *table; enum table_service service = K_MAILADDR; if (!r->flag_smtp_mail_from) return 1; if (r->flag_smtp_mail_from_regex) service = K_REGEX; if ((key = mailaddr_to_text(&evp->sender)) == NULL) return -1; table = table_find(env, r->table_smtp_mail_from); ret = table_match(table, service, key); return MATCH_RESULT(ret, r->flag_smtp_mail_from); } static int ruleset_match_smtp_rcpt_to(struct rule *r, const struct envelope *evp) { int ret; const char *key; struct table *table; enum table_service service = K_MAILADDR; if (!r->flag_smtp_rcpt_to) return 1; if (r->flag_smtp_rcpt_to_regex) service = K_REGEX; if ((key = mailaddr_to_text(&evp->dest)) == NULL) return -1; table = table_find(env, r->table_smtp_rcpt_to); ret = table_match(table, service, key); return MATCH_RESULT(ret, r->flag_smtp_rcpt_to); } struct rule * ruleset_match(const struct envelope *evp) { struct rule *r; int i = 0; #define MATCH_EVAL(x) \ switch ((x)) { \ case -1: goto tempfail; \ case 0: continue; \ default: break; \ } TAILQ_FOREACH(r, env->sc_rules, r_entry) { ++i; MATCH_EVAL(ruleset_match_tag(r, evp)); MATCH_EVAL(ruleset_match_from(r, evp)); MATCH_EVAL(ruleset_match_to(r, evp)); MATCH_EVAL(ruleset_match_smtp_helo(r, evp)); MATCH_EVAL(ruleset_match_smtp_auth(r, evp)); MATCH_EVAL(ruleset_match_smtp_starttls(r, evp)); MATCH_EVAL(ruleset_match_smtp_mail_from(r, evp)); MATCH_EVAL(ruleset_match_smtp_rcpt_to(r, evp)); goto matched; } #undef MATCH_EVAL errno = 0; log_trace(TRACE_RULES, "no rule matched"); return (NULL); tempfail: errno = EAGAIN; log_trace(TRACE_RULES, "temporary failure in processing of a rule"); return (NULL); matched: log_trace(TRACE_RULES, "rule #%d matched: %s", i, rule_to_text(r)); return r; } opensmtpd-7.7.0p0/usr.sbin/smtpd/envelope.c0000644000175000001440000004352414620126254014340 /* $OpenBSD: envelope.c,v 1.52 2024/01/03 08:11:15 op Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2011-2013 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static int envelope_ascii_load(struct envelope *, struct dict *); static void envelope_ascii_dump(const struct envelope *, char **, size_t *, const char *); void envelope_set_errormsg(struct envelope *e, char *fmt, ...) { int ret; va_list ap; va_start(ap, fmt); ret = vsnprintf(e->errorline, sizeof(e->errorline), fmt, ap); va_end(ap); /* this should not happen */ if (ret < 0) fatal("vsnprintf"); if ((size_t)ret >= sizeof(e->errorline)) (void)strlcpy(e->errorline + (sizeof(e->errorline) - 4), "...", 4); } void envelope_set_esc_class(struct envelope *e, enum enhanced_status_class class) { e->esc_class = class; } void envelope_set_esc_code(struct envelope *e, enum enhanced_status_code code) { e->esc_code = code; } static int envelope_buffer_to_dict(struct dict *d, const char *ibuf, size_t buflen) { static char lbuf[sizeof(struct envelope)]; size_t len; char *buf, *field, *nextline; memset(lbuf, 0, sizeof lbuf); if (strlcpy(lbuf, ibuf, sizeof lbuf) >= sizeof lbuf) goto err; buf = lbuf; while (buflen > 0) { len = strcspn(buf, "\n"); buf[len] = '\0'; nextline = buf + len + 1; buflen -= (nextline - buf); field = buf; while (*buf && (isalnum((unsigned char)*buf) || *buf == '-')) buf++; if (!*buf) goto err; /* skip whitespaces before separator */ while (*buf && isspace((unsigned char)*buf)) *buf++ = 0; /* we *want* ':' */ if (*buf != ':') goto err; *buf++ = 0; /* skip whitespaces after separator */ while (*buf && isspace((unsigned char)*buf)) *buf++ = 0; dict_set(d, field, buf); buf = nextline; } return (1); err: return (0); } int envelope_load_buffer(struct envelope *ep, const char *ibuf, size_t buflen) { struct dict d; const char *val, *errstr; long long version; int ret = 0; dict_init(&d); if (!envelope_buffer_to_dict(&d, ibuf, buflen)) { log_debug("debug: cannot parse envelope to dict"); goto end; } val = dict_get(&d, "version"); if (val == NULL) { log_debug("debug: envelope version not found"); goto end; } version = strtonum(val, 1, 64, &errstr); if (errstr) { log_debug("debug: cannot parse envelope version: %s", val); goto end; } if (version != SMTPD_ENVELOPE_VERSION) { log_debug("debug: bad envelope version %lld", version); goto end; } memset(ep, 0, sizeof *ep); ret = envelope_ascii_load(ep, &d); if (ret) ep->version = SMTPD_ENVELOPE_VERSION; end: while (dict_poproot(&d, NULL)) ; return (ret); } int envelope_dump_buffer(const struct envelope *ep, char *dest, size_t len) { char *p = dest; envelope_ascii_dump(ep, &dest, &len, "version"); envelope_ascii_dump(ep, &dest, &len, "dispatcher"); envelope_ascii_dump(ep, &dest, &len, "tag"); envelope_ascii_dump(ep, &dest, &len, "type"); envelope_ascii_dump(ep, &dest, &len, "smtpname"); envelope_ascii_dump(ep, &dest, &len, "helo"); envelope_ascii_dump(ep, &dest, &len, "hostname"); envelope_ascii_dump(ep, &dest, &len, "username"); envelope_ascii_dump(ep, &dest, &len, "errorline"); envelope_ascii_dump(ep, &dest, &len, "sockaddr"); envelope_ascii_dump(ep, &dest, &len, "sender"); envelope_ascii_dump(ep, &dest, &len, "rcpt"); envelope_ascii_dump(ep, &dest, &len, "dest"); envelope_ascii_dump(ep, &dest, &len, "ctime"); envelope_ascii_dump(ep, &dest, &len, "last-try"); envelope_ascii_dump(ep, &dest, &len, "last-bounce"); envelope_ascii_dump(ep, &dest, &len, "ttl"); envelope_ascii_dump(ep, &dest, &len, "retry"); envelope_ascii_dump(ep, &dest, &len, "flags"); envelope_ascii_dump(ep, &dest, &len, "dsn-notify"); envelope_ascii_dump(ep, &dest, &len, "dsn-ret"); envelope_ascii_dump(ep, &dest, &len, "dsn-envid"); envelope_ascii_dump(ep, &dest, &len, "dsn-orcpt"); envelope_ascii_dump(ep, &dest, &len, "esc-class"); envelope_ascii_dump(ep, &dest, &len, "esc-code"); switch (ep->type) { case D_MDA: envelope_ascii_dump(ep, &dest, &len, "mda-exec"); envelope_ascii_dump(ep, &dest, &len, "mda-subaddress"); envelope_ascii_dump(ep, &dest, &len, "mda-user"); break; case D_MTA: break; case D_BOUNCE: envelope_ascii_dump(ep, &dest, &len, "bounce-ttl"); envelope_ascii_dump(ep, &dest, &len, "bounce-delay"); envelope_ascii_dump(ep, &dest, &len, "bounce-type"); break; default: return (0); } if (dest == NULL) return (0); return (dest - p); } static int ascii_load_uint8(uint8_t *dest, char *buf) { const char *errstr; *dest = strtonum(buf, 0, 0xff, &errstr); if (errstr) return 0; return 1; } static int ascii_load_uint16(uint16_t *dest, char *buf) { const char *errstr; *dest = strtonum(buf, 0, 0xffff, &errstr); if (errstr) return 0; return 1; } static int ascii_load_uint32(uint32_t *dest, char *buf) { const char *errstr; *dest = strtonum(buf, 0, 0xffffffff, &errstr); if (errstr) return 0; return 1; } static int ascii_load_time(time_t *dest, char *buf) { const char *errstr; *dest = strtonum(buf, 0, LLONG_MAX, &errstr); if (errstr) return 0; return 1; } static int ascii_load_type(enum delivery_type *dest, char *buf) { if (strcasecmp(buf, "mda") == 0) *dest = D_MDA; else if (strcasecmp(buf, "mta") == 0) *dest = D_MTA; else if (strcasecmp(buf, "bounce") == 0) *dest = D_BOUNCE; else return 0; return 1; } static int ascii_load_string(char *dest, char *buf, size_t len) { if (strlcpy(dest, buf, len) >= len) return 0; return 1; } static int ascii_load_sockaddr(struct sockaddr_storage *ss, char *buf) { if (!strcmp("local", buf)) { ss->ss_family = AF_LOCAL; } else if (buf[0] == '[' && buf[strlen(buf)-1] == ']') { struct addrinfo hints, *res0; buf[strlen(buf)-1] = '\0'; /* getaddrinfo() is used to support scoped addresses. */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET6; hints.ai_flags = AI_NUMERICHOST; if (getaddrinfo(buf+1, NULL, &hints, &res0) != 0) return 0; memcpy(ss, res0->ai_addr, res0->ai_addrlen); #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN ss->ss_len = res0->ai_addrlen; #endif freeaddrinfo(res0); } else { struct sockaddr_in ssin; memset(&ssin, 0, sizeof ssin); if (inet_pton(AF_INET, buf, &ssin.sin_addr) != 1) return 0; ssin.sin_family = AF_INET; memcpy(ss, &ssin, sizeof(ssin)); #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN ss->ss_len = sizeof(struct sockaddr_in); #endif } return 1; } static int ascii_load_mailaddr(struct mailaddr *dest, char *buf) { if (!text_to_mailaddr(dest, buf)) return 0; return 1; } static int ascii_load_flags(enum envelope_flags *dest, char *buf) { char *flag; while ((flag = strsep(&buf, " ,|")) != NULL) { if (strcasecmp(flag, "authenticated") == 0) *dest |= EF_AUTHENTICATED; else if (strcasecmp(flag, "enqueued") == 0) ; else if (strcasecmp(flag, "bounce") == 0) *dest |= EF_BOUNCE; else if (strcasecmp(flag, "internal") == 0) *dest |= EF_INTERNAL; else return 0; } return 1; } static int ascii_load_bounce_type(enum bounce_type *dest, char *buf) { if (strcasecmp(buf, "error") == 0 || strcasecmp(buf, "failed") == 0) *dest = B_FAILED; else if (strcasecmp(buf, "warn") == 0 || strcasecmp(buf, "delayed") == 0) *dest = B_DELAYED; else if (strcasecmp(buf, "dsn") == 0 || strcasecmp(buf, "delivered") == 0) *dest = B_DELIVERED; else return 0; return 1; } static int ascii_load_dsn_ret(enum dsn_ret *ret, char *buf) { if (strcasecmp(buf, "HDRS") == 0) *ret = DSN_RETHDRS; else if (strcasecmp(buf, "FULL") == 0) *ret = DSN_RETFULL; else return 0; return 1; } static int ascii_load_field(const char *field, struct envelope *ep, char *buf) { if (strcasecmp("dispatcher", field) == 0) return ascii_load_string(ep->dispatcher, buf, sizeof ep->dispatcher); if (strcasecmp("bounce-delay", field) == 0) return ascii_load_time(&ep->agent.bounce.delay, buf); if (strcasecmp("bounce-ttl", field) == 0) return ascii_load_time(&ep->agent.bounce.ttl, buf); if (strcasecmp("bounce-type", field) == 0) return ascii_load_bounce_type(&ep->agent.bounce.type, buf); if (strcasecmp("ctime", field) == 0) return ascii_load_time(&ep->creation, buf); if (strcasecmp("dest", field) == 0) return ascii_load_mailaddr(&ep->dest, buf); if (strcasecmp("username", field) == 0) return ascii_load_string(ep->username, buf, sizeof(ep->username)); if (strcasecmp("errorline", field) == 0) return ascii_load_string(ep->errorline, buf, sizeof ep->errorline); if (strcasecmp("ttl", field) == 0) return ascii_load_time(&ep->ttl, buf); if (strcasecmp("flags", field) == 0) return ascii_load_flags(&ep->flags, buf); if (strcasecmp("helo", field) == 0) return ascii_load_string(ep->helo, buf, sizeof ep->helo); if (strcasecmp("hostname", field) == 0) return ascii_load_string(ep->hostname, buf, sizeof ep->hostname); if (strcasecmp("last-bounce", field) == 0) return ascii_load_time(&ep->lastbounce, buf); if (strcasecmp("last-try", field) == 0) return ascii_load_time(&ep->lasttry, buf); if (strcasecmp("retry", field) == 0) return ascii_load_uint16(&ep->retry, buf); if (strcasecmp("rcpt", field) == 0) return ascii_load_mailaddr(&ep->rcpt, buf); if (strcasecmp("mda-exec", field) == 0) return ascii_load_string(ep->mda_exec, buf, sizeof(ep->mda_exec)); if (strcasecmp("mda-subaddress", field) == 0) return ascii_load_string(ep->mda_subaddress, buf, sizeof(ep->mda_subaddress)); if (strcasecmp("mda-user", field) == 0) return ascii_load_string(ep->mda_user, buf, sizeof(ep->mda_user)); if (strcasecmp("sender", field) == 0) return ascii_load_mailaddr(&ep->sender, buf); if (strcasecmp("smtpname", field) == 0) return ascii_load_string(ep->smtpname, buf, sizeof(ep->smtpname)); if (strcasecmp("sockaddr", field) == 0) return ascii_load_sockaddr(&ep->ss, buf); if (strcasecmp("tag", field) == 0) return ascii_load_string(ep->tag, buf, sizeof ep->tag); if (strcasecmp("type", field) == 0) return ascii_load_type(&ep->type, buf); if (strcasecmp("version", field) == 0) return ascii_load_uint32(&ep->version, buf); if (strcasecmp("dsn-notify", field) == 0) return ascii_load_uint8(&ep->dsn_notify, buf); if (strcasecmp("dsn-orcpt", field) == 0) return ascii_load_string(ep->dsn_orcpt, buf, sizeof(ep->dsn_orcpt)); if (strcasecmp("dsn-ret", field) == 0) return ascii_load_dsn_ret(&ep->dsn_ret, buf); if (strcasecmp("dsn-envid", field) == 0) return ascii_load_string(ep->dsn_envid, buf, sizeof(ep->dsn_envid)); if (strcasecmp("esc-class", field) == 0) return ascii_load_uint8(&ep->esc_class, buf); if (strcasecmp("esc-code", field) == 0) return ascii_load_uint8(&ep->esc_code, buf); return (0); } static int envelope_ascii_load(struct envelope *ep, struct dict *d) { const char *field; char *value; void *hdl; hdl = NULL; while (dict_iter(d, &hdl, &field, (void **)&value)) if (!ascii_load_field(field, ep, value)) goto err; return (1); err: log_warnx("envelope: invalid field \"%s\"", field); return (0); } static int ascii_dump_uint8(uint8_t src, char *dest, size_t len) { return bsnprintf(dest, len, "%d", src); } static int ascii_dump_uint16(uint16_t src, char *dest, size_t len) { return bsnprintf(dest, len, "%d", src); } static int ascii_dump_uint32(uint32_t src, char *dest, size_t len) { return bsnprintf(dest, len, "%d", src); } static int ascii_dump_time(time_t src, char *dest, size_t len) { return bsnprintf(dest, len, "%lld", (long long) src); } static int ascii_dump_string(const char *src, char *dest, size_t len) { return bsnprintf(dest, len, "%s", src); } static int ascii_dump_type(enum delivery_type type, char *dest, size_t len) { char *p = NULL; switch (type) { case D_MDA: p = "mda"; break; case D_MTA: p = "mta"; break; case D_BOUNCE: p = "bounce"; break; default: return 0; } return bsnprintf(dest, len, "%s", p); } static int ascii_dump_mailaddr(const struct mailaddr *addr, char *dest, size_t len) { return bsnprintf(dest, len, "%s@%s", addr->user, addr->domain); } static int ascii_dump_flags(enum envelope_flags flags, char *buf, size_t len) { size_t cpylen = 0; buf[0] = '\0'; if (flags) { if (flags & EF_AUTHENTICATED) cpylen = strlcat(buf, "authenticated", len); if (flags & EF_BOUNCE) { if (buf[0] != '\0') (void)strlcat(buf, " ", len); cpylen = strlcat(buf, "bounce", len); } if (flags & EF_INTERNAL) { if (buf[0] != '\0') (void)strlcat(buf, " ", len); cpylen = strlcat(buf, "internal", len); } } return cpylen < len ? 1 : 0; } static int ascii_dump_bounce_type(enum bounce_type type, char *dest, size_t len) { char *p = NULL; switch (type) { case B_FAILED: p = "failed"; break; case B_DELAYED: p = "delayed"; break; case B_DELIVERED: p = "delivered"; break; default: return 0; } return bsnprintf(dest, len, "%s", p); } static int ascii_dump_dsn_ret(enum dsn_ret flag, char *dest, size_t len) { size_t cpylen = 0; dest[0] = '\0'; if (flag == DSN_RETFULL) cpylen = strlcat(dest, "FULL", len); else if (flag == DSN_RETHDRS) cpylen = strlcat(dest, "HDRS", len); return cpylen < len ? 1 : 0; } static int ascii_dump_field(const char *field, const struct envelope *ep, char *buf, size_t len) { if (strcasecmp(field, "dispatcher") == 0) return ascii_dump_string(ep->dispatcher, buf, len); if (strcasecmp(field, "bounce-delay") == 0) { if (ep->agent.bounce.type != B_DELAYED) return (1); return ascii_dump_time(ep->agent.bounce.delay, buf, len); } if (strcasecmp(field, "bounce-ttl") == 0) { if (ep->agent.bounce.type != B_DELAYED) return (1); return ascii_dump_time(ep->agent.bounce.ttl, buf, len); } if (strcasecmp(field, "bounce-type") == 0) return ascii_dump_bounce_type(ep->agent.bounce.type, buf, len); if (strcasecmp(field, "ctime") == 0) return ascii_dump_time(ep->creation, buf, len); if (strcasecmp(field, "dest") == 0) return ascii_dump_mailaddr(&ep->dest, buf, len); if (strcasecmp(field, "username") == 0) { if (ep->username[0]) return ascii_dump_string(ep->username, buf, len); return 1; } if (strcasecmp(field, "errorline") == 0) return ascii_dump_string(ep->errorline, buf, len); if (strcasecmp(field, "ttl") == 0) return ascii_dump_time(ep->ttl, buf, len); if (strcasecmp(field, "flags") == 0) return ascii_dump_flags(ep->flags, buf, len); if (strcasecmp(field, "helo") == 0) return ascii_dump_string(ep->helo, buf, len); if (strcasecmp(field, "hostname") == 0) return ascii_dump_string(ep->hostname, buf, len); if (strcasecmp(field, "last-bounce") == 0) return ascii_dump_time(ep->lastbounce, buf, len); if (strcasecmp(field, "last-try") == 0) return ascii_dump_time(ep->lasttry, buf, len); if (strcasecmp(field, "retry") == 0) return ascii_dump_uint16(ep->retry, buf, len); if (strcasecmp(field, "rcpt") == 0) return ascii_dump_mailaddr(&ep->rcpt, buf, len); if (strcasecmp(field, "mda-exec") == 0) { if (ep->mda_exec[0]) return ascii_dump_string(ep->mda_exec, buf, len); return 1; } if (strcasecmp(field, "mda-subaddress") == 0) { if (ep->mda_subaddress[0]) return ascii_dump_string(ep->mda_subaddress, buf, len); return 1; } if (strcasecmp(field, "mda-user") == 0) { if (ep->mda_user[0]) return ascii_dump_string(ep->mda_user, buf, len); return 1; } if (strcasecmp(field, "sender") == 0) return ascii_dump_mailaddr(&ep->sender, buf, len); if (strcasecmp(field, "smtpname") == 0) return ascii_dump_string(ep->smtpname, buf, len); if (strcasecmp(field, "sockaddr") == 0) return ascii_dump_string(ss_to_text(&ep->ss), buf, len); if (strcasecmp(field, "tag") == 0) return ascii_dump_string(ep->tag, buf, len); if (strcasecmp(field, "type") == 0) return ascii_dump_type(ep->type, buf, len); if (strcasecmp(field, "version") == 0) return ascii_dump_uint32(SMTPD_ENVELOPE_VERSION, buf, len); if (strcasecmp(field, "dsn-notify") == 0) return ascii_dump_uint8(ep->dsn_notify, buf, len); if (strcasecmp(field, "dsn-ret") == 0) return ascii_dump_dsn_ret(ep->dsn_ret, buf, len); if (strcasecmp(field, "dsn-orcpt") == 0) return ascii_dump_string(ep->dsn_orcpt, buf, len); if (strcasecmp(field, "dsn-envid") == 0) return ascii_dump_string(ep->dsn_envid, buf, len); if (strcasecmp(field, "esc-class") == 0) { if (ep->esc_class) return ascii_dump_uint8(ep->esc_class, buf, len); return 1; } if (strcasecmp(field, "esc-code") == 0) { /* this is not a pasto, we dump esc_code if esc_class is !0 */ if (ep->esc_class) return ascii_dump_uint8(ep->esc_code, buf, len); return 1; } return (0); } static void envelope_ascii_dump(const struct envelope *ep, char **dest, size_t *len, const char *field) { char buf[8192]; int l; if (*dest == NULL) return; memset(buf, 0, sizeof buf); if (!ascii_dump_field(field, ep, buf, sizeof buf)) goto err; if (buf[0] == '\0') return; l = snprintf(*dest, *len, "%s: %s\n", field, buf); if (l < 0 || (size_t) l >= *len) goto err; *dest += l; *len -= l; return; err: *dest = NULL; } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpctl.80000644000175000001440000002057614610663500014137 .\" $OpenBSD: smtpctl.8,v 1.66 2023/03/02 17:09:53 jmc Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 2 2023 $ .Dt SMTPCTL 8 .Os .Sh NAME .Nm smtpctl , .Nm mailq .Nd control the SMTP daemon .Sh SYNOPSIS .Nm .Ar command .Op Ar argument ... .Nm mailq .Sh DESCRIPTION The .Nm program controls .Xr smtpd 8 . Commands may be abbreviated to the minimum unambiguous prefix; for example, .Cm sh ro for .Cm show routes . .Pp The .Nm mailq command is provided for compatibility with other MTAs and is simply a shortcut for .Cm show queue . .Pp The following commands are available: .Bl -tag -width Ds .It Cm discover Ar envelope-id | message-id Schedule a single envelope, or all envelopes with the same message ID that were manually moved to the queue. .It Cm encrypt Op Ar string Encrypt the password .Ar string to a representation suitable for user credentials and print it to the standard output. If .Ar string is not provided, cleartext passwords are read from standard input. .Pp It is advised to avoid providing the password as a parameter as it will be visible from .Xr top 1 and .Xr ps 1 output. .It Cm log brief Disable verbose debug logging. .It Cm log verbose Enable verbose debug logging. .It Cm monitor Display updates of some .Xr smtpd 8 internal counters in one second intervals. Each line reports the increment of all counters since the last update, except for some counters which are always absolute values. The first line reports the current value of each counter. The fields are: .Pp .Bl -bullet -compact .It Current number of active SMTP clients (absolute value). .It New SMTP clients. .It Disconnected clients. .It Current number of envelopes in the queue (absolute value). .It Newly enqueued envelopes. .It Dequeued envelopes. .It Successful deliveries. .It Temporary failures. .It Permanent failures. .It Message loops. .It Expired envelopes. .It Envelopes removed by the administrator. .It Generated bounces. .El .It Cm pause envelope Ar envelope-id | message-id | Cm all Temporarily suspend scheduling for the envelope with the given ID, envelopes with the given message ID, or all envelopes. .It Cm pause mda Temporarily stop deliveries to local users. .It Cm pause mta Temporarily stop relaying and deliveries to remote users. .It Cm pause smtp Temporarily stop accepting incoming sessions. .It Cm profile Ar subsystem Enables real-time profiling of .Ar subsystem . Supported subsystems are: .Pp .Bl -bullet -compact .It queue, to profile cost of queue IO .It imsg, to profile cost of event handlers .El .It Cm remove Ar envelope-id | message-id | Cm all Remove a single envelope, envelopes with the given message ID, or all envelopes. .It Cm resume envelope Ar envelope-id | message-id | Cm all Resume scheduling for the envelope with the given ID, envelopes with the given message ID, or all envelopes. .It Cm resume mda Resume deliveries to local users. .It Cm resume mta Resume relaying and deliveries to remote users. .It Cm resume route Ar route-id Resume routing on disabled route .Ar route-id . .It Cm resume smtp Resume accepting incoming sessions. .It Cm schedule Ar envelope-id | message-id | Cm all Mark as ready for immediate delivery a single envelope, envelopes with the given message ID, or all envelopes. .It Cm show envelope Ar envelope-id Display envelope content for the given ID. .It Cm show hosts Display the list of known remote MX hosts. For each of them, it shows the IP address, the canonical hostname, a reference count, the number of active connections to this host, and the elapsed time since the last connection. .It Cm show hoststats Display status of last delivery for domains that have been active in the last 4 hours. It consists of the following fields, separated by a "|": .Pp .Bl -bullet -compact .It Domain. .It .Ux timestamp of last delivery. .It Status of last delivery. .El .It Cm show message Ar envelope-id Display message content for the given ID. .It Cm show queue Display information concerning envelopes that are currently in the queue. Each line of output describes a single envelope. It consists of the following fields, separated by a "|": .Pp .Bl -bullet -compact .It Envelope ID. .It Address family of the client which enqueued the mail. .It Type of delivery: one of "mta", "mda" or "bounce". .It Various flags on the envelope. .It Sender address (return path). .It The original recipient address. .It The destination address. .It Time of creation. .It Time of expiration. .It Time of last delivery or relaying attempt. .It Number of delivery or relaying attempts. .It Current runstate: either "pending" or "inflight" if .Xr smtpd 8 is running, or "offline" otherwise. .It Delay in seconds before the next attempt if pending, or time elapsed if currently running. This field is blank if .Xr smtpd 8 is not running. .It Error string for the last failed delivery or relay attempt. .El .It Cm show relays Display the list of currently active relays and associated connectors. For each relay, it shows a number of counters and information on its internal state on a single line. Then comes the list of connectors (source addresses to connect from for this relay). .It Cm show routes Display status of routes currently known by .Xr smtpd 8 . Each line consists of a route number, a source address, a destination address, a set of flags, the number of connections on this route, the current penalty level which determines the amount of time the route is disabled if an error occurs, and the delay before it gets reactivated. The following flags are defined: .Pp .Bl -tag -width xx -compact .It D The route is currently disabled. .It N The route is new. No SMTP session has been established yet. .It Q The route has a timeout registered to lower its penalty level and possibly reactivate or discard it. .El .It Cm show stats Displays runtime statistics concerning .Xr smtpd 8 . .It Cm show status Shows if MTA, MDA and SMTP systems are currently running or paused. .It Cm spf walk Recursively look up SPF records for the domains read from stdin. For example: .Bd -literal -offset indent $ smtpctl spf walk < domains.txt .Ed .Pp SPF records may contain macros which cannot be included in a static list and must be resolved dynamically at connection time. .Cm spf walk cannot provide full results in these cases. .It Cm trace Ar subsystem Enables real-time tracing of .Ar subsystem . Supported subsystems are: .Pp .Bl -bullet -compact .It imsg .It io .It smtp (incoming sessions) .It filters .It mta (outgoing sessions) .It bounce .It scheduler .It expand (aliases/virtual/forward expansion) .It lookup (user/credentials lookups) .It stat .It rules (matched by incoming sessions) .It mproc .It all .El .It Cm unprofile Ar subsystem Disables real-time profiling of .Ar subsystem . .It Cm untrace Ar subsystem Disables real-time tracing of .Ar subsystem . .It Cm update table Ar name Updates the contents of table .Ar name , for tables using the .Dq file backend. .El .Pp When .Nm smtpd receives a message, it generates a .Ar message-id for the message, and one .Ar envelope-id per recipient. The .Ar message-id is a 32-bit random identifier that is guaranteed to be unique on the host system. The .Ar envelope-id is a 64-bit unique identifier that encodes the .Ar message-id in the 32 upper bits and a random envelope identifier in the 32 lower bits. .Pp A command which specifies a .Ar message-id applies to all recipients of a message; a command which specifies an .Ar envelope-id applies to a specific recipient of a message. .Sh FILES .Bl -tag -width "/var/run/smtpd.sockXXX" -compact .It Pa /var/run/smtpd.sock .Ux Ns -domain socket used for communication with .Xr smtpd 8 . .El .Sh SEE ALSO .Xr smtpd 8 .Sh HISTORY The .Nm program first appeared in .Ox 4.6 . opensmtpd-7.7.0p0/usr.sbin/smtpd/dict.h0000644000175000001440000000345114610663500013445 /* $OpenBSD: dict.h,v 1.1 2018/12/23 16:06:24 gilles Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _DICT_H_ #define _DICT_H_ SPLAY_HEAD(_dict, dictentry); struct dict { struct _dict dict; size_t count; }; /* dict.c */ #define dict_init(d) do { SPLAY_INIT(&((d)->dict)); (d)->count = 0; } while(0) #define dict_empty(d) SPLAY_EMPTY(&((d)->dict)) #define dict_count(d) ((d)->count) int dict_check(struct dict *, const char *); void *dict_set(struct dict *, const char *, void *); void dict_xset(struct dict *, const char *, void *); void *dict_get(struct dict *, const char *); void *dict_xget(struct dict *, const char *); void *dict_pop(struct dict *, const char *); void *dict_xpop(struct dict *, const char *); int dict_poproot(struct dict *, void **); int dict_root(struct dict *, const char **, void **); int dict_iter(struct dict *, void **, const char **, void **); int dict_iterfrom(struct dict *, void **, const char *, const char **, void **); void dict_merge(struct dict *, struct dict *); #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd.conf0000644000175000001440000000116514610663500014347 # $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $ # This is the smtpd server system-wide configuration file. # See smtpd.conf(5) for more information. table aliases file:/etc/mail/aliases # To also accept external mail over IPv4 or IPv6, # respectively replace "listen on localhost" with: # # listen on 0.0.0.0 # listen on :: listen on localhost action "local" maildir alias action "relay" relay # Uncomment the following to accept external mail for domain "example.org" # # match from any for domain "example.org" action "local" match for local action "local" match from local for any action "relay" opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpc.c0000644000175000001440000002516714674615567013677 /* $OpenBSD: smtpc.c,v 1.21 2024/05/13 06:48:26 jsg Exp $ */ /* * Copyright (c) 2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include "smtp.h" #include "log.h" static void parse_server(char *); static void parse_message(FILE *); static void resume(void); static int verbose = 1; static int done = 0; static int noaction = 0; static struct addrinfo *res0, *ai; static struct smtp_params params; static struct smtp_mail mail; static const char *servname = NULL; static struct tls_config *tls_config; static int nosni = 0; static const char *cafile = NULL; static const char *protocols = NULL; static const char *ciphers = NULL; static void usage(void) { extern char *__progname; fprintf(stderr, "usage: %s [-Chnv] [-a authfile] [-F from] [-H helo] " "[-s server] [-T params] [recipient ...]\n", __progname); exit(1); } static void parse_tls_options(char *opt) { static char * const tokens[] = { #define CAFILE 0 "cafile", #define CIPHERS 1 "ciphers", #define NOSNI 2 "nosni", #define NOVERIFY 3 "noverify", #define PROTOCOLS 4 "protocols", #define SERVERNAME 5 "servername", NULL }; char *value; while (*opt) { switch (getsubopt(&opt, tokens, &value)) { case CAFILE: if (value == NULL) fatalx("missing value for cafile"); cafile = value; break; case CIPHERS: if (value == NULL) fatalx("missing value for ciphers"); ciphers = value; break; case NOSNI: if (value != NULL) fatalx("no value expected for nosni"); nosni = 1; break; case NOVERIFY: if (value != NULL) fatalx("no value expected for noverify"); params.tls_verify = 0; break; case PROTOCOLS: if (value == NULL) fatalx("missing value for protocols"); protocols = value; break; case SERVERNAME: if (value == NULL) fatalx("missing value for servername"); servname = value; break; case -1: if (suboptarg) fatalx("invalid TLS option \"%s\"", suboptarg); fatalx("missing TLS option"); } } } int main(int argc, char **argv) { char hostname[256]; FILE *authfile; int ch, i; uint32_t protos; char *server = "localhost"; char *authstr = NULL; size_t alloc = 0; ssize_t len; struct passwd *pw; log_init(1, 0); if (gethostname(hostname, sizeof(hostname)) == -1) fatal("gethostname"); if ((pw = getpwuid(getuid())) == NULL) fatal("getpwuid"); memset(¶ms, 0, sizeof(params)); params.linemax = 16392; params.ibufmax = 65536; params.obufmax = 65536; params.timeout = 100000; params.helo = hostname; params.tls_verify = 1; memset(&mail, 0, sizeof(mail)); mail.from = pw->pw_name; while ((ch = getopt(argc, argv, "CF:H:S:T:a:hns:v")) != -1) { switch (ch) { case 'C': params.tls_verify = 0; break; case 'F': mail.from = optarg; break; case 'H': params.helo = optarg; break; case 'S': servname = optarg; break; case 'T': parse_tls_options(optarg); break; case 'a': if ((authfile = fopen(optarg, "r")) == NULL) fatal("%s: open", optarg); if ((len = getline(&authstr, &alloc, authfile)) == -1) fatal("%s: Failed to read username", optarg); if (authstr[len - 1] == '\n') authstr[len - 1] = '\0'; params.auth_user = authstr; authstr = NULL; len = 0; if ((len = getline(&authstr, &alloc, authfile)) == -1) fatal("%s: Failed to read password", optarg); if (authstr[len - 1] == '\n') authstr[len - 1] = '\0'; params.auth_pass = authstr; fclose(authfile); break; case 'h': usage(); break; case 'n': noaction = 1; break; case 's': server = optarg; break; case 'v': verbose++; break; default: usage(); } } log_setverbose(verbose); argc -= optind; argv += optind; if (argc) { mail.rcpt = calloc(argc, sizeof(*mail.rcpt)); if (mail.rcpt == NULL) fatal("calloc"); for (i = 0; i < argc; i++) mail.rcpt[i].to = argv[i]; mail.rcptcount = argc; } event_init(); tls_config = tls_config_new(); if (tls_config == NULL) fatal("tls_config_new"); if (protocols) { if (tls_config_parse_protocols(&protos, protocols) == -1) fatalx("failed to parse protocol '%s'", protocols); if (tls_config_set_protocols(tls_config, protos) == -1) fatalx("tls_config_set_protocols: %s", tls_config_error(tls_config)); } if (ciphers && tls_config_set_ciphers(tls_config, ciphers) == -1) fatalx("tls_config_set_ciphers: %s", tls_config_error(tls_config)); if (cafile == NULL) cafile = tls_default_ca_cert_file(); if (tls_config_set_ca_file(tls_config, cafile) == -1) fatalx("tls_set_ca_file: %s", tls_config_error(tls_config)); if (!params.tls_verify) { tls_config_insecure_noverifycert(tls_config); tls_config_insecure_noverifyname(tls_config); tls_config_insecure_noverifytime(tls_config); } else tls_config_verify(tls_config); #if HAVE_PLEDGE if (pledge("stdio inet dns tmppath", NULL) == -1) fatal("pledge"); #endif if (!noaction) parse_message(stdin); #if HAVE_PLEDGE if (pledge("stdio inet dns", NULL) == -1) fatal("pledge"); #endif parse_server(server); #if HAVE_PLEDGE if (pledge("stdio inet", NULL) == -1) fatal("pledge"); #endif resume(); log_debug("done..."); return 0; } static void parse_server(char *server) { struct addrinfo hints; char *scheme, *creds, *host, *port, *p, *c; int error; creds = NULL; host = NULL; port = NULL; scheme = server; p = strstr(server, "://"); if (p) { *p = '\0'; p += 3; /* check for credentials */ c = strrchr(p, '@'); if (c) { creds = p; *c = '\0'; host = c + 1; } else host = p; } else { /* Assume a simple server name */ scheme = "smtp"; host = server; } if (host[0] == '[') { /* IPV6 address? */ p = strchr(host, ']'); if (p) { if (p[1] == ':' || p[1] == '\0') { *p++ = '\0'; /* remove ']' */ host++; /* skip '[' */ if (*p == ':') port = p + 1; } } } else { port = strchr(host, ':'); if (port) *port++ = '\0'; } if (port && port[0] == '\0') port = NULL; if (creds) { p = strchr(creds, ':'); if (p == NULL) fatalx("invalid credentials"); *p = '\0'; params.auth_user = creds; params.auth_pass = p + 1; } params.tls_req = TLS_YES; if (!strcmp(scheme, "lmtp")) { params.lmtp = 1; } else if (!strcmp(scheme, "lmtp+tls")) { params.lmtp = 1; params.tls_req = TLS_FORCE; } else if (!strcmp(scheme, "lmtp+notls")) { params.lmtp = 1; params.tls_req = TLS_NO; } else if (!strcmp(scheme, "smtps")) { params.tls_req = TLS_SMTPS; if (port == NULL) port = "smtps"; } else if (!strcmp(scheme, "smtp")) { } else if (!strcmp(scheme, "smtp+tls")) { params.tls_req = TLS_FORCE; } else if (!strcmp(scheme, "smtp+notls")) { params.tls_req = TLS_NO; } else fatalx("invalid url scheme %s", scheme); if (port == NULL) port = "smtp"; if (servname == NULL) servname = host; if (nosni == 0) params.tls_servname = servname; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo(host, port, &hints, &res0); if (error) fatalx("%s: %s", host, gai_strerror(error)); ai = res0; } void parse_message(FILE *ifp) { char *line = NULL; size_t linesz = 0; ssize_t len; if ((mail.fp = tmpfile()) == NULL) fatal("tmpfile"); for (;;) { if ((len = getline(&line, &linesz, ifp)) == -1) { if (feof(ifp)) break; fatal("getline"); } if (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n') line[--len - 1] = '\n'; if (fwrite(line, 1, len, mail.fp) != (size_t)len) fatal("fwrite"); if (line[len - 1] != '\n' && fputc('\n', mail.fp) == EOF) fatal("fputc"); } free(line); fclose(ifp); rewind(mail.fp); } void resume(void) { static int started = 0; char host[256]; char serv[16]; if (done) { event_loopexit(NULL); return; } if (ai == NULL) fatalx("no more host"); getnameinfo(ai->ai_addr, SA_LEN(ai->ai_addr), host, sizeof(host), serv, sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV); log_debug("trying host %s port %s...", host, serv); params.dst = ai->ai_addr; if (smtp_connect(¶ms, NULL) == NULL) fatal("smtp_connect"); if (started == 0) { started = 1; event_loop(0); } } void log_trace(int lvl, const char *emsg, ...) { va_list ap; if (verbose > lvl) { va_start(ap, emsg); vlog(LOG_DEBUG, emsg, ap); va_end(ap); } } void smtp_require_tls(void *tag, struct smtp_client *proto) { struct tls *tls; tls = tls_client(); if (tls == NULL) fatal("tls_client"); if (tls_configure(tls, tls_config) == -1) fatalx("tls_configure: %s", tls_error(tls)); smtp_set_tls(proto, tls); } void smtp_ready(void *tag, struct smtp_client *proto) { log_debug("connection ready..."); if (done || noaction) smtp_quit(proto); else smtp_sendmail(proto, &mail); } void smtp_failed(void *tag, struct smtp_client *proto, int failure, const char *detail) { switch (failure) { case FAIL_INTERNAL: log_warnx("internal error: %s", detail); break; case FAIL_CONN: log_warnx("connection error: %s", detail); break; case FAIL_PROTO: log_warnx("protocol error: %s", detail); break; case FAIL_IMPL: log_warnx("missing feature: %s", detail); break; case FAIL_RESP: log_warnx("rejected by server: %s", detail); break; default: fatalx("unknown failure %d: %s", failure, detail); } } void smtp_status(void *tag, struct smtp_client *proto, struct smtp_status *status) { log_info("%s: %s: %s", status->rcpt->to, status->cmd, status->status); } void smtp_done(void *tag, struct smtp_client *proto, struct smtp_mail *mail) { int i; log_debug("mail done..."); if (noaction) return; for (i = 0; i < mail->rcptcount; i++) if (!mail->rcpt[i].done) return; done = 1; } void smtp_closed(void *tag, struct smtp_client *proto) { log_debug("connection closed..."); ai = ai->ai_next; if (noaction && ai == NULL) done = 1; resume(); } opensmtpd-7.7.0p0/usr.sbin/smtpd/log.c0000644000175000001440000001033314610663500013273 /* $OpenBSD: log.c,v 1.20 2017/03/21 12:06:56 bluhm Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include static int debug; static int verbose; const char *log_procname; void log_init(int, int); void log_procinit(const char *); void log_setverbose(int); int log_getverbose(void); void log_warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_info(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_debug(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void logit(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); void vlog(int, const char *, va_list) __attribute__((__format__ (printf, 2, 0))); __dead void fatal(const char *, ...) __attribute__((__format__ (printf, 1, 2))); __dead void fatalx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_init(int n_debug, int facility) { extern char *__progname; debug = n_debug; verbose = n_debug; log_procinit(__progname); if (!debug) openlog(__progname, LOG_PID | LOG_NDELAY, facility); tzset(); } void log_procinit(const char *procname) { if (procname != NULL) log_procname = procname; } void log_setverbose(int v) { verbose = v; } int log_getverbose(void) { return (verbose); } void logit(int pri, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vlog(pri, fmt, ap); va_end(ap); } void vlog(int pri, const char *fmt, va_list ap) { char *nfmt; int saved_errno = errno; if (debug) { /* best effort in out of mem situations */ if (asprintf(&nfmt, "%s\n", fmt) == -1) { vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } else { vfprintf(stderr, nfmt, ap); free(nfmt); } fflush(stderr); } else vsyslog(pri, fmt, ap); errno = saved_errno; } void log_warn(const char *emsg, ...) { char *nfmt; va_list ap; int saved_errno = errno; /* best effort to even work in out of memory situations */ if (emsg == NULL) logit(LOG_ERR, "%s", strerror(saved_errno)); else { va_start(ap, emsg); if (asprintf(&nfmt, "%s: %s", emsg, strerror(saved_errno)) == -1) { /* we tried it... */ vlog(LOG_ERR, emsg, ap); logit(LOG_ERR, "%s", strerror(saved_errno)); } else { vlog(LOG_ERR, nfmt, ap); free(nfmt); } va_end(ap); } errno = saved_errno; } void log_warnx(const char *emsg, ...) { va_list ap; va_start(ap, emsg); vlog(LOG_ERR, emsg, ap); va_end(ap); } void log_info(const char *emsg, ...) { va_list ap; va_start(ap, emsg); vlog(LOG_INFO, emsg, ap); va_end(ap); } void log_debug(const char *emsg, ...) { va_list ap; if (verbose > 1) { va_start(ap, emsg); vlog(LOG_DEBUG, emsg, ap); va_end(ap); } } static void vfatalc(int code, const char *emsg, va_list ap) { static char s[BUFSIZ]; const char *sep; if (emsg != NULL) { (void)vsnprintf(s, sizeof(s), emsg, ap); sep = ": "; } else { s[0] = '\0'; sep = ""; } if (code) logit(LOG_CRIT, "%s: %s%s%s", log_procname, s, sep, strerror(code)); else logit(LOG_CRIT, "%s%s%s", log_procname, sep, s); } void fatal(const char *emsg, ...) { va_list ap; va_start(ap, emsg); vfatalc(errno, emsg, ap); va_end(ap); exit(1); } void fatalx(const char *emsg, ...) { va_list ap; va_start(ap, emsg); vfatalc(0, emsg, ap); va_end(ap); exit(1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/stat_backend.c0000644000175000001440000000524014610663500015135 /* $OpenBSD: stat_backend.c,v 1.12 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "log.h" #include "smtpd.h" extern struct stat_backend stat_backend_ramstat; struct stat_backend * stat_backend_lookup(const char *name) { return &stat_backend_ramstat; } void stat_increment(const char *key, size_t count) { struct stat_value *value; if (count == 0) return; value = stat_counter(count); m_create(p_control, IMSG_STAT_INCREMENT, 0, 0, -1); m_add_string(p_control, key); m_add_data(p_control, value, sizeof(*value)); m_close(p_control); } void stat_decrement(const char *key, size_t count) { struct stat_value *value; if (count == 0) return; value = stat_counter(count); m_create(p_control, IMSG_STAT_DECREMENT, 0, 0, -1); m_add_string(p_control, key); m_add_data(p_control, value, sizeof(*value)); m_close(p_control); } void stat_set(const char *key, const struct stat_value *value) { m_create(p_control, IMSG_STAT_SET, 0, 0, -1); m_add_string(p_control, key); m_add_data(p_control, value, sizeof(*value)); m_close(p_control); } /* helpers */ struct stat_value * stat_counter(size_t counter) { static struct stat_value value; value.type = STAT_COUNTER; value.u.counter = counter; return &value; } struct stat_value * stat_timestamp(time_t timestamp) { static struct stat_value value; value.type = STAT_TIMESTAMP; value.u.timestamp = timestamp; return &value; } struct stat_value * stat_timeval(struct timeval *tv) { static struct stat_value value; value.type = STAT_TIMEVAL; value.u.tv = *tv; return &value; } struct stat_value * stat_timespec(struct timespec *ts) { static struct stat_value value; value.type = STAT_TIMESPEC; value.u.ts = *ts; return &value; } opensmtpd-7.7.0p0/usr.sbin/smtpd/aliases.50000644000175000001440000000614114610663500014057 .\" $OpenBSD: aliases.5,v 1.17 2021/02/13 07:20:49 jmc Exp $ .\" .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 13 2021 $ .Dt ALIASES 5 .Os .Sh NAME .Nm aliases .Nd aliases file for smtpd .Sh DESCRIPTION This manual page describes the format of the .Nm file, as used by .Xr smtpd 8 . An alias, in its simplest form, is used to assign an arbitrary name to an email address or a group of email addresses. This provides a convenient way to send mail. For example an alias could refer to all users of a group: email to that alias would be sent to all members of the group. Much more complex aliases can be defined however: an alias can refer to other aliases, be used to send mail to a file instead of another person, or to execute various commands. .Pp Within the file, .Ql # is a comment delimiter; anything placed after it is discarded. The file consists of key/value mappings of the form: .Bd -filled -offset indent key: value1, value2, value3, ... .Ed .Pp .Em key is always folded to lowercase before alias lookups to ensure that there can be no ambiguity. The key is expanded to the corresponding values, which consist of one or more of the following: .Bl -tag -width Ds .It Em user A user on the host machine. The user must have a valid entry in the .Xr passwd 5 database file. .It Ar /path/to/file Append messages to .Ar file , specified by its absolute pathname. .It | Ns Ar command Pipe the message to .Ar command on its standard input. The command is run under the privileges of the daemon's unprivileged account. .It : Ns Ar include : Ns Ar /path/to/file Include any definitions in .Ar file as alias entries. The format of the file is identical to this one. .It Ar user-part@domain-part An email address in RFC 5322 format. If an address extension is appended to the user-part, it is first compared for an exact match. It is then stripped so that an address such as user+ext@example.com will only use the part that precedes .Sq + as a .Em key . .It Ar error : Ns Ar code message A status code and message to return. The code must be 3 digits, starting 4XX (TempFail) or 5XX (PermFail). The message must be present and can be freely chosen. .El .Sh FILES .Bl -tag -width "/etc/mail/aliasesXXX" -compact .It Pa /etc/mail/aliases Default .Nm file. .El .Sh SEE ALSO .Xr smtpd.conf 5 , .Xr makemap 8 , .Xr newaliases 8 , .Xr smtpd 8 .Sh HISTORY The .Nm file format appeared in .Bx 4.0 . opensmtpd-7.7.0p0/usr.sbin/smtpd/mda_variables.c0000644000175000001440000002212414620126254015305 /* $OpenBSD: mda_variables.c,v 1.10 2024/04/23 13:34:51 jsg Exp $ */ /* * Copyright (c) 2011-2017 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define EXPAND_DEPTH 10 ssize_t mda_expand_format(char *, size_t, const struct deliver *, const struct userinfo *, const char *); static ssize_t mda_expand_token(char *, size_t, const char *, const struct deliver *, const struct userinfo *, const char *); static int mod_lowercase(char *, size_t); static int mod_uppercase(char *, size_t); static int mod_strip(char *, size_t); static struct modifiers { char *name; int (*f)(char *buf, size_t len); } token_modifiers[] = { { "lowercase", mod_lowercase }, { "uppercase", mod_uppercase }, { "strip", mod_strip }, { "raw", NULL }, /* special case, must stay last */ }; #define MAXTOKENLEN 128 static ssize_t mda_expand_token(char *dest, size_t len, const char *token, const struct deliver *dlv, const struct userinfo *ui, const char *mda_command) { char rtoken[MAXTOKENLEN]; char tmp[EXPAND_BUFFER]; const char *string = NULL; char *lbracket, *rbracket, *content, *sep, *mods; ssize_t i; ssize_t begoff, endoff; const char *errstr = NULL; int replace = 1; int raw = 0; begoff = 0; endoff = EXPAND_BUFFER; mods = NULL; if (strlcpy(rtoken, token, sizeof rtoken) >= sizeof rtoken) return -1; /* token[x[:y]] -> extracts optional x and y, converts into offsets */ if ((lbracket = strchr(rtoken, '[')) && (rbracket = strchr(rtoken, ']'))) { /* ] before [ ... or empty */ if (rbracket < lbracket || rbracket - lbracket <= 1) return -1; *lbracket = *rbracket = '\0'; content = lbracket + 1; if ((sep = strchr(content, ':')) == NULL) endoff = begoff = strtonum(content, -EXPAND_BUFFER, EXPAND_BUFFER, &errstr); else { *sep = '\0'; if (content != sep) begoff = strtonum(content, -EXPAND_BUFFER, EXPAND_BUFFER, &errstr); if (*(++sep)) { if (errstr == NULL) endoff = strtonum(sep, -EXPAND_BUFFER, EXPAND_BUFFER, &errstr); } } if (errstr) return -1; /* token:mod_1,mod_2,mod_n -> extract modifiers */ mods = strchr(rbracket + 1, ':'); } else { if ((mods = strchr(rtoken, ':')) != NULL) *mods++ = '\0'; } /* token -> expanded token */ if (!strcasecmp("sender", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", dlv->sender.user, dlv->sender.domain) >= (int)sizeof tmp) return -1; if (strcmp(tmp, "@") == 0) (void)strlcpy(tmp, "", sizeof tmp); string = tmp; } else if (!strcasecmp("rcpt", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", dlv->rcpt.user, dlv->rcpt.domain) >= (int)sizeof tmp) return -1; if (strcmp(tmp, "@") == 0) (void)strlcpy(tmp, "", sizeof tmp); string = tmp; } else if (!strcasecmp("dest", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", dlv->dest.user, dlv->dest.domain) >= (int)sizeof tmp) return -1; if (strcmp(tmp, "@") == 0) (void)strlcpy(tmp, "", sizeof tmp); string = tmp; } else if (!strcasecmp("sender.user", rtoken)) string = dlv->sender.user; else if (!strcasecmp("sender.domain", rtoken)) string = dlv->sender.domain; else if (!strcasecmp("user.username", rtoken)) string = ui->username; else if (!strcasecmp("user.directory", rtoken)) { string = ui->directory; replace = 0; } else if (!strcasecmp("rcpt.user", rtoken)) string = dlv->rcpt.user; else if (!strcasecmp("rcpt.domain", rtoken)) string = dlv->rcpt.domain; else if (!strcasecmp("dest.user", rtoken)) string = dlv->dest.user; else if (!strcasecmp("dest.domain", rtoken)) string = dlv->dest.domain; else if (!strcasecmp("mda", rtoken)) { string = mda_command; replace = 0; } else if (!strcasecmp("mbox.from", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", dlv->sender.user, dlv->sender.domain) >= (int)sizeof tmp) return -1; if (strcmp(tmp, "@") == 0) (void)strlcpy(tmp, "MAILER-DAEMON", sizeof tmp); string = tmp; } else return -1; if (string != tmp) { if (string == NULL) return -1; if (strlcpy(tmp, string, sizeof tmp) >= sizeof tmp) return -1; string = tmp; } /* apply modifiers */ if (mods != NULL) { do { if ((sep = strchr(mods, '|')) != NULL) *sep++ = '\0'; for (i = 0; (size_t)i < nitems(token_modifiers); ++i) { if (!strcasecmp(token_modifiers[i].name, mods)) { if (token_modifiers[i].f == NULL) { raw = 1; break; } if (!token_modifiers[i].f(tmp, sizeof tmp)) return -1; /* modifier error */ break; } } if ((size_t)i == nitems(token_modifiers)) return -1; /* modifier not found */ } while ((mods = sep) != NULL); } if (!raw && replace) for (i = 0; (size_t)i < strlen(tmp); ++i) if (strchr(MAILADDR_ESCAPE, tmp[i])) tmp[i] = ':'; /* expanded string is empty */ i = strlen(string); if (i == 0) return 0; /* begin offset beyond end of string */ if (begoff >= i) return -1; /* end offset beyond end of string, make it end of string */ if (endoff >= i) endoff = i - 1; /* negative begin offset, make it relative to end of string */ if (begoff < 0) begoff += i; /* negative end offset, make it relative to end of string, * note that end offset is inclusive. */ if (endoff < 0) endoff += i - 1; /* check that final offsets are valid */ if (begoff < 0 || endoff < 0 || endoff < begoff) return -1; endoff += 1; /* end offset is inclusive */ /* check that substring does not exceed destination buffer length */ i = endoff - begoff; if ((size_t)i + 1 >= len) return -1; string += begoff; for (; i; i--) { *dest = *string; dest++; string++; } return endoff - begoff; } ssize_t mda_expand_format(char *buf, size_t len, const struct deliver *dlv, const struct userinfo *ui, const char *mda_command) { char tmpbuf[EXPAND_BUFFER], *ptmp, *pbuf, *ebuf; char exptok[EXPAND_BUFFER]; ssize_t exptoklen; char token[MAXTOKENLEN]; size_t ret, tmpret, toklen; if (len < sizeof tmpbuf) { log_warnx("mda_expand_format: tmp buffer < rule buffer"); return -1; } memset(tmpbuf, 0, sizeof tmpbuf); pbuf = buf; ptmp = tmpbuf; ret = tmpret = 0; /* special case: ~/ only allowed expanded at the beginning */ if (strncmp(pbuf, "~/", 2) == 0) { tmpret = snprintf(ptmp, sizeof tmpbuf, "%s/", ui->directory); if (tmpret >= sizeof tmpbuf) { log_warnx("warn: user directory for %s too large", ui->directory); return 0; } ret += tmpret; ptmp += tmpret; pbuf += 2; } /* expansion loop */ for (; *pbuf && ret < sizeof tmpbuf; ret += tmpret) { if (*pbuf == '%' && *(pbuf + 1) == '%') { *ptmp++ = *pbuf++; pbuf += 1; tmpret = 1; continue; } if (*pbuf != '%' || *(pbuf + 1) != '{') { *ptmp++ = *pbuf++; tmpret = 1; continue; } /* %{...} otherwise fail */ if ((ebuf = strchr(pbuf+2, '}')) == NULL) return 0; /* extract token from %{token} */ toklen = ebuf - (pbuf+2); if (toklen >= sizeof token) return 0; memcpy(token, pbuf+2, toklen); token[toklen] = '\0'; exptoklen = mda_expand_token(exptok, sizeof exptok, token, dlv, ui, mda_command); if (exptoklen == -1) return -1; /* writing expanded token at ptmp will overflow tmpbuf */ if (sizeof (tmpbuf) - (ptmp - tmpbuf) <= (size_t)exptoklen) return -1; memcpy(ptmp, exptok, exptoklen); pbuf = ebuf + 1; ptmp += exptoklen; tmpret = exptoklen; } if (ret >= sizeof tmpbuf) return -1; if ((ret = strlcpy(buf, tmpbuf, len)) >= len) return -1; return ret; } static int mod_lowercase(char *buf, size_t len) { char tmp[EXPAND_BUFFER]; if (!lowercase(tmp, buf, sizeof tmp)) return 0; if (strlcpy(buf, tmp, len) >= len) return 0; return 1; } static int mod_uppercase(char *buf, size_t len) { char tmp[EXPAND_BUFFER]; if (!uppercase(tmp, buf, sizeof tmp)) return 0; if (strlcpy(buf, tmp, len) >= len) return 0; return 1; } static int mod_strip(char *buf, size_t len) { char *tag, *at; unsigned int i; /* gilles+hackers -> gilles */ if ((tag = strchr(buf, *env->sc_subaddressing_delim)) != NULL) { /* gilles+hackers@poolp.org -> gilles@poolp.org */ if ((at = strchr(tag, '@')) != NULL) { for (i = 0; i <= strlen(at); ++i) tag[i] = at[i]; } else *tag = '\0'; } return 1; } opensmtpd-7.7.0p0/usr.sbin/smtpd/expand.c0000644000175000001440000001616414610663500014001 /* $OpenBSD: expand.c,v 1.32 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2009 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #include "smtpd.h" static const char *expandnode_info(struct expandnode *); struct expandnode * expand_lookup(struct expand *expand, struct expandnode *key) { return RB_FIND(expandtree, &expand->tree, key); } int expand_to_text(struct expand *expand, char *buf, size_t sz) { struct expandnode *xn; buf[0] = '\0'; RB_FOREACH(xn, expandtree, &expand->tree) { if (buf[0]) (void)strlcat(buf, ", ", sz); if (strlcat(buf, expandnode_to_text(xn), sz) >= sz) return 0; } return 1; } void expand_insert(struct expand *expand, struct expandnode *node) { struct expandnode *xn; node->rule = expand->rule; node->parent = expand->parent; log_trace(TRACE_EXPAND, "expand: %p: expand_insert() called for %s", expand, expandnode_info(node)); if (node->type == EXPAND_USERNAME && expand->parent && expand->parent->type == EXPAND_USERNAME && !strcmp(expand->parent->u.user, node->u.user)) { log_trace(TRACE_EXPAND, "expand: %p: setting sameuser = 1", expand); node->sameuser = 1; } if (expand_lookup(expand, node)) { log_trace(TRACE_EXPAND, "expand: %p: node found, discarding", expand); return; } xn = xmemdup(node, sizeof *xn); xn->rule = expand->rule; xn->parent = expand->parent; if (xn->parent) xn->depth = xn->parent->depth + 1; else xn->depth = 0; RB_INSERT(expandtree, &expand->tree, xn); if (expand->queue) TAILQ_INSERT_TAIL(expand->queue, xn, tq_entry); expand->nb_nodes++; log_trace(TRACE_EXPAND, "expand: %p: inserted node %p", expand, xn); } void expand_clear(struct expand *expand) { struct expandnode *xn; log_trace(TRACE_EXPAND, "expand: %p: clearing expand tree", expand); if (expand->queue) while ((xn = TAILQ_FIRST(expand->queue))) TAILQ_REMOVE(expand->queue, xn, tq_entry); while ((xn = RB_ROOT(&expand->tree)) != NULL) { RB_REMOVE(expandtree, &expand->tree, xn); free(xn); } } void expand_free(struct expand *expand) { expand_clear(expand); log_trace(TRACE_EXPAND, "expand: %p: freeing expand tree", expand); free(expand); } int expand_cmp(struct expandnode *e1, struct expandnode *e2) { struct expandnode *p1, *p2; int r; if (e1->type < e2->type) return -1; if (e1->type > e2->type) return 1; if (e1->sameuser < e2->sameuser) return -1; if (e1->sameuser > e2->sameuser) return 1; if (e1->realuser < e2->realuser) return -1; if (e1->realuser > e2->realuser) return 1; r = memcmp(&e1->u, &e2->u, sizeof(e1->u)); if (r) return (r); if (e1->parent == e2->parent) return (0); if (e1->parent == NULL) return (-1); if (e2->parent == NULL) return (1); /* * The same node can be expanded in for different dest context. * Wen need to distinguish between those. */ for(p1 = e1->parent; p1->type != EXPAND_ADDRESS; p1 = p1->parent) ; for(p2 = e2->parent; p2->type != EXPAND_ADDRESS; p2 = p2->parent) ; if (p1 < p2) return (-1); if (p1 > p2) return (1); if (e1->type != EXPAND_FILENAME && e1->type != EXPAND_FILTER) return (0); /* * For external delivery, we need to distinguish between users. * If we can't find a username, we assume it is _smtpd. */ for(p1 = e1->parent; p1 && p1->type != EXPAND_USERNAME; p1 = p1->parent) ; for(p2 = e2->parent; p2 && p2->type != EXPAND_USERNAME; p2 = p2->parent) ; if (p1 < p2) return (-1); if (p1 > p2) return (1); return (0); } static int expand_line_split(char **line, char **ret) { static char buffer[LINE_MAX]; int esc, dq, sq; size_t i; char *s; memset(buffer, 0, sizeof buffer); esc = dq = sq = 0; i = 0; for (s = *line; (*s) && (i < sizeof(buffer)); ++s) { if (esc) { buffer[i++] = *s; esc = 0; continue; } if (*s == '\\') { esc = 1; continue; } if (*s == ',' && !dq && !sq) { *ret = buffer; *line = s+1; return (1); } buffer[i++] = *s; esc = 0; if (*s == '"' && !sq) dq ^= 1; if (*s == '\'' && !dq) sq ^= 1; } if (esc || dq || sq || i == sizeof(buffer)) return (-1); *ret = buffer; *line = s; return (i ? 1 : 0); } int expand_line(struct expand *expand, const char *s, int do_includes) { struct expandnode xn; char buffer[LINE_MAX]; char *p, *subrcpt; int ret; memset(buffer, 0, sizeof buffer); if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer) return 0; p = buffer; while ((ret = expand_line_split(&p, &subrcpt)) > 0) { subrcpt = strip(subrcpt); if (subrcpt[0] == '\0') continue; if (!text_to_expandnode(&xn, subrcpt)) return 0; if (!do_includes) if (xn.type == EXPAND_INCLUDE) continue; expand_insert(expand, &xn); } if (ret >= 0) return 1; /* expand_line_split() returned < 0 */ return 0; } static const char * expandnode_info(struct expandnode *e) { static char buffer[1024]; const char *type = NULL; const char *value = NULL; char tmp[64]; switch (e->type) { case EXPAND_FILTER: type = "filter"; break; case EXPAND_FILENAME: type = "filename"; break; case EXPAND_INCLUDE: type = "include"; break; case EXPAND_USERNAME: type = "username"; break; case EXPAND_ADDRESS: type = "address"; break; case EXPAND_ERROR: type = "error"; break; case EXPAND_INVALID: default: return NULL; } if ((value = expandnode_to_text(e)) == NULL) return NULL; (void)strlcpy(buffer, type, sizeof buffer); (void)strlcat(buffer, ":", sizeof buffer); if (strlcat(buffer, value, sizeof buffer) >= sizeof buffer) return NULL; (void)snprintf(tmp, sizeof(tmp), "[parent=%p", e->parent); if (strlcat(buffer, tmp, sizeof buffer) >= sizeof buffer) return NULL; (void)snprintf(tmp, sizeof(tmp), ", rule=%p", e->rule); if (strlcat(buffer, tmp, sizeof buffer) >= sizeof buffer) return NULL; if (e->rule) { (void)snprintf(tmp, sizeof(tmp), ", dispatcher=%p", e->rule->dispatcher); if (strlcat(buffer, tmp, sizeof buffer) >= sizeof buffer) return NULL; } if (strlcat(buffer, "]", sizeof buffer) >= sizeof buffer) return NULL; return buffer; } RB_GENERATE(expandtree, expandnode, entry, expand_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/aliases.c0000644000175000001440000001322714610663500014140 /* $OpenBSD: aliases.c,v 1.79 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #include "smtpd.h" #include "log.h" static int aliases_expand_include(struct expand *, const char *); int aliases_get(struct expand *expand, const char *username) { struct expandnode *xn; char buf[SMTPD_MAXLOCALPARTSIZE]; size_t nbaliases; int ret; union lookup lk; struct dispatcher *dsp; struct table *mapping = NULL; char *pbuf; dsp = dict_xget(env->sc_dispatchers, expand->rule->dispatcher); mapping = table_find(env, dsp->u.local.table_alias); xlowercase(buf, username, sizeof(buf)); /* first, check if entry has a user-part tag */ pbuf = strchr(buf, *env->sc_subaddressing_delim); if (pbuf) { ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; *pbuf = '\0'; } /* no user-part tag, try looking up user */ ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret <= 0) return ret; expand: /* foreach node in table_alias expandtree, we merge */ nbaliases = 0; RB_FOREACH(xn, expandtree, &lk.expand->tree) { if (xn->type == EXPAND_INCLUDE) nbaliases += aliases_expand_include(expand, xn->u.buffer); else { expand_insert(expand, xn); nbaliases++; } } expand_free(lk.expand); log_debug("debug: aliases_get: returned %zd aliases", nbaliases); return nbaliases; } int aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) { struct expandnode *xn; union lookup lk; char buf[LINE_MAX]; char user[LINE_MAX]; char tag[LINE_MAX]; char domain[LINE_MAX]; char *pbuf; int nbaliases; int ret; struct dispatcher *dsp; struct table *mapping = NULL; dsp = dict_xget(env->sc_dispatchers, expand->rule->dispatcher); mapping = table_find(env, dsp->u.local.table_virtual); if (!bsnprintf(user, sizeof(user), "%s", maddr->user)) return 0; if (!bsnprintf(domain, sizeof(domain), "%s", maddr->domain)) return 0; xlowercase(user, user, sizeof(user)); xlowercase(domain, domain, sizeof(domain)); memset(tag, '\0', sizeof tag); pbuf = strchr(user, *env->sc_subaddressing_delim); if (pbuf) { if (!bsnprintf(tag, sizeof(tag), "%s", pbuf + 1)) return 0; xlowercase(tag, tag, sizeof(tag)); *pbuf = '\0'; } /* first, check if entry has a user-part tag */ if (tag[0]) { if (!bsnprintf(buf, sizeof(buf), "%s%c%s@%s", user, *env->sc_subaddressing_delim, tag, domain)) return 0; ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; } /* then, check if entry exists without user-part tag */ if (!bsnprintf(buf, sizeof(buf), "%s@%s", user, domain)) return 0; ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; if (tag[0]) { /* Failed ? We lookup for username + user-part tag */ if (!bsnprintf(buf, sizeof(buf), "%s%c%s", user, *env->sc_subaddressing_delim, tag)) return 0; ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; } /* Failed ? We lookup for username only */ if (!bsnprintf(buf, sizeof(buf), "%s", user)) return 0; ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; /* Do not try catch-all entries if there is no domain */ if (domain[0] == '\0') return 0; if (!bsnprintf(buf, sizeof(buf), "@%s", domain)) return 0; /* Failed ? We lookup for catch all for virtual domain */ ret = table_lookup(mapping, K_ALIAS, buf, &lk); if (ret < 0) return (-1); if (ret) goto expand; /* Failed ? We lookup for a *global* catch all */ ret = table_lookup(mapping, K_ALIAS, "@", &lk); if (ret <= 0) return (ret); expand: /* foreach node in table_virtual expand, we merge */ nbaliases = 0; RB_FOREACH(xn, expandtree, &lk.expand->tree) { if (xn->type == EXPAND_INCLUDE) nbaliases += aliases_expand_include(expand, xn->u.buffer); else { expand_insert(expand, xn); nbaliases++; } } expand_free(lk.expand); log_debug("debug: aliases_virtual_get: '%s' resolved to %d nodes", buf, nbaliases); return nbaliases; } static int aliases_expand_include(struct expand *expand, const char *filename) { FILE *fp; char *line; size_t len, lineno = 0; char delim[3] = { '\\', '#', '\0' }; fp = fopen(filename, "r"); if (fp == NULL) { log_warn("warn: failed to open include file \"%s\".", filename); return 0; } while ((line = fparseln(fp, &len, &lineno, delim, 0)) != NULL) { expand_line(expand, line, 0); free(line); } fclose(fp); return 1; } opensmtpd-7.7.0p0/usr.sbin/smtpd/rfc5322.h0000644000175000001440000000275514610663500013616 /* $OpenBSD: rfc5322.h,v 1.1 2018/08/23 10:07:06 eric Exp $ */ /* * Copyright (c) 2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct rfc5322_result { const char *hdr; const char *value; }; #define RFC5322_ERR -1 #define RFC5322_NONE 0 #define RFC5322_HEADER_START 1 #define RFC5322_HEADER_CONT 2 #define RFC5322_HEADER_END 3 #define RFC5322_END_OF_HEADERS 4 #define RFC5322_BODY_START 5 #define RFC5322_BODY 6 #define RFC5322_END_OF_MESSAGE 7 struct rfc5322_parser; struct rfc5322_parser *rfc5322_parser_new(void); void rfc5322_free(struct rfc5322_parser *); void rfc5322_clear(struct rfc5322_parser *); int rfc5322_push(struct rfc5322_parser *, const char *); int rfc5322_next(struct rfc5322_parser *, struct rfc5322_result *); int rfc5322_unfold_header(struct rfc5322_parser *); opensmtpd-7.7.0p0/usr.sbin/smtpd/dns.c0000644000175000001440000002113214610663500013275 /* $OpenBSD: dns.c,v 1.91 2023/11/08 08:46:34 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2011-2014 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #ifdef HAVE_ARPA_NAMESER_COMPAT_H #include #endif #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #include "unpack_dns.h" struct dns_lookup { struct dns_session *session; char *host; int preference; }; struct dns_session { struct mproc *p; uint64_t reqid; int type; char name[HOST_NAME_MAX+1]; size_t mxfound; int error; int refcount; }; static void dns_lookup_host(struct dns_session *, const char *, int); static void dns_dispatch_host(struct asr_result *, void *); static void dns_dispatch_mx(struct asr_result *, void *); static void dns_dispatch_mx_preference(struct asr_result *, void *); static int domainname_is_addr(const char *s, struct sockaddr *sa, socklen_t *sl) { struct addrinfo hints, *res; socklen_t sl2; size_t l; char buf[SMTPD_MAXDOMAINPARTSIZE]; int i6, error; if (*s != '[') return (0); i6 = (strncasecmp("[IPv6:", s, 6) == 0); s += i6 ? 6 : 1; l = strlcpy(buf, s, sizeof(buf)); if (l >= sizeof(buf) || l == 0 || buf[l - 1] != ']') return (0); buf[l - 1] = '\0'; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_socktype = SOCK_STREAM; if (i6) hints.ai_family = AF_INET6; res = NULL; if ((error = getaddrinfo(buf, NULL, &hints, &res))) { log_warnx("getaddrinfo: %s", gai_strerror(error)); } if (!res) return (0); if (sa && sl) { sl2 = *sl; if (sl2 > res->ai_addrlen) sl2 = res->ai_addrlen; memmove(sa, res->ai_addr, sl2); *sl = res->ai_addrlen; } freeaddrinfo(res); return (1); } void dns_imsg(struct mproc *p, struct imsg *imsg) { struct sockaddr_storage ss; struct dns_session *s; struct sockaddr *sa; struct asr_query *as; struct msg m; const char *domain, *mx, *host; socklen_t sl; s = xcalloc(1, sizeof *s); s->type = imsg->hdr.type; s->p = p; m_msg(&m, imsg); m_get_id(&m, &s->reqid); switch (s->type) { case IMSG_MTA_DNS_HOST: m_get_string(&m, &host); m_end(&m); dns_lookup_host(s, host, -1); return; case IMSG_MTA_DNS_MX: m_get_string(&m, &domain); m_end(&m); (void)strlcpy(s->name, domain, sizeof(s->name)); sa = (struct sockaddr *)&ss; sl = sizeof(ss); if (domainname_is_addr(domain, sa, &sl)) { m_create(s->p, IMSG_MTA_DNS_HOST, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_string(s->p, sockaddr_to_text(sa)); m_add_sockaddr(s->p, sa); m_add_int(s->p, -1); m_close(s->p); m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, DNS_OK); m_close(s->p); free(s); return; } as = res_query_async(s->name, C_IN, T_MX, NULL); if (as == NULL) { log_warn("warn: res_query_async: %s", s->name); m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, DNS_EINVAL); m_close(s->p); free(s); return; } event_asr_run(as, dns_dispatch_mx, s); return; case IMSG_MTA_DNS_MX_PREFERENCE: m_get_string(&m, &domain); m_get_string(&m, &mx); m_end(&m); (void)strlcpy(s->name, mx, sizeof(s->name)); as = res_query_async(domain, C_IN, T_MX, NULL); if (as == NULL) { m_create(s->p, IMSG_MTA_DNS_MX_PREFERENCE, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, DNS_ENOTFOUND); m_close(s->p); free(s); return; } event_asr_run(as, dns_dispatch_mx_preference, s); return; default: log_warnx("warn: bad dns request %d", s->type); fatal(NULL); } } static void dns_dispatch_host(struct asr_result *ar, void *arg) { struct dns_session *s; struct dns_lookup *lookup = arg; struct addrinfo *ai; s = lookup->session; for (ai = ar->ar_addrinfo; ai; ai = ai->ai_next) { s->mxfound++; m_create(s->p, IMSG_MTA_DNS_HOST, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_string(s->p, lookup->host); m_add_sockaddr(s->p, ai->ai_addr); m_add_int(s->p, lookup->preference); m_close(s->p); } free(lookup->host); free(lookup); if (ar->ar_addrinfo) asr_freeaddrinfo(ar->ar_addrinfo); if (ar->ar_gai_errno) s->error = ar->ar_gai_errno; if (--s->refcount) return; m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, s->mxfound ? DNS_OK : DNS_ENOTFOUND); m_close(s->p); free(s); } static void dns_dispatch_mx(struct asr_result *ar, void *arg) { struct dns_session *s = arg; struct unpack pack; struct dns_header h; struct dns_query q; struct dns_rr rr; char buf[512]; size_t found; int nullmx = 0; if (ar->ar_h_errno && ar->ar_h_errno != NO_DATA && ar->ar_h_errno != NOTIMP) { m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); m_add_id(s->p, s->reqid); if (ar->ar_rcode == NXDOMAIN) m_add_int(s->p, DNS_ENONAME); else if (ar->ar_h_errno == NO_RECOVERY) m_add_int(s->p, DNS_EINVAL); else m_add_int(s->p, DNS_RETRY); m_close(s->p); free(s); free(ar->ar_data); return; } unpack_init(&pack, ar->ar_data, ar->ar_datalen); unpack_header(&pack, &h); unpack_query(&pack, &q); found = 0; for (; h.ancount; h.ancount--) { unpack_rr(&pack, &rr); if (rr.rr_type != T_MX) continue; print_dname(rr.rr.mx.exchange, buf, sizeof(buf)); buf[strlen(buf) - 1] = '\0'; if ((rr.rr.mx.preference == 0 && !strcmp(buf, "")) || !strcmp(buf, "localhost")) { nullmx = 1; continue; } dns_lookup_host(s, buf, rr.rr.mx.preference); found++; } free(ar->ar_data); if (nullmx && found == 0) { m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, DNS_NULLMX); m_close(s->p); free(s); return; } /* fallback to host if no MX is found. */ if (found == 0) dns_lookup_host(s, s->name, 0); } static void dns_dispatch_mx_preference(struct asr_result *ar, void *arg) { struct dns_session *s = arg; struct unpack pack; struct dns_header h; struct dns_query q; struct dns_rr rr; char buf[512]; int error; if (ar->ar_h_errno) { if (ar->ar_rcode == NXDOMAIN) error = DNS_ENONAME; else if (ar->ar_h_errno == NO_RECOVERY || ar->ar_h_errno == NO_DATA) error = DNS_EINVAL; else error = DNS_RETRY; } else { error = DNS_ENOTFOUND; unpack_init(&pack, ar->ar_data, ar->ar_datalen); unpack_header(&pack, &h); unpack_query(&pack, &q); for (; h.ancount; h.ancount--) { unpack_rr(&pack, &rr); if (rr.rr_type != T_MX) continue; print_dname(rr.rr.mx.exchange, buf, sizeof(buf)); buf[strlen(buf) - 1] = '\0'; if (!strcasecmp(s->name, buf)) { error = DNS_OK; break; } } } free(ar->ar_data); m_create(s->p, IMSG_MTA_DNS_MX_PREFERENCE, 0, 0, -1); m_add_id(s->p, s->reqid); m_add_int(s->p, error); if (error == DNS_OK) m_add_int(s->p, rr.rr.mx.preference); m_close(s->p); free(s); } static void dns_lookup_host(struct dns_session *s, const char *host, int preference) { struct dns_lookup *lookup; struct addrinfo hints; char hostcopy[HOST_NAME_MAX+1]; char *p; void *as; lookup = xcalloc(1, sizeof *lookup); lookup->preference = preference; lookup->host = xstrdup(host); lookup->session = s; s->refcount++; if (*host == '[') { if (strncasecmp("[IPv6:", host, 6) == 0) host += 6; else host += 1; (void)strlcpy(hostcopy, host, sizeof hostcopy); p = strchr(hostcopy, ']'); if (p) *p = 0; host = hostcopy; } memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_ADDRCONFIG; hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; as = getaddrinfo_async(host, NULL, &hints, NULL); event_asr_run(as, dns_dispatch_host, lookup); } opensmtpd-7.7.0p0/usr.sbin/smtpd/queue_proc.c0000644000175000001440000001517515007615667014706 /* $OpenBSD: queue_proc.c,v 1.14 2024/11/21 13:42:22 claudio Exp $ */ /* * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static struct imsgbuf ibuf; static struct imsg imsg; static size_t rlen; static char *rdata; static void queue_proc_call(void) { ssize_t n; if (imsgbuf_flush(&ibuf) == -1) { log_warn("warn: queue-proc: imsgbuf_flush"); fatalx("queue-proc: exiting"); } while (1) { if ((n = imsg_get(&ibuf, &imsg)) == -1) { log_warn("warn: queue-proc: imsg_get"); break; } if (n) { rlen = imsg.hdr.len - IMSG_HEADER_SIZE; rdata = imsg.data; if (imsg.hdr.type != PROC_QUEUE_OK) { log_warnx("warn: queue-proc: bad response"); break; } return; } if ((n = imsgbuf_read(&ibuf)) == -1) { log_warn("warn: queue-proc: imsgbuf_read"); break; } if (n == 0) { log_warnx("warn: queue-proc: pipe closed"); break; } } fatalx("queue-proc: exiting"); } static void queue_proc_read(void *dst, size_t len) { if (len > rlen) { log_warnx("warn: queue-proc: bad msg len"); fatalx("queue-proc: exiting"); } memmove(dst, rdata, len); rlen -= len; rdata += len; } static void queue_proc_end(void) { if (rlen) { log_warnx("warn: queue-proc: bogus data"); fatalx("queue-proc: exiting"); } imsg_free(&imsg); } /* * API */ static int queue_proc_close(void) { int r; imsg_compose(&ibuf, PROC_QUEUE_CLOSE, 0, 0, -1, NULL, 0); queue_proc_call(); queue_proc_read(&r, sizeof(r)); queue_proc_end(); return (r); } static int queue_proc_message_create(uint32_t *msgid) { int r; imsg_compose(&ibuf, PROC_QUEUE_MESSAGE_CREATE, 0, 0, -1, NULL, 0); queue_proc_call(); queue_proc_read(&r, sizeof(r)); if (r == 1) queue_proc_read(msgid, sizeof(*msgid)); queue_proc_end(); return (r); } static int queue_proc_message_commit(uint32_t msgid, const char *path) { int r, fd; fd = open(path, O_RDONLY); if (fd == -1) { log_warn("queue-proc: open: %s", path); return (0); } imsg_compose(&ibuf, PROC_QUEUE_MESSAGE_COMMIT, 0, 0, fd, &msgid, sizeof(msgid)); queue_proc_call(); queue_proc_read(&r, sizeof(r)); queue_proc_end(); return (r); } static int queue_proc_message_delete(uint32_t msgid) { int r; imsg_compose(&ibuf, PROC_QUEUE_MESSAGE_DELETE, 0, 0, -1, &msgid, sizeof(msgid)); queue_proc_call(); queue_proc_read(&r, sizeof(r)); queue_proc_end(); return (r); } static int queue_proc_message_fd_r(uint32_t msgid) { imsg_compose(&ibuf, PROC_QUEUE_MESSAGE_FD_R, 0, 0, -1, &msgid, sizeof(msgid)); queue_proc_call(); queue_proc_end(); return (imsg_get_fd(&imsg)); } static int queue_proc_envelope_create(uint32_t msgid, const char *buf, size_t len, uint64_t *evpid) { struct ibuf *b; int r; msgid = evpid_to_msgid(*evpid); b = imsg_create(&ibuf, PROC_QUEUE_ENVELOPE_CREATE, 0, 0, sizeof(msgid) + len); if (imsg_add(b, &msgid, sizeof(msgid)) == -1 || imsg_add(b, buf, len) == -1) return (0); imsg_close(&ibuf, b); queue_proc_call(); queue_proc_read(&r, sizeof(r)); if (r == 1) queue_proc_read(evpid, sizeof(*evpid)); queue_proc_end(); return (r); } static int queue_proc_envelope_delete(uint64_t evpid) { int r; imsg_compose(&ibuf, PROC_QUEUE_ENVELOPE_DELETE, 0, 0, -1, &evpid, sizeof(evpid)); queue_proc_call(); queue_proc_read(&r, sizeof(r)); queue_proc_end(); return (r); } static int queue_proc_envelope_update(uint64_t evpid, const char *buf, size_t len) { struct ibuf *b; int r; b = imsg_create(&ibuf, PROC_QUEUE_ENVELOPE_UPDATE, 0, 0, len + sizeof(evpid)); if (imsg_add(b, &evpid, sizeof(evpid)) == -1 || imsg_add(b, buf, len) == -1) return (0); imsg_close(&ibuf, b); queue_proc_call(); queue_proc_read(&r, sizeof(r)); queue_proc_end(); return (r); } static int queue_proc_envelope_load(uint64_t evpid, char *buf, size_t len) { int r; imsg_compose(&ibuf, PROC_QUEUE_ENVELOPE_LOAD, 0, 0, -1, &evpid, sizeof(evpid)); queue_proc_call(); if (rlen > len) { log_warnx("warn: queue-proc: buf too small"); fatalx("queue-proc: exiting"); } r = rlen; queue_proc_read(buf, rlen); queue_proc_end(); return (r); } static int queue_proc_envelope_walk(uint64_t *evpid, char *buf, size_t len) { int r; imsg_compose(&ibuf, PROC_QUEUE_ENVELOPE_WALK, 0, 0, -1, NULL, 0); queue_proc_call(); queue_proc_read(&r, sizeof(r)); if (r > 0) { queue_proc_read(evpid, sizeof(*evpid)); if (rlen > len) { log_warnx("warn: queue-proc: buf too small"); fatalx("queue-proc: exiting"); } if (r != (int)rlen) { log_warnx("warn: queue-proc: len mismatch"); fatalx("queue-proc: exiting"); } queue_proc_read(buf, rlen); } queue_proc_end(); return (r); } static int queue_proc_init(struct passwd *pw, int server, const char *conf) { uint32_t version; int fd; fd = fork_proc_backend("queue", conf, "queue-proc", 0); if (fd == -1) fatalx("queue-proc: exiting"); if (imsgbuf_init(&ibuf, fd) == -1) fatal("queue-proc: exiting"); imsgbuf_allow_fdpass(&ibuf); version = PROC_QUEUE_API_VERSION; imsg_compose(&ibuf, PROC_QUEUE_INIT, 0, 0, -1, &version, sizeof(version)); queue_api_on_close(queue_proc_close); queue_api_on_message_create(queue_proc_message_create); queue_api_on_message_commit(queue_proc_message_commit); queue_api_on_message_delete(queue_proc_message_delete); queue_api_on_message_fd_r(queue_proc_message_fd_r); queue_api_on_envelope_create(queue_proc_envelope_create); queue_api_on_envelope_delete(queue_proc_envelope_delete); queue_api_on_envelope_update(queue_proc_envelope_update); queue_api_on_envelope_load(queue_proc_envelope_load); queue_api_on_envelope_walk(queue_proc_envelope_walk); queue_proc_call(); queue_proc_end(); return (1); } struct queue_backend queue_backend_proc = { queue_proc_init, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/mproc.c0000644000175000001440000002717415007615667013661 /* $OpenBSD: mproc.c,v 1.47 2024/11/21 13:42:22 claudio Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static void mproc_dispatch(int, short, void *); int mproc_fork(struct mproc *p, const char *path, char *argv[]) { int sp[2]; if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) return (-1); io_set_nonblocking(sp[0]); io_set_nonblocking(sp[1]); if ((p->pid = fork()) == -1) goto err; if (p->pid == 0) { /* child process */ dup2(sp[0], STDIN_FILENO); closefrom(STDERR_FILENO + 1); execv(path, argv); fatal("execv: %s", path); } /* parent process */ close(sp[0]); mproc_init(p, sp[1]); return (0); err: log_warn("warn: Failed to start process %s, instance of %s", argv[0], path); close(sp[0]); close(sp[1]); return (-1); } void mproc_init(struct mproc *p, int fd) { if (imsgbuf_init(&p->imsgbuf, fd) == -1) fatal("mproc_init: imsgbuf_init"); if (p->proc != PROC_CLIENT) imsgbuf_allow_fdpass(&p->imsgbuf); } void mproc_clear(struct mproc *p) { log_debug("debug: clearing p=%s, fd=%d, pid=%d", p->name, p->imsgbuf.fd, p->pid); if (p->events) event_del(&p->ev); close(p->imsgbuf.fd); imsgbuf_clear(&p->imsgbuf); } void mproc_enable(struct mproc *p) { if (p->enable == 0) { log_trace(TRACE_MPROC, "mproc: %s -> %s: enabled", proc_name(smtpd_process), proc_name(p->proc)); p->enable = 1; } mproc_event_add(p); } void mproc_disable(struct mproc *p) { if (p->enable == 1) { log_trace(TRACE_MPROC, "mproc: %s -> %s: disabled", proc_name(smtpd_process), proc_name(p->proc)); p->enable = 0; } mproc_event_add(p); } void mproc_event_add(struct mproc *p) { short events; if (p->enable) events = EV_READ; else events = 0; if (imsgbuf_queuelen(&p->imsgbuf) > 0) events |= EV_WRITE; if (p->events) event_del(&p->ev); p->events = events; if (events) { event_set(&p->ev, p->imsgbuf.fd, events, mproc_dispatch, p); event_add(&p->ev, NULL); } } static void mproc_dispatch(int fd, short event, void *arg) { struct mproc *p = arg; struct imsg imsg; ssize_t n; p->events = 0; if (event & EV_READ) { n = imsgbuf_read(&p->imsgbuf); switch (n) { case -1: log_warn("warn: %s -> %s: imsgbuf_read", proc_name(smtpd_process), p->name); fatal("exiting"); /* NOTREACHED */ case 0: /* this pipe is dead, so remove the event handler */ log_debug("debug: %s -> %s: pipe closed", proc_name(smtpd_process), p->name); p->handler(p, NULL); return; default: break; } } if (event & EV_WRITE) { if (imsgbuf_write(&p->imsgbuf) == -1) { /* this pipe is dead, so remove the event handler */ log_debug("debug: %s -> %s: pipe closed", proc_name(smtpd_process), p->name); p->handler(p, NULL); return; } } for (;;) { if ((n = imsg_get(&p->imsgbuf, &imsg)) == -1) { if (smtpd_process == PROC_CONTROL && p->proc == PROC_CLIENT) { log_warnx("warn: client sent invalid imsg " "over control socket"); p->handler(p, NULL); return; } log_warn("fatal: %s: error in imsg_get for %s", proc_name(smtpd_process), p->name); fatalx(NULL); } if (n == 0) break; p->handler(p, &imsg); imsg_free(&imsg); } mproc_event_add(p); } void m_forward(struct mproc *p, struct imsg *imsg) { imsg_compose(&p->imsgbuf, imsg->hdr.type, imsg->hdr.peerid, imsg->hdr.pid, imsg_get_fd(imsg), imsg->data, imsg->hdr.len - sizeof(imsg->hdr)); if (imsg->hdr.type != IMSG_STAT_DECREMENT && imsg->hdr.type != IMSG_STAT_INCREMENT) log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s (forward)", proc_name(smtpd_process), proc_name(p->proc), imsg->hdr.len - sizeof(imsg->hdr), imsg_to_str(imsg->hdr.type)); mproc_event_add(p); } void m_compose(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd, void *data, size_t len) { imsg_compose(&p->imsgbuf, type, peerid, pid, fd, data, len); if (type != IMSG_STAT_DECREMENT && type != IMSG_STAT_INCREMENT) log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s", proc_name(smtpd_process), proc_name(p->proc), len, imsg_to_str(type)); mproc_event_add(p); } void m_composev(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd, const struct iovec *iov, int n) { size_t len; int i; imsg_composev(&p->imsgbuf, type, peerid, pid, fd, iov, n); len = 0; for (i = 0; i < n; i++) len += iov[i].iov_len; if (type != IMSG_STAT_DECREMENT && type != IMSG_STAT_INCREMENT) log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s", proc_name(smtpd_process), proc_name(p->proc), len, imsg_to_str(type)); mproc_event_add(p); } void m_create(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd) { p->m_pos = 0; p->m_type = type; p->m_peerid = peerid; p->m_pid = pid; p->m_fd = fd; } void m_add(struct mproc *p, const void *data, size_t len) { size_t alloc; void *tmp; if (p->m_pos + len + IMSG_HEADER_SIZE > MAX_IMSGSIZE) { log_warnx("warn: message too large"); fatal(NULL); } alloc = p->m_alloc ? p->m_alloc : 128; while (p->m_pos + len > alloc) alloc *= 2; if (alloc != p->m_alloc) { log_trace(TRACE_MPROC, "mproc: %s -> %s: realloc %zu -> %zu", proc_name(smtpd_process), proc_name(p->proc), p->m_alloc, alloc); tmp = recallocarray(p->m_buf, p->m_alloc, alloc, 1); if (tmp == NULL) fatal("realloc"); p->m_alloc = alloc; p->m_buf = tmp; } memmove(p->m_buf + p->m_pos, data, len); p->m_pos += len; } void m_close(struct mproc *p) { if (imsg_compose(&p->imsgbuf, p->m_type, p->m_peerid, p->m_pid, p->m_fd, p->m_buf, p->m_pos) == -1) fatal("imsg_compose"); log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s", proc_name(smtpd_process), proc_name(p->proc), p->m_pos, imsg_to_str(p->m_type)); mproc_event_add(p); } void m_flush(struct mproc *p) { if (imsg_compose(&p->imsgbuf, p->m_type, p->m_peerid, p->m_pid, p->m_fd, p->m_buf, p->m_pos) == -1) fatal("imsg_compose"); log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s (flush)", proc_name(smtpd_process), proc_name(p->proc), p->m_pos, imsg_to_str(p->m_type)); p->m_pos = 0; if (imsgbuf_flush(&p->imsgbuf) == -1) fatal("imsgbuf_flush"); } static struct imsg * current; static void m_error(const char *error) { char buf[512]; (void)snprintf(buf, sizeof buf, "%s: %s: %s", proc_name(smtpd_process), imsg_to_str(current->hdr.type), error); fatalx("%s", buf); } void m_msg(struct msg *m, struct imsg *imsg) { current = imsg; m->pos = imsg->data; m->end = m->pos + (imsg->hdr.len - sizeof(imsg->hdr)); } void m_end(struct msg *m) { if (m->pos != m->end) m_error("not at msg end"); } int m_is_eom(struct msg *m) { return (m->pos == m->end); } static inline void m_get(struct msg *m, void *dst, size_t sz) { if (sz > MAX_IMSGSIZE || m->end - m->pos < (ssize_t)sz) fatalx("msg too short"); memmove(dst, m->pos, sz); m->pos += sz; } void m_add_int(struct mproc *m, int v) { m_add(m, &v, sizeof(v)); }; void m_add_u32(struct mproc *m, uint32_t u32) { m_add(m, &u32, sizeof(u32)); }; void m_add_size(struct mproc *m, size_t sz) { m_add(m, &sz, sizeof(sz)); }; void m_add_time(struct mproc *m, time_t v) { m_add(m, &v, sizeof(v)); }; void m_add_timeval(struct mproc *m, struct timeval *tv) { m_add(m, tv, sizeof(*tv)); } void m_add_string(struct mproc *m, const char *v) { if (v) { m_add(m, "s", 1); m_add(m, v, strlen(v) + 1); } else m_add(m, "\0", 1); }; void m_add_data(struct mproc *m, const void *v, size_t len) { m_add_size(m, len); m_add(m, v, len); }; void m_add_id(struct mproc *m, uint64_t v) { m_add(m, &v, sizeof(v)); } void m_add_evpid(struct mproc *m, uint64_t v) { m_add(m, &v, sizeof(v)); } void m_add_msgid(struct mproc *m, uint32_t v) { m_add(m, &v, sizeof(v)); } void m_add_sockaddr(struct mproc *m, const struct sockaddr *sa) { m_add_size(m, SA_LEN(sa)); m_add(m, sa, SA_LEN(sa)); } void m_add_mailaddr(struct mproc *m, const struct mailaddr *maddr) { m_add(m, maddr, sizeof(*maddr)); } void m_add_envelope(struct mproc *m, const struct envelope *evp) { char buf[sizeof(*evp)]; envelope_dump_buffer(evp, buf, sizeof(buf)); m_add_evpid(m, evp->id); m_add_string(m, buf); } void m_add_params(struct mproc *m, struct dict *d) { const char *key; char *value; void *iter; if (d == NULL) { m_add_size(m, 0); return; } m_add_size(m, dict_count(d)); iter = NULL; while (dict_iter(d, &iter, &key, (void **)&value)) { m_add_string(m, key); m_add_string(m, value); } } void m_get_int(struct msg *m, int *i) { m_get(m, i, sizeof(*i)); } void m_get_u32(struct msg *m, uint32_t *u32) { m_get(m, u32, sizeof(*u32)); } void m_get_size(struct msg *m, size_t *sz) { m_get(m, sz, sizeof(*sz)); } void m_get_time(struct msg *m, time_t *t) { m_get(m, t, sizeof(*t)); } void m_get_timeval(struct msg *m, struct timeval *tv) { m_get(m, tv, sizeof(*tv)); } void m_get_string(struct msg *m, const char **s) { uint8_t *end; char c; if (m->pos >= m->end) m_error("msg too short"); c = *m->pos++; if (c == '\0') { *s = NULL; return; } if (m->pos >= m->end) m_error("msg too short"); end = memchr(m->pos, 0, m->end - m->pos); if (end == NULL) m_error("unterminated string"); *s = m->pos; m->pos = end + 1; } void m_get_data(struct msg *m, const void **data, size_t *sz) { m_get_size(m, sz); if (*sz == 0) { *data = NULL; return; } if (m->pos + *sz > m->end) m_error("msg too short"); *data = m->pos; m->pos += *sz; } void m_get_evpid(struct msg *m, uint64_t *evpid) { m_get(m, evpid, sizeof(*evpid)); } void m_get_msgid(struct msg *m, uint32_t *msgid) { m_get(m, msgid, sizeof(*msgid)); } void m_get_id(struct msg *m, uint64_t *id) { m_get(m, id, sizeof(*id)); } void m_get_sockaddr(struct msg *m, struct sockaddr *sa) { size_t len; m_get_size(m, &len); m_get(m, sa, len); } void m_get_mailaddr(struct msg *m, struct mailaddr *maddr) { m_get(m, maddr, sizeof(*maddr)); } void m_get_envelope(struct msg *m, struct envelope *evp) { uint64_t evpid; const char *buf; m_get_evpid(m, &evpid); m_get_string(m, &buf); if (buf == NULL) fatalx("empty envelope buffer"); if (!envelope_load_buffer(evp, buf, strlen(buf))) fatalx("failed to retrieve envelope"); evp->id = evpid; } void m_get_params(struct msg *m, struct dict *d) { size_t c; const char *key; const char *value; char *tmp; dict_init(d); m_get_size(m, &c); for (; c; c--) { m_get_string(m, &key); m_get_string(m, &value); if ((tmp = strdup(value)) == NULL) fatal("m_get_params"); dict_set(d, key, tmp); } } void m_clear_params(struct dict *d) { char *value; while (dict_poproot(d, (void **)&value)) free(value); } opensmtpd-7.7.0p0/usr.sbin/smtpd/ssl.c0000644000175000001440000001430614610663500013317 /* $OpenBSD: ssl.c,v 1.100 2023/06/25 08:08:03 op Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008 Reyk Floeter * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include "log.h" #include "ssl.h" static char * ssl_load_file(const char *name, off_t *len, mode_t perm) { struct stat st; off_t size; char *buf = NULL; int fd, saved_errno; char mode[12]; if ((fd = open(name, O_RDONLY)) == -1) return (NULL); if (fstat(fd, &st) != 0) goto fail; if (st.st_uid != 0) { log_warnx("warn: %s: not owned by uid 0", name); errno = EACCES; goto fail; } if (st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO) & ~perm) { strmode(perm, mode); log_warnx("warn: %s: insecure permissions: must be at most %s", name, &mode[1]); errno = EACCES; goto fail; } size = st.st_size; if ((buf = calloc(1, size + 1)) == NULL) goto fail; if (read(fd, buf, size) != size) goto fail; close(fd); *len = size + 1; return (buf); fail: free(buf); saved_errno = errno; close(fd); errno = saved_errno; return (NULL); } #if 0 static int ssl_password_cb(char *buf, int size, int rwflag, void *u) { size_t len; if (u == NULL) { explicit_bzero(buf, size); return (0); } if ((len = strlcpy(buf, u, size)) >= (size_t)size) return (0); return (len); } #endif static int ssl_password_cb(char *buf, int size, int rwflag, void *u) { int ret = 0; size_t len; char *pass; pass = getpass((const char *)u); if (pass == NULL) return 0; len = strlen(pass); if (strlcpy(buf, pass, size) >= (size_t)size) goto end; ret = len; end: if (len) explicit_bzero(pass, len); return ret; } static char * ssl_load_key(const char *name, off_t *len, char *pass, mode_t perm, const char *pkiname) { FILE *fp = NULL; EVP_PKEY *key = NULL; BIO *bio = NULL; long size; char *data, *buf, *filebuf; struct stat st; char mode[12]; char prompt[2048]; /* * Read (possibly) encrypted key from file */ if ((fp = fopen(name, "r")) == NULL) return (NULL); if ((filebuf = malloc_conceal(BUFSIZ)) == NULL) goto fail; setvbuf(fp, filebuf, _IOFBF, BUFSIZ); if (fstat(fileno(fp), &st) != 0) goto fail; if (st.st_uid != 0) { log_warnx("warn: %s: not owned by uid 0", name); errno = EACCES; goto fail; } if (st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO) & ~perm) { strmode(perm, mode); log_warnx("warn: %s: insecure permissions: must be at most %s", name, &mode[1]); errno = EACCES; goto fail; } (void)snprintf(prompt, sizeof prompt, "passphrase for %s: ", pkiname); key = PEM_read_PrivateKey(fp, NULL, ssl_password_cb, prompt); fclose(fp); fp = NULL; freezero(filebuf, BUFSIZ); filebuf = NULL; if (key == NULL) goto fail; /* * Write unencrypted key to memory buffer */ if ((bio = BIO_new(BIO_s_mem())) == NULL) goto fail; if (!PEM_write_bio_PrivateKey(bio, key, NULL, NULL, 0, NULL, NULL)) goto fail; if ((size = BIO_get_mem_data(bio, &data)) <= 0) goto fail; if ((buf = calloc_conceal(1, size + 1)) == NULL) goto fail; memcpy(buf, data, size); BIO_free_all(bio); EVP_PKEY_free(key); *len = (off_t)size + 1; return (buf); fail: ssl_error("ssl_load_key"); BIO_free_all(bio); EVP_PKEY_free(key); if (fp) fclose(fp); freezero(filebuf, BUFSIZ); return (NULL); } int ssl_load_certificate(struct pki *p, const char *pathname) { p->pki_cert = ssl_load_file(pathname, &p->pki_cert_len, 0755); if (p->pki_cert == NULL) return 0; return 1; } int ssl_load_keyfile(struct pki *p, const char *pathname, const char *pkiname) { char pass[1024]; p->pki_key = ssl_load_key(pathname, &p->pki_key_len, pass, 0740, pkiname); if (p->pki_key == NULL) return 0; return 1; } int ssl_load_cafile(struct ca *c, const char *pathname) { c->ca_cert = ssl_load_file(pathname, &c->ca_cert_len, 0755); if (c->ca_cert == NULL) return 0; return 1; } void ssl_error(const char *where) { unsigned long code; char errbuf[128]; for (; (code = ERR_get_error()) != 0 ;) { ERR_error_string_n(code, errbuf, sizeof(errbuf)); log_debug("debug: SSL library error: %s: %s", where, errbuf); } } static void hash_x509(X509 *cert, char *hash, size_t hashlen) { static const char hex[] = "0123456789abcdef"; size_t off; char digest[EVP_MAX_MD_SIZE]; int dlen, i; if (X509_pubkey_digest(cert, EVP_sha256(), digest, &dlen) != 1) fatalx("%s: X509_pubkey_digest failed", __func__); if (hashlen < 2 * dlen + sizeof("SHA256:")) fatalx("%s: hash buffer too small", __func__); off = strlcpy(hash, "SHA256:", hashlen); for (i = 0; i < dlen; i++) { hash[off++] = hex[(digest[i] >> 4) & 0x0f]; hash[off++] = hex[digest[i] & 0x0f]; } hash[off] = 0; } char * ssl_pubkey_hash(const char *buf, off_t len) { #define TLS_CERT_HASH_SIZE 128 BIO *in; X509 *x509 = NULL; char *hash = NULL; if ((in = BIO_new_mem_buf(buf, len)) == NULL) { log_warnx("%s: BIO_new_mem_buf failed", __func__); return NULL; } if ((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)) == NULL) { log_warnx("%s: PEM_read_bio_X509 failed", __func__); goto fail; } if ((hash = malloc(TLS_CERT_HASH_SIZE)) == NULL) { log_warn("%s: malloc", __func__); goto fail; } hash_x509(x509, hash, TLS_CERT_HASH_SIZE); fail: BIO_free(in); if (x509) X509_free(x509); return hash; } opensmtpd-7.7.0p0/usr.sbin/smtpd/srs.c0000644000175000001440000002275414610663500013333 /* $OpenBSD: srs.c,v 1.5 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2019 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" static uint8_t base32[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; static int minrange(uint16_t tref, uint16_t t2, int drift, int mod) { if (tref > drift) { /* t2 must fall in between tref and tref - drift */ if (t2 <= tref && t2>= tref - drift) return 1; } else { /* t2 must fall in between 0 and tref, or wrap */ if (t2 <= tref || t2 >= mod - (drift - tref)) return 1; } return 0; } static int maxrange(uint16_t tref, uint16_t t2, int drift, int mod) { if (tref + drift < 1024) { /* t2 must fall in between tref and tref + drift */ if (t2 >= tref && t2 <= tref + drift) return 1; } else { /* t2 must fall in between tref + drift, or wrap */ if (t2 >= tref || t2 <= (tref + drift) % 1024) return 1; } return 0; } static int timestamp_check_range(uint16_t tref, uint16_t t2) { if (! minrange(tref, t2, env->sc_srs_ttl, 1024) && ! maxrange(tref, t2, 1, 1024)) return 0; return 1; } static const unsigned char * srs_hash(const char *key, const char *value) { SHA_CTX c; static unsigned char md[SHA_DIGEST_LENGTH]; SHA1_Init(&c); SHA1_Update(&c, key, strlen(key)); SHA1_Update(&c, value, strlen(value)); SHA1_Final(md, &c); return md; } static const char * srs0_encode(const char *sender, const char *rcpt_domain) { static char dest[SMTPD_MAXMAILADDRSIZE]; char tmp[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; uint16_t timestamp; int ret; /* compute 10 bits timestamp according to spec */ timestamp = (time(NULL) / (60 * 60 * 24)) % 1024; /* parse sender into user and domain */ if (! text_to_mailaddr(&maddr, sender)) return sender; /* TT==@ */ ret = snprintf(tmp, sizeof tmp, "%c%c=%s=%s@%s", base32[(timestamp>>5) & 0x1F], base32[timestamp & 0x1F], maddr.domain, maddr.user, rcpt_domain); if (ret == -1 || ret >= (int)sizeof tmp) return sender; /* compute HHHH */ base64_encode_rfc3548(srs_hash(env->sc_srs_key, tmp), SHA_DIGEST_LENGTH, md, sizeof md); /* prepend SRS0=HHHH= prefix */ ret = snprintf(dest, sizeof dest, "SRS0=%c%c%c%c=%s", md[0], md[1], md[2], md[3], tmp); if (ret == -1 || ret >= (int)sizeof dest) return sender; return dest; } static const char * srs1_encode_srs0(const char *sender, const char *rcpt_domain) { static char dest[SMTPD_MAXMAILADDRSIZE]; char tmp[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; int ret; /* parse sender into user and domain */ if (! text_to_mailaddr(&maddr, sender)) return sender; /* ==@ */ ret = snprintf(tmp, sizeof tmp, "%s==%s@%s", maddr.domain, maddr.user, rcpt_domain); if (ret == -1 || ret >= (int)sizeof tmp) return sender; /* compute HHHH */ base64_encode_rfc3548(srs_hash(env->sc_srs_key, tmp), SHA_DIGEST_LENGTH, md, sizeof md); /* prepend SRS1=HHHH= prefix */ ret = snprintf(dest, sizeof dest, "SRS1=%c%c%c%c=%s", md[0], md[1], md[2], md[3], tmp); if (ret == -1 || ret >= (int)sizeof dest) return sender; return dest; } static const char * srs1_encode_srs1(const char *sender, const char *rcpt_domain) { static char dest[SMTPD_MAXMAILADDRSIZE]; char tmp[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; int ret; /* parse sender into user and domain */ if (! text_to_mailaddr(&maddr, sender)) return sender; /* @ */ ret = snprintf(tmp, sizeof tmp, "%s@%s", maddr.user, rcpt_domain); if (ret == -1 || ret >= (int)sizeof tmp) return sender; /* sanity check: there's at least room for a checksum * with allowed delimiter =, + or - */ if (strlen(tmp) < 5) return sender; if (tmp[4] != '=' && tmp[4] != '+' && tmp[4] != '-') return sender; /* compute HHHH */ base64_encode_rfc3548(srs_hash(env->sc_srs_key, tmp + 5), SHA_DIGEST_LENGTH, md, sizeof md); /* prepend SRS1=HHHH= prefix skipping previous hops' HHHH */ ret = snprintf(dest, sizeof dest, "SRS1=%c%c%c%c=%s", md[0], md[1], md[2], md[3], tmp + 5); if (ret == -1 || ret >= (int)sizeof dest) return sender; return dest; } const char * srs_encode(const char *sender, const char *rcpt_domain) { if (strncasecmp(sender, "SRS0=", 5) == 0) return srs1_encode_srs0(sender+5, rcpt_domain); if (strncasecmp(sender, "SRS1=", 5) == 0) return srs1_encode_srs1(sender+5, rcpt_domain); return srs0_encode(sender, rcpt_domain); } static const char * srs0_decode(const char *rcpt) { static char dest[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; char *p; uint8_t *idx; int ret; uint16_t timestamp, srs_timestamp; /* sanity check: we have room for a checksum and delimiter */ if (strlen(rcpt) < 5) return NULL; /* compute checksum */ base64_encode_rfc3548(srs_hash(env->sc_srs_key, rcpt+5), SHA_DIGEST_LENGTH, md, sizeof md); /* compare prefix checksum with computed checksum */ if (strncmp(md, rcpt, 4) != 0) { if (env->sc_srs_key_backup == NULL) return NULL; base64_encode_rfc3548(srs_hash(env->sc_srs_key_backup, rcpt+5), SHA_DIGEST_LENGTH, md, sizeof md); if (strncmp(md, rcpt, 4) != 0) return NULL; } rcpt += 5; /* sanity check: we have room for a timestamp and delimiter */ if (strlen(rcpt) < 3) return NULL; /* decode timestamp */ if ((idx = strchr(base32, rcpt[0])) == NULL) return NULL; srs_timestamp = ((idx - base32) << 5); if ((idx = strchr(base32, rcpt[1])) == NULL) return NULL; srs_timestamp |= (idx - base32); rcpt += 3; /* compute current 10 bits timestamp */ timestamp = (time(NULL) / (60 * 60 * 24)) % 1024; /* check that SRS timestamp isn't too far from current */ if (timestamp != srs_timestamp) if (! timestamp_check_range(timestamp, srs_timestamp)) return NULL; if (! text_to_mailaddr(&maddr, rcpt)) return NULL; /* sanity check: we have at least one SRS separator */ if ((p = strchr(maddr.user, '=')) == NULL) return NULL; *p++ = '\0'; /* maddr.user holds "domain\0user", with p pointing at user */ ret = snprintf(dest, sizeof dest, "%s@%s", p, maddr.user); if (ret == -1 || ret >= (int)sizeof dest) return NULL; return dest; } static const char * srs1_decode(const char *rcpt) { static char dest[SMTPD_MAXMAILADDRSIZE]; char md[SHA_DIGEST_LENGTH*4+1]; struct mailaddr maddr; char *p; uint8_t *idx; int ret; uint16_t timestamp, srs_timestamp; /* sanity check: we have room for a checksum and delimiter */ if (strlen(rcpt) < 5) return NULL; /* compute checksum */ base64_encode_rfc3548(srs_hash(env->sc_srs_key, rcpt+5), SHA_DIGEST_LENGTH, md, sizeof md); /* compare prefix checksum with computed checksum */ if (strncmp(md, rcpt, 4) != 0) { if (env->sc_srs_key_backup == NULL) return NULL; base64_encode_rfc3548(srs_hash(env->sc_srs_key_backup, rcpt+5), SHA_DIGEST_LENGTH, md, sizeof md); if (strncmp(md, rcpt, 4) != 0) return NULL; } rcpt += 5; if (! text_to_mailaddr(&maddr, rcpt)) return NULL; /* sanity check: we have at least one SRS separator */ if ((p = strchr(maddr.user, '=')) == NULL) return NULL; *p++ = '\0'; /* maddr.user holds "domain\0user", with p pointing at user */ ret = snprintf(dest, sizeof dest, "SRS0%s@%s", p, maddr.user); if (ret == -1 || ret >= (int)sizeof dest) return NULL; /* we're ready to return decoded address, but let's check if * SRS0 timestamp is valid. */ /* first, get rid of SRS0 checksum (=HHHH=), we can't check it */ if (strlen(p) < 6) return NULL; p += 6; /* we should be pointing to a timestamp, check that we're indeed */ if (strlen(p) < 3) return NULL; if (p[2] != '=' && p[2] != '+' && p[2] != '-') return NULL; p[2] = '\0'; if ((idx = strchr(base32, p[0])) == NULL) return NULL; srs_timestamp = ((idx - base32) << 5); if ((idx = strchr(base32, p[1])) == NULL) return NULL; srs_timestamp |= (idx - base32); /* compute current 10 bits timestamp */ timestamp = (time(NULL) / (60 * 60 * 24)) % 1024; /* check that SRS timestamp isn't too far from current */ if (timestamp != srs_timestamp) if (! timestamp_check_range(timestamp, srs_timestamp)) return NULL; return dest; } const char * srs_decode(const char *rcpt) { if (strncasecmp(rcpt, "SRS0=", 5) == 0) return srs0_decode(rcpt + 5); if (strncasecmp(rcpt, "SRS1=", 5) == 0) return srs1_decode(rcpt + 5); return NULL; } opensmtpd-7.7.0p0/usr.sbin/smtpd/scheduler_null.c0000644000175000001440000000674214610663500015533 /* $OpenBSD: scheduler_null.c,v 1.11 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" static int scheduler_null_init(const char *); static int scheduler_null_insert(struct scheduler_info *); static size_t scheduler_null_commit(uint32_t); static size_t scheduler_null_rollback(uint32_t); static int scheduler_null_update(struct scheduler_info *); static int scheduler_null_delete(uint64_t); static int scheduler_null_hold(uint64_t, uint64_t); static int scheduler_null_release(int, uint64_t, int); static int scheduler_null_batch(int, int*, size_t*, uint64_t*, int*); static size_t scheduler_null_messages(uint32_t, uint32_t *, size_t); static size_t scheduler_null_envelopes(uint64_t, struct evpstate *, size_t); static int scheduler_null_schedule(uint64_t); static int scheduler_null_remove(uint64_t); static int scheduler_null_suspend(uint64_t); static int scheduler_null_resume(uint64_t); struct scheduler_backend scheduler_backend_null = { scheduler_null_init, scheduler_null_insert, scheduler_null_commit, scheduler_null_rollback, scheduler_null_update, scheduler_null_delete, scheduler_null_hold, scheduler_null_release, scheduler_null_batch, scheduler_null_messages, scheduler_null_envelopes, scheduler_null_schedule, scheduler_null_remove, scheduler_null_suspend, scheduler_null_resume, }; static int scheduler_null_init(const char *arg) { return (1); } static int scheduler_null_insert(struct scheduler_info *si) { return (0); } static size_t scheduler_null_commit(uint32_t msgid) { return (0); } static size_t scheduler_null_rollback(uint32_t msgid) { return (0); } static int scheduler_null_update(struct scheduler_info *si) { return (0); } static int scheduler_null_delete(uint64_t evpid) { return (0); } static int scheduler_null_hold(uint64_t evpid, uint64_t holdq) { return (0); } static int scheduler_null_release(int type, uint64_t holdq, int n) { return (0); } static int scheduler_null_batch(int typemask, int *delay, size_t *count, uint64_t *evpids, int *types) { *delay = 0; return (0); } static int scheduler_null_schedule(uint64_t evpid) { return (0); } static int scheduler_null_remove(uint64_t evpid) { return (0); } static int scheduler_null_suspend(uint64_t evpid) { return (0); } static int scheduler_null_resume(uint64_t evpid) { return (0); } static size_t scheduler_null_messages(uint32_t from, uint32_t *dst, size_t size) { return (0); } static size_t scheduler_null_envelopes(uint64_t from, struct evpstate *dst, size_t size) { return (0); } opensmtpd-7.7.0p0/usr.sbin/smtpd/report_smtp.c0000644000175000001440000001720214610663500015072 /* $OpenBSD: report_smtp.c,v 1.12 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2018 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #else #include "bsd-vis.h" #endif #include "smtpd.h" void report_smtp_link_connect(const char *direction, uint64_t qid, const char *rdns, int fcrdns, const struct sockaddr_storage *ss_src, const struct sockaddr_storage *ss_dest) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_CONNECT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, rdns); m_add_int(p_lka, fcrdns); m_add_sockaddr(p_lka, (const struct sockaddr *)ss_src); m_add_sockaddr(p_lka, (const struct sockaddr *)ss_dest); m_close(p_lka); } void report_smtp_link_greeting(const char *direction, uint64_t qid, const char *domain) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_GREETING, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, domain); m_close(p_lka); } void report_smtp_link_identify(const char *direction, uint64_t qid, const char *method, const char *identity) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_IDENTIFY, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, method); m_add_string(p_lka, identity); m_close(p_lka); } void report_smtp_link_tls(const char *direction, uint64_t qid, const char *ssl) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_TLS, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, ssl); m_close(p_lka); } void report_smtp_link_disconnect(const char *direction, uint64_t qid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_DISCONNECT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_close(p_lka); } void report_smtp_link_auth(const char *direction, uint64_t qid, const char *user, const char *result) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_LINK_AUTH, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, user); m_add_string(p_lka, result); m_close(p_lka); } void report_smtp_tx_reset(const char *direction, uint64_t qid, uint32_t msgid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_RESET, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_close(p_lka); } void report_smtp_tx_begin(const char *direction, uint64_t qid, uint32_t msgid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_BEGIN, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_close(p_lka); } void report_smtp_tx_mail(const char *direction, uint64_t qid, uint32_t msgid, const char *address, int ok) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_MAIL, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_add_string(p_lka, address); m_add_int(p_lka, ok); m_close(p_lka); } void report_smtp_tx_rcpt(const char *direction, uint64_t qid, uint32_t msgid, const char *address, int ok) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_RCPT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_add_string(p_lka, address); m_add_int(p_lka, ok); m_close(p_lka); } void report_smtp_tx_envelope(const char *direction, uint64_t qid, uint32_t msgid, uint64_t evpid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_ENVELOPE, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_add_id(p_lka, evpid); m_close(p_lka); } void report_smtp_tx_data(const char *direction, uint64_t qid, uint32_t msgid, int ok) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_DATA, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_add_int(p_lka, ok); m_close(p_lka); } void report_smtp_tx_commit(const char *direction, uint64_t qid, uint32_t msgid, size_t msgsz) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_COMMIT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_add_size(p_lka, msgsz); m_close(p_lka); } void report_smtp_tx_rollback(const char *direction, uint64_t qid, uint32_t msgid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TX_ROLLBACK, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_u32(p_lka, msgid); m_close(p_lka); } void report_smtp_protocol_client(const char *direction, uint64_t qid, const char *command) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_PROTOCOL_CLIENT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, command); m_close(p_lka); } void report_smtp_protocol_server(const char *direction, uint64_t qid, const char *response) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_PROTOCOL_SERVER, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_string(p_lka, response); m_close(p_lka); } void report_smtp_filter_response(const char *direction, uint64_t qid, int phase, int response, const char *param) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_FILTER_RESPONSE, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_add_int(p_lka, phase); m_add_int(p_lka, response); m_add_string(p_lka, param); m_close(p_lka); } void report_smtp_timeout(const char *direction, uint64_t qid) { struct timeval tv; gettimeofday(&tv, NULL); m_create(p_lka, IMSG_REPORT_SMTP_TIMEOUT, 0, 0, -1); m_add_string(p_lka, direction); m_add_timeval(p_lka, &tv); m_add_id(p_lka, qid); m_close(p_lka); } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpctl.c0000644000175000001440000007532715007615667014232 /* $OpenBSD: smtpctl.c,v 1.176 2024/11/21 13:42:22 claudio Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2006 Gilles Chehade * Copyright (c) 2006 Pierre-Yves Ritschard * Copyright (c) 2005 Claudio Jeker * Copyright (c) 2004, 2005 Esben Norby * Copyright (c) 2003 Henning Brauer * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include /* #include */ /* #include */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #else #include "bsd-vis.h" #endif #include #include "smtpd.h" #include "parser.h" #include "log.h" #ifndef PATH_GZCAT #define PATH_GZCAT "/usr/bin/gzcat" #endif #define PATH_CAT "/bin/cat" #define PATH_QUEUE "/queue" #ifndef PATH_ENCRYPT #define PATH_ENCRYPT "/usr/bin/encrypt" #endif #ifndef HAVE_DB_API #define makemap(x, y, z) 1 #endif int srv_connect(void); int srv_connected(void); void usage(void); static void show_queue_envelope(struct envelope *, int); static void getflag(uint *, int, char *, char *, size_t); static void display(const char *); static int str_to_trace(const char *); static int str_to_profile(const char *); static void show_offline_envelope(uint64_t); static int is_gzip_fp(FILE *); static int is_encrypted_fp(FILE *); static int is_encrypted_buffer(const char *); static int is_gzip_buffer(const char *); static FILE *offline_file(void); static void sendmail_compat(int, char **); extern int spfwalk(int, struct parameter *); extern char *__progname; int sendmail; struct smtpd *env; struct imsgbuf *ibuf; struct imsg imsg; char *rdata; size_t rlen; time_t now; struct queue_backend queue_backend_null; struct queue_backend queue_backend_proc; struct queue_backend queue_backend_ram; __dead void usage(void) { if (sendmail) fprintf(stderr, "usage: %s [-tv] [-f from] [-F name] to ...\n", __progname); else fprintf(stderr, "usage: %s command [argument ...]\n", __progname); exit(1); } void stat_increment(const char *k, size_t v) { } void stat_decrement(const char *k, size_t v) { } int srv_connect(void) { struct sockaddr_un s_un; int ctl_sock, saved_errno; /* connect to smtpd control socket */ if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "socket"); memset(&s_un, 0, sizeof(s_un)); s_un.sun_family = AF_UNIX; (void)strlcpy(s_un.sun_path, SMTPD_SOCKET, sizeof(s_un.sun_path)); if (connect(ctl_sock, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { saved_errno = errno; close(ctl_sock); errno = saved_errno; return (0); } ibuf = xcalloc(1, sizeof(struct imsgbuf)); if (imsgbuf_init(ibuf, ctl_sock) == -1) err(1, "imsgbuf_init"); imsgbuf_allow_fdpass(ibuf); return (1); } int srv_connected(void) { return ibuf != NULL ? 1 : 0; } FILE * offline_file(void) { char path[PATH_MAX]; int fd; FILE *fp; if (!bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL, PATH_OFFLINE, (long long)time(NULL))) err(EX_UNAVAILABLE, "snprintf"); if ((fd = mkstemp(path)) == -1 || (fp = fdopen(fd, "w+")) == NULL) { if (fd != -1) unlink(path); err(EX_UNAVAILABLE, "cannot create temporary file %s", path); } if (fchmod(fd, 0600) == -1) { unlink(path); err(EX_SOFTWARE, "fchmod"); } return fp; } static void srv_flush(void) { if (imsgbuf_flush(ibuf) == -1) err(1, "write error"); } static void srv_send(int msg, const void *data, size_t len) { if (ibuf == NULL && !srv_connect()) errx(1, "smtpd doesn't seem to be running"); imsg_compose(ibuf, msg, IMSG_VERSION, 0, -1, data, len); } static void srv_recv(int type) { ssize_t n; srv_flush(); while (1) { if ((n = imsg_get(ibuf, &imsg)) == -1) errx(1, "imsg_get error"); if (n) { if (imsg.hdr.type == IMSG_CTL_FAIL && imsg.hdr.peerid != 0 && imsg.hdr.peerid != IMSG_VERSION) errx(1, "incompatible smtpctl and smtpd"); if (type != -1 && type != (int)imsg.hdr.type) errx(1, "bad message type"); rdata = imsg.data; rlen = imsg.hdr.len - sizeof(imsg.hdr); break; } if ((n = imsgbuf_read(ibuf)) == -1) err(1, "read error"); if (n == 0) errx(1, "pipe closed"); } } static void srv_read(void *dst, size_t sz) { if (sz == 0) return; if (rlen < sz) errx(1, "message too short"); if (dst) memmove(dst, rdata, sz); rlen -= sz; rdata += sz; } static void srv_get_int(int *i) { srv_read(i, sizeof(*i)); } static void srv_get_time(time_t *t) { srv_read(t, sizeof(*t)); } static void srv_get_evpid(uint64_t *evpid) { srv_read(evpid, sizeof(*evpid)); } static void srv_get_string(const char **s) { const char *end; size_t len; if (rlen == 0) errx(1, "message too short"); rlen -= 1; if (*rdata++ == '\0') { *s = NULL; return; } if (rlen == 0) errx(1, "bogus string"); end = memchr(rdata, 0, rlen); if (end == NULL) errx(1, "unterminated string"); len = end + 1 - rdata; *s = rdata; rlen -= len; rdata += len; } static void srv_get_envelope(struct envelope *evp) { uint64_t evpid; const char *str; srv_get_evpid(&evpid); srv_get_string(&str); envelope_load_buffer(evp, str, strlen(str)); evp->id = evpid; } static void srv_end(void) { if (rlen) errx(1, "bogus data"); imsg_free(&imsg); } static int srv_check_result(int verbose_) { srv_recv(-1); srv_end(); switch (imsg.hdr.type) { case IMSG_CTL_OK: if (verbose_) printf("command succeeded\n"); return (0); case IMSG_CTL_FAIL: if (verbose_) { if (rlen) printf("command failed: %s\n", rdata); else printf("command failed\n"); } return (1); default: errx(1, "wrong message in response: %u", imsg.hdr.type); } return (0); } static int srv_iter_messages(uint32_t *res) { static uint32_t *msgids = NULL, from = 0; static size_t n, curr; static int done = 0; if (done) return (0); if (msgids == NULL) { srv_send(IMSG_CTL_LIST_MESSAGES, &from, sizeof(from)); srv_recv(IMSG_CTL_LIST_MESSAGES); if (rlen == 0) { srv_end(); done = 1; return (0); } msgids = malloc(rlen); n = rlen / sizeof(*msgids); srv_read(msgids, rlen); srv_end(); curr = 0; from = msgids[n - 1] + 1; if (from == 0) done = 1; } *res = msgids[curr++]; if (curr == n) { free(msgids); msgids = NULL; } return (1); } static int srv_iter_envelopes(uint32_t msgid, struct envelope *evp) { static uint32_t currmsgid = 0; static uint64_t from = 0; static int done = 0, need_send = 1, found; int flags; time_t nexttry; if (currmsgid != msgid) { if (currmsgid != 0 && !done) errx(1, "must finish current iteration first"); currmsgid = msgid; from = msgid_to_evpid(msgid); done = 0; found = 0; need_send = 1; } if (done) return (0); again: if (need_send) { found = 0; srv_send(IMSG_CTL_LIST_ENVELOPES, &from, sizeof(from)); } need_send = 0; srv_recv(IMSG_CTL_LIST_ENVELOPES); if (rlen == 0) { srv_end(); if (!found || evpid_to_msgid(from) != msgid) { done = 1; return (0); } need_send = 1; goto again; } srv_get_int(&flags); srv_get_time(&nexttry); srv_get_envelope(evp); srv_end(); evp->flags |= flags; evp->nexttry = nexttry; from = evp->id + 1; found++; return (1); } static int srv_iter_evpids(uint32_t msgid, uint64_t *evpid, int *offset) { static uint64_t *evpids = NULL, *tmp; static int n, tmpalloc, alloc = 0; struct envelope evp; if (*offset == 0) { n = 0; while (srv_iter_envelopes(msgid, &evp)) { if (n == alloc) { tmpalloc = alloc ? (alloc * 2) : 128; tmp = recallocarray(evpids, alloc, tmpalloc, sizeof(*evpids)); if (tmp == NULL) err(1, "recallocarray"); evpids = tmp; alloc = tmpalloc; } evpids[n++] = evp.id; } } if (*offset >= n) return (0); *evpid = evpids[*offset]; *offset += 1; return (1); } static void srv_foreach_envelope(struct parameter *argv, int ctl, size_t *total, size_t *ok) { uint32_t msgid; uint64_t evpid; int i; *total = 0; *ok = 0; if (argv == NULL) { while (srv_iter_messages(&msgid)) { i = 0; while (srv_iter_evpids(msgid, &evpid, &i)) { *total += 1; srv_send(ctl, &evpid, sizeof(evpid)); if (srv_check_result(0) == 0) *ok += 1; } } } else if (argv->type == P_MSGID) { i = 0; while (srv_iter_evpids(argv->u.u_msgid, &evpid, &i)) { srv_send(ctl, &evpid, sizeof(evpid)); if (srv_check_result(0) == 0) *ok += 1; } } else { *total += 1; srv_send(ctl, &argv->u.u_evpid, sizeof(evpid)); if (srv_check_result(0) == 0) *ok += 1; } } static void srv_show_cmd(int cmd, const void *data, size_t len) { int done = 0; srv_send(cmd, data, len); do { srv_recv(cmd); if (rlen) { printf("%s\n", rdata); srv_read(NULL, rlen); } else done = 1; srv_end(); } while (!done); } static void droppriv(void) { struct passwd *pw; if (geteuid()) return; if ((pw = getpwnam(SMTPD_USER)) == NULL) errx(1, "unknown user " SMTPD_USER); if ((setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))) err(1, "cannot drop privileges"); } static int do_permission_denied(int argc, struct parameter *argv) { errx(1, "need root privileges"); } static int do_log_brief(int argc, struct parameter *argv) { int v = 0; srv_send(IMSG_CTL_VERBOSE, &v, sizeof(v)); return srv_check_result(1); } static int do_log_verbose(int argc, struct parameter *argv) { int v = TRACE_DEBUG; srv_send(IMSG_CTL_VERBOSE, &v, sizeof(v)); return srv_check_result(1); } static int do_monitor(int argc, struct parameter *argv) { struct stat_digest last, digest; size_t count; memset(&last, 0, sizeof(last)); count = 0; while (1) { srv_send(IMSG_CTL_GET_DIGEST, NULL, 0); srv_recv(IMSG_CTL_GET_DIGEST); srv_read(&digest, sizeof(digest)); srv_end(); if (count % 25 == 0) { if (count != 0) printf("\n"); printf("--- client --- " "-- envelope -- " "---- relay/delivery --- " "------- misc -------\n" "curr conn disc " "curr enq deq " "ok tmpfail prmfail loop " "expire remove bounce\n"); } printf("%4zu %4zu %4zu " "%4zu %4zu %4zu " "%4zu %4zu %4zu %4zu " "%4zu %4zu %4zu\n", digest.clt_connect - digest.clt_disconnect, digest.clt_connect - last.clt_connect, digest.clt_disconnect - last.clt_disconnect, digest.evp_enqueued - digest.evp_dequeued, digest.evp_enqueued - last.evp_enqueued, digest.evp_dequeued - last.evp_dequeued, digest.dlv_ok - last.dlv_ok, digest.dlv_tempfail - last.dlv_tempfail, digest.dlv_permfail - last.dlv_permfail, digest.dlv_loop - last.dlv_loop, digest.evp_expired - last.evp_expired, digest.evp_removed - last.evp_removed, digest.evp_bounce - last.evp_bounce); last = digest; count++; sleep(1); } return (0); } static int do_pause_envelope(int argc, struct parameter *argv) { size_t total, ok; srv_foreach_envelope(argv, IMSG_CTL_PAUSE_EVP, &total, &ok); printf("%zu envelope%s paused\n", ok, (ok > 1) ? "s" : ""); return (0); } static int do_pause_mda(int argc, struct parameter *argv) { srv_send(IMSG_CTL_PAUSE_MDA, NULL, 0); return srv_check_result(1); } static int do_pause_mta(int argc, struct parameter *argv) { srv_send(IMSG_CTL_PAUSE_MTA, NULL, 0); return srv_check_result(1); } static int do_pause_smtp(int argc, struct parameter *argv) { srv_send(IMSG_CTL_PAUSE_SMTP, NULL, 0); return srv_check_result(1); } static int do_profile(int argc, struct parameter *argv) { int v; v = str_to_profile(argv[0].u.u_str); srv_send(IMSG_CTL_PROFILE_ENABLE, &v, sizeof(v)); return srv_check_result(1); } static int do_remove(int argc, struct parameter *argv) { size_t total, ok; srv_foreach_envelope(argv, IMSG_CTL_REMOVE, &total, &ok); printf("%zu envelope%s removed\n", ok, (ok > 1) ? "s" : ""); return (0); } static int do_resume_envelope(int argc, struct parameter *argv) { size_t total, ok; srv_foreach_envelope(argv, IMSG_CTL_RESUME_EVP, &total, &ok); printf("%zu envelope%s resumed\n", ok, (ok > 1) ? "s" : ""); return (0); } static int do_resume_mda(int argc, struct parameter *argv) { srv_send(IMSG_CTL_RESUME_MDA, NULL, 0); return srv_check_result(1); } static int do_resume_mta(int argc, struct parameter *argv) { srv_send(IMSG_CTL_RESUME_MTA, NULL, 0); return srv_check_result(1); } static int do_resume_route(int argc, struct parameter *argv) { uint64_t v; if (argc == 0) v = 0; else v = argv[0].u.u_routeid; srv_send(IMSG_CTL_RESUME_ROUTE, &v, sizeof(v)); return srv_check_result(1); } static int do_resume_smtp(int argc, struct parameter *argv) { srv_send(IMSG_CTL_RESUME_SMTP, NULL, 0); return srv_check_result(1); } static int do_schedule(int argc, struct parameter *argv) { size_t total, ok; srv_foreach_envelope(argv, IMSG_CTL_SCHEDULE, &total, &ok); printf("%zu envelope%s scheduled\n", ok, (ok > 1) ? "s" : ""); return (0); } static int do_show_envelope(int argc, struct parameter *argv) { char buf[PATH_MAX]; if (!bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/%016" PRIx64, PATH_SPOOL, PATH_QUEUE, (evpid_to_msgid(argv[0].u.u_evpid) & 0xff000000) >> 24, evpid_to_msgid(argv[0].u.u_evpid), argv[0].u.u_evpid)) errx(1, "unable to retrieve envelope"); display(buf); return (0); } static int do_show_hoststats(int argc, struct parameter *argv) { srv_show_cmd(IMSG_CTL_MTA_SHOW_HOSTSTATS, NULL, 0); return (0); } static int do_show_message(int argc, struct parameter *argv) { char buf[PATH_MAX]; uint32_t msgid; if (argv[0].type == P_EVPID) msgid = evpid_to_msgid(argv[0].u.u_evpid); else msgid = argv[0].u.u_msgid; if (!bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/message", PATH_SPOOL, PATH_QUEUE, (msgid & 0xff000000) >> 24, msgid)) errx(1, "unable to retrieve message"); display(buf); return (0); } static int do_show_queue(int argc, struct parameter *argv) { struct envelope evp; uint32_t msgid; FTS *fts; FTSENT *ftse; char *qpath[] = {"/queue", NULL}; char *tmp; uint64_t evpid; now = time(NULL); if (!srv_connect()) { queue_init("fs", 0); if (chroot(PATH_SPOOL) == -1 || chdir("/") == -1) err(1, "%s", PATH_SPOOL); fts = fts_open(qpath, FTS_PHYSICAL|FTS_NOCHDIR, NULL); if (fts == NULL) err(1, "%s/queue", PATH_SPOOL); while ((ftse = fts_read(fts)) != NULL) { switch (ftse->fts_info) { case FTS_DP: case FTS_DNR: break; case FTS_F: tmp = NULL; evpid = strtoull(ftse->fts_name, &tmp, 16); if (tmp && *tmp != '\0') break; show_offline_envelope(evpid); } } fts_close(fts); return (0); } if (argc == 0) { msgid = 0; while (srv_iter_messages(&msgid)) while (srv_iter_envelopes(msgid, &evp)) show_queue_envelope(&evp, 1); } else if (argv[0].type == P_MSGID) { while (srv_iter_envelopes(argv[0].u.u_msgid, &evp)) show_queue_envelope(&evp, 1); } return (0); } static int do_show_hosts(int argc, struct parameter *argv) { srv_show_cmd(IMSG_CTL_MTA_SHOW_HOSTS, NULL, 0); return (0); } static int do_show_relays(int argc, struct parameter *argv) { srv_show_cmd(IMSG_CTL_MTA_SHOW_RELAYS, NULL, 0); return (0); } static int do_show_routes(int argc, struct parameter *argv) { srv_show_cmd(IMSG_CTL_MTA_SHOW_ROUTES, NULL, 0); return (0); } static int do_show_stats(int argc, struct parameter *argv) { struct stat_kv kv; time_t duration; memset(&kv, 0, sizeof kv); while (1) { srv_send(IMSG_CTL_GET_STATS, &kv, sizeof kv); srv_recv(IMSG_CTL_GET_STATS); srv_read(&kv, sizeof(kv)); srv_end(); if (kv.iter == NULL) break; if (strcmp(kv.key, "uptime") == 0) { duration = time(NULL) - kv.val.u.counter; printf("uptime=%lld\n", (long long)duration); printf("uptime.human=%s\n", duration_to_text(duration)); } else { switch (kv.val.type) { case STAT_COUNTER: printf("%s=%zd\n", kv.key, kv.val.u.counter); break; case STAT_TIMESTAMP: printf("%s=%" PRId64 "\n", kv.key, (int64_t)kv.val.u.timestamp); break; case STAT_TIMEVAL: printf("%s=%lld.%lld\n", kv.key, (long long)kv.val.u.tv.tv_sec, (long long)kv.val.u.tv.tv_usec); break; case STAT_TIMESPEC: printf("%s=%lld.%06ld\n", kv.key, (long long)kv.val.u.ts.tv_sec * 1000000 + kv.val.u.ts.tv_nsec / 1000000, kv.val.u.ts.tv_nsec % 1000000); break; } } } return (0); } static int do_show_status(int argc, struct parameter *argv) { uint32_t sc_flags; srv_send(IMSG_CTL_SHOW_STATUS, NULL, 0); srv_recv(IMSG_CTL_SHOW_STATUS); srv_read(&sc_flags, sizeof(sc_flags)); srv_end(); printf("MDA %s\n", (sc_flags & SMTPD_MDA_PAUSED) ? "paused" : "running"); printf("MTA %s\n", (sc_flags & SMTPD_MTA_PAUSED) ? "paused" : "running"); printf("SMTP %s\n", (sc_flags & SMTPD_SMTP_PAUSED) ? "paused" : "running"); return (0); } static int do_trace(int argc, struct parameter *argv) { int v; v = str_to_trace(argv[0].u.u_str); srv_send(IMSG_CTL_TRACE_ENABLE, &v, sizeof(v)); return srv_check_result(1); } static int do_unprofile(int argc, struct parameter *argv) { int v; v = str_to_profile(argv[0].u.u_str); srv_send(IMSG_CTL_PROFILE_DISABLE, &v, sizeof(v)); return srv_check_result(1); } static int do_untrace(int argc, struct parameter *argv) { int v; v = str_to_trace(argv[0].u.u_str); srv_send(IMSG_CTL_TRACE_DISABLE, &v, sizeof(v)); return srv_check_result(1); } static int do_update_table(int argc, struct parameter *argv) { const char *name = argv[0].u.u_str; srv_send(IMSG_CTL_UPDATE_TABLE, name, strlen(name) + 1); return srv_check_result(1); } static int do_encrypt(int argc, struct parameter *argv) { const char *p = NULL; droppriv(); if (argv) p = argv[0].u.u_str; execl(PATH_ENCRYPT, "encrypt", p, (char *)NULL); errx(1, "execl"); } static int do_block_mta(int argc, struct parameter *argv) { struct ibuf *m; if (ibuf == NULL && !srv_connect()) errx(1, "smtpd doesn't seem to be running"); m = imsg_create(ibuf, IMSG_CTL_MTA_BLOCK, IMSG_VERSION, 0, sizeof(argv[0].u.u_ss) + strlen(argv[1].u.u_str) + 1); if (imsg_add(m, &argv[0].u.u_ss, sizeof(argv[0].u.u_ss)) == -1) errx(1, "imsg_add"); if (imsg_add(m, argv[1].u.u_str, strlen(argv[1].u.u_str) + 1) == -1) errx(1, "imsg_add"); imsg_close(ibuf, m); return srv_check_result(1); } static int do_unblock_mta(int argc, struct parameter *argv) { struct ibuf *m; if (ibuf == NULL && !srv_connect()) errx(1, "smtpd doesn't seem to be running"); m = imsg_create(ibuf, IMSG_CTL_MTA_UNBLOCK, IMSG_VERSION, 0, sizeof(argv[0].u.u_ss) + strlen(argv[1].u.u_str) + 1); if (imsg_add(m, &argv[0].u.u_ss, sizeof(argv[0].u.u_ss)) == -1) errx(1, "imsg_add"); if (imsg_add(m, argv[1].u.u_str, strlen(argv[1].u.u_str) + 1) == -1) errx(1, "imsg_add"); imsg_close(ibuf, m); return srv_check_result(1); } static int do_show_mta_block(int argc, struct parameter *argv) { srv_show_cmd(IMSG_CTL_MTA_SHOW_BLOCK, NULL, 0); return (0); } static int do_discover(int argc, struct parameter *argv) { uint64_t evpid; uint32_t msgid; size_t n_evp; if (ibuf == NULL && !srv_connect()) errx(1, "smtpd doesn't seem to be running"); if (argv[0].type == P_EVPID) { evpid = argv[0].u.u_evpid; srv_send(IMSG_CTL_DISCOVER_EVPID, &evpid, sizeof evpid); srv_recv(IMSG_CTL_DISCOVER_EVPID); } else { msgid = argv[0].u.u_msgid; srv_send(IMSG_CTL_DISCOVER_MSGID, &msgid, sizeof msgid); srv_recv(IMSG_CTL_DISCOVER_MSGID); } if (rlen == 0) { srv_end(); return (0); } else { srv_read(&n_evp, sizeof n_evp); srv_end(); } printf("%zu envelope%s discovered\n", n_evp, (n_evp != 1) ? "s" : ""); return (0); } static int do_spf_walk(int argc, struct parameter *argv) { droppriv(); return spfwalk(argc, argv); } #define cmd_install_priv(s, f) \ cmd_install((s), privileged ? (f) : do_permission_denied) int main(int argc, char **argv) { gid_t gid; struct group *gr; int privileged; char *argv_mailq[] = { "show", "queue", NULL }; #ifndef HAVE___PROGNAME __progname = get_progname(argv[0]); #endif /* check that smtpctl was installed setgid */ if ((gr = getgrnam(SMTPD_QUEUE_GROUP)) == NULL) errx(1, "unknown group %s", SMTPD_QUEUE_GROUP); else if (gr->gr_gid != getegid()) errx(1, "this program must be setgid %s", SMTPD_QUEUE_GROUP); log_init(1, LOG_MAIL); sendmail_compat(argc, argv); privileged = geteuid() == 0; gid = getgid(); if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); /* Privileged commands */ cmd_install_priv("discover ", do_discover); cmd_install_priv("discover ", do_discover); cmd_install_priv("pause mta from for ", do_block_mta); cmd_install_priv("resume mta from for ", do_unblock_mta); cmd_install_priv("show mta paused", do_show_mta_block); cmd_install_priv("log brief", do_log_brief); cmd_install_priv("log verbose", do_log_verbose); cmd_install_priv("monitor", do_monitor); cmd_install_priv("pause envelope ", do_pause_envelope); cmd_install_priv("pause envelope ", do_pause_envelope); cmd_install_priv("pause envelope all", do_pause_envelope); cmd_install_priv("pause mda", do_pause_mda); cmd_install_priv("pause mta", do_pause_mta); cmd_install_priv("pause smtp", do_pause_smtp); cmd_install_priv("profile ", do_profile); cmd_install_priv("remove ", do_remove); cmd_install_priv("remove ", do_remove); cmd_install_priv("remove all", do_remove); cmd_install_priv("resume envelope ", do_resume_envelope); cmd_install_priv("resume envelope ", do_resume_envelope); cmd_install_priv("resume envelope all", do_resume_envelope); cmd_install_priv("resume mda", do_resume_mda); cmd_install_priv("resume mta", do_resume_mta); cmd_install_priv("resume route ", do_resume_route); cmd_install_priv("resume smtp", do_resume_smtp); cmd_install_priv("schedule ", do_schedule); cmd_install_priv("schedule ", do_schedule); cmd_install_priv("schedule all", do_schedule); cmd_install_priv("show envelope ", do_show_envelope); cmd_install_priv("show hoststats", do_show_hoststats); cmd_install_priv("show message ", do_show_message); cmd_install_priv("show message ", do_show_message); cmd_install_priv("show queue", do_show_queue); cmd_install_priv("show queue ", do_show_queue); cmd_install_priv("show hosts", do_show_hosts); cmd_install_priv("show relays", do_show_relays); cmd_install_priv("show routes", do_show_routes); cmd_install_priv("show stats", do_show_stats); cmd_install_priv("show status", do_show_status); cmd_install_priv("trace ", do_trace); cmd_install_priv("unprofile ", do_unprofile); cmd_install_priv("untrace ", do_untrace); cmd_install_priv("update table ", do_update_table); /* Unprivileged commands */ cmd_install("encrypt", do_encrypt); cmd_install("encrypt ", do_encrypt); cmd_install("spf walk", do_spf_walk); if (strcmp(__progname, "mailq") == 0) return cmd_run(2, argv_mailq); if (strcmp(__progname, "smtpctl") == 0) return cmd_run(argc - 1, argv + 1); errx(1, "unsupported mode"); return (0); } void sendmail_compat(int argc, char **argv) { FILE *offlinefp = NULL; gid_t gid; int i, r; if (strcmp(__progname, "sendmail") == 0 || strcmp(__progname, "send-mail") == 0) { /* * determine whether we are called with flags * that should invoke makemap/newaliases. */ for (i = 1; i < argc; i++) if (strncmp(argv[i], "-bi", 3) == 0) exit(makemap(P_SENDMAIL, argc, argv)); if (!srv_connect()) offlinefp = offline_file(); gid = getgid(); if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); #if HAVE_PLEDGE /* we'll reduce further down the road */ if (pledge("stdio rpath wpath cpath tmppath flock " "dns getpw recvfd", NULL) == -1) err(1, "pledge"); #endif sendmail = 1; exit(enqueue(argc, argv, offlinefp)); } else if (strcmp(__progname, "makemap") == 0) exit(makemap(P_MAKEMAP, argc, argv)); else if (strcmp(__progname, "newaliases") == 0) { r = makemap(P_NEWALIASES, argc, argv); /* * if server is available, notify of table update. * only makes sense for static tables AND if server is up. */ if (srv_connect()) { srv_send(IMSG_CTL_UPDATE_TABLE, "aliases", strlen("aliases") + 1); srv_check_result(0); } exit(r); } } static void show_queue_envelope(struct envelope *e, int online) { const char *src = "?", *agent = "?"; char status[128], runstate[128], errline[LINE_MAX]; status[0] = '\0'; getflag(&e->flags, EF_BOUNCE, "bounce", status, sizeof(status)); getflag(&e->flags, EF_AUTHENTICATED, "auth", status, sizeof(status)); getflag(&e->flags, EF_INTERNAL, "internal", status, sizeof(status)); getflag(&e->flags, EF_SUSPEND, "suspend", status, sizeof(status)); getflag(&e->flags, EF_HOLD, "hold", status, sizeof(status)); if (online) { if (e->flags & EF_PENDING) (void)snprintf(runstate, sizeof runstate, "pending|%zd", (ssize_t)(e->nexttry - now)); else if (e->flags & EF_INFLIGHT) (void)snprintf(runstate, sizeof runstate, "inflight|%zd", (ssize_t)(now - e->lasttry)); else (void)snprintf(runstate, sizeof runstate, "invalid|"); e->flags &= ~(EF_PENDING|EF_INFLIGHT); } else (void)strlcpy(runstate, "offline|", sizeof runstate); if (e->flags) errx(1, "%016" PRIx64 ": unexpected flags 0x%04x", e->id, e->flags); if (status[0]) status[strlen(status) - 1] = '\0'; if (e->type == D_MDA) agent = "mda"; else if (e->type == D_MTA) agent = "mta"; else if (e->type == D_BOUNCE) agent = "bounce"; if (e->ss.ss_family == AF_LOCAL) src = "local"; else if (e->ss.ss_family == AF_INET) src = "inet4"; else if (e->ss.ss_family == AF_INET6) src = "inet6"; strnvis(errline, e->errorline, sizeof(errline), 0); printf("%016"PRIx64 "|%s|%s|%s|%s@%s|%s@%s|%s@%s" "|%zu|%zu|%zu|%zu|%s|%s\n", e->id, src, agent, status, e->sender.user, e->sender.domain, e->rcpt.user, e->rcpt.domain, e->dest.user, e->dest.domain, (size_t) e->creation, (size_t) (e->creation + e->ttl), (size_t) e->lasttry, (size_t) e->retry, runstate, errline); } static void getflag(uint *bitmap, int bit, char *bitstr, char *buf, size_t len) { if (*bitmap & bit) { *bitmap &= ~bit; (void)strlcat(buf, bitstr, len); (void)strlcat(buf, ",", len); } } static void show_offline_envelope(uint64_t evpid) { FILE *fp = NULL; char pathname[PATH_MAX]; size_t plen; char *p; size_t buflen; char buffer[sizeof(struct envelope)]; struct envelope evp; if (!bsnprintf(pathname, sizeof pathname, "/queue/%02x/%08x/%016"PRIx64, (evpid_to_msgid(evpid) & 0xff000000) >> 24, evpid_to_msgid(evpid), evpid)) goto end; fp = fopen(pathname, "r"); if (fp == NULL) goto end; buflen = fread(buffer, 1, sizeof (buffer) - 1, fp); p = buffer; plen = buflen; buffer[buflen] = '\0'; if (is_encrypted_buffer(p)) { warnx("offline encrypted queue is not supported yet"); goto end; } if (is_gzip_buffer(p)) { warnx("offline compressed queue is not supported yet"); goto end; } if (!envelope_load_buffer(&evp, p, plen)) goto end; evp.id = evpid; show_queue_envelope(&evp, 0); end: if (fp) fclose(fp); } static void display(const char *s) { FILE *fp; char *key; int gzipped; char *gzcat_argv0 = strrchr(PATH_GZCAT, '/') + 1; if ((fp = fopen(s, "r")) == NULL) err(1, "fopen"); if (is_encrypted_fp(fp)) { int i; FILE *ofp = NULL; if ((ofp = tmpfile()) == NULL) err(1, "tmpfile"); for (i = 0; i < 3; i++) { key = getpass("key> "); if (crypto_setup(key, strlen(key))) break; } if (i == 3) errx(1, "crypto-setup: invalid key"); if (!crypto_decrypt_file(fp, ofp)) { printf("object is encrypted: %s\n", key); exit(1); } fclose(fp); fp = ofp; fseek(fp, 0, SEEK_SET); } gzipped = is_gzip_fp(fp); lseek(fileno(fp), 0, SEEK_SET); (void)dup2(fileno(fp), STDIN_FILENO); if (gzipped) execl(PATH_GZCAT, gzcat_argv0, (char *)NULL); else execl(PATH_CAT, "cat", (char *)NULL); err(1, "execl"); } static int str_to_trace(const char *str) { if (!strcmp(str, "imsg")) return TRACE_IMSG; if (!strcmp(str, "io")) return TRACE_IO; if (!strcmp(str, "smtp")) return TRACE_SMTP; if (!strcmp(str, "filters")) return TRACE_FILTERS; if (!strcmp(str, "mta")) return TRACE_MTA; if (!strcmp(str, "bounce")) return TRACE_BOUNCE; if (!strcmp(str, "scheduler")) return TRACE_SCHEDULER; if (!strcmp(str, "lookup")) return TRACE_LOOKUP; if (!strcmp(str, "stat")) return TRACE_STAT; if (!strcmp(str, "rules")) return TRACE_RULES; if (!strcmp(str, "mproc")) return TRACE_MPROC; if (!strcmp(str, "expand")) return TRACE_EXPAND; if (!strcmp(str, "all")) return ~TRACE_DEBUG; errx(1, "invalid trace keyword: %s", str); return (0); } static int str_to_profile(const char *str) { if (!strcmp(str, "imsg")) return PROFILE_IMSG; if (!strcmp(str, "queue")) return PROFILE_QUEUE; errx(1, "invalid profile keyword: %s", str); return (0); } static int is_gzip_buffer(const char *buffer) { uint16_t magic; memcpy(&magic, buffer, sizeof magic); #define GZIP_MAGIC 0x8b1f return (magic == GZIP_MAGIC); } static int is_gzip_fp(FILE *fp) { uint8_t magic[2]; int ret = 0; if (fread(&magic, 1, sizeof magic, fp) != sizeof magic) goto end; ret = is_gzip_buffer((const char *)&magic); end: fseek(fp, 0, SEEK_SET); return ret; } /* XXX */ /* * queue supports transparent encryption. * encrypted chunks are prefixed with an API version byte * which we ensure is unambiguous with gzipped / plain * objects. */ static int is_encrypted_buffer(const char *buffer) { uint8_t magic; magic = *buffer; #define ENCRYPTION_MAGIC 0x1 return (magic == ENCRYPTION_MAGIC); } static int is_encrypted_fp(FILE *fp) { uint8_t magic; int ret = 0; if (fread(&magic, 1, sizeof magic, fp) != sizeof magic) goto end; ret = is_encrypted_buffer((const char *)&magic); end: fseek(fp, 0, SEEK_SET); return ret; } opensmtpd-7.7.0p0/usr.sbin/smtpd/stat_ramstat.c0000644000175000001440000000770514610663500015231 /* $OpenBSD: stat_ramstat.c,v 1.12 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include "smtpd.h" static void ramstat_init(void); static void ramstat_close(void); static void ramstat_increment(const char *, size_t); static void ramstat_decrement(const char *, size_t); static void ramstat_set(const char *, const struct stat_value *); static int ramstat_iter(void **, char **, struct stat_value *); struct ramstat_entry { RB_ENTRY(ramstat_entry) entry; char key[STAT_KEY_SIZE]; struct stat_value value; }; RB_HEAD(stats_tree, ramstat_entry) stats; RB_PROTOTYPE(stats_tree, ramstat_entry, entry, ramstat_entry_cmp); struct stat_backend stat_backend_ramstat = { ramstat_init, ramstat_close, ramstat_increment, ramstat_decrement, ramstat_set, ramstat_iter }; static void ramstat_init(void) { log_trace(TRACE_STAT, "ramstat: init"); RB_INIT(&stats); /* ramstat_set() should be called for each key we want * to have displayed by smtpctl show stats at startup. */ ramstat_set("uptime", stat_timestamp(env->sc_uptime)); } static void ramstat_close(void) { log_trace(TRACE_STAT, "ramstat: close"); } static void ramstat_increment(const char *name, size_t val) { struct ramstat_entry *np, lk; log_trace(TRACE_STAT, "ramstat: increment: %s", name); (void)strlcpy(lk.key, name, sizeof (lk.key)); np = RB_FIND(stats_tree, &stats, &lk); if (np == NULL) { np = xcalloc(1, sizeof *np); (void)strlcpy(np->key, name, sizeof (np->key)); RB_INSERT(stats_tree, &stats, np); } log_trace(TRACE_STAT, "ramstat: %s (%p): %zd -> %zd", name, name, np->value.u.counter, np->value.u.counter + val); np->value.u.counter += val; } static void ramstat_decrement(const char *name, size_t val) { struct ramstat_entry *np, lk; log_trace(TRACE_STAT, "ramstat: decrement: %s", name); (void)strlcpy(lk.key, name, sizeof (lk.key)); np = RB_FIND(stats_tree, &stats, &lk); if (np == NULL) { np = xcalloc(1, sizeof *np); (void)strlcpy(np->key, name, sizeof (np->key)); RB_INSERT(stats_tree, &stats, np); } log_trace(TRACE_STAT, "ramstat: %s (%p): %zd -> %zd", name, name, np->value.u.counter, np->value.u.counter - val); np->value.u.counter -= val; } static void ramstat_set(const char *name, const struct stat_value *val) { struct ramstat_entry *np, lk; log_trace(TRACE_STAT, "ramstat: set: %s", name); (void)strlcpy(lk.key, name, sizeof (lk.key)); np = RB_FIND(stats_tree, &stats, &lk); if (np == NULL) { np = xcalloc(1, sizeof *np); (void)strlcpy(np->key, name, sizeof (np->key)); RB_INSERT(stats_tree, &stats, np); } log_trace(TRACE_STAT, "ramstat: %s: n/a -> n/a", name); np->value = *val; } static int ramstat_iter(void **iter, char **name, struct stat_value *val) { struct ramstat_entry *np; log_trace(TRACE_STAT, "ramstat: iter"); if (RB_EMPTY(&stats)) return 0; if (*iter == NULL) np = RB_MIN(stats_tree, &stats); else np = RB_NEXT(stats_tree, &stats, *iter); *iter = np; if (np == NULL) return 0; *name = np->key; *val = np->value; return 1; } static int ramstat_entry_cmp(struct ramstat_entry *e1, struct ramstat_entry *e2) { return strcmp(e1->key, e2->key); } RB_GENERATE(stats_tree, ramstat_entry, entry, ramstat_entry_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/ioev.h0000644000175000001440000000506514610663500013467 /* $OpenBSD: ioev.h,v 1.20 2021/07/28 19:39:50 benno Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ enum { IO_CONNECTED = 0, /* connection successful */ IO_TLSREADY, /* TLS started successfully */ IO_DATAIN, /* new data in input buffer */ IO_LOWAT, /* output queue running low */ IO_DISCONNECTED, /* error? */ IO_TIMEOUT, /* error? */ IO_ERROR, /* details? */ }; #define IO_IN 0x01 #define IO_OUT 0x02 struct io; struct tls; void io_set_nonblocking(int); void io_set_nolinger(int); struct io *io_new(void); void io_free(struct io *); void io_set_read(struct io *); void io_set_write(struct io *); void io_set_fd(struct io *, int); void io_set_callback(struct io *io, void(*)(struct io *, int, void *), void *); void io_set_timeout(struct io *, int); void io_set_lowat(struct io *, size_t); void io_pause(struct io *, int); void io_resume(struct io *, int); void io_reload(struct io *); int io_connect(struct io *, const struct sockaddr *, const struct sockaddr *); int io_connect_tls(struct io *, struct tls *, const char *); int io_accept_tls(struct io *, struct tls *); const char* io_strio(struct io *); const char* io_strevent(int); const char* io_error(struct io *); struct tls* io_tls(struct io *); int io_fileno(struct io *); int io_paused(struct io *, int); /* Buffered output functions */ int io_write(struct io *, const void *, size_t); int io_writev(struct io *, const struct iovec *, int); int io_print(struct io *, const char *); int io_printf(struct io *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); int io_vprintf(struct io *, const char *, va_list) __attribute__((__format__ (printf, 2, 0))); size_t io_queued(struct io *); /* Buffered input functions */ void* io_data(struct io *); size_t io_datalen(struct io *); char* io_getline(struct io *, size_t *); void io_drop(struct io *, size_t); opensmtpd-7.7.0p0/usr.sbin/smtpd/mda.c0000644000175000001440000005242614610663500013264 /* $OpenBSD: mda.c,v 1.147 2024/01/20 09:01:03 claudio Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include #if defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #else #include "bsd-vis.h" #endif #include "smtpd.h" #include "log.h" #define MDA_HIWAT 65536 struct mda_envelope { TAILQ_ENTRY(mda_envelope) entry; uint64_t session_id; uint64_t id; time_t creation; char *sender; char *rcpt; char *dest; char *user; char *dispatcher; char *mda_subaddress; char *mda_exec; }; #define USER_WAITINFO 0x01 #define USER_RUNNABLE 0x02 #define USER_ONHOLD 0x04 #define USER_HOLDQ 0x08 struct mda_user { uint64_t id; TAILQ_ENTRY(mda_user) entry; TAILQ_ENTRY(mda_user) entry_runnable; char name[LOGIN_NAME_MAX]; char usertable[PATH_MAX]; size_t evpcount; TAILQ_HEAD(, mda_envelope) envelopes; int flags; size_t running; struct userinfo userinfo; }; struct mda_session { uint64_t id; struct mda_user *user; struct mda_envelope *evp; struct io *io; FILE *datafp; }; static void mda_io(struct io *, int, void *); static int mda_check_loop(FILE *, struct mda_envelope *); static int mda_getlastline(int, char *, size_t); static void mda_done(struct mda_session *); static void mda_fail(struct mda_user *, int, const char *, enum enhanced_status_code); static void mda_drain(void); static void mda_log(const struct mda_envelope *, const char *, const char *); static void mda_queue_ok(uint64_t); static void mda_queue_tempfail(uint64_t, const char *, enum enhanced_status_code); static void mda_queue_permfail(uint64_t, const char *, enum enhanced_status_code); static void mda_queue_loop(uint64_t); static struct mda_user *mda_user(const struct envelope *); static void mda_user_free(struct mda_user *); static const char *mda_user_to_text(const struct mda_user *); static struct mda_envelope *mda_envelope(uint64_t, const struct envelope *); static void mda_envelope_free(struct mda_envelope *); static struct mda_session * mda_session(struct mda_user *); static const char *mda_sysexit_to_str(int); static struct tree sessions; static struct tree users; static TAILQ_HEAD(, mda_user) runnable; void mda_imsg(struct mproc *p, struct imsg *imsg) { struct mda_session *s; struct mda_user *u; struct mda_envelope *e; struct envelope evp; struct deliver deliver; struct msg m; const void *data; const char *error, *parent_error, *syserror; uint64_t reqid; size_t sz; char out[256], buf[LINE_MAX]; int n, fd; enum lka_resp_status status; enum mda_resp_status mda_status; int mda_sysexit; switch (imsg->hdr.type) { case IMSG_MDA_LOOKUP_USERINFO: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, (int *)&status); if (status == LKA_OK) m_get_data(&m, &data, &sz); m_end(&m); u = tree_xget(&users, reqid); if (status == LKA_TEMPFAIL) mda_fail(u, 0, "Temporary failure in user lookup", ESC_OTHER_ADDRESS_STATUS); else if (status == LKA_PERMFAIL) mda_fail(u, 1, "Permanent failure in user lookup", ESC_DESTINATION_MAILBOX_HAS_MOVED); else { if (sz != sizeof(u->userinfo)) fatalx("mda: userinfo size mismatch"); memmove(&u->userinfo, data, sz); u->flags &= ~USER_WAITINFO; u->flags |= USER_RUNNABLE; TAILQ_INSERT_TAIL(&runnable, u, entry_runnable); mda_drain(); } return; case IMSG_QUEUE_DELIVER: m_msg(&m, imsg); m_get_envelope(&m, &evp); m_end(&m); u = mda_user(&evp); if (u->evpcount >= env->sc_mda_task_hiwat) { if (!(u->flags & USER_ONHOLD)) { log_debug("debug: mda: hiwat reached for " "user \"%s\": holding envelopes", mda_user_to_text(u)); u->flags |= USER_ONHOLD; } } if (u->flags & USER_ONHOLD) { u->flags |= USER_HOLDQ; m_create(p_queue, IMSG_MDA_DELIVERY_HOLD, 0, 0, -1); m_add_evpid(p_queue, evp.id); m_add_id(p_queue, u->id); m_close(p_queue); return; } e = mda_envelope(u->id, &evp); TAILQ_INSERT_TAIL(&u->envelopes, e, entry); u->evpcount += 1; stat_increment("mda.pending", 1); if (!(u->flags & USER_RUNNABLE) && !(u->flags & USER_WAITINFO)) { u->flags |= USER_RUNNABLE; TAILQ_INSERT_TAIL(&runnable, u, entry_runnable); } mda_drain(); return; case IMSG_MDA_OPEN_MESSAGE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); s = tree_xget(&sessions, reqid); e = s->evp; fd = imsg_get_fd(imsg); if (fd == -1) { log_debug("debug: mda: cannot get message fd"); mda_queue_tempfail(e->id, "Cannot get message fd", ESC_OTHER_MAIL_SYSTEM_STATUS); mda_log(e, "TempFail", "Cannot get message fd"); mda_done(s); return; } log_debug("debug: mda: got message fd %d " "for session %016"PRIx64 " evpid %016"PRIx64, fd, s->id, e->id); if ((s->datafp = fdopen(fd, "r")) == NULL) { log_warn("warn: mda: fdopen"); close(fd); mda_queue_tempfail(e->id, "fdopen failed", ESC_OTHER_MAIL_SYSTEM_STATUS); mda_log(e, "TempFail", "fdopen failed"); mda_done(s); return; } /* check delivery loop */ if (mda_check_loop(s->datafp, e)) { log_debug("debug: mda: loop detected"); mda_queue_loop(e->id); mda_log(e, "PermFail", "Loop detected"); mda_done(s); return; } /* start queueing delivery headers */ if (e->sender[0]) /* * XXX: remove existing Return-Path, * if any */ n = io_printf(s->io, "Return-Path: <%s>\n" "Delivered-To: %s\n", e->sender, e->rcpt ? e->rcpt : e->dest); else n = io_printf(s->io, "Delivered-To: %s\n", e->rcpt ? e->rcpt : e->dest); if (n == -1) { log_warn("warn: mda: " "fail to write delivery info"); mda_queue_tempfail(e->id, "Out of memory", ESC_OTHER_MAIL_SYSTEM_STATUS); mda_log(e, "TempFail", "Out of memory"); mda_done(s); return; } /* request parent to fork a helper process */ memset(&deliver, 0, sizeof deliver); (void)text_to_mailaddr(&deliver.sender, s->evp->sender); (void)text_to_mailaddr(&deliver.rcpt, s->evp->rcpt); (void)text_to_mailaddr(&deliver.dest, s->evp->dest); if (s->evp->mda_exec) (void)strlcpy(deliver.mda_exec, s->evp->mda_exec, sizeof deliver.mda_exec); if (s->evp->mda_subaddress) (void)strlcpy(deliver.mda_subaddress, s->evp->mda_subaddress, sizeof deliver.mda_subaddress); (void)strlcpy(deliver.dispatcher, s->evp->dispatcher, sizeof deliver.dispatcher); deliver.userinfo = s->user->userinfo; log_debug("debug: mda: querying mda fd " "for session %016"PRIx64 " evpid %016"PRIx64, s->id, s->evp->id); m_create(p_parent, IMSG_MDA_FORK, 0, 0, -1); m_add_id(p_parent, reqid); m_add_data(p_parent, &deliver, sizeof(deliver)); m_close(p_parent); return; case IMSG_MDA_FORK: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); s = tree_xget(&sessions, reqid); e = s->evp; fd = imsg_get_fd(imsg); if (fd == -1) { log_warn("warn: mda: fail to retrieve mda fd"); mda_queue_tempfail(e->id, "Cannot get mda fd", ESC_OTHER_MAIL_SYSTEM_STATUS); mda_log(e, "TempFail", "Cannot get mda fd"); mda_done(s); return; } log_debug("debug: mda: got mda fd %d " "for session %016"PRIx64 " evpid %016"PRIx64, fd, s->id, s->evp->id); io_set_nonblocking(fd); io_set_fd(s->io, fd); io_set_write(s->io); return; case IMSG_MDA_DONE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, (int *)&mda_status); m_get_int(&m, (int *)&mda_sysexit); m_get_string(&m, &parent_error); m_end(&m); s = tree_xget(&sessions, reqid); e = s->evp; /* * Grab last line of mda stdout/stderr if available. */ out[0] = '\0'; fd = imsg_get_fd(imsg); if (fd != -1) mda_getlastline(fd, out, sizeof(out)); /* * Choose between parent's description of error and * child's output, the latter having preference over * the former. */ error = NULL; if (mda_status == MDA_OK) { if (s->datafp || (s->io && io_queued(s->io))) { error = "mda exited prematurely"; mda_status = MDA_TEMPFAIL; } } else error = out[0] ? out : parent_error; syserror = NULL; if (mda_sysexit) syserror = mda_sysexit_to_str(mda_sysexit); /* update queue entry */ switch (mda_status) { case MDA_TEMPFAIL: mda_queue_tempfail(e->id, error, ESC_OTHER_MAIL_SYSTEM_STATUS); (void)snprintf(buf, sizeof buf, "Error (%s%s%s)", syserror ? syserror : "", syserror ? ": " : "", error); mda_log(e, "TempFail", buf); break; case MDA_PERMFAIL: mda_queue_permfail(e->id, error, ESC_OTHER_MAIL_SYSTEM_STATUS); (void)snprintf(buf, sizeof buf, "Error (%s%s%s)", syserror ? syserror : "", syserror ? ": " : "", error); mda_log(e, "PermFail", buf); break; case MDA_OK: mda_queue_ok(e->id); mda_log(e, "Ok", "Delivered"); break; } mda_done(s); return; } fatalx("mda_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } void mda_postfork(void) { } void mda_postprivdrop(void) { tree_init(&sessions); tree_init(&users); TAILQ_INIT(&runnable); } static void mda_io(struct io *io, int evt, void *arg) { struct mda_session *s = arg; char *ln = NULL; size_t sz = 0; ssize_t len; log_trace(TRACE_IO, "mda: %p: %s %s", s, io_strevent(evt), io_strio(io)); switch (evt) { case IO_LOWAT: /* done */ done: if (s->datafp == NULL) { log_debug("debug: mda: all data sent for session" " %016"PRIx64 " evpid %016"PRIx64, s->id, s->evp->id); io_free(io); s->io = NULL; return; } while (io_queued(s->io) < MDA_HIWAT) { if ((len = getline(&ln, &sz, s->datafp)) == -1) break; if (io_write(s->io, ln, len) == -1) { m_create(p_parent, IMSG_MDA_KILL, 0, 0, -1); m_add_id(p_parent, s->id); m_add_string(p_parent, "Out of memory"); m_close(p_parent); io_pause(io, IO_OUT); free(ln); return; } } free(ln); ln = NULL; if (ferror(s->datafp)) { log_debug("debug: mda: ferror on session %016"PRIx64, s->id); m_create(p_parent, IMSG_MDA_KILL, 0, 0, -1); m_add_id(p_parent, s->id); m_add_string(p_parent, "Error reading body"); m_close(p_parent); io_pause(io, IO_OUT); return; } if (feof(s->datafp)) { log_debug("debug: mda: end-of-file for session" " %016"PRIx64 " evpid %016"PRIx64, s->id, s->evp->id); fclose(s->datafp); s->datafp = NULL; if (io_queued(s->io) == 0) goto done; } return; case IO_TIMEOUT: log_debug("debug: mda: timeout on session %016"PRIx64, s->id); io_pause(io, IO_OUT); return; case IO_ERROR: log_debug("debug: mda: io error on session %016"PRIx64": %s", s->id, io_error(io)); io_pause(io, IO_OUT); return; case IO_DISCONNECTED: log_debug("debug: mda: io disconnected on session %016"PRIx64, s->id); io_pause(io, IO_OUT); return; default: log_debug("debug: mda: unexpected event on session %016"PRIx64, s->id); io_pause(io, IO_OUT); return; } } static int mda_check_loop(FILE *fp, struct mda_envelope *e) { char *buf = NULL; size_t sz = 0; ssize_t len; int ret = 0; while ((len = getline(&buf, &sz, fp)) != -1) { if (buf[len - 1] == '\n') buf[len - 1] = '\0'; if (strchr(buf, ':') == NULL && !isspace((unsigned char)*buf)) break; if (strncasecmp("Delivered-To: ", buf, 14) == 0) { if (strcasecmp(buf + 14, e->dest) == 0) { ret = 1; break; } } } free(buf); fseek(fp, SEEK_SET, 0); return (ret); } static int mda_getlastline(int fd, char *dst, size_t dstsz) { FILE *fp; char *ln = NULL; size_t sz = 0; ssize_t len; int out = 0; if (lseek(fd, 0, SEEK_SET) == -1) { log_warn("warn: mda: lseek"); close(fd); return (-1); } fp = fdopen(fd, "r"); if (fp == NULL) { log_warn("warn: mda: fdopen"); close(fd); return (-1); } while ((len = getline(&ln, &sz, fp)) != -1) { if (ln[len - 1] == '\n') ln[len - 1] = '\0'; out = 1; } fclose(fp); if (out) { (void)strlcpy(dst, "\"", dstsz); (void)strnvis(dst + 1, ln, dstsz - 2, VIS_SAFE | VIS_CSTYLE | VIS_NL); (void)strlcat(dst, "\"", dstsz); } free(ln); return (0); } static void mda_fail(struct mda_user *user, int permfail, const char *error, enum enhanced_status_code code) { struct mda_envelope *e; while ((e = TAILQ_FIRST(&user->envelopes))) { TAILQ_REMOVE(&user->envelopes, e, entry); if (permfail) { mda_log(e, "PermFail", error); mda_queue_permfail(e->id, error, code); } else { mda_log(e, "TempFail", error); mda_queue_tempfail(e->id, error, code); } mda_envelope_free(e); } mda_user_free(user); } static void mda_drain(void) { struct mda_user *u; while ((u = (TAILQ_FIRST(&runnable)))) { TAILQ_REMOVE(&runnable, u, entry_runnable); if (u->evpcount == 0 && u->running == 0) { log_debug("debug: mda: all done for user \"%s\"", mda_user_to_text(u)); mda_user_free(u); continue; } if (u->evpcount == 0) { log_debug("debug: mda: no more envelope for \"%s\"", mda_user_to_text(u)); u->flags &= ~USER_RUNNABLE; continue; } if (u->running >= env->sc_mda_max_user_session) { log_debug("debug: mda: " "maximum number of session reached for user \"%s\"", mda_user_to_text(u)); u->flags &= ~USER_RUNNABLE; continue; } if (tree_count(&sessions) >= env->sc_mda_max_session) { log_debug("debug: mda: " "maximum number of session reached"); TAILQ_INSERT_HEAD(&runnable, u, entry_runnable); return; } mda_session(u); if (u->evpcount == env->sc_mda_task_lowat) { if (u->flags & USER_ONHOLD) { log_debug("debug: mda: down to lowat for user " "\"%s\": releasing", mda_user_to_text(u)); u->flags &= ~USER_ONHOLD; } if (u->flags & USER_HOLDQ) { m_create(p_queue, IMSG_MDA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, u->id); m_add_int(p_queue, env->sc_mda_task_release); m_close(p_queue); } } /* re-add the user at the tail of the queue */ TAILQ_INSERT_TAIL(&runnable, u, entry_runnable); } } static void mda_done(struct mda_session *s) { log_debug("debug: mda: session %016" PRIx64 " done", s->id); tree_xpop(&sessions, s->id); mda_envelope_free(s->evp); s->user->running--; if (!(s->user->flags & USER_RUNNABLE)) { log_debug("debug: mda: user \"%s\" becomes runnable", s->user->name); TAILQ_INSERT_TAIL(&runnable, s->user, entry_runnable); s->user->flags |= USER_RUNNABLE; } if (s->datafp) fclose(s->datafp); if (s->io) io_free(s->io); free(s); stat_decrement("mda.running", 1); mda_drain(); } static void mda_log(const struct mda_envelope *evp, const char *prefix, const char *status) { char rcpt[LINE_MAX]; rcpt[0] = '\0'; if (evp->rcpt) (void)snprintf(rcpt, sizeof rcpt, "rcpt=<%s> ", evp->rcpt); log_info("%016"PRIx64" mda delivery evpid=%016" PRIx64 " from=<%s> to=<%s> " "%suser=%s delay=%s result=%s stat=%s", evp->session_id, evp->id, evp->sender ? evp->sender : "", evp->dest, rcpt, evp->user, duration_to_text(time(NULL) - evp->creation), prefix, status); } static void mda_queue_ok(uint64_t evpid) { m_create(p_queue, IMSG_MDA_DELIVERY_OK, 0, 0, -1); m_add_evpid(p_queue, evpid); m_close(p_queue); } static void mda_queue_tempfail(uint64_t evpid, const char *reason, enum enhanced_status_code code) { m_create(p_queue, IMSG_MDA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, evpid); m_add_string(p_queue, reason); m_add_int(p_queue, (int)code); m_close(p_queue); } static void mda_queue_permfail(uint64_t evpid, const char *reason, enum enhanced_status_code code) { m_create(p_queue, IMSG_MDA_DELIVERY_PERMFAIL, 0, 0, -1); m_add_evpid(p_queue, evpid); m_add_string(p_queue, reason); m_add_int(p_queue, (int)code); m_close(p_queue); } static void mda_queue_loop(uint64_t evpid) { m_create(p_queue, IMSG_MDA_DELIVERY_LOOP, 0, 0, -1); m_add_evpid(p_queue, evpid); m_close(p_queue); } static struct mda_user * mda_user(const struct envelope *evp) { struct dispatcher *dsp; struct mda_user *u; void *i; i = NULL; dsp = dict_xget(env->sc_dispatchers, evp->dispatcher); while (tree_iter(&users, &i, NULL, (void**)(&u))) { if (!strcmp(evp->mda_user, u->name) && !strcmp(dsp->u.local.table_userbase, u->usertable)) return (u); } u = xcalloc(1, sizeof *u); u->id = generate_uid(); TAILQ_INIT(&u->envelopes); (void)strlcpy(u->name, evp->mda_user, sizeof(u->name)); (void)strlcpy(u->usertable, dsp->u.local.table_userbase, sizeof(u->usertable)); tree_xset(&users, u->id, u); m_create(p_lka, IMSG_MDA_LOOKUP_USERINFO, 0, 0, -1); m_add_id(p_lka, u->id); m_add_string(p_lka, dsp->u.local.table_userbase); m_add_string(p_lka, evp->mda_user); m_close(p_lka); u->flags |= USER_WAITINFO; stat_increment("mda.user", 1); if (dsp->u.local.user) log_debug("mda: new user %016" PRIx64 " for \"%s\" delivering as \"%s\"", u->id, mda_user_to_text(u), dsp->u.local.user); else log_debug("mda: new user %016" PRIx64 " for \"%s\"", u->id, mda_user_to_text(u)); return (u); } static void mda_user_free(struct mda_user *u) { tree_xpop(&users, u->id); if (u->flags & USER_HOLDQ) { m_create(p_queue, IMSG_MDA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, u->id); m_add_int(p_queue, 0); m_close(p_queue); } free(u); stat_decrement("mda.user", 1); } static const char * mda_user_to_text(const struct mda_user *u) { static char buf[1024]; (void)snprintf(buf, sizeof(buf), "%s:%s", u->usertable, u->name); return (buf); } static struct mda_envelope * mda_envelope(uint64_t session_id, const struct envelope *evp) { struct mda_envelope *e; char buf[LINE_MAX]; e = xcalloc(1, sizeof *e); e->session_id = session_id; e->id = evp->id; e->creation = evp->creation; buf[0] = '\0'; if (evp->sender.user[0] && evp->sender.domain[0]) (void)snprintf(buf, sizeof buf, "%s@%s", evp->sender.user, evp->sender.domain); e->sender = xstrdup(buf); (void)snprintf(buf, sizeof buf, "%s@%s", evp->dest.user, evp->dest.domain); e->dest = xstrdup(buf); (void)snprintf(buf, sizeof buf, "%s@%s", evp->rcpt.user, evp->rcpt.domain); e->rcpt = xstrdup(buf); e->user = evp->mda_user[0] ? xstrdup(evp->mda_user) : xstrdup(evp->dest.user); e->dispatcher = xstrdup(evp->dispatcher); if (evp->mda_exec[0]) e->mda_exec = xstrdup(evp->mda_exec); if (evp->mda_subaddress[0]) e->mda_subaddress = xstrdup(evp->mda_subaddress); stat_increment("mda.envelope", 1); return (e); } static void mda_envelope_free(struct mda_envelope *e) { free(e->sender); free(e->dest); free(e->rcpt); free(e->user); free(e->mda_exec); free(e); stat_decrement("mda.envelope", 1); } static struct mda_session * mda_session(struct mda_user * u) { struct mda_session *s; s = xcalloc(1, sizeof *s); s->id = generate_uid(); s->user = u; s->io = io_new(); io_set_callback(s->io, mda_io, s); tree_xset(&sessions, s->id, s); s->evp = TAILQ_FIRST(&u->envelopes); TAILQ_REMOVE(&u->envelopes, s->evp, entry); u->evpcount--; u->running++; stat_decrement("mda.pending", 1); stat_increment("mda.running", 1); log_debug("debug: mda: new session %016" PRIx64 " for user \"%s\" evpid %016" PRIx64, s->id, mda_user_to_text(u), s->evp->id); m_create(p_queue, IMSG_MDA_OPEN_MESSAGE, 0, 0, -1); m_add_id(p_queue, s->id); m_add_msgid(p_queue, evpid_to_msgid(s->evp->id)); m_close(p_queue); return (s); } static const char * mda_sysexit_to_str(int sysexit) { switch (sysexit) { case EX_USAGE: return "command line usage error"; case EX_DATAERR: return "data format error"; case EX_NOINPUT: return "cannot open input"; case EX_NOUSER: return "user unknown"; case EX_NOHOST: return "host name unknown"; case EX_UNAVAILABLE: return "service unavailable"; case EX_SOFTWARE: return "internal software error"; case EX_OSERR: return "system resource problem"; case EX_OSFILE: return "critical OS file missing"; case EX_CANTCREAT: return "can't create user output file"; case EX_IOERR: return "input/output error"; case EX_TEMPFAIL: return "temporary failure"; case EX_PROTOCOL: return "remote error in protocol"; case EX_NOPERM: return "permission denied"; case EX_CONFIG: return "local configuration error"; default: break; } return NULL; } opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.mboxfile.c0000644000175000001440000000461114610663500015242 /* * Copyright (c) 2018 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include static void mboxfile_engine(const char *sender, const char *filename); int main(int argc, char *argv[]) { int ch; char *sender = ""; if (! geteuid()) errx(1, "mail.mboxfile: may not be executed as root"); while ((ch = getopt(argc, argv, "f:")) != -1) { switch (ch) { case 'f': sender = optarg; break; default: break; } } argc -= optind; argv += optind; if (argc > 1) errx(1, "mail.mboxfile: only one mboxfile is allowed"); mboxfile_engine(sender, argv[0]); return (0); } static void mboxfile_engine(const char *sender, const char *filename) { int fd; FILE *fp; char *line = NULL; size_t linesize = 0; time_t now; time(&now); #ifndef O_EXLOCK #define O_EXLOCK 0 #endif fd = open(filename, O_CREAT | O_APPEND | O_WRONLY | O_EXLOCK, 0600); #ifndef HAVE_O_EXLOCK /* XXX : do something! */ #endif if (fd == -1) err(EX_TEMPFAIL, NULL); if ((fp = fdopen(fd, "w")) == NULL) err(EX_TEMPFAIL, NULL); fprintf(fp, "From %s %s", sender, ctime(&now)); while (getline(&line, &linesize, stdin) != -1) { line[strcspn(line, "\n")] = '\0'; if (strncmp(line, "From ", 5) == 0) fprintf(fp, ">%s\n", line); else fprintf(fp, "%s\n", line); } fprintf(fp, "\n"); free(line); if (ferror(stdin)) err(EX_TEMPFAIL, NULL); if (fflush(fp) == EOF || ferror(fp) || (fsync(fd) == -1 && errno != EINVAL) || fclose(fp) == EOF) err(EX_TEMPFAIL, NULL); } opensmtpd-7.7.0p0/usr.sbin/smtpd/table.50000644000175000001440000002046114674615567013552 .\" $OpenBSD: table.5,v 1.14 2024/05/02 18:14:33 op Exp $ .\" .\" Copyright (c) 2013 Eric Faurot .\" Copyright (c) 2013 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" .Dd $Mdocdate: May 2 2024 $ .Dt TABLE 5 .Os .Sh NAME .Nm table .Nd format description for smtpd tables .Sh DESCRIPTION This manual page documents the file format for the various tables used in the .Xr smtpd 8 mail daemon. .Pp The format described here applies to tables as defined in .Xr smtpd.conf 5 . .Sh TABLE TYPES There are two types of tables: lists and mappings. A list consists of a series of values, while a mapping consists of a series of keys and their associated values. The following illustrates how to declare them as static tables: .Bd -literal -offset indent table mylist { value1, value2, value3 } table mymapping { key1 = value1, key2 = value2, key3 = value3 } .Ed .Pp When using a .Ql file table, a list will be written with each value on a line by itself. .Bd -literal -offset indent value1 value2 value3 .Ed .Pp A mapping will be written with each key and value on a line, whitespace and an optional colon separating both columns: .Bd -literal -offset indent key1: value1 key2 value2 key3 value3 .Ed .Pp Blank lines, leading and trailing spaces and tabs are ignored. Lines whose first non-space character is a hash mark .Pq Sq # are comments and are ignored. To force the parsing of a file table as a list rather than a mapping, use this special comment: .Pp .Dl # @list .Pp A file table can be converted to a Berkeley database using the .Xr makemap 8 utility with no syntax change. .Pp Tables using a .Ql file or Berkeley DB backend will be referenced as follows: .Bd -unfilled -offset indent .Ic table Ar name Cm file : Ns Pa /path/to/file .Ic table Ar name Cm db : Ns Pa /path/to/file.db .Ed .Ss Aliasing tables Aliasing tables are mappings that associate a recipient to one or many destinations. They can be used in two contexts: primary domain aliases and virtual domain mapping. .Bd -unfilled -offset indent .Ic action Ar name method Cm alias Pf < table Ns > .Ic action Ar name method Cm virtual Pf < table Ns > .Ed .Pp In a primary domain context, the key is the user part of the recipient address, whilst the value is one or many recipients as described in .Xr aliases 5 : .Bd -literal -offset indent user1 otheruser user2 otheruser1,otheruser2 user3 otheruser@example.com .Ed .Pp In a virtual domain context, the key is either a user part, a full email address or a catch-all, following selection rules described in .Xr smtpd.conf 5 , and the value is one or many recipients as described in .Xr aliases 5 : .Bd -literal -offset indent user1 otheruser user2@example.org otheruser1,otheruser2 @example.org otheruser@example.com @ catchall@example.com .Ed .Pp The following directive shares the same table format, but with a different meaning. Here, the user is allowed to send mail from the listed addresses: .Bd -unfilled -offset indent .Ic listen on Ar interface Cm auth Oo Ar ... Oc Cm senders Pf < Ar table Ns > .Ed .Ss Domain tables Domain tables are simple lists of domains or hosts. .Bd -unfilled -offset indent .Ic match Cm for domain Pf < table Ns > Cm action Ar name .Ic match Cm helo Pf < table Ns > Oo Ar ... Oc Cm action Ar name .Ed .Pp In that context, the list of domains will be matched against the recipient domain or against the HELO name advertised by the sending host, respectively. For .Ql static , .Ql file and .Xr dbopen 3 backends, a wildcard may be used so the domain table may contain: .Bd -literal -offset indent example.org *.example.org .Ed .Ss Credentials tables Credentials tables are mappings of credentials. They can be used in two contexts: .Bd -unfilled -offset indent .Ic listen on Ar interface Cm tls Oo Ar ... Oc Cm auth Pf < Ar table Ns > .Ic action Ar name Cm relay host Ar relay-url Cm auth Pf < Ar table Ns > .Ed .Pp In a listener context, the credentials are a mapping of username and encrypted passwords: .Bd -literal -offset indent user1 $2b$10$hIJ4QfMcp.90nJwKqGbKM.MybArjHOTpEtoTV.DgLYAiThuoYmTSe user2 $2b$10$bwSmUOBGcZGamIfRuXGTvuTo3VLbPG9k5yeKNMBtULBhksV5KdGsK .Ed .Pp The passwords are to be encrypted using the .Xr smtpctl 8 encrypt subcommand. .Pp In a relay context, the credentials are a mapping of labels and username:password pairs: .Bd -literal -offset indent label1 user:password .Ed .Pp The label must be unique and is used as a selector for the proper credentials when multiple credentials are valid for a single destination. The password is not encrypted as it must be provided to the remote host. .Ss Netaddr tables Netaddr tables are lists of IPv4 and IPv6 network addresses. They can only be used in the following context: .Pp .D1 Ic match Cm from src Pf < Ar table Ns > Cm action Ar name .Pp When used as a "from source", the address of a client is compared to the list of addresses in the table until a match is found. .Pp A netaddr table can contain exact addresses or netmasks, and looks as follow: .Bd -literal -offset indent 192.168.1.1 [::1] 192.168.1.0/24 .Ed .Pp IPv6 addresses must be enclosed in square brackets. .Ss Userinfo tables Userinfo tables are used in rule context to specify an alternate userbase, mapping virtual users to local system users by UID, GID and home directory. .Pp .D1 Ic action Ar name method Cm userbase Pf < Ar table Ns > .Pp A userinfo table looks as follows: .Bd -literal -offset indent joe 1000:100:/home/virtual/joe jack 1000:100:/home/virtual/jack .Ed .Pp In this example, both joe and jack are virtual users mapped to the local system user with UID 1000 and GID 100, but different home directories. These directories may contain a .Xr forward 5 file. This can be used in conjunction with an alias table that maps an email address or the domain part to the desired virtual username. For example: .Bd -literal -offset indent joe@example.org joe jack@example.com jack .Ed .Ss Source tables Source tables are lists of IPv4 and IPv6 addresses. They can only be used in the following context: .Pp .D1 Ic action Ar name Cm relay src Pf < Ar table Ns > .Pp Successive queries to the source table will return the elements one by one. .Pp A source table looks as follow: .Bd -literal -offset indent 192.168.1.2 192.168.1.3 [::1] [::2] .Ed .Pp IPv6 address must be enclosed in square brackets. .Ss Mailaddr tables Mailaddr tables are lists of email addresses. They can be used in the following contexts: .Bd -unfilled -offset indent .Ic match Cm mail\-from Pf < Ar table Ns > Cm action Ar name .Ic match Cm rcpt\-to Pf < Ar table Ns > Cm action Ar name .Ed .Pp A mailaddr entry is used to match an email address against a username, a domain or a full email address. A "*" wildcard may be used in part of the domain name. .Pp A mailaddr table looks as follow: .Bd -literal -offset indent user @domain user@domain user@*.domain .Ed .Ss Addrname tables Addrname tables are used to map IP addresses to hostnames. They can be used in both listen context and relay context: .Bd -unfilled -offset indent .Ic listen on Ar interface Cm hostnames Pf < Ar table Ns > .Ic action Ar name Cm relay helo\-src Pf < Ar table Ns > .Ed .Pp In listen context, the table is used to look up the server name to advertise depending on the local address of the socket on which a connection is accepted. In relay context, the table is used to determine the hostname for the HELO sequence of the SMTP protocol, depending on the local address used for the outgoing connection. .Pp The format is a mapping from inet4 or inet6 addresses to hostnames: .Bd -literal -offset indent [::1] localhost 127.0.0.1 localhost 88.190.23.165 www.opensmtpd.org .Ed .Pp IPv6 addresses must be enclosed in square brackets. .Sh SEE ALSO .Xr smtpd.conf 5 , .Xr makemap 8 , .Xr smtpd 8 opensmtpd-7.7.0p0/usr.sbin/smtpd/makemap.c0000644000175000001440000002360314674615567014155 /* $OpenBSD: makemap.c,v 1.77 2024/05/07 12:10:06 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008-2009 Jacek Masiulaniec * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #ifdef HAVE_SYS_FILE_H #include /* Needed for flock */ #endif #include #include #include #ifdef HAVE_DB_H #include #elif defined(HAVE_DB1_DB_H) #include #elif defined(HAVE_DB_185_H) #include #endif #include #include #include #include /* FreeBSD needs this for fparseln(3) */ #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #include "smtpd.h" #include "log.h" #define PATH_ALIASES SMTPD_CONFDIR "/aliases" static void usage(void); static int parse_map(DB *, int *, char *); static int add_mapentry(DB *, int *, char *, char *, size_t); static int add_setentry(DB *, int *, char *, size_t); static int make_plain(DBT *, char *); static int make_aliases(DBT *, char *); static char *conf_aliases(char *); static int dump_db(const char *, DBTYPE); char *source; static int mode; enum output_type { T_PLAIN, T_ALIASES, T_SET } type; /* * Stub functions so that makemap compiles using minimum object files. */ int fork_proc_backend(const char *backend, const char *conf, const char *procname, int do_stdout) { return (-1); } int makemap(int prog_mode, int argc, char *argv[]) { struct stat sb; char dbname[PATH_MAX]; DB *db; const char *opts; char *conf, *oflag = NULL; int ch, dbputs = 0, Uflag = 0; DBTYPE dbtype = DB_HASH; char *p; gid_t gid; int fd = -1; gid = getgid(); if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); if ((env = config_default()) == NULL) err(1, NULL); log_init(1, LOG_MAIL); mode = prog_mode; conf = CONF_FILE; type = T_PLAIN; opts = "b:C:d:ho:O:t:U"; if (mode == P_NEWALIASES) opts = "f:h"; while ((ch = getopt(argc, argv, opts)) != -1) { switch (ch) { case 'b': if (optarg && strcmp(optarg, "i") == 0) mode = P_NEWALIASES; break; case 'C': break; /* for compatibility */ case 'd': if (strcmp(optarg, "hash") == 0) dbtype = DB_HASH; else if (strcmp(optarg, "btree") == 0) dbtype = DB_BTREE; else errx(1, "unsupported DB type '%s'", optarg); break; case 'f': conf = optarg; break; case 'o': oflag = optarg; break; case 'O': if (strncmp(optarg, "AliasFile=", 10) != 0) break; type = T_ALIASES; p = strchr(optarg, '='); source = ++p; break; case 't': if (strcmp(optarg, "aliases") == 0) type = T_ALIASES; else if (strcmp(optarg, "set") == 0) type = T_SET; else errx(1, "unsupported type '%s'", optarg); break; case 'U': Uflag = 1; break; default: usage(); } } argc -= optind; argv += optind; /* sendmail-compat makemap ... re-execute using proper interface */ if (argc == 2) { if (oflag) usage(); p = strstr(argv[1], ".db"); if (p == NULL || strcmp(p, ".db") != 0) { if (!bsnprintf(dbname, sizeof dbname, "%s.db", argv[1])) errx(1, "database name too long"); } else { if (strlcpy(dbname, argv[1], sizeof dbname) >= sizeof dbname) errx(1, "database name too long"); } execl(PATH_MAKEMAP, "makemap", "-d", argv[0], "-o", dbname, "-", (char *)NULL); err(1, "execl"); } if (mode == P_NEWALIASES) { if (geteuid()) errx(1, "need root privileges"); if (argc != 0) usage(); type = T_ALIASES; if (source == NULL) source = conf_aliases(conf); } else { if (argc != 1) usage(); source = argv[0]; } if (Uflag) return dump_db(source, dbtype); if (oflag == NULL && asprintf(&oflag, "%s.db", source) == -1) err(1, "asprintf"); if (strcmp(source, "-") != 0) if (stat(source, &sb) == -1) err(1, "stat: %s", source); if (!bsnprintf(dbname, sizeof(dbname), "%s.XXXXXXXXXXX", oflag)) errx(1, "path too long"); if ((fd = mkstemp(dbname)) == -1) err(1, "mkstemp"); db = dbopen(dbname, O_TRUNC|O_RDWR, 0644, dbtype, NULL); if (db == NULL) { warn("dbopen: %s", dbname); goto bad; } if (strcmp(source, "-") != 0) if (fchmod(db->fd(db), sb.st_mode) == -1 || fchown(db->fd(db), sb.st_uid, sb.st_gid) == -1) { warn("couldn't carry ownership and perms to %s", dbname); goto bad; } if (!parse_map(db, &dbputs, source)) goto bad; if (db->close(db) == -1) { warn("dbclose: %s", dbname); goto bad; } /* force to disk before renaming over an existing file */ if (fsync(fd) == -1) { warn("fsync: %s", dbname); goto bad; } if (close(fd) == -1) { fd = -1; warn("close: %s", dbname); goto bad; } fd = -1; if (rename(dbname, oflag) == -1) { warn("rename"); goto bad; } if (mode == P_NEWALIASES) printf("%s: %d aliases\n", source, dbputs); else if (dbputs == 0) warnx("warning: empty map created: %s", oflag); return 0; bad: if (fd != -1) close(fd); unlink(dbname); return 1; } static int parse_map(DB *db, int *dbputs, char *filename) { FILE *fp; char *key, *val, *line = NULL; size_t linesize = 0; size_t lineno = 0; int malformed, table_type, r; if (strcmp(filename, "-") == 0) fp = fdopen(0, "r"); else fp = fopen(filename, "r"); if (fp == NULL) { warn("%s", filename); return 0; } if (!isatty(fileno(fp)) && flock(fileno(fp), LOCK_SH|LOCK_NB) == -1) { if (errno == EWOULDBLOCK) warnx("%s is locked", filename); else warn("%s: flock", filename); fclose(fp); return 0; } table_type = (type == T_SET) ? T_LIST : T_HASH; while (parse_table_line(fp, &line, &linesize, &table_type, &key, &val, &malformed) != -1) { lineno++; if (malformed) { warnx("%s:%zd: invalid entry", source, lineno); free(line); fclose(fp); return 0; } if (key == NULL) continue; switch (type) { case T_PLAIN: case T_ALIASES: r = add_mapentry(db, dbputs, key, val, lineno); break; case T_SET: r = add_setentry(db, dbputs, key, lineno); break; } if (!r) { free(line); fclose(fp); return 0; } } free(line); fclose(fp); return 1; } static int add_mapentry(DB *db, int *dbputs, char *keyp, char *valp, size_t lineno) { DBT key; DBT val; /* Check for dups. */ key.data = keyp; key.size = strlen(keyp) + 1; xlowercase(key.data, key.data, strlen(key.data) + 1); if (db->get(db, &key, &val, 0) == 0) { warnx("%s:%zd: duplicate entry for %s", source, lineno, keyp); return 0; } if (type == T_PLAIN) { if (!make_plain(&val, valp)) goto bad; } else if (type == T_ALIASES) { if (!make_aliases(&val, valp)) goto bad; } if (db->put(db, &key, &val, 0) == -1) { warn("dbput"); return 0; } (*dbputs)++; free(val.data); return 1; bad: warnx("%s:%zd: invalid entry", source, lineno); return 0; } static int add_setentry(DB *db, int *dbputs, char *keyp, size_t lineno) { DBT key; DBT val; val.data = ""; val.size = strlen(val.data) + 1; /* Check for dups. */ key.data = keyp; key.size = strlen(keyp) + 1; xlowercase(key.data, key.data, strlen(key.data) + 1); if (db->get(db, &key, &val, 0) == 0) { warnx("%s:%zd: duplicate entry for %s", source, lineno, keyp); return 0; } if (db->put(db, &key, &val, 0) == -1) { warn("dbput"); return 0; } (*dbputs)++; return 1; } static int make_plain(DBT *val, char *text) { val->data = xstrdup(text); val->size = strlen(text) + 1; return (val->size); } static int make_aliases(DBT *val, char *text) { struct expandnode xn; char *subrcpt; char *origtext; val->data = NULL; val->size = 0; origtext = xstrdup(text); while ((subrcpt = strsep(&text, ",")) != NULL) { /* subrcpt: strip initial and trailing whitespace. */ subrcpt = strip(subrcpt); if (*subrcpt == '\0') goto error; if (!text_to_expandnode(&xn, subrcpt)) goto error; } val->data = origtext; val->size = strlen(origtext) + 1; return (val->size); error: free(origtext); return 0; } static char * conf_aliases(char *cfgpath) { struct table *table; char *path; char *p; if (parse_config(env, cfgpath, 0)) exit(1); table = table_find(env, "aliases"); if (table == NULL) return (PATH_ALIASES); path = xstrdup(table->t_config); p = strstr(path, ".db"); if (p == NULL || strcmp(p, ".db") != 0) { return (path); } *p = '\0'; return (path); } static int dump_db(const char *dbname, DBTYPE dbtype) { DB *db; DBT key, val; char *keystr, *valstr; int r; db = dbopen(dbname, O_RDONLY, 0644, dbtype, NULL); if (db == NULL) err(1, "dbopen: %s", dbname); for (r = db->seq(db, &key, &val, R_FIRST); r == 0; r = db->seq(db, &key, &val, R_NEXT)) { keystr = key.data; valstr = val.data; if (keystr[key.size - 1] == '\0') key.size--; if (valstr[val.size - 1] == '\0') val.size--; printf("%.*s\t%.*s\n", (int)key.size, keystr, (int)val.size, valstr); } if (r == -1) err(1, "db->seq: %s", dbname); if (db->close(db) == -1) err(1, "dbclose: %s", dbname); return 0; } static void usage(void) { if (mode == P_NEWALIASES) fprintf(stderr, "usage: newaliases [-f file]\n"); else fprintf(stderr, "usage: makemap [-U] [-d dbtype] [-o dbfile] " "[-t type] file\n"); exit(1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/dict.c0000644000175000001440000001233714610663500013443 /* $OpenBSD: dict.c,v 1.8 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include "dict.h" #include "log.h" struct dictentry { SPLAY_ENTRY(dictentry) entry; const char *key; void *data; }; static int dictentry_cmp(struct dictentry *, struct dictentry *); SPLAY_PROTOTYPE(_dict, dictentry, entry, dictentry_cmp); int dict_check(struct dict *d, const char *k) { struct dictentry key; key.key = k; return (SPLAY_FIND(_dict, &d->dict, &key) != NULL); } static inline struct dictentry * dict_alloc(const char *k, void *data) { struct dictentry *e; size_t s = strlen(k) + 1; void *t; if ((e = malloc(sizeof(*e) + s)) == NULL) return NULL; e->key = t = (char*)(e) + sizeof(*e); e->data = data; memmove(t, k, s); return (e); } void * dict_set(struct dict *d, const char *k, void *data) { struct dictentry *entry, key; char *old; key.key = k; if ((entry = SPLAY_FIND(_dict, &d->dict, &key)) == NULL) { if ((entry = dict_alloc(k, data)) == NULL) fatal("dict_set: malloc"); SPLAY_INSERT(_dict, &d->dict, entry); old = NULL; d->count += 1; } else { old = entry->data; entry->data = data; } return (old); } void dict_xset(struct dict *d, const char * k, void *data) { struct dictentry *entry; if ((entry = dict_alloc(k, data)) == NULL) fatal("dict_xset: malloc"); if (SPLAY_INSERT(_dict, &d->dict, entry)) fatalx("dict_xset(%p, %s)", d, k); d->count += 1; } void * dict_get(struct dict *d, const char *k) { struct dictentry key, *entry; key.key = k; if ((entry = SPLAY_FIND(_dict, &d->dict, &key)) == NULL) return (NULL); return (entry->data); } void * dict_xget(struct dict *d, const char *k) { struct dictentry key, *entry; key.key = k; if ((entry = SPLAY_FIND(_dict, &d->dict, &key)) == NULL) fatalx("dict_xget(%p, %s)", d, k); return (entry->data); } void * dict_pop(struct dict *d, const char *k) { struct dictentry key, *entry; void *data; key.key = k; if ((entry = SPLAY_FIND(_dict, &d->dict, &key)) == NULL) return (NULL); data = entry->data; SPLAY_REMOVE(_dict, &d->dict, entry); free(entry); d->count -= 1; return (data); } void * dict_xpop(struct dict *d, const char *k) { struct dictentry key, *entry; void *data; key.key = k; if ((entry = SPLAY_FIND(_dict, &d->dict, &key)) == NULL) fatalx("dict_xpop(%p, %s)", d, k); data = entry->data; SPLAY_REMOVE(_dict, &d->dict, entry); free(entry); d->count -= 1; return (data); } int dict_poproot(struct dict *d, void **data) { struct dictentry *entry; entry = SPLAY_ROOT(&d->dict); if (entry == NULL) return (0); if (data) *data = entry->data; SPLAY_REMOVE(_dict, &d->dict, entry); free(entry); d->count -= 1; return (1); } int dict_root(struct dict *d, const char **k, void **data) { struct dictentry *entry; entry = SPLAY_ROOT(&d->dict); if (entry == NULL) return (0); if (k) *k = entry->key; if (data) *data = entry->data; return (1); } int dict_iter(struct dict *d, void **hdl, const char **k, void **data) { struct dictentry *curr = *hdl; if (curr == NULL) curr = SPLAY_MIN(_dict, &d->dict); else curr = SPLAY_NEXT(_dict, &d->dict, curr); if (curr) { *hdl = curr; if (k) *k = curr->key; if (data) *data = curr->data; return (1); } return (0); } int dict_iterfrom(struct dict *d, void **hdl, const char *kfrom, const char **k, void **data) { struct dictentry *curr = *hdl, key; if (curr == NULL) { if (kfrom == NULL) curr = SPLAY_MIN(_dict, &d->dict); else { key.key = kfrom; curr = SPLAY_FIND(_dict, &d->dict, &key); if (curr == NULL) { SPLAY_INSERT(_dict, &d->dict, &key); curr = SPLAY_NEXT(_dict, &d->dict, &key); SPLAY_REMOVE(_dict, &d->dict, &key); } } } else curr = SPLAY_NEXT(_dict, &d->dict, curr); if (curr) { *hdl = curr; if (k) *k = curr->key; if (data) *data = curr->data; return (1); } return (0); } void dict_merge(struct dict *dst, struct dict *src) { struct dictentry *entry; while (!SPLAY_EMPTY(&src->dict)) { entry = SPLAY_ROOT(&src->dict); SPLAY_REMOVE(_dict, &src->dict, entry); if (SPLAY_INSERT(_dict, &dst->dict, entry)) fatalx("dict_merge: duplicate"); } dst->count += src->count; src->count = 0; } static int dictentry_cmp(struct dictentry *a, struct dictentry *b) { return strcmp(a->key, b->key); } SPLAY_GENERATE(_dict, dictentry, entry, dictentry_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/mta.c0000644000175000001440000021302014620126254013272 /* $OpenBSD: mta.c,v 1.248 2024/04/23 13:34:51 jsg Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #include "ssl.h" #define MAXERROR_PER_ROUTE 4 #define DELAY_CHECK_SOURCE 1 #define DELAY_CHECK_SOURCE_SLOW 10 #define DELAY_CHECK_SOURCE_FAST 0 #define DELAY_CHECK_LIMIT 5 #define DELAY_QUADRATIC 1 #define DELAY_ROUTE_BASE 15 #define DELAY_ROUTE_MAX 3600 #define RELAY_ONHOLD 0x01 #define RELAY_HOLDQ 0x02 static void mta_setup_dispatcher(struct dispatcher *); static void mta_handle_envelope(struct envelope *, const char *); static void mta_query_smarthost(struct envelope *); static void mta_on_smarthost(struct envelope *, const char *); static void mta_query_mx(struct mta_relay *); static void mta_query_secret(struct mta_relay *); static void mta_query_preference(struct mta_relay *); static void mta_query_source(struct mta_relay *); static void mta_on_mx(void *, void *, void *); static void mta_on_secret(struct mta_relay *, const char *); static void mta_on_preference(struct mta_relay *, int); static void mta_on_source(struct mta_relay *, struct mta_source *); static void mta_on_timeout(struct runq *, void *); static void mta_connect(struct mta_connector *); static void mta_route_enable(struct mta_route *); static void mta_route_disable(struct mta_route *, int, int); static void mta_drain(struct mta_relay *); static void mta_delivery_flush_event(int, short, void *); static void mta_flush(struct mta_relay *, int, const char *); static struct mta_route *mta_find_route(struct mta_connector *, time_t, int*, time_t*, struct mta_mx **); static void mta_log(const struct mta_envelope *, const char *, const char *, const char *, const char *); SPLAY_HEAD(mta_relay_tree, mta_relay); static struct mta_relay *mta_relay(struct envelope *, struct relayhost *); static void mta_relay_ref(struct mta_relay *); static void mta_relay_unref(struct mta_relay *); static void mta_relay_show(struct mta_relay *, struct mproc *, uint32_t, time_t); static int mta_relay_cmp(const struct mta_relay *, const struct mta_relay *); SPLAY_PROTOTYPE(mta_relay_tree, mta_relay, entry, mta_relay_cmp); SPLAY_HEAD(mta_host_tree, mta_host); static struct mta_host *mta_host(const struct sockaddr *); static void mta_host_ref(struct mta_host *); static void mta_host_unref(struct mta_host *); static int mta_host_cmp(const struct mta_host *, const struct mta_host *); SPLAY_PROTOTYPE(mta_host_tree, mta_host, entry, mta_host_cmp); SPLAY_HEAD(mta_domain_tree, mta_domain); static struct mta_domain *mta_domain(char *, int); #if 0 static void mta_domain_ref(struct mta_domain *); #endif static void mta_domain_unref(struct mta_domain *); static int mta_domain_cmp(const struct mta_domain *, const struct mta_domain *); SPLAY_PROTOTYPE(mta_domain_tree, mta_domain, entry, mta_domain_cmp); SPLAY_HEAD(mta_source_tree, mta_source); static struct mta_source *mta_source(const struct sockaddr *); static void mta_source_ref(struct mta_source *); static void mta_source_unref(struct mta_source *); static const char *mta_source_to_text(struct mta_source *); static int mta_source_cmp(const struct mta_source *, const struct mta_source *); SPLAY_PROTOTYPE(mta_source_tree, mta_source, entry, mta_source_cmp); static struct mta_connector *mta_connector(struct mta_relay *, struct mta_source *); static void mta_connector_free(struct mta_connector *); static const char *mta_connector_to_text(struct mta_connector *); SPLAY_HEAD(mta_route_tree, mta_route); static struct mta_route *mta_route(struct mta_source *, struct mta_host *); static void mta_route_ref(struct mta_route *); static void mta_route_unref(struct mta_route *); static const char *mta_route_to_text(struct mta_route *); static int mta_route_cmp(const struct mta_route *, const struct mta_route *); SPLAY_PROTOTYPE(mta_route_tree, mta_route, entry, mta_route_cmp); struct mta_block { SPLAY_ENTRY(mta_block) entry; struct mta_source *source; char *domain; }; SPLAY_HEAD(mta_block_tree, mta_block); void mta_block(struct mta_source *, char *); void mta_unblock(struct mta_source *, char *); int mta_is_blocked(struct mta_source *, char *); static int mta_block_cmp(const struct mta_block *, const struct mta_block *); SPLAY_PROTOTYPE(mta_block_tree, mta_block, entry, mta_block_cmp); /* * This function is not publicy exported because it is a hack until libtls * has a proper privsep setup */ void tls_config_use_fake_private_key(struct tls_config *config); static struct mta_relay_tree relays; static struct mta_domain_tree domains; static struct mta_host_tree hosts; static struct mta_source_tree sources; static struct mta_route_tree routes; static struct mta_block_tree blocks; static struct tree wait_mx; static struct tree wait_preference; static struct tree wait_secret; static struct tree wait_smarthost; static struct tree wait_source; static struct tree flush_evp; static struct event ev_flush_evp; static struct runq *runq_relay; static struct runq *runq_connector; static struct runq *runq_route; static struct runq *runq_hoststat; static time_t max_seen_conndelay_route; static time_t max_seen_discdelay_route; #define HOSTSTAT_EXPIRE_DELAY (4 * 3600) struct hoststat { char name[HOST_NAME_MAX+1]; time_t tm; char error[LINE_MAX]; struct tree deferred; }; static struct dict hoststat; void mta_hoststat_update(const char *, const char *); void mta_hoststat_cache(const char *, uint64_t); void mta_hoststat_uncache(const char *, uint64_t); void mta_hoststat_reschedule(const char *); static void mta_hoststat_remove_entry(struct hoststat *); void mta_imsg(struct mproc *p, struct imsg *imsg) { struct mta_relay *relay; struct mta_domain *domain; struct mta_host *host; struct mta_route *route; struct mta_block *block; struct mta_mx *mx, *imx; struct mta_source *source; struct hoststat *hs; struct sockaddr_storage ss; struct envelope evp, *e; struct msg m; const char *secret; const char *hostname; const char *dom; const char *smarthost; uint64_t reqid; time_t t; char buf[LINE_MAX]; int dnserror, preference, v, status; void *iter; uint64_t u64; switch (imsg->hdr.type) { case IMSG_QUEUE_TRANSFER: m_msg(&m, imsg); m_get_envelope(&m, &evp); m_end(&m); mta_handle_envelope(&evp, NULL); return; case IMSG_MTA_OPEN_MESSAGE: mta_session_imsg(p, imsg); return; case IMSG_MTA_LOOKUP_CREDENTIALS: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &secret); m_end(&m); relay = tree_xpop(&wait_secret, reqid); mta_on_secret(relay, secret[0] ? secret : NULL); return; case IMSG_MTA_LOOKUP_SOURCE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &status); if (status == LKA_OK) m_get_sockaddr(&m, (struct sockaddr*)&ss); m_end(&m); relay = tree_xpop(&wait_source, reqid); mta_on_source(relay, (status == LKA_OK) ? mta_source((struct sockaddr *)&ss) : NULL); return; case IMSG_MTA_LOOKUP_SMARTHOST: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &status); smarthost = NULL; if (status == LKA_OK) m_get_string(&m, &smarthost); m_end(&m); e = tree_xpop(&wait_smarthost, reqid); mta_on_smarthost(e, smarthost); return; case IMSG_MTA_LOOKUP_HELO: mta_session_imsg(p, imsg); return; case IMSG_MTA_DNS_HOST: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &hostname); m_get_sockaddr(&m, (struct sockaddr*)&ss); m_get_int(&m, &preference); m_end(&m); domain = tree_xget(&wait_mx, reqid); mx = xcalloc(1, sizeof *mx); mx->mxname = xstrdup(hostname); mx->host = mta_host((struct sockaddr*)&ss); mx->preference = preference; TAILQ_FOREACH(imx, &domain->mxs, entry) { if (imx->preference > mx->preference) { TAILQ_INSERT_BEFORE(imx, mx, entry); return; } } TAILQ_INSERT_TAIL(&domain->mxs, mx, entry); return; case IMSG_MTA_DNS_HOST_END: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &dnserror); m_end(&m); domain = tree_xpop(&wait_mx, reqid); domain->mxstatus = dnserror; if (domain->mxstatus == DNS_OK) { log_debug("debug: MXs for domain %s:", domain->name); TAILQ_FOREACH(mx, &domain->mxs, entry) log_debug(" %s preference %d", sa_to_text(mx->host->sa), mx->preference); } else { log_debug("debug: Failed MX query for %s:", domain->name); } domain->lastmxquery = time(NULL); waitq_run(&domain->mxs, domain); return; case IMSG_MTA_DNS_MX_PREFERENCE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &dnserror); if (dnserror == 0) m_get_int(&m, &preference); m_end(&m); relay = tree_xpop(&wait_preference, reqid); if (dnserror) { log_warnx("warn: Couldn't find backup " "preference for %s: error %d", mta_relay_to_text(relay), dnserror); preference = INT_MAX; } mta_on_preference(relay, preference); return; case IMSG_CTL_RESUME_ROUTE: u64 = *((uint64_t *)imsg->data); if (u64) log_debug("resuming route: %llu", (unsigned long long)u64); else log_debug("resuming all routes"); SPLAY_FOREACH(route, mta_route_tree, &routes) { if (u64 && route->id != u64) continue; if (route->flags & ROUTE_DISABLED) { log_info("smtp-out: Enabling route %s per admin request", mta_route_to_text(route)); if (!runq_cancel(runq_route, route)) { log_warnx("warn: route not on runq"); fatalx("exiting"); } route->flags &= ~ROUTE_DISABLED; route->flags |= ROUTE_NEW; route->nerror = 0; route->penalty = 0; mta_route_unref(route); /* from mta_route_disable */ } if (u64) break; } return; case IMSG_CTL_MTA_SHOW_HOSTS: t = time(NULL); SPLAY_FOREACH(host, mta_host_tree, &hosts) { (void)snprintf(buf, sizeof(buf), "%s %s refcount=%d nconn=%zu lastconn=%s", sockaddr_to_text(host->sa), host->ptrname, host->refcount, host->nconn, host->lastconn ? duration_to_text(t - host->lastconn) : "-"); m_compose(p, IMSG_CTL_MTA_SHOW_HOSTS, imsg->hdr.peerid, 0, -1, buf, strlen(buf) + 1); } m_compose(p, IMSG_CTL_MTA_SHOW_HOSTS, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_SHOW_RELAYS: t = time(NULL); SPLAY_FOREACH(relay, mta_relay_tree, &relays) mta_relay_show(relay, p, imsg->hdr.peerid, t); m_compose(p, IMSG_CTL_MTA_SHOW_RELAYS, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_SHOW_ROUTES: SPLAY_FOREACH(route, mta_route_tree, &routes) { v = runq_pending(runq_route, route, &t); (void)snprintf(buf, sizeof(buf), "%llu. %s %c%c%c%c nconn=%zu nerror=%d penalty=%d timeout=%s", (unsigned long long)route->id, mta_route_to_text(route), route->flags & ROUTE_NEW ? 'N' : '-', route->flags & ROUTE_DISABLED ? 'D' : '-', route->flags & ROUTE_RUNQ ? 'Q' : '-', route->flags & ROUTE_KEEPALIVE ? 'K' : '-', route->nconn, route->nerror, route->penalty, v ? duration_to_text(t - time(NULL)) : "-"); m_compose(p, IMSG_CTL_MTA_SHOW_ROUTES, imsg->hdr.peerid, 0, -1, buf, strlen(buf) + 1); } m_compose(p, IMSG_CTL_MTA_SHOW_ROUTES, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_SHOW_HOSTSTATS: iter = NULL; while (dict_iter(&hoststat, &iter, &hostname, (void **)&hs)) { (void)snprintf(buf, sizeof(buf), "%s|%llu|%s", hostname, (unsigned long long) hs->tm, hs->error); m_compose(p, IMSG_CTL_MTA_SHOW_HOSTSTATS, imsg->hdr.peerid, 0, -1, buf, strlen(buf) + 1); } m_compose(p, IMSG_CTL_MTA_SHOW_HOSTSTATS, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_BLOCK: m_msg(&m, imsg); m_get_sockaddr(&m, (struct sockaddr*)&ss); m_get_string(&m, &dom); m_end(&m); source = mta_source((struct sockaddr*)&ss); if (*dom != '\0') { if (!(strlcpy(buf, dom, sizeof(buf)) >= sizeof(buf))) mta_block(source, buf); } else mta_block(source, NULL); mta_source_unref(source); m_compose(p, IMSG_CTL_OK, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_UNBLOCK: m_msg(&m, imsg); m_get_sockaddr(&m, (struct sockaddr*)&ss); m_get_string(&m, &dom); m_end(&m); source = mta_source((struct sockaddr*)&ss); if (*dom != '\0') { if (!(strlcpy(buf, dom, sizeof(buf)) >= sizeof(buf))) mta_unblock(source, buf); } else mta_unblock(source, NULL); mta_source_unref(source); m_compose(p, IMSG_CTL_OK, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_MTA_SHOW_BLOCK: SPLAY_FOREACH(block, mta_block_tree, &blocks) { (void)snprintf(buf, sizeof(buf), "%s -> %s", mta_source_to_text(block->source), block->domain ? block->domain : "*"); m_compose(p, IMSG_CTL_MTA_SHOW_BLOCK, imsg->hdr.peerid, 0, -1, buf, strlen(buf) + 1); } m_compose(p, IMSG_CTL_MTA_SHOW_BLOCK, imsg->hdr.peerid, 0, -1, NULL, 0); return; } fatalx("mta_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } void mta_postfork(void) { struct dispatcher *dispatcher; const char *key; void *iter; iter = NULL; while (dict_iter(env->sc_dispatchers, &iter, &key, (void **)&dispatcher)) { log_debug("%s: %s", __func__, key); mta_setup_dispatcher(dispatcher); } } static void mta_setup_dispatcher(struct dispatcher *dispatcher) { struct dispatcher_remote *remote; static const char *dheparams[] = { "none", "auto", "legacy" }; struct tls_config *config; struct pki *pki; struct ca *ca; const char *ciphers; uint32_t protos; if (dispatcher->type != DISPATCHER_REMOTE) return; remote = &dispatcher->u.remote; if ((config = tls_config_new()) == NULL) fatal("smtpd: tls_config_new"); ciphers = env->sc_tls_ciphers; if (remote->tls_ciphers) ciphers = remote->tls_ciphers; if (ciphers && tls_config_set_ciphers(config, ciphers) == -1) fatalx("%s", tls_config_error(config)); if (remote->tls_protocols) { if (tls_config_parse_protocols(&protos, remote->tls_protocols) == -1) fatalx("failed to parse protocols \"%s\"", remote->tls_protocols); if (tls_config_set_protocols(config, protos) == -1) fatalx("%s", tls_config_error(config)); } if (remote->pki) { pki = dict_get(env->sc_pki_dict, remote->pki); if (pki == NULL) fatalx("client pki \"%s\" not found", remote->pki); tls_config_set_dheparams(config, dheparams[pki->pki_dhe]); tls_config_use_fake_private_key(config); if (tls_config_set_keypair_mem(config, pki->pki_cert, pki->pki_cert_len, NULL, 0) == -1) fatalx("tls_config_set_keypair_mem: %s", tls_config_error(config)); } if (remote->ca) { ca = dict_get(env->sc_ca_dict, remote->ca); if (tls_config_set_ca_mem(config, ca->ca_cert, ca->ca_cert_len) == -1) fatalx("tls_config_set_ca_mem: %s", tls_config_error(config)); } else if (tls_config_set_ca_file(config, tls_default_ca_cert_file()) == -1) fatalx("tls_config_set_ca_file: %s", tls_config_error(config)); if (remote->tls_verify) { tls_config_verify(config); } else { tls_config_insecure_noverifycert(config); tls_config_insecure_noverifyname(config); tls_config_insecure_noverifytime(config); } remote->tls_config = config; } void mta_postprivdrop(void) { SPLAY_INIT(&relays); SPLAY_INIT(&domains); SPLAY_INIT(&hosts); SPLAY_INIT(&sources); SPLAY_INIT(&routes); SPLAY_INIT(&blocks); tree_init(&wait_secret); tree_init(&wait_smarthost); tree_init(&wait_mx); tree_init(&wait_preference); tree_init(&wait_source); tree_init(&flush_evp); dict_init(&hoststat); evtimer_set(&ev_flush_evp, mta_delivery_flush_event, NULL); runq_init(&runq_relay, mta_on_timeout); runq_init(&runq_connector, mta_on_timeout); runq_init(&runq_route, mta_on_timeout); runq_init(&runq_hoststat, mta_on_timeout); } /* * Local error on the given source. */ void mta_source_error(struct mta_relay *relay, struct mta_route *route, const char *e) { struct mta_connector *c; /* * Remember the source as broken for this connector. */ c = mta_connector(relay, route->src); if (!(c->flags & CONNECTOR_ERROR_SOURCE)) log_info("smtp-out: Error on %s: %s", mta_route_to_text(route), e); c->flags |= CONNECTOR_ERROR_SOURCE; } void mta_route_error(struct mta_relay *relay, struct mta_route *route) { #if 0 route->nerror += 1; if (route->nerror > MAXERROR_PER_ROUTE) { log_info("smtp-out: Too many errors on %s: " "disabling for a while", mta_route_to_text(route)); mta_route_disable(route, 2, ROUTE_DISABLED_SMTP); } #endif } void mta_route_ok(struct mta_relay *relay, struct mta_route *route) { struct mta_connector *c; if (!(route->flags & ROUTE_NEW)) return; log_debug("debug: mta-routing: route %s is now valid.", mta_route_to_text(route)); route->nerror = 0; route->flags &= ~ROUTE_NEW; c = mta_connector(relay, route->src); mta_connect(c); } void mta_route_down(struct mta_relay *relay, struct mta_route *route) { #if 0 mta_route_disable(route, 2, ROUTE_DISABLED_SMTP); #endif } void mta_route_collect(struct mta_relay *relay, struct mta_route *route) { struct mta_connector *c; log_debug("debug: mta_route_collect(%s)", mta_route_to_text(route)); relay->nconn -= 1; relay->domain->nconn -= 1; route->nconn -= 1; route->src->nconn -= 1; route->dst->nconn -= 1; route->lastdisc = time(NULL); /* First connection failed */ if (route->flags & ROUTE_NEW) mta_route_disable(route, 1, ROUTE_DISABLED_NET); c = mta_connector(relay, route->src); c->nconn -= 1; mta_connect(c); mta_route_unref(route); /* from mta_find_route() */ mta_relay_unref(relay); /* from mta_connect() */ } struct mta_task * mta_route_next_task(struct mta_relay *relay, struct mta_route *route) { struct mta_task *task; if ((task = TAILQ_FIRST(&relay->tasks))) { TAILQ_REMOVE(&relay->tasks, task, entry); relay->ntask -= 1; task->relay = NULL; /* When the number of tasks is down to lowat, query some evp */ if (relay->ntask == (size_t)relay->limits->task_lowat) { if (relay->state & RELAY_ONHOLD) { log_info("smtp-out: back to lowat on %s: releasing", mta_relay_to_text(relay)); relay->state &= ~RELAY_ONHOLD; } if (relay->state & RELAY_HOLDQ) { m_create(p_queue, IMSG_MTA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, relay->id); m_add_int(p_queue, relay->limits->task_release); m_close(p_queue); } } else if (relay->ntask == 0 && relay->state & RELAY_HOLDQ) { m_create(p_queue, IMSG_MTA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, relay->id); m_add_int(p_queue, 0); m_close(p_queue); } } return (task); } static void mta_handle_envelope(struct envelope *evp, const char *smarthost) { struct mta_relay *relay; struct mta_task *task; struct mta_envelope *e; struct dispatcher *dispatcher; struct mailaddr maddr; struct relayhost relayh; char buf[LINE_MAX]; dispatcher = dict_xget(env->sc_dispatchers, evp->dispatcher); if (dispatcher->u.remote.smarthost && smarthost == NULL) { mta_query_smarthost(evp); return; } memset(&relayh, 0, sizeof(relayh)); relayh.tls = RELAY_TLS_OPPORTUNISTIC; if (smarthost && !text_to_relayhost(&relayh, smarthost)) { log_warnx("warn: Failed to parse smarthost %s", smarthost); m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, evp->id); m_add_string(p_queue, "Cannot parse smarthost"); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); return; } if (relayh.flags & RELAY_AUTH && dispatcher->u.remote.auth == NULL) { log_warnx("warn: No auth table on action \"%s\" for relay %s", evp->dispatcher, smarthost); m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, evp->id); m_add_string(p_queue, "No auth table for relaying"); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); return; } if (dispatcher->u.remote.tls_required) { /* Reject relay if smtp+notls:// is requested */ if (relayh.tls == RELAY_TLS_NO) { log_warnx("warn: TLS required for action \"%s\"", evp->dispatcher); m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, evp->id); m_add_string(p_queue, "TLS required for relaying"); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); return; } /* Update smtp:// to smtp+tls:// */ if (relayh.tls == RELAY_TLS_OPPORTUNISTIC) relayh.tls = RELAY_TLS_STARTTLS; } relay = mta_relay(evp, &relayh); /* ignore if we don't know the limits yet */ if (relay->limits && relay->ntask >= (size_t)relay->limits->task_hiwat) { if (!(relay->state & RELAY_ONHOLD)) { log_info("smtp-out: hiwat reached on %s: holding envelopes", mta_relay_to_text(relay)); relay->state |= RELAY_ONHOLD; } } /* * If the relay has too many pending tasks, tell the * scheduler to hold it until further notice */ if (relay->state & RELAY_ONHOLD) { relay->state |= RELAY_HOLDQ; m_create(p_queue, IMSG_MTA_DELIVERY_HOLD, 0, 0, -1); m_add_evpid(p_queue, evp->id); m_add_id(p_queue, relay->id); m_close(p_queue); mta_relay_unref(relay); /* from here */ return; } task = NULL; TAILQ_FOREACH(task, &relay->tasks, entry) if (task->msgid == evpid_to_msgid(evp->id)) break; if (task == NULL) { task = xmalloc(sizeof *task); TAILQ_INIT(&task->envelopes); task->relay = relay; relay->ntask += 1; TAILQ_INSERT_TAIL(&relay->tasks, task, entry); task->msgid = evpid_to_msgid(evp->id); if (evp->sender.user[0] || evp->sender.domain[0]) (void)snprintf(buf, sizeof buf, "%s@%s", evp->sender.user, evp->sender.domain); else buf[0] = '\0'; if (dispatcher->u.remote.mail_from && evp->sender.user[0]) { memset(&maddr, 0, sizeof (maddr)); if (text_to_mailaddr(&maddr, dispatcher->u.remote.mail_from)) { (void)snprintf(buf, sizeof buf, "%s@%s", maddr.user[0] ? maddr.user : evp->sender.user, maddr.domain[0] ? maddr.domain : evp->sender.domain); } } task->sender = xstrdup(buf); stat_increment("mta.task", 1); } e = xcalloc(1, sizeof *e); e->id = evp->id; e->creation = evp->creation; e->smtpname = xstrdup(evp->smtpname); (void)snprintf(buf, sizeof buf, "%s@%s", evp->dest.user, evp->dest.domain); e->dest = xstrdup(buf); (void)snprintf(buf, sizeof buf, "%s@%s", evp->rcpt.user, evp->rcpt.domain); if (strcmp(buf, e->dest)) e->rcpt = xstrdup(buf); e->task = task; if (evp->dsn_orcpt[0] != '\0') e->dsn_orcpt = xstrdup(evp->dsn_orcpt); (void)strlcpy(e->dsn_envid, evp->dsn_envid, sizeof e->dsn_envid); e->dsn_notify = evp->dsn_notify; e->dsn_ret = evp->dsn_ret; TAILQ_INSERT_TAIL(&task->envelopes, e, entry); log_debug("debug: mta: received evp:%016" PRIx64 " for <%s>", e->id, e->dest); stat_increment("mta.envelope", 1); mta_drain(relay); mta_relay_unref(relay); /* from here */ } static void mta_delivery_flush_event(int fd, short event, void *arg) { struct mta_envelope *e; struct timeval tv; if (tree_poproot(&flush_evp, NULL, (void**)(&e))) { if (e->delivery == IMSG_MTA_DELIVERY_OK) { m_create(p_queue, IMSG_MTA_DELIVERY_OK, 0, 0, -1); m_add_evpid(p_queue, e->id); m_add_int(p_queue, e->ext); m_close(p_queue); } else if (e->delivery == IMSG_MTA_DELIVERY_TEMPFAIL) { m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, e->id); m_add_string(p_queue, e->status); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); } else if (e->delivery == IMSG_MTA_DELIVERY_PERMFAIL) { m_create(p_queue, IMSG_MTA_DELIVERY_PERMFAIL, 0, 0, -1); m_add_evpid(p_queue, e->id); m_add_string(p_queue, e->status); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); } else if (e->delivery == IMSG_MTA_DELIVERY_LOOP) { m_create(p_queue, IMSG_MTA_DELIVERY_LOOP, 0, 0, -1); m_add_evpid(p_queue, e->id); m_close(p_queue); } else { log_warnx("warn: bad delivery type %d for %016" PRIx64, e->delivery, e->id); fatalx("aborting"); } log_debug("debug: mta: flush for %016"PRIx64" (-> %s)", e->id, e->dest); free(e->smtpname); free(e->dest); free(e->rcpt); free(e->dsn_orcpt); free(e); tv.tv_sec = 0; tv.tv_usec = 0; evtimer_add(&ev_flush_evp, &tv); } } void mta_delivery_log(struct mta_envelope *e, const char *source, const char *relay, int delivery, const char *status) { if (delivery == IMSG_MTA_DELIVERY_OK) mta_log(e, "Ok", source, relay, status); else if (delivery == IMSG_MTA_DELIVERY_TEMPFAIL) mta_log(e, "TempFail", source, relay, status); else if (delivery == IMSG_MTA_DELIVERY_PERMFAIL) mta_log(e, "PermFail", source, relay, status); else if (delivery == IMSG_MTA_DELIVERY_LOOP) mta_log(e, "PermFail", source, relay, "Loop detected"); else { log_warnx("warn: bad delivery type %d for %016" PRIx64, delivery, e->id); fatalx("aborting"); } e->delivery = delivery; if (status) (void)strlcpy(e->status, status, sizeof(e->status)); } void mta_delivery_notify(struct mta_envelope *e) { struct timeval tv; tree_xset(&flush_evp, e->id, e); if (tree_count(&flush_evp) == 1) { tv.tv_sec = 0; tv.tv_usec = 0; evtimer_add(&ev_flush_evp, &tv); } } static void mta_query_mx(struct mta_relay *relay) { uint64_t id; if (relay->status & RELAY_WAIT_MX) return; log_debug("debug: mta: querying MX for %s...", mta_relay_to_text(relay)); if (waitq_wait(&relay->domain->mxs, mta_on_mx, relay)) { id = generate_uid(); tree_xset(&wait_mx, id, relay->domain); if (relay->domain->as_host) m_create(p_lka, IMSG_MTA_DNS_HOST, 0, 0, -1); else m_create(p_lka, IMSG_MTA_DNS_MX, 0, 0, -1); m_add_id(p_lka, id); m_add_string(p_lka, relay->domain->name); m_close(p_lka); } relay->status |= RELAY_WAIT_MX; mta_relay_ref(relay); } static void mta_query_limits(struct mta_relay *relay) { if (relay->status & RELAY_WAIT_LIMITS) return; relay->limits = dict_get(env->sc_limits_dict, relay->domain->name); if (relay->limits == NULL) relay->limits = dict_get(env->sc_limits_dict, "default"); if (max_seen_conndelay_route < relay->limits->conndelay_route) max_seen_conndelay_route = relay->limits->conndelay_route; if (max_seen_discdelay_route < relay->limits->discdelay_route) max_seen_discdelay_route = relay->limits->discdelay_route; } static void mta_query_secret(struct mta_relay *relay) { if (relay->status & RELAY_WAIT_SECRET) return; log_debug("debug: mta: querying secret for %s...", mta_relay_to_text(relay)); tree_xset(&wait_secret, relay->id, relay); relay->status |= RELAY_WAIT_SECRET; m_create(p_lka, IMSG_MTA_LOOKUP_CREDENTIALS, 0, 0, -1); m_add_id(p_lka, relay->id); m_add_string(p_lka, relay->authtable); m_add_string(p_lka, relay->authlabel); m_close(p_lka); mta_relay_ref(relay); } static void mta_query_smarthost(struct envelope *evp0) { struct dispatcher *dispatcher; struct envelope *evp; evp = malloc(sizeof(*evp)); memmove(evp, evp0, sizeof(*evp)); dispatcher = dict_xget(env->sc_dispatchers, evp->dispatcher); log_debug("debug: mta: querying smarthost for %s:%s...", evp->dispatcher, dispatcher->u.remote.smarthost); tree_xset(&wait_smarthost, evp->id, evp); m_create(p_lka, IMSG_MTA_LOOKUP_SMARTHOST, 0, 0, -1); m_add_id(p_lka, evp->id); if (dispatcher->u.remote.smarthost_domain) m_add_string(p_lka, evp->dest.domain); else m_add_string(p_lka, NULL); m_add_string(p_lka, dispatcher->u.remote.smarthost); m_close(p_lka); log_debug("debug: mta: querying smarthost"); } static void mta_query_preference(struct mta_relay *relay) { if (relay->status & RELAY_WAIT_PREFERENCE) return; log_debug("debug: mta: querying preference for %s...", mta_relay_to_text(relay)); tree_xset(&wait_preference, relay->id, relay); relay->status |= RELAY_WAIT_PREFERENCE; m_create(p_lka, IMSG_MTA_DNS_MX_PREFERENCE, 0, 0, -1); m_add_id(p_lka, relay->id); m_add_string(p_lka, relay->domain->name); m_add_string(p_lka, relay->backupname); m_close(p_lka); mta_relay_ref(relay); } static void mta_query_source(struct mta_relay *relay) { log_debug("debug: mta: querying source for %s...", mta_relay_to_text(relay)); relay->sourceloop += 1; if (relay->sourcetable == NULL) { /* * This is a recursive call, but it only happens once, since * another source will not be queried immediately. */ mta_relay_ref(relay); mta_on_source(relay, mta_source(NULL)); return; } m_create(p_lka, IMSG_MTA_LOOKUP_SOURCE, 0, 0, -1); m_add_id(p_lka, relay->id); m_add_string(p_lka, relay->sourcetable); m_close(p_lka); tree_xset(&wait_source, relay->id, relay); relay->status |= RELAY_WAIT_SOURCE; mta_relay_ref(relay); } static void mta_on_mx(void *tag, void *arg, void *data) { struct mta_domain *domain = data; struct mta_relay *relay = arg; log_debug("debug: mta: ... got mx (%p, %s, %s)", tag, domain->name, mta_relay_to_text(relay)); switch (domain->mxstatus) { case DNS_OK: break; case DNS_RETRY: relay->fail = IMSG_MTA_DELIVERY_TEMPFAIL; relay->failstr = "Temporary failure in MX lookup"; break; case DNS_EINVAL: relay->fail = IMSG_MTA_DELIVERY_PERMFAIL; relay->failstr = "Invalid domain name"; break; case DNS_ENONAME: relay->fail = IMSG_MTA_DELIVERY_PERMFAIL; relay->failstr = "Domain does not exist"; break; case DNS_ENOTFOUND: relay->fail = IMSG_MTA_DELIVERY_TEMPFAIL; if (relay->domain->as_host) relay->failstr = "Host not found"; else relay->failstr = "No MX found for domain"; break; case DNS_NULLMX: relay->fail = IMSG_MTA_DELIVERY_PERMFAIL; relay->failstr = "Domain does not accept mail"; break; default: fatalx("bad DNS lookup error code"); break; } if (domain->mxstatus) log_info("smtp-out: Failed to resolve MX for %s: %s", mta_relay_to_text(relay), relay->failstr); relay->status &= ~RELAY_WAIT_MX; mta_drain(relay); mta_relay_unref(relay); /* from mta_drain() */ } static void mta_on_secret(struct mta_relay *relay, const char *secret) { log_debug("debug: mta: ... got secret for %s: %s", mta_relay_to_text(relay), secret); if (secret) relay->secret = strdup(secret); if (relay->secret == NULL) { log_warnx("warn: Failed to retrieve secret " "for %s", mta_relay_to_text(relay)); relay->fail = IMSG_MTA_DELIVERY_TEMPFAIL; relay->failstr = "Could not retrieve credentials"; } relay->status &= ~RELAY_WAIT_SECRET; mta_drain(relay); mta_relay_unref(relay); /* from mta_query_secret() */ } static void mta_on_smarthost(struct envelope *evp, const char *smarthost) { if (smarthost == NULL) { log_warnx("warn: Failed to retrieve smarthost " "for envelope %"PRIx64, evp->id); m_create(p_queue, IMSG_MTA_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_evpid(p_queue, evp->id); m_add_string(p_queue, "Cannot retrieve smarthost"); m_add_int(p_queue, ESC_OTHER_STATUS); m_close(p_queue); return; } log_debug("debug: mta: ... got smarthost for %016"PRIx64": %s", evp->id, smarthost); mta_handle_envelope(evp, smarthost); free(evp); } static void mta_on_preference(struct mta_relay *relay, int preference) { log_debug("debug: mta: ... got preference for %s: %d", mta_relay_to_text(relay), preference); relay->backuppref = preference; relay->status &= ~RELAY_WAIT_PREFERENCE; mta_drain(relay); mta_relay_unref(relay); /* from mta_query_preference() */ } static void mta_on_source(struct mta_relay *relay, struct mta_source *source) { struct mta_connector *c; void *iter; int delay, errmask; log_debug("debug: mta: ... got source for %s: %s", mta_relay_to_text(relay), source ? mta_source_to_text(source) : "NULL"); relay->lastsource = time(NULL); delay = DELAY_CHECK_SOURCE_SLOW; if (source) { c = mta_connector(relay, source); if (c->flags & CONNECTOR_NEW) { c->flags &= ~CONNECTOR_NEW; delay = DELAY_CHECK_SOURCE; } mta_connect(c); if ((c->flags & CONNECTOR_ERROR) == 0) relay->sourceloop = 0; else delay = DELAY_CHECK_SOURCE_FAST; mta_source_unref(source); /* from constructor */ } else { log_warnx("warn: Failed to get source address for %s", mta_relay_to_text(relay)); } if (tree_count(&relay->connectors) == 0) { relay->fail = IMSG_MTA_DELIVERY_TEMPFAIL; relay->failstr = "Could not retrieve source address"; } if (tree_count(&relay->connectors) < relay->sourceloop) { relay->fail = IMSG_MTA_DELIVERY_TEMPFAIL; relay->failstr = "No valid route to remote MX"; errmask = 0; iter = NULL; while (tree_iter(&relay->connectors, &iter, NULL, (void **)&c)) errmask |= c->flags; if (errmask & CONNECTOR_ERROR_ROUTE_SMTP) relay->failstr = "Destination seem to reject all mails"; else if (errmask & CONNECTOR_ERROR_ROUTE_NET) relay->failstr = "Network error on destination MXs"; else if (errmask & CONNECTOR_ERROR_MX) relay->failstr = "No MX found for destination"; else if (errmask & CONNECTOR_ERROR_FAMILY) relay->failstr = "Address family mismatch on destination MXs"; else if (errmask & CONNECTOR_ERROR_BLOCKED) relay->failstr = "All routes to destination blocked"; else relay->failstr = "No valid route to destination"; } relay->nextsource = relay->lastsource + delay; relay->status &= ~RELAY_WAIT_SOURCE; mta_drain(relay); mta_relay_unref(relay); /* from mta_query_source() */ } static void mta_connect(struct mta_connector *c) { struct mta_route *route; struct mta_mx *mx; struct mta_limits *l = c->relay->limits; int limits; time_t nextconn, now; /* toggle the block flag */ if (mta_is_blocked(c->source, c->relay->domain->name)) c->flags |= CONNECTOR_ERROR_BLOCKED; else c->flags &= ~CONNECTOR_ERROR_BLOCKED; again: log_debug("debug: mta: connecting with %s", mta_connector_to_text(c)); /* Do not connect if this connector has an error. */ if (c->flags & CONNECTOR_ERROR) { log_debug("debug: mta: connector error"); return; } if (c->flags & CONNECTOR_WAIT) { log_debug("debug: mta: cancelling connector timeout"); runq_cancel(runq_connector, c); c->flags &= ~CONNECTOR_WAIT; } /* No job. */ if (c->relay->ntask == 0) { log_debug("debug: mta: no task for connector"); return; } /* Do not create more connections than necessary */ if ((c->relay->nconn_ready >= c->relay->ntask) || (c->relay->nconn > 2 && c->relay->nconn >= c->relay->ntask / 2)) { log_debug("debug: mta: enough connections already"); return; } limits = 0; nextconn = now = time(NULL); if (c->relay->domain->lastconn + l->conndelay_domain > nextconn) { log_debug("debug: mta: cannot use domain %s before %llus", c->relay->domain->name, (unsigned long long) c->relay->domain->lastconn + l->conndelay_domain - now); nextconn = c->relay->domain->lastconn + l->conndelay_domain; } if (c->relay->domain->nconn >= l->maxconn_per_domain) { log_debug("debug: mta: hit domain limit"); limits |= CONNECTOR_LIMIT_DOMAIN; } if (c->source->lastconn + l->conndelay_source > nextconn) { log_debug("debug: mta: cannot use source %s before %llus", mta_source_to_text(c->source), (unsigned long long) c->source->lastconn + l->conndelay_source - now); nextconn = c->source->lastconn + l->conndelay_source; } if (c->source->nconn >= l->maxconn_per_source) { log_debug("debug: mta: hit source limit"); limits |= CONNECTOR_LIMIT_SOURCE; } if (c->lastconn + l->conndelay_connector > nextconn) { log_debug("debug: mta: cannot use %s before %llus", mta_connector_to_text(c), (unsigned long long) c->lastconn + l->conndelay_connector - now); nextconn = c->lastconn + l->conndelay_connector; } if (c->nconn >= l->maxconn_per_connector) { log_debug("debug: mta: hit connector limit"); limits |= CONNECTOR_LIMIT_CONN; } if (c->relay->lastconn + l->conndelay_relay > nextconn) { log_debug("debug: mta: cannot use %s before %llus", mta_relay_to_text(c->relay), (unsigned long long) c->relay->lastconn + l->conndelay_relay - now); nextconn = c->relay->lastconn + l->conndelay_relay; } if (c->relay->nconn >= l->maxconn_per_relay) { log_debug("debug: mta: hit relay limit"); limits |= CONNECTOR_LIMIT_RELAY; } /* We can connect now, find a route */ if (!limits && nextconn <= now) route = mta_find_route(c, now, &limits, &nextconn, &mx); else route = NULL; /* No route */ if (route == NULL) { if (c->flags & CONNECTOR_ERROR) { /* XXX we might want to clear this flag later */ log_debug("debug: mta-routing: no route available for %s: errors on connector", mta_connector_to_text(c)); return; } else if (limits) { log_debug("debug: mta-routing: no route available for %s: limits reached", mta_connector_to_text(c)); nextconn = now + DELAY_CHECK_LIMIT; } else { log_debug("debug: mta-routing: no route available for %s: must wait a bit", mta_connector_to_text(c)); } log_debug("debug: mta: retrying to connect on %s in %llus...", mta_connector_to_text(c), (unsigned long long) nextconn - time(NULL)); c->flags |= CONNECTOR_WAIT; runq_schedule_at(runq_connector, nextconn, c); return; } log_debug("debug: mta-routing: spawning new connection on %s", mta_route_to_text(route)); c->nconn += 1; c->lastconn = time(NULL); c->relay->nconn += 1; c->relay->lastconn = c->lastconn; c->relay->domain->nconn += 1; c->relay->domain->lastconn = c->lastconn; route->nconn += 1; route->lastconn = c->lastconn; route->src->nconn += 1; route->src->lastconn = c->lastconn; route->dst->nconn += 1; route->dst->lastconn = c->lastconn; mta_session(c->relay, route, mx->mxname); /* this never fails synchronously */ mta_relay_ref(c->relay); goto again; } static void mta_on_timeout(struct runq *runq, void *arg) { struct mta_connector *connector = arg; struct mta_relay *relay = arg; struct mta_route *route = arg; struct hoststat *hs = arg; if (runq == runq_relay) { log_debug("debug: mta: ... timeout for %s", mta_relay_to_text(relay)); relay->status &= ~RELAY_WAIT_CONNECTOR; mta_drain(relay); mta_relay_unref(relay); /* from mta_drain() */ } else if (runq == runq_connector) { log_debug("debug: mta: ... timeout for %s", mta_connector_to_text(connector)); connector->flags &= ~CONNECTOR_WAIT; mta_connect(connector); } else if (runq == runq_route) { route->flags &= ~ROUTE_RUNQ; mta_route_enable(route); mta_route_unref(route); } else if (runq == runq_hoststat) { log_debug("debug: mta: ... timeout for hoststat %s", hs->name); mta_hoststat_remove_entry(hs); free(hs); } } static void mta_route_disable(struct mta_route *route, int penalty, int reason) { unsigned long long delay; route->penalty += penalty; route->lastpenalty = time(NULL); delay = (unsigned long long)DELAY_ROUTE_BASE * route->penalty * route->penalty; if (delay > DELAY_ROUTE_MAX) delay = DELAY_ROUTE_MAX; #if 0 delay = 60; #endif log_info("smtp-out: Disabling route %s for %llus", mta_route_to_text(route), delay); if (route->flags & ROUTE_DISABLED) runq_cancel(runq_route, route); else mta_route_ref(route); route->flags |= reason & ROUTE_DISABLED; runq_schedule(runq_route, delay, route); } static void mta_route_enable(struct mta_route *route) { if (route->flags & ROUTE_DISABLED) { log_info("smtp-out: Enabling route %s", mta_route_to_text(route)); route->flags &= ~ROUTE_DISABLED; route->flags |= ROUTE_NEW; route->nerror = 0; } if (route->penalty) { #if DELAY_QUADRATIC route->penalty -= 1; route->lastpenalty = time(NULL); #else route->penalty = 0; #endif } } static void mta_drain(struct mta_relay *r) { char buf[64]; log_debug("debug: mta: draining %s " "refcount=%d, ntask=%zu, nconnector=%zu, nconn=%zu", mta_relay_to_text(r), r->refcount, r->ntask, tree_count(&r->connectors), r->nconn); /* * All done. */ if (r->ntask == 0) { log_debug("debug: mta: all done for %s", mta_relay_to_text(r)); return; } /* * If we know that this relay is failing flush the tasks. */ if (r->fail) { mta_flush(r, r->fail, r->failstr); return; } /* Query secret if needed. */ if (r->flags & RELAY_AUTH && r->secret == NULL) mta_query_secret(r); /* Query our preference if needed. */ if (r->backupname && r->backuppref == -1) mta_query_preference(r); /* Query the domain MXs if needed. */ if (r->domain->lastmxquery == 0) mta_query_mx(r); /* Query the limits if needed. */ if (r->limits == NULL) mta_query_limits(r); /* Wait until we are ready to proceed. */ if (r->status & RELAY_WAITMASK) { buf[0] = '\0'; if (r->status & RELAY_WAIT_MX) (void)strlcat(buf, " MX", sizeof buf); if (r->status & RELAY_WAIT_PREFERENCE) (void)strlcat(buf, " preference", sizeof buf); if (r->status & RELAY_WAIT_SECRET) (void)strlcat(buf, " secret", sizeof buf); if (r->status & RELAY_WAIT_SOURCE) (void)strlcat(buf, " source", sizeof buf); if (r->status & RELAY_WAIT_CONNECTOR) (void)strlcat(buf, " connector", sizeof buf); log_debug("debug: mta: %s waiting for%s", mta_relay_to_text(r), buf); return; } /* * We have pending task, and it's maybe time too try a new source. */ if (r->nextsource <= time(NULL)) mta_query_source(r); else { log_debug("debug: mta: scheduling relay %s in %llus...", mta_relay_to_text(r), (unsigned long long) r->nextsource - time(NULL)); runq_schedule_at(runq_relay, r->nextsource, r); r->status |= RELAY_WAIT_CONNECTOR; mta_relay_ref(r); } } static void mta_flush(struct mta_relay *relay, int fail, const char *error) { struct mta_envelope *e; struct mta_task *task; const char *domain; void *iter; struct mta_connector *c; size_t n, r; log_debug("debug: mta_flush(%s, %d, \"%s\")", mta_relay_to_text(relay), fail, error); if (fail != IMSG_MTA_DELIVERY_TEMPFAIL && fail != IMSG_MTA_DELIVERY_PERMFAIL) fatalx("unexpected delivery status %d", fail); n = 0; while ((task = TAILQ_FIRST(&relay->tasks))) { TAILQ_REMOVE(&relay->tasks, task, entry); while ((e = TAILQ_FIRST(&task->envelopes))) { TAILQ_REMOVE(&task->envelopes, e, entry); /* * host was suspended, cache envelope id in hoststat tree * so that it can be retried when a delivery succeeds for * that domain. */ domain = strchr(e->dest, '@'); if (fail == IMSG_MTA_DELIVERY_TEMPFAIL && domain) { r = 0; iter = NULL; while (tree_iter(&relay->connectors, &iter, NULL, (void **)&c)) { if (c->flags & CONNECTOR_ERROR_ROUTE) r++; } if (tree_count(&relay->connectors) == r) mta_hoststat_cache(domain+1, e->id); } mta_delivery_log(e, NULL, relay->domain->name, fail, error); mta_delivery_notify(e); n++; } free(task->sender); free(task); } stat_decrement("mta.task", relay->ntask); stat_decrement("mta.envelope", n); relay->ntask = 0; /* release all waiting envelopes for the relay */ if (relay->state & RELAY_HOLDQ) { m_create(p_queue, IMSG_MTA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, relay->id); m_add_int(p_queue, -1); m_close(p_queue); } } /* * Find a route to use for this connector */ static struct mta_route * mta_find_route(struct mta_connector *c, time_t now, int *limits, time_t *nextconn, struct mta_mx **pmx) { struct mta_route *route, *best; struct mta_limits *l = c->relay->limits; struct mta_mx *mx; int level, limit_host, limit_route; int family_mismatch, seen, suspended_route; time_t tm; log_debug("debug: mta-routing: searching new route for %s...", mta_connector_to_text(c)); tm = 0; limit_host = 0; limit_route = 0; suspended_route = 0; family_mismatch = 0; level = -1; best = NULL; seen = 0; TAILQ_FOREACH(mx, &c->relay->domain->mxs, entry) { /* * New preference level */ if (mx->preference > level) { #ifndef IGNORE_MX_PREFERENCE /* * Use the current best MX if found. */ if (best) break; /* * No candidate found. There are valid MXs at this * preference level but they reached their limit, or * we can't connect yet. */ if (limit_host || limit_route || tm) break; /* * If we are a backup MX, do not relay to MXs with * a greater preference value. */ if (c->relay->backuppref >= 0 && mx->preference >= c->relay->backuppref) break; /* * Start looking at MXs on this preference level. */ #endif level = mx->preference; } if (mx->host->flags & HOST_IGNORE) continue; /* Found a possibly valid mx */ seen++; if ((c->source->sa && c->source->sa->sa_family != mx->host->sa->sa_family) || (l->family && l->family != mx->host->sa->sa_family)) { log_debug("debug: mta-routing: skipping host %s: AF mismatch", mta_host_to_text(mx->host)); family_mismatch = 1; continue; } if (mx->host->nconn >= l->maxconn_per_host) { log_debug("debug: mta-routing: skipping host %s: too many connections", mta_host_to_text(mx->host)); limit_host = 1; continue; } if (mx->host->lastconn + l->conndelay_host > now) { log_debug("debug: mta-routing: skipping host %s: cannot use before %llus", mta_host_to_text(mx->host), (unsigned long long) mx->host->lastconn + l->conndelay_host - now); if (tm == 0 || mx->host->lastconn + l->conndelay_host < tm) tm = mx->host->lastconn + l->conndelay_host; continue; } route = mta_route(c->source, mx->host); if (route->flags & ROUTE_DISABLED) { log_debug("debug: mta-routing: skipping route %s: suspend", mta_route_to_text(route)); suspended_route |= route->flags & ROUTE_DISABLED; mta_route_unref(route); /* from here */ continue; } if (route->nconn && (route->flags & ROUTE_NEW)) { log_debug("debug: mta-routing: skipping route %s: not validated yet", mta_route_to_text(route)); limit_route = 1; mta_route_unref(route); /* from here */ continue; } if (route->nconn >= l->maxconn_per_route) { log_debug("debug: mta-routing: skipping route %s: too many connections", mta_route_to_text(route)); limit_route = 1; mta_route_unref(route); /* from here */ continue; } if (route->lastconn + l->conndelay_route > now) { log_debug("debug: mta-routing: skipping route %s: cannot use before %llus (delay after connect)", mta_route_to_text(route), (unsigned long long) route->lastconn + l->conndelay_route - now); if (tm == 0 || route->lastconn + l->conndelay_route < tm) tm = route->lastconn + l->conndelay_route; mta_route_unref(route); /* from here */ continue; } if (route->lastdisc + l->discdelay_route > now) { log_debug("debug: mta-routing: skipping route %s: cannot use before %llus (delay after disconnect)", mta_route_to_text(route), (unsigned long long) route->lastdisc + l->discdelay_route - now); if (tm == 0 || route->lastdisc + l->discdelay_route < tm) tm = route->lastdisc + l->discdelay_route; mta_route_unref(route); /* from here */ continue; } /* Use the route with the lowest number of connections. */ if (best && route->nconn >= best->nconn) { log_debug("debug: mta-routing: skipping route %s: current one is better", mta_route_to_text(route)); mta_route_unref(route); /* from here */ continue; } if (best) mta_route_unref(best); /* from here */ best = route; *pmx = mx; log_debug("debug: mta-routing: selecting candidate route %s", mta_route_to_text(route)); } if (best) return (best); /* Order is important */ if (seen == 0) { log_info("smtp-out: No MX found for %s", mta_connector_to_text(c)); c->flags |= CONNECTOR_ERROR_MX; } else if (limit_route) { log_debug("debug: mta: hit route limit"); *limits |= CONNECTOR_LIMIT_ROUTE; } else if (limit_host) { log_debug("debug: mta: hit host limit"); *limits |= CONNECTOR_LIMIT_HOST; } else if (tm) { if (tm > *nextconn) *nextconn = tm; } else if (family_mismatch) { log_info("smtp-out: Address family mismatch on %s", mta_connector_to_text(c)); c->flags |= CONNECTOR_ERROR_FAMILY; } else if (suspended_route) { log_info("smtp-out: No valid route for %s", mta_connector_to_text(c)); if (suspended_route & ROUTE_DISABLED_NET) c->flags |= CONNECTOR_ERROR_ROUTE_NET; if (suspended_route & ROUTE_DISABLED_SMTP) c->flags |= CONNECTOR_ERROR_ROUTE_SMTP; } return (NULL); } static void mta_log(const struct mta_envelope *evp, const char *prefix, const char *source, const char *relay, const char *status) { log_info("%016"PRIx64" mta delivery evpid=%016"PRIx64" " "from=<%s> to=<%s> rcpt=<%s> source=\"%s\" " "relay=\"%s\" delay=%s result=\"%s\" stat=\"%s\"", evp->session, evp->id, evp->task->sender, evp->dest, evp->rcpt ? evp->rcpt : "-", source ? source : "-", relay, duration_to_text(time(NULL) - evp->creation), prefix, status); } static struct mta_relay * mta_relay(struct envelope *e, struct relayhost *relayh) { struct dispatcher *dispatcher; struct mta_relay key, *r; dispatcher = dict_xget(env->sc_dispatchers, e->dispatcher); memset(&key, 0, sizeof key); key.pki_name = dispatcher->u.remote.pki; key.ca_name = dispatcher->u.remote.ca; key.authtable = dispatcher->u.remote.auth; key.sourcetable = dispatcher->u.remote.source; key.helotable = dispatcher->u.remote.helo_source; key.heloname = dispatcher->u.remote.helo; key.srs = dispatcher->u.remote.srs; if (relayh->hostname[0]) { key.domain = mta_domain(relayh->hostname, 1); } else { key.domain = mta_domain(e->dest.domain, 0); if (dispatcher->u.remote.backup) { key.backupname = dispatcher->u.remote.backupmx; if (key.backupname == NULL) key.backupname = e->smtpname; } } key.tls = relayh->tls; key.flags |= relayh->flags; key.port = relayh->port; key.authlabel = relayh->authlabel; if (!key.authlabel[0]) key.authlabel = NULL; if ((r = SPLAY_FIND(mta_relay_tree, &relays, &key)) == NULL) { r = xcalloc(1, sizeof *r); TAILQ_INIT(&r->tasks); r->id = generate_uid(); r->dispatcher = dispatcher; r->tls = key.tls; r->flags = key.flags; r->domain = key.domain; r->backupname = key.backupname ? xstrdup(key.backupname) : NULL; r->backuppref = -1; r->port = key.port; r->pki_name = key.pki_name ? xstrdup(key.pki_name) : NULL; r->ca_name = key.ca_name ? xstrdup(key.ca_name) : NULL; if (key.authtable) r->authtable = xstrdup(key.authtable); if (key.authlabel) r->authlabel = xstrdup(key.authlabel); if (key.sourcetable) r->sourcetable = xstrdup(key.sourcetable); if (key.helotable) r->helotable = xstrdup(key.helotable); if (key.heloname) r->heloname = xstrdup(key.heloname); r->srs = key.srs; SPLAY_INSERT(mta_relay_tree, &relays, r); stat_increment("mta.relay", 1); } else { mta_domain_unref(key.domain); /* from here */ } r->refcount++; return (r); } static void mta_relay_ref(struct mta_relay *r) { r->refcount++; } static void mta_relay_unref(struct mta_relay *relay) { struct mta_connector *c; if (--relay->refcount) return; /* Make sure they are no envelopes held for this relay */ if (relay->state & RELAY_HOLDQ) { m_create(p_queue, IMSG_MTA_HOLDQ_RELEASE, 0, 0, -1); m_add_id(p_queue, relay->id); m_add_int(p_queue, 0); m_close(p_queue); } log_debug("debug: mta: freeing %s", mta_relay_to_text(relay)); SPLAY_REMOVE(mta_relay_tree, &relays, relay); while ((tree_poproot(&relay->connectors, NULL, (void**)&c))) mta_connector_free(c); free(relay->authlabel); free(relay->authtable); free(relay->backupname); free(relay->pki_name); free(relay->ca_name); free(relay->helotable); free(relay->heloname); free(relay->secret); free(relay->sourcetable); mta_domain_unref(relay->domain); /* from constructor */ free(relay); stat_decrement("mta.relay", 1); } const char * mta_relay_to_text(struct mta_relay *relay) { static char buf[1024]; char tmp[32]; const char *sep = ","; (void)snprintf(buf, sizeof buf, "[relay:%s", relay->domain->name); if (relay->port) { (void)strlcat(buf, sep, sizeof buf); (void)snprintf(tmp, sizeof tmp, "port=%d", (int)relay->port); (void)strlcat(buf, tmp, sizeof buf); } (void)strlcat(buf, sep, sizeof buf); switch(relay->tls) { case RELAY_TLS_OPPORTUNISTIC: (void)strlcat(buf, "smtp", sizeof buf); break; case RELAY_TLS_STARTTLS: (void)strlcat(buf, "smtp+tls", sizeof buf); break; case RELAY_TLS_SMTPS: (void)strlcat(buf, "smtps", sizeof buf); break; case RELAY_TLS_NO: if (relay->flags & RELAY_LMTP) (void)strlcat(buf, "lmtp", sizeof buf); else (void)strlcat(buf, "smtp+notls", sizeof buf); break; default: (void)strlcat(buf, "???", sizeof buf); } if (relay->flags & RELAY_AUTH) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "auth=", sizeof buf); (void)strlcat(buf, relay->authtable, sizeof buf); (void)strlcat(buf, ":", sizeof buf); (void)strlcat(buf, relay->authlabel, sizeof buf); } if (relay->pki_name) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "pki_name=", sizeof buf); (void)strlcat(buf, relay->pki_name, sizeof buf); } if (relay->domain->as_host) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "mx", sizeof buf); } if (relay->backupname) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "backup=", sizeof buf); (void)strlcat(buf, relay->backupname, sizeof buf); } if (relay->sourcetable) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "sourcetable=", sizeof buf); (void)strlcat(buf, relay->sourcetable, sizeof buf); } if (relay->helotable) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "helotable=", sizeof buf); (void)strlcat(buf, relay->helotable, sizeof buf); } if (relay->heloname) { (void)strlcat(buf, sep, sizeof buf); (void)strlcat(buf, "heloname=", sizeof buf); (void)strlcat(buf, relay->heloname, sizeof buf); } (void)strlcat(buf, "]", sizeof buf); return (buf); } static void mta_relay_show(struct mta_relay *r, struct mproc *p, uint32_t id, time_t t) { struct mta_connector *c; void *iter; char buf[1024], flags[1024], dur[64]; time_t to; flags[0] = '\0'; #define SHOWSTATUS(f, n) do { \ if (r->status & (f)) { \ if (flags[0]) \ (void)strlcat(flags, ",", sizeof(flags)); \ (void)strlcat(flags, (n), sizeof(flags)); \ } \ } while(0) SHOWSTATUS(RELAY_WAIT_MX, "MX"); SHOWSTATUS(RELAY_WAIT_PREFERENCE, "preference"); SHOWSTATUS(RELAY_WAIT_SECRET, "secret"); SHOWSTATUS(RELAY_WAIT_LIMITS, "limits"); SHOWSTATUS(RELAY_WAIT_SOURCE, "source"); SHOWSTATUS(RELAY_WAIT_CONNECTOR, "connector"); #undef SHOWSTATUS if (runq_pending(runq_relay, r, &to)) (void)snprintf(dur, sizeof(dur), "%s", duration_to_text(to - t)); else (void)strlcpy(dur, "-", sizeof(dur)); (void)snprintf(buf, sizeof(buf), "%s refcount=%d ntask=%zu nconn=%zu lastconn=%s timeout=%s wait=%s%s", mta_relay_to_text(r), r->refcount, r->ntask, r->nconn, r->lastconn ? duration_to_text(t - r->lastconn) : "-", dur, flags, (r->state & RELAY_ONHOLD) ? "ONHOLD" : ""); m_compose(p, IMSG_CTL_MTA_SHOW_RELAYS, id, 0, -1, buf, strlen(buf) + 1); iter = NULL; while (tree_iter(&r->connectors, &iter, NULL, (void **)&c)) { if (runq_pending(runq_connector, c, &to)) (void)snprintf(dur, sizeof(dur), "%s", duration_to_text(to - t)); else (void)strlcpy(dur, "-", sizeof(dur)); flags[0] = '\0'; #define SHOWFLAG(f, n) do { \ if (c->flags & (f)) { \ if (flags[0]) \ (void)strlcat(flags, ",", sizeof(flags)); \ (void)strlcat(flags, (n), sizeof(flags)); \ } \ } while(0) SHOWFLAG(CONNECTOR_NEW, "NEW"); SHOWFLAG(CONNECTOR_WAIT, "WAIT"); SHOWFLAG(CONNECTOR_ERROR_FAMILY, "ERROR_FAMILY"); SHOWFLAG(CONNECTOR_ERROR_SOURCE, "ERROR_SOURCE"); SHOWFLAG(CONNECTOR_ERROR_MX, "ERROR_MX"); SHOWFLAG(CONNECTOR_ERROR_ROUTE_NET, "ERROR_ROUTE_NET"); SHOWFLAG(CONNECTOR_ERROR_ROUTE_SMTP, "ERROR_ROUTE_SMTP"); SHOWFLAG(CONNECTOR_ERROR_BLOCKED, "ERROR_BLOCKED"); SHOWFLAG(CONNECTOR_LIMIT_HOST, "LIMIT_HOST"); SHOWFLAG(CONNECTOR_LIMIT_ROUTE, "LIMIT_ROUTE"); SHOWFLAG(CONNECTOR_LIMIT_SOURCE, "LIMIT_SOURCE"); SHOWFLAG(CONNECTOR_LIMIT_RELAY, "LIMIT_RELAY"); SHOWFLAG(CONNECTOR_LIMIT_CONN, "LIMIT_CONN"); SHOWFLAG(CONNECTOR_LIMIT_DOMAIN, "LIMIT_DOMAIN"); #undef SHOWFLAG (void)snprintf(buf, sizeof(buf), " connector %s refcount=%d nconn=%zu lastconn=%s timeout=%s flags=%s", mta_source_to_text(c->source), c->refcount, c->nconn, c->lastconn ? duration_to_text(t - c->lastconn) : "-", dur, flags); m_compose(p, IMSG_CTL_MTA_SHOW_RELAYS, id, 0, -1, buf, strlen(buf) + 1); } } static int mta_relay_cmp(const struct mta_relay *a, const struct mta_relay *b) { int r; if (a->domain < b->domain) return (-1); if (a->domain > b->domain) return (1); if (a->tls < b->tls) return (-1); if (a->tls > b->tls) return (1); if (a->flags < b->flags) return (-1); if (a->flags > b->flags) return (1); if (a->port < b->port) return (-1); if (a->port > b->port) return (1); if (a->authtable == NULL && b->authtable) return (-1); if (a->authtable && b->authtable == NULL) return (1); if (a->authtable && ((r = strcmp(a->authtable, b->authtable)))) return (r); if (a->authlabel == NULL && b->authlabel) return (-1); if (a->authlabel && b->authlabel == NULL) return (1); if (a->authlabel && ((r = strcmp(a->authlabel, b->authlabel)))) return (r); if (a->sourcetable == NULL && b->sourcetable) return (-1); if (a->sourcetable && b->sourcetable == NULL) return (1); if (a->sourcetable && ((r = strcmp(a->sourcetable, b->sourcetable)))) return (r); if (a->helotable == NULL && b->helotable) return (-1); if (a->helotable && b->helotable == NULL) return (1); if (a->helotable && ((r = strcmp(a->helotable, b->helotable)))) return (r); if (a->heloname == NULL && b->heloname) return (-1); if (a->heloname && b->heloname == NULL) return (1); if (a->heloname && ((r = strcmp(a->heloname, b->heloname)))) return (r); if (a->pki_name == NULL && b->pki_name) return (-1); if (a->pki_name && b->pki_name == NULL) return (1); if (a->pki_name && ((r = strcmp(a->pki_name, b->pki_name)))) return (r); if (a->ca_name == NULL && b->ca_name) return (-1); if (a->ca_name && b->ca_name == NULL) return (1); if (a->ca_name && ((r = strcmp(a->ca_name, b->ca_name)))) return (r); if (a->backupname == NULL && b->backupname) return (-1); if (a->backupname && b->backupname == NULL) return (1); if (a->backupname && ((r = strcmp(a->backupname, b->backupname)))) return (r); if (a->srs < b->srs) return (-1); if (a->srs > b->srs) return (1); return (0); } SPLAY_GENERATE(mta_relay_tree, mta_relay, entry, mta_relay_cmp); static struct mta_host * mta_host(const struct sockaddr *sa) { struct mta_host key, *h; struct sockaddr_storage ss; memmove(&ss, sa, SA_LEN(sa)); key.sa = (struct sockaddr*)&ss; h = SPLAY_FIND(mta_host_tree, &hosts, &key); if (h == NULL) { h = xcalloc(1, sizeof(*h)); h->sa = xmemdup(sa, SA_LEN(sa)); SPLAY_INSERT(mta_host_tree, &hosts, h); stat_increment("mta.host", 1); } h->refcount++; return (h); } static void mta_host_ref(struct mta_host *h) { h->refcount++; } static void mta_host_unref(struct mta_host *h) { if (--h->refcount) return; SPLAY_REMOVE(mta_host_tree, &hosts, h); free(h->sa); free(h->ptrname); free(h); stat_decrement("mta.host", 1); } const char * mta_host_to_text(struct mta_host *h) { static char buf[1024]; if (h->ptrname) (void)snprintf(buf, sizeof buf, "%s (%s)", sa_to_text(h->sa), h->ptrname); else (void)snprintf(buf, sizeof buf, "%s", sa_to_text(h->sa)); return (buf); } static int mta_host_cmp(const struct mta_host *a, const struct mta_host *b) { if (SA_LEN(a->sa) < SA_LEN(b->sa)) return (-1); if (SA_LEN(a->sa) > SA_LEN(b->sa)) return (1); return (memcmp(a->sa, b->sa, SA_LEN(a->sa))); } SPLAY_GENERATE(mta_host_tree, mta_host, entry, mta_host_cmp); static struct mta_domain * mta_domain(char *name, int as_host) { struct mta_domain key, *d; key.name = name; key.as_host = as_host; d = SPLAY_FIND(mta_domain_tree, &domains, &key); if (d == NULL) { d = xcalloc(1, sizeof(*d)); d->name = xstrdup(name); d->as_host = as_host; TAILQ_INIT(&d->mxs); SPLAY_INSERT(mta_domain_tree, &domains, d); stat_increment("mta.domain", 1); } d->refcount++; return (d); } #if 0 static void mta_domain_ref(struct mta_domain *d) { d->refcount++; } #endif static void mta_domain_unref(struct mta_domain *d) { struct mta_mx *mx; if (--d->refcount) return; while ((mx = TAILQ_FIRST(&d->mxs))) { TAILQ_REMOVE(&d->mxs, mx, entry); mta_host_unref(mx->host); /* from IMSG_DNS_HOST */ free(mx->mxname); free(mx); } SPLAY_REMOVE(mta_domain_tree, &domains, d); free(d->name); free(d); stat_decrement("mta.domain", 1); } static int mta_domain_cmp(const struct mta_domain *a, const struct mta_domain *b) { if (a->as_host < b->as_host) return (-1); if (a->as_host > b->as_host) return (1); return (strcasecmp(a->name, b->name)); } SPLAY_GENERATE(mta_domain_tree, mta_domain, entry, mta_domain_cmp); static struct mta_source * mta_source(const struct sockaddr *sa) { struct mta_source key, *s; struct sockaddr_storage ss; if (sa) { memmove(&ss, sa, SA_LEN(sa)); key.sa = (struct sockaddr*)&ss; } else key.sa = NULL; s = SPLAY_FIND(mta_source_tree, &sources, &key); if (s == NULL) { s = xcalloc(1, sizeof(*s)); if (sa) s->sa = xmemdup(sa, SA_LEN(sa)); SPLAY_INSERT(mta_source_tree, &sources, s); stat_increment("mta.source", 1); } s->refcount++; return (s); } static void mta_source_ref(struct mta_source *s) { s->refcount++; } static void mta_source_unref(struct mta_source *s) { if (--s->refcount) return; SPLAY_REMOVE(mta_source_tree, &sources, s); free(s->sa); free(s); stat_decrement("mta.source", 1); } static const char * mta_source_to_text(struct mta_source *s) { static char buf[1024]; if (s->sa == NULL) return "[]"; (void)snprintf(buf, sizeof buf, "%s", sa_to_text(s->sa)); return (buf); } static int mta_source_cmp(const struct mta_source *a, const struct mta_source *b) { if (a->sa == NULL) return ((b->sa == NULL) ? 0 : -1); if (b->sa == NULL) return (1); if (SA_LEN(a->sa) < SA_LEN(b->sa)) return (-1); if (SA_LEN(a->sa) > SA_LEN(b->sa)) return (1); return (memcmp(a->sa, b->sa, SA_LEN(a->sa))); } SPLAY_GENERATE(mta_source_tree, mta_source, entry, mta_source_cmp); static struct mta_connector * mta_connector(struct mta_relay *relay, struct mta_source *source) { struct mta_connector *c; c = tree_get(&relay->connectors, (uintptr_t)(source)); if (c == NULL) { c = xcalloc(1, sizeof(*c)); c->relay = relay; c->source = source; c->flags |= CONNECTOR_NEW; mta_source_ref(source); tree_xset(&relay->connectors, (uintptr_t)(source), c); stat_increment("mta.connector", 1); log_debug("debug: mta: new %s", mta_connector_to_text(c)); } return (c); } static void mta_connector_free(struct mta_connector *c) { log_debug("debug: mta: freeing %s", mta_connector_to_text(c)); if (c->flags & CONNECTOR_WAIT) { log_debug("debug: mta: cancelling timeout for %s", mta_connector_to_text(c)); runq_cancel(runq_connector, c); } mta_source_unref(c->source); /* from constructor */ free(c); stat_decrement("mta.connector", 1); } static const char * mta_connector_to_text(struct mta_connector *c) { static char buf[1024]; (void)snprintf(buf, sizeof buf, "[connector:%s->%s,0x%x]", mta_source_to_text(c->source), mta_relay_to_text(c->relay), c->flags); return (buf); } static struct mta_route * mta_route(struct mta_source *src, struct mta_host *dst) { struct mta_route key, *r; static uint64_t rid = 0; key.src = src; key.dst = dst; r = SPLAY_FIND(mta_route_tree, &routes, &key); if (r == NULL) { r = xcalloc(1, sizeof(*r)); r->src = src; r->dst = dst; r->flags |= ROUTE_NEW; r->id = ++rid; SPLAY_INSERT(mta_route_tree, &routes, r); mta_source_ref(src); mta_host_ref(dst); stat_increment("mta.route", 1); } else if (r->flags & ROUTE_RUNQ) { log_debug("debug: mta: mta_route_ref(): cancelling runq for route %s", mta_route_to_text(r)); r->flags &= ~(ROUTE_RUNQ | ROUTE_KEEPALIVE); runq_cancel(runq_route, r); r->refcount--; /* from mta_route_unref() */ } r->refcount++; return (r); } static void mta_route_ref(struct mta_route *r) { r->refcount++; } static void mta_route_unref(struct mta_route *r) { time_t sched, now; int delay; if (--r->refcount) return; /* * Nothing references this route, but we might want to keep it alive * for a while. */ now = time(NULL); sched = 0; if (r->penalty) { #if DELAY_QUADRATIC delay = DELAY_ROUTE_BASE * r->penalty * r->penalty; #else delay = 15 * 60; #endif if (delay > DELAY_ROUTE_MAX) delay = DELAY_ROUTE_MAX; sched = r->lastpenalty + delay; log_debug("debug: mta: mta_route_unref(): keeping route %s alive for %llus (penalty %d)", mta_route_to_text(r), (unsigned long long) sched - now, r->penalty); } else if (!(r->flags & ROUTE_KEEPALIVE)) { if (r->lastconn + max_seen_conndelay_route > now) sched = r->lastconn + max_seen_conndelay_route; if (r->lastdisc + max_seen_discdelay_route > now && r->lastdisc + max_seen_discdelay_route < sched) sched = r->lastdisc + max_seen_discdelay_route; if (sched > now) log_debug("debug: mta: mta_route_unref(): keeping route %s alive for %llus (imposed delay)", mta_route_to_text(r), (unsigned long long) sched - now); } if (sched > now) { r->flags |= ROUTE_RUNQ; runq_schedule_at(runq_route, sched, r); r->refcount++; return; } log_debug("debug: mta: mta_route_unref(): really discarding route %s", mta_route_to_text(r)); SPLAY_REMOVE(mta_route_tree, &routes, r); mta_source_unref(r->src); /* from constructor */ mta_host_unref(r->dst); /* from constructor */ free(r); stat_decrement("mta.route", 1); } static const char * mta_route_to_text(struct mta_route *r) { static char buf[1024]; (void)snprintf(buf, sizeof buf, "%s <-> %s", mta_source_to_text(r->src), mta_host_to_text(r->dst)); return (buf); } static int mta_route_cmp(const struct mta_route *a, const struct mta_route *b) { if (a->src < b->src) return (-1); if (a->src > b->src) return (1); if (a->dst < b->dst) return (-1); if (a->dst > b->dst) return (1); return (0); } SPLAY_GENERATE(mta_route_tree, mta_route, entry, mta_route_cmp); void mta_block(struct mta_source *src, char *dom) { struct mta_block key, *b; key.source = src; key.domain = dom; b = SPLAY_FIND(mta_block_tree, &blocks, &key); if (b != NULL) return; b = xcalloc(1, sizeof(*b)); if (dom) b->domain = xstrdup(dom); b->source = src; mta_source_ref(src); SPLAY_INSERT(mta_block_tree, &blocks, b); } void mta_unblock(struct mta_source *src, char *dom) { struct mta_block key, *b; key.source = src; key.domain = dom; b = SPLAY_FIND(mta_block_tree, &blocks, &key); if (b == NULL) return; SPLAY_REMOVE(mta_block_tree, &blocks, b); mta_source_unref(b->source); free(b->domain); free(b); } int mta_is_blocked(struct mta_source *src, char *dom) { struct mta_block key; key.source = src; key.domain = dom; if (SPLAY_FIND(mta_block_tree, &blocks, &key)) return (1); return (0); } static int mta_block_cmp(const struct mta_block *a, const struct mta_block *b) { if (a->source < b->source) return (-1); if (a->source > b->source) return (1); if (!a->domain && b->domain) return (-1); if (a->domain && !b->domain) return (1); if (a->domain == b->domain) return (0); return (strcasecmp(a->domain, b->domain)); } SPLAY_GENERATE(mta_block_tree, mta_block, entry, mta_block_cmp); /* hoststat errors are not critical, we do best effort */ void mta_hoststat_update(const char *host, const char *error) { struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); if (hs == NULL) { if ((hs = calloc(1, sizeof *hs)) == NULL) return; tree_init(&hs->deferred); runq_schedule(runq_hoststat, HOSTSTAT_EXPIRE_DELAY, hs); } (void)strlcpy(hs->name, buf, sizeof hs->name); (void)strlcpy(hs->error, error, sizeof hs->error); hs->tm = time(NULL); dict_set(&hoststat, buf, hs); runq_cancel(runq_hoststat, hs); runq_schedule(runq_hoststat, HOSTSTAT_EXPIRE_DELAY, hs); } void mta_hoststat_cache(const char *host, uint64_t evpid) { struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); if (hs == NULL) return; if (tree_count(&hs->deferred) >= env->sc_mta_max_deferred) return; tree_set(&hs->deferred, evpid, NULL); } void mta_hoststat_uncache(const char *host, uint64_t evpid) { struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); if (hs == NULL) return; tree_pop(&hs->deferred, evpid); } void mta_hoststat_reschedule(const char *host) { struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; uint64_t evpid; if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); if (hs == NULL) return; while (tree_poproot(&hs->deferred, &evpid, NULL)) { m_compose(p_queue, IMSG_MTA_SCHEDULE, 0, 0, -1, &evpid, sizeof evpid); } } static void mta_hoststat_remove_entry(struct hoststat *hs) { while (tree_poproot(&hs->deferred, NULL, NULL)) ; dict_pop(&hoststat, hs->name); runq_cancel(runq_hoststat, hs); } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd-defines.h0000644000175000001440000000367614610663500015275 /* $OpenBSD: smtpd-defines.h,v 1.12 2020/02/24 16:16:08 millert Exp $ */ /* * Copyright (c) 2013 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) #endif #define SMTPD_TABLENAME_SIZE (64 + 1) #define SMTPD_TAG_SIZE (32 + 1) /* buffer sizes for email address components */ #define SMTPD_MAXLOCALPARTSIZE (255 + 1) #define SMTPD_MAXDOMAINPARTSIZE (255 + 1) #define SMTPD_MAXMAILADDRSIZE (255 + 1) /* buffer size for virtual username (can be email addresses) */ #define SMTPD_VUSERNAME_SIZE (255 + 1) #define SMTPD_SUBADDRESS_SIZE (255 + 1) #ifndef SMTPD_USER #define SMTPD_USER "_smtpd" #endif #ifndef PATH_CHROOT #define PATH_CHROOT "/var/empty" #endif #ifndef SMTPD_QUEUE_USER #define SMTPD_QUEUE_USER "_smtpq" #endif #ifndef SMTPD_QUEUE_GROUP #define SMTPD_QUEUE_GROUP "_smtpq" #endif #ifndef PATH_SPOOL #define PATH_SPOOL "/var/spool/smtpd" #endif #ifndef PATH_MAILLOCAL #define PATH_MAILLOCAL PATH_LIBEXEC "/mail.local" #endif #ifndef PATH_MAKEMAP #define PATH_MAKEMAP "/usr/sbin/makemap" #endif #define SUBADDRESSING_DELIMITER "+" /* sendmail compat */ #define EX_OK 0 #define EX_NOHOST 68 #define EX_UNAVAILABLE 69 #define EX_SOFTWARE 70 #define EX_TEMPFAIL 75 opensmtpd-7.7.0p0/usr.sbin/smtpd/lka_filter.c0000644000175000001440000013035414674615567014660 /* $OpenBSD: lka_filter.c,v 1.77 2024/05/14 13:38:54 op Exp $ */ /* * Copyright (c) 2018 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define PROTOCOL_VERSION "0.7" struct filter; struct filter_session; static void filter_protocol_internal(struct filter_session *, uint64_t *, uint64_t, enum filter_phase, const char *); static void filter_protocol(uint64_t, enum filter_phase, const char *); static void filter_protocol_next(uint64_t, uint64_t, enum filter_phase); static void filter_protocol_query(struct filter *, uint64_t, uint64_t, const char *, const char *); static void filter_data_internal(struct filter_session *, uint64_t, uint64_t, const char *); static void filter_data(uint64_t, const char *); static void filter_data_next(uint64_t, uint64_t, const char *); static void filter_data_query(struct filter *, uint64_t, uint64_t, const char *); static int filter_builtins_notimpl(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_connect(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_helo(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_mail_from(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_rcpt_to(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_data(struct filter_session *, struct filter *, uint64_t, const char *); static int filter_builtins_commit(struct filter_session *, struct filter *, uint64_t, const char *); static void filter_result_proceed(uint64_t); static void filter_result_report(uint64_t, const char *); static void filter_result_junk(uint64_t); static void filter_result_rewrite(uint64_t, const char *); static void filter_result_reject(uint64_t, const char *); static void filter_result_disconnect(uint64_t, const char *); static void filter_session_io(struct io *, int, void *); void lka_filter_process_response(const char *, const char *); struct filter_session { uint64_t id; struct io *io; char *lastparam; char *filter_name; struct sockaddr_storage ss_src; struct sockaddr_storage ss_dest; char *rdns; int fcrdns; char *helo; char *username; char *mail_from; enum filter_phase phase; }; static struct filter_exec { enum filter_phase phase; const char *phase_name; int (*func)(struct filter_session *, struct filter *, uint64_t, const char *); } filter_execs[FILTER_PHASES_COUNT] = { { FILTER_CONNECT, "connect", filter_builtins_connect }, { FILTER_HELO, "helo", filter_builtins_helo }, { FILTER_EHLO, "ehlo", filter_builtins_helo }, { FILTER_STARTTLS, "starttls", filter_builtins_notimpl }, { FILTER_AUTH, "auth", filter_builtins_notimpl }, { FILTER_MAIL_FROM, "mail-from", filter_builtins_mail_from }, { FILTER_RCPT_TO, "rcpt-to", filter_builtins_rcpt_to }, { FILTER_DATA, "data", filter_builtins_data }, { FILTER_DATA_LINE, "data-line", filter_builtins_notimpl }, { FILTER_RSET, "rset", filter_builtins_notimpl }, { FILTER_QUIT, "quit", filter_builtins_notimpl }, { FILTER_NOOP, "noop", filter_builtins_notimpl }, { FILTER_HELP, "help", filter_builtins_notimpl }, { FILTER_WIZ, "wiz", filter_builtins_notimpl }, { FILTER_COMMIT, "commit", filter_builtins_commit }, }; struct filter { uint64_t id; uint32_t phases; const char *name; const char *proc; struct filter **chain; size_t chain_size; struct filter_config *config; }; static struct dict filters; struct filter_entry { TAILQ_ENTRY(filter_entry) entries; uint64_t id; const char *name; }; struct filter_chain { TAILQ_HEAD(, filter_entry) chain[nitems(filter_execs)]; }; static struct tree sessions; static int filters_inited; static struct dict filter_chains; struct reporter_proc { TAILQ_ENTRY(reporter_proc) entries; const char *name; }; TAILQ_HEAD(reporters, reporter_proc); static struct dict report_smtp_in; static struct dict report_smtp_out; static struct smtp_events { const char *event; } smtp_events[] = { { "link-connect" }, { "link-disconnect" }, { "link-greeting" }, { "link-identify" }, { "link-tls" }, { "link-auth" }, { "tx-reset" }, { "tx-begin" }, { "tx-mail" }, { "tx-rcpt" }, { "tx-envelope" }, { "tx-data" }, { "tx-commit" }, { "tx-rollback" }, { "protocol-client" }, { "protocol-server" }, { "filter-report" }, { "filter-response" }, { "timeout" }, }; static int processors_inited = 0; static struct dict processors; struct processor_instance { char *name; struct io *io; struct io *errfd; int ready; uint32_t subsystems; }; static void processor_io(struct io *, int, void *); static void processor_errfd(struct io *, int, void *); void lka_filter_process_response(const char *, const char *); int lka_proc_ready(void) { void *iter; struct processor_instance *pi; iter = NULL; while (dict_iter(&processors, &iter, NULL, (void **)&pi)) if (!pi->ready) return 0; return 1; } static void lka_proc_config(struct processor_instance *pi) { io_printf(pi->io, "config|smtpd-version|%s\n", SMTPD_VERSION); io_printf(pi->io, "config|protocol|%s\n", PROTOCOL_VERSION); io_printf(pi->io, "config|smtp-session-timeout|%d\n", SMTPD_SESSION_TIMEOUT); if (pi->subsystems & FILTER_SUBSYSTEM_SMTP_IN) io_printf(pi->io, "config|subsystem|smtp-in\n"); if (pi->subsystems & FILTER_SUBSYSTEM_SMTP_OUT) io_printf(pi->io, "config|subsystem|smtp-out\n"); io_printf(pi->io, "config|admd|%s\n", env->sc_admd != NULL ? env->sc_admd : env->sc_hostname); io_printf(pi->io, "config|ready\n"); } void lka_proc_forked(const char *name, uint32_t subsystems, int fd) { struct processor_instance *processor; if (!processors_inited) { dict_init(&processors); processors_inited = 1; } processor = xcalloc(1, sizeof *processor); processor->name = xstrdup(name); processor->io = io_new(); processor->subsystems = subsystems; io_set_nonblocking(fd); io_set_fd(processor->io, fd); io_set_callback(processor->io, processor_io, processor->name); dict_xset(&processors, name, processor); } void lka_proc_errfd(const char *name, int fd) { struct processor_instance *processor; processor = dict_xget(&processors, name); io_set_nonblocking(fd); processor->errfd = io_new(); io_set_fd(processor->errfd, fd); io_set_callback(processor->errfd, processor_errfd, processor->name); lka_proc_config(processor); } struct io * lka_proc_get_io(const char *name) { struct processor_instance *processor; processor = dict_xget(&processors, name); return processor->io; } static void processor_register(const char *name, const char *line) { struct processor_instance *processor; processor = dict_xget(&processors, name); if (strcmp(line, "register|ready") == 0) { processor->ready = 1; return; } if (strncmp(line, "register|report|", 16) == 0) { lka_report_register_hook(name, line+16); return; } if (strncmp(line, "register|filter|", 16) == 0) { lka_filter_register_hook(name, line+16); return; } fatalx("Invalid register line received: %s", line); } static void processor_io(struct io *io, int evt, void *arg) { struct processor_instance *processor; const char *name = arg; char *line = NULL; ssize_t len; switch (evt) { case IO_DATAIN: while ((line = io_getline(io, &len)) != NULL) { if (strncmp("register|", line, 9) == 0) { processor_register(name, line); continue; } processor = dict_xget(&processors, name); if (!processor->ready) fatalx("Non-register message before register|" "ready: %s", line); else if (strncmp(line, "filter-result|", 14) == 0 || strncmp(line, "filter-dataline|", 16) == 0) lka_filter_process_response(name, line); else if (strncmp(line, "report|", 7) == 0) lka_report_proc(name, line); else fatalx("Invalid filter message type: %s", line); } } } static void processor_errfd(struct io *io, int evt, void *arg) { const char *name = arg; char *line = NULL; ssize_t len; switch (evt) { case IO_DATAIN: while ((line = io_getline(io, &len)) != NULL) log_warnx("%s: %s", name, line); } } void lka_filter_init(void) { void *iter; const char *name; struct filter *filter; struct filter_config *filter_config; size_t i; char buffer[LINE_MAX]; /* for traces */ dict_init(&filters); dict_init(&filter_chains); /* first pass, allocate and init individual filters */ iter = NULL; while (dict_iter(env->sc_filters_dict, &iter, &name, (void **)&filter_config)) { switch (filter_config->filter_type) { case FILTER_TYPE_BUILTIN: filter = xcalloc(1, sizeof(*filter)); filter->name = name; filter->phases |= (1<phase); filter->config = filter_config; dict_set(&filters, name, filter); log_trace(TRACE_FILTERS, "filters init type=builtin, name=%s, hooks=%08x", name, filter->phases); break; case FILTER_TYPE_PROC: filter = xcalloc(1, sizeof(*filter)); filter->name = name; filter->proc = filter_config->proc; filter->config = filter_config; dict_set(&filters, name, filter); log_trace(TRACE_FILTERS, "filters init type=proc, name=%s, proc=%s", name, filter_config->proc); break; case FILTER_TYPE_CHAIN: break; } } /* second pass, allocate and init filter chains but don't build yet */ iter = NULL; while (dict_iter(env->sc_filters_dict, &iter, &name, (void **)&filter_config)) { switch (filter_config->filter_type) { case FILTER_TYPE_CHAIN: filter = xcalloc(1, sizeof(*filter)); filter->name = name; filter->chain = xcalloc(filter_config->chain_size, sizeof(void **)); filter->chain_size = filter_config->chain_size; filter->config = filter_config; buffer[0] = '\0'; for (i = 0; i < filter->chain_size; ++i) { filter->chain[i] = dict_xget(&filters, filter_config->chain[i]); if (i) (void)strlcat(buffer, ", ", sizeof buffer); (void)strlcat(buffer, filter->chain[i]->name, sizeof buffer); } log_trace(TRACE_FILTERS, "filters init type=chain, name=%s { %s }", name, buffer); dict_set(&filters, name, filter); break; case FILTER_TYPE_BUILTIN: case FILTER_TYPE_PROC: break; } } } void lka_filter_register_hook(const char *name, const char *hook) { struct filter *filter; const char *filter_name; void *iter; size_t i; if (strncasecmp(hook, "smtp-in|", 8) == 0) { hook += 8; } else fatalx("Invalid message direction: %s", hook); for (i = 0; i < nitems(filter_execs); i++) if (strcmp(hook, filter_execs[i].phase_name) == 0) break; if (i == nitems(filter_execs)) fatalx("Unrecognized report name: %s", hook); iter = NULL; while (dict_iter(&filters, &iter, &filter_name, (void **)&filter)) if (filter->proc && strcmp(name, filter->proc) == 0) filter->phases |= (1<chain[i]); dict_set(&filter_chains, filter_name, filter_chain); if (filter->chain) { for (i = 0; i < filter->chain_size; i++) { subfilter = filter->chain[i]; for (j = 0; j < nitems(filter_execs); ++j) { if (subfilter->phases & (1<id = generate_uid(); filter_entry->name = subfilter->name; TAILQ_INSERT_TAIL(&filter_chain->chain[j], filter_entry, entries); } } } continue; } for (i = 0; i < nitems(filter_execs); ++i) { if (filter->phases & (1<id = generate_uid(); filter_entry->name = filter_name; TAILQ_INSERT_TAIL(&filter_chain->chain[i], filter_entry, entries); } } } } int lka_filter_proc_in_session(uint64_t reqid, const char *proc) { struct filter_session *fs; struct filter *filter; size_t i; if ((fs = tree_get(&sessions, reqid)) == NULL) return 0; filter = dict_get(&filters, fs->filter_name); if (filter == NULL || (filter->proc == NULL && filter->chain == NULL)) return 0; if (filter->proc) return strcmp(filter->proc, proc) == 0 ? 1 : 0; for (i = 0; i < filter->chain_size; i++) if (filter->chain[i]->proc && strcmp(filter->chain[i]->proc, proc) == 0) return 1; return 0; } void lka_filter_begin(uint64_t reqid, const char *filter_name) { struct filter_session *fs; if (!filters_inited) { tree_init(&sessions); filters_inited = 1; } fs = xcalloc(1, sizeof (struct filter_session)); fs->id = reqid; fs->filter_name = xstrdup(filter_name); tree_xset(&sessions, fs->id, fs); log_trace(TRACE_FILTERS, "%016"PRIx64" filters session-begin", reqid); } void lka_filter_end(uint64_t reqid) { struct filter_session *fs; fs = tree_xpop(&sessions, reqid); free(fs->rdns); free(fs->helo); free(fs->mail_from); free(fs->username); free(fs->lastparam); free(fs->filter_name); free(fs); log_trace(TRACE_FILTERS, "%016"PRIx64" filters session-end", reqid); } void lka_filter_data_begin(uint64_t reqid) { struct filter_session *fs; int sp[2]; int fd = -1; fs = tree_xget(&sessions, reqid); if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) goto end; io_set_nonblocking(sp[0]); io_set_nonblocking(sp[1]); fd = sp[0]; fs->io = io_new(); io_set_fd(fs->io, sp[1]); io_set_callback(fs->io, filter_session_io, fs); end: m_create(p_dispatcher, IMSG_FILTER_SMTP_DATA_BEGIN, 0, 0, fd); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, fd != -1 ? 1 : 0); m_close(p_dispatcher); log_trace(TRACE_FILTERS, "%016"PRIx64" filters data-begin fd=%d", reqid, fd); } void lka_filter_data_end(uint64_t reqid) { struct filter_session *fs; fs = tree_xget(&sessions, reqid); if (fs->io) { io_free(fs->io); fs->io = NULL; } log_trace(TRACE_FILTERS, "%016"PRIx64" filters data-end", reqid); } static void filter_session_io(struct io *io, int evt, void *arg) { struct filter_session *fs = arg; char *line = NULL; ssize_t len; log_trace(TRACE_IO, "filter session: %p: %s %s", fs, io_strevent(evt), io_strio(io)); switch (evt) { case IO_DATAIN: nextline: line = io_getline(fs->io, &len); /* No complete line received */ if (line == NULL) return; filter_data(fs->id, line); goto nextline; } } void lka_filter_process_response(const char *name, const char *line) { uint64_t reqid; uint64_t token; char *ep = NULL; const char *kind = NULL; const char *qid = NULL; const char *response = NULL; const char *parameter = NULL; struct filter_session *fs; kind = line; if ((ep = strchr(kind, '|')) == NULL) fatalx("Missing token: %s", line); qid = ep+1; errno = 0; reqid = strtoull(qid, &ep, 16); if (qid[0] == '\0' || *ep != '|') fatalx("Invalid reqid: %s", line); if (errno == ERANGE && reqid == ULLONG_MAX) fatal("Invalid reqid: %s", line); qid = ep + 1; token = strtoull(qid, &ep, 16); if (qid[0] == '\0' || *ep != '|') fatalx("Invalid token: %s", line); if (errno == ERANGE && token == ULLONG_MAX) fatal("Invalid token: %s", line); response = ep+1; /* session can legitimately disappear on a resume */ if ((fs = tree_get(&sessions, reqid)) == NULL) return; if (strncmp(kind, "filter-dataline|", 16) == 0) { if (fs->phase != FILTER_DATA_LINE) fatalx("filter-dataline out of dataline phase"); filter_data_next(token, reqid, response); return; } if (fs->phase == FILTER_DATA_LINE) fatalx("filter-result in dataline phase"); if ((ep = strchr(response, '|')) != NULL) parameter = ep + 1; if (strcmp(response, "proceed") == 0) { filter_protocol_next(token, reqid, 0); return; } else if (strcmp(response, "junk") == 0) { if (fs->phase == FILTER_COMMIT) fatalx("filter-reponse junk after DATA"); filter_result_junk(reqid); return; } else { if (parameter == NULL) fatalx("Missing parameter: %s", line); if (strncmp(response, "rewrite|", 8) == 0) filter_result_rewrite(reqid, parameter); else if (strncmp(response, "reject|", 7) == 0) filter_result_reject(reqid, parameter); else if (strncmp(response, "disconnect|", 11) == 0) filter_result_disconnect(reqid, parameter); else if (strncmp(response, "report|", 7) == 0) filter_result_report(reqid, parameter); else fatalx("Invalid directive: %s", line); } } void lka_filter_protocol(uint64_t reqid, enum filter_phase phase, const char *param) { filter_protocol(reqid, phase, param); } static void filter_protocol_internal(struct filter_session *fs, uint64_t *token, uint64_t reqid, enum filter_phase phase, const char *param) { struct filter_chain *filter_chain; struct filter_entry *filter_entry; struct filter *filter; struct timeval tv; const char *phase_name = filter_execs[phase].phase_name; int resume = 1; if (!*token) { fs->phase = phase; resume = 0; } /* XXX - this sanity check requires a protocol change, stub for now */ phase = fs->phase; if (fs->phase != phase) fatalx("misbehaving filter"); /* based on token, identify the filter_entry we should apply */ filter_chain = dict_get(&filter_chains, fs->filter_name); filter_entry = TAILQ_FIRST(&filter_chain->chain[fs->phase]); if (*token) { TAILQ_FOREACH(filter_entry, &filter_chain->chain[fs->phase], entries) if (filter_entry->id == *token) break; if (filter_entry == NULL) fatalx("misbehaving filter"); filter_entry = TAILQ_NEXT(filter_entry, entries); } /* no filter_entry, we either had none or reached end of chain */ if (filter_entry == NULL) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, resume=%s, " "action=proceed", fs->id, phase_name, resume ? "y" : "n"); filter_result_proceed(reqid); return; } /* process param with current filter_entry */ *token = filter_entry->id; filter = dict_get(&filters, filter_entry->name); if (filter->proc) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=deferred, filter=%s", fs->id, phase_name, resume ? "y" : "n", filter->name); filter_protocol_query(filter, filter_entry->id, reqid, filter_execs[fs->phase].phase_name, param); return; /* deferred response */ } if (filter_execs[fs->phase].func(fs, filter, reqid, param)) { if (filter->config->rewrite) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=rewrite, filter=%s, query=%s, response=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param, filter->config->rewrite); filter_result_rewrite(reqid, filter->config->rewrite); return; } else if (filter->config->disconnect) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=disconnect, filter=%s, query=%s, response=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param, filter->config->disconnect); filter_result_disconnect(reqid, filter->config->disconnect); return; } else if (filter->config->junk) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=junk, filter=%s, query=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param); filter_result_junk(reqid); return; } else if (filter->config->report) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=report, filter=%s, query=%s response=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param, filter->config->report); gettimeofday(&tv, NULL); lka_report_filter_report(fs->id, filter->name, 1, "smtp-in", &tv, filter->config->report); } else if (filter->config->bypass) { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=bypass, filter=%s, query=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param); filter_result_proceed(reqid); return; } else { log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=reject, filter=%s, query=%s, response=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param, filter->config->reject); filter_result_reject(reqid, filter->config->reject); return; } } log_trace(TRACE_FILTERS, "%016"PRIx64" filters protocol phase=%s, " "resume=%s, action=proceed, filter=%s, query=%s", fs->id, phase_name, resume ? "y" : "n", filter->name, param); /* filter_entry resulted in proceed, try next filter */ filter_protocol_internal(fs, token, reqid, phase, param); return; } static void filter_data_internal(struct filter_session *fs, uint64_t token, uint64_t reqid, const char *line) { struct filter_chain *filter_chain; struct filter_entry *filter_entry; struct filter *filter; if (!token) fs->phase = FILTER_DATA_LINE; if (fs->phase != FILTER_DATA_LINE) fatalx("misbehaving filter"); /* based on token, identify the filter_entry we should apply */ filter_chain = dict_get(&filter_chains, fs->filter_name); filter_entry = TAILQ_FIRST(&filter_chain->chain[fs->phase]); if (token) { TAILQ_FOREACH(filter_entry, &filter_chain->chain[fs->phase], entries) if (filter_entry->id == token) break; if (filter_entry == NULL) fatalx("misbehaving filter"); filter_entry = TAILQ_NEXT(filter_entry, entries); } /* no filter_entry, we either had none or reached end of chain */ if (filter_entry == NULL) { io_printf(fs->io, "%s\n", line); return; } /* pass data to the filter */ filter = dict_get(&filters, filter_entry->name); filter_data_query(filter, filter_entry->id, reqid, line); } static void filter_protocol(uint64_t reqid, enum filter_phase phase, const char *param) { struct filter_session *fs; uint64_t token = 0; char *nparam = NULL; fs = tree_xget(&sessions, reqid); switch (phase) { case FILTER_HELO: case FILTER_EHLO: free(fs->helo); fs->helo = xstrdup(param); break; case FILTER_MAIL_FROM: free(fs->mail_from); fs->mail_from = xstrdup(param + 1); *strchr(fs->mail_from, '>') = '\0'; param = fs->mail_from; break; case FILTER_RCPT_TO: nparam = xstrdup(param + 1); *strchr(nparam, '>') = '\0'; param = nparam; break; case FILTER_STARTTLS: /* TBD */ break; default: break; } free(fs->lastparam); fs->lastparam = xstrdup(param); filter_protocol_internal(fs, &token, reqid, phase, param); if (nparam) free(nparam); } static void filter_protocol_next(uint64_t token, uint64_t reqid, enum filter_phase phase) { struct filter_session *fs; /* session can legitimately disappear on a resume */ if ((fs = tree_get(&sessions, reqid)) == NULL) return; filter_protocol_internal(fs, &token, reqid, phase, fs->lastparam); } static void filter_data(uint64_t reqid, const char *line) { struct filter_session *fs; fs = tree_xget(&sessions, reqid); filter_data_internal(fs, 0, reqid, line); } static void filter_data_next(uint64_t token, uint64_t reqid, const char *line) { struct filter_session *fs; /* session can legitimately disappear on a resume */ if ((fs = tree_get(&sessions, reqid)) == NULL) return; filter_data_internal(fs, token, reqid, line); } static void filter_protocol_query(struct filter *filter, uint64_t token, uint64_t reqid, const char *phase, const char *param) { int n; struct filter_session *fs; struct timeval tv; gettimeofday(&tv, NULL); fs = tree_xget(&sessions, reqid); if (strcmp(phase, "connect") == 0) n = io_printf(lka_proc_get_io(filter->proc), "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s|%s\n", PROTOCOL_VERSION, (long long)tv.tv_sec, (long)tv.tv_usec, phase, reqid, token, fs->rdns, param); else n = io_printf(lka_proc_get_io(filter->proc), "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, (long long)tv.tv_sec, (long)tv.tv_usec, phase, reqid, token, param); if (n == -1) fatalx("failed to write to processor"); } static void filter_data_query(struct filter *filter, uint64_t token, uint64_t reqid, const char *line) { int n; struct timeval tv; gettimeofday(&tv, NULL); n = io_printf(lka_proc_get_io(filter->proc), "filter|%s|%lld.%06ld|smtp-in|data-line|" "%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, (long long)tv.tv_sec, (long)tv.tv_usec, reqid, token, line); if (n == -1) fatalx("failed to write to processor"); } static void filter_result_proceed(uint64_t reqid) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_PROCEED); m_close(p_dispatcher); } static void filter_result_report(uint64_t reqid, const char *param) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_REPORT); m_add_string(p_dispatcher, param); m_close(p_dispatcher); } static void filter_result_junk(uint64_t reqid) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_JUNK); m_close(p_dispatcher); } static void filter_result_rewrite(uint64_t reqid, const char *param) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_REWRITE); m_add_string(p_dispatcher, param); m_close(p_dispatcher); } static void filter_result_reject(uint64_t reqid, const char *message) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_REJECT); m_add_string(p_dispatcher, message); m_close(p_dispatcher); } static void filter_result_disconnect(uint64_t reqid, const char *message) { m_create(p_dispatcher, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, FILTER_DISCONNECT); m_add_string(p_dispatcher, message); m_close(p_dispatcher); } /* below is code for builtin filters */ static int filter_check_rdns_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->rdns_table == NULL) return 0; if (table_match(filter->config->rdns_table, kind, key) > 0) ret = 1; return filter->config->not_rdns_table < 0 ? !ret : ret; } static int filter_check_rdns_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->rdns_regex == NULL) return 0; if (table_match(filter->config->rdns_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_rdns_regex < 0 ? !ret : ret; } static int filter_check_src_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->src_table == NULL) return 0; if (table_match(filter->config->src_table, kind, key) > 0) ret = 1; return filter->config->not_src_table < 0 ? !ret : ret; } static int filter_check_src_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->src_regex == NULL) return 0; if (table_match(filter->config->src_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_src_regex < 0 ? !ret : ret; } static int filter_check_helo_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->helo_table == NULL) return 0; if (table_match(filter->config->helo_table, kind, key) > 0) ret = 1; return filter->config->not_helo_table < 0 ? !ret : ret; } static int filter_check_helo_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->helo_regex == NULL) return 0; if (table_match(filter->config->helo_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_helo_regex < 0 ? !ret : ret; } static int filter_check_auth(struct filter *filter, const char *username) { int ret = 0; if (!filter->config->auth) return 0; ret = username ? 1 : 0; return filter->config->not_auth < 0 ? !ret : ret; } static int filter_check_auth_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->auth_table == NULL) return 0; if (key && table_match(filter->config->auth_table, kind, key) > 0) ret = 1; return filter->config->not_auth_table < 0 ? !ret : ret; } static int filter_check_auth_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->auth_regex == NULL) return 0; if (key && table_match(filter->config->auth_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_auth_regex < 0 ? !ret : ret; } static int filter_check_mail_from_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->mail_from_table == NULL) return 0; if (table_match(filter->config->mail_from_table, kind, key) > 0) ret = 1; return filter->config->not_mail_from_table < 0 ? !ret : ret; } static int filter_check_mail_from_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->mail_from_regex == NULL) return 0; if (table_match(filter->config->mail_from_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_mail_from_regex < 0 ? !ret : ret; } static int filter_check_rcpt_to_table(struct filter *filter, enum table_service kind, const char *key) { int ret = 0; if (filter->config->rcpt_to_table == NULL) return 0; if (table_match(filter->config->rcpt_to_table, kind, key) > 0) ret = 1; return filter->config->not_rcpt_to_table < 0 ? !ret : ret; } static int filter_check_rcpt_to_regex(struct filter *filter, const char *key) { int ret = 0; if (filter->config->rcpt_to_regex == NULL) return 0; if (table_match(filter->config->rcpt_to_regex, K_REGEX, key) > 0) ret = 1; return filter->config->not_rcpt_to_regex < 0 ? !ret : ret; } static int filter_check_fcrdns(struct filter *filter, int fcrdns) { int ret = 0; if (!filter->config->fcrdns) return 0; ret = fcrdns == 1; return filter->config->not_fcrdns < 0 ? !ret : ret; } static int filter_check_rdns(struct filter *filter, const char *hostname) { int ret = 0; struct netaddr netaddr; if (!filter->config->rdns) return 0; /* this is a hack until smtp session properly deals with lack of rdns */ ret = strcmp("", hostname); if (ret == 0) return filter->config->not_rdns < 0 ? !ret : ret; /* if text_to_netaddress succeeds, * we don't have an rDNS so the filter should match */ ret = !text_to_netaddr(&netaddr, hostname); return filter->config->not_rdns < 0 ? !ret : ret; } static int filter_builtins_notimpl(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return 0; } static int filter_builtins_global(struct filter_session *fs, struct filter *filter, uint64_t reqid) { return filter_check_fcrdns(filter, fs->fcrdns) || filter_check_rdns(filter, fs->rdns) || filter_check_rdns_table(filter, K_DOMAIN, fs->rdns) || filter_check_rdns_regex(filter, fs->rdns) || filter_check_src_table(filter, K_NETADDR, ss_to_text(&fs->ss_src)) || filter_check_src_regex(filter, ss_to_text(&fs->ss_src)) || filter_check_helo_table(filter, K_DOMAIN, fs->helo) || filter_check_helo_regex(filter, fs->helo) || filter_check_auth(filter, fs->username) || filter_check_auth_table(filter, K_STRING, fs->username) || filter_check_auth_table(filter, K_CREDENTIALS, fs->username) || filter_check_auth_regex(filter, fs->username) || filter_check_mail_from_table(filter, K_MAILADDR, fs->mail_from) || filter_check_mail_from_regex(filter, fs->mail_from); } static int filter_builtins_connect(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid); } static int filter_builtins_helo(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid); } static int filter_builtins_mail_from(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid); } static int filter_builtins_rcpt_to(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid) || filter_check_rcpt_to_table(filter, K_MAILADDR, param) || filter_check_rcpt_to_regex(filter, param); } static int filter_builtins_data(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid); } static int filter_builtins_commit(struct filter_session *fs, struct filter *filter, uint64_t reqid, const char *param) { return filter_builtins_global(fs, filter, reqid); } static void report_smtp_broadcast(uint64_t, const char *, struct timeval *, const char *, const char *, ...) __attribute__((__format__ (printf, 5, 6))); void lka_report_init(void) { struct reporters *tailq; size_t i; dict_init(&report_smtp_in); dict_init(&report_smtp_out); for (i = 0; i < nitems(smtp_events); ++i) { tailq = xcalloc(1, sizeof (struct reporters)); TAILQ_INIT(tailq); dict_xset(&report_smtp_in, smtp_events[i].event, tailq); tailq = xcalloc(1, sizeof (struct reporters)); TAILQ_INIT(tailq); dict_xset(&report_smtp_out, smtp_events[i].event, tailq); } } void lka_report_register_hook(const char *name, const char *hook) { struct dict *subsystem; struct reporter_proc *rp; struct reporters *tailq; void *iter; size_t i; if (strncmp(hook, "smtp-in|", 8) == 0) { subsystem = &report_smtp_in; hook += 8; } else if (strncmp(hook, "smtp-out|", 9) == 0) { subsystem = &report_smtp_out; hook += 9; } else fatalx("Invalid message direction: %s", hook); if (strcmp(hook, "*") == 0) { iter = NULL; while (dict_iter(subsystem, &iter, NULL, (void **)&tailq)) { rp = xcalloc(1, sizeof *rp); rp->name = xstrdup(name); TAILQ_INSERT_TAIL(tailq, rp, entries); } return; } for (i = 0; i < nitems(smtp_events); i++) if (strcmp(hook, smtp_events[i].event) == 0) break; if (i == nitems(smtp_events)) fatalx("Unrecognized report name: %s", hook); tailq = dict_get(subsystem, hook); rp = xcalloc(1, sizeof *rp); rp->name = xstrdup(name); TAILQ_INSERT_TAIL(tailq, rp, entries); } static void report_smtp_broadcast(uint64_t reqid, const char *direction, struct timeval *tv, const char *event, const char *format, ...) { va_list ap; struct dict *d; struct reporters *tailq; struct reporter_proc *rp; if (strcmp("smtp-in", direction) == 0) d = &report_smtp_in; else if (strcmp("smtp-out", direction) == 0) d = &report_smtp_out; else fatalx("unexpected direction: %s", direction); tailq = dict_xget(d, event); TAILQ_FOREACH(rp, tailq, entries) { if (!lka_filter_proc_in_session(reqid, rp->name)) continue; va_start(ap, format); if (io_printf(lka_proc_get_io(rp->name), "report|%s|%lld.%06ld|%s|%s|%016"PRIx64"%s", PROTOCOL_VERSION, (long long)tv->tv_sec, (long)tv->tv_usec, direction, event, reqid, format[0] != '\n' ? "|" : "") == -1 || io_vprintf(lka_proc_get_io(rp->name), format, ap) == -1) fatalx("failed to write to processor"); va_end(ap); } } void lka_report_smtp_link_connect(const char *direction, struct timeval *tv, uint64_t reqid, const char *rdns, int fcrdns, const struct sockaddr_storage *ss_src, const struct sockaddr_storage *ss_dest) { struct filter_session *fs; char src[NI_MAXHOST + 5]; char dest[NI_MAXHOST + 5]; uint16_t src_port = 0; uint16_t dest_port = 0; const char *fcrdns_str; if (ss_src->ss_family == AF_INET) src_port = ntohs(((const struct sockaddr_in *)ss_src)->sin_port); else if (ss_src->ss_family == AF_INET6) src_port = ntohs(((const struct sockaddr_in6 *)ss_src)->sin6_port); if (ss_dest->ss_family == AF_INET) dest_port = ntohs(((const struct sockaddr_in *)ss_dest)->sin_port); else if (ss_dest->ss_family == AF_INET6) dest_port = ntohs(((const struct sockaddr_in6 *)ss_dest)->sin6_port); if (strcmp(ss_to_text(ss_src), "local") == 0) { (void)snprintf(src, sizeof src, "unix:%s", SMTPD_SOCKET); (void)snprintf(dest, sizeof dest, "unix:%s", SMTPD_SOCKET); } else { (void)snprintf(src, sizeof src, "%s:%d", ss_to_text(ss_src), src_port); (void)snprintf(dest, sizeof dest, "%s:%d", ss_to_text(ss_dest), dest_port); } switch (fcrdns) { case 1: fcrdns_str = "pass"; break; case 0: fcrdns_str = "fail"; break; default: fcrdns_str = "error"; break; } fs = tree_xget(&sessions, reqid); fs->rdns = xstrdup(rdns); fs->fcrdns = fcrdns; fs->ss_src = *ss_src; fs->ss_dest = *ss_dest; report_smtp_broadcast(reqid, direction, tv, "link-connect", "%s|%s|%s|%s\n", rdns, fcrdns_str, src, dest); } void lka_report_smtp_link_disconnect(const char *direction, struct timeval *tv, uint64_t reqid) { report_smtp_broadcast(reqid, direction, tv, "link-disconnect", "\n"); } void lka_report_smtp_link_greeting(const char *direction, uint64_t reqid, struct timeval *tv, const char *domain) { report_smtp_broadcast(reqid, direction, tv, "link-greeting", "%s\n", domain); } void lka_report_smtp_link_auth(const char *direction, struct timeval *tv, uint64_t reqid, const char *username, const char *result) { struct filter_session *fs; if (strcmp(result, "pass") == 0) { fs = tree_xget(&sessions, reqid); fs->username = xstrdup(username); } report_smtp_broadcast(reqid, direction, tv, "link-auth", "%s|%s\n", result, username); } void lka_report_smtp_link_identify(const char *direction, struct timeval *tv, uint64_t reqid, const char *method, const char *heloname) { report_smtp_broadcast(reqid, direction, tv, "link-identify", "%s|%s\n", method, heloname); } void lka_report_smtp_link_tls(const char *direction, struct timeval *tv, uint64_t reqid, const char *ciphers) { report_smtp_broadcast(reqid, direction, tv, "link-tls", "%s\n", ciphers); } void lka_report_smtp_tx_reset(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid) { report_smtp_broadcast(reqid, direction, tv, "tx-reset", "%08x\n", msgid); } void lka_report_smtp_tx_begin(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid) { report_smtp_broadcast(reqid, direction, tv, "tx-begin", "%08x\n", msgid); } void lka_report_smtp_tx_mail(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid, const char *address, int ok) { const char *result; switch (ok) { case 1: result = "ok"; break; case 0: result = "permfail"; break; default: result = "tempfail"; break; } report_smtp_broadcast(reqid, direction, tv, "tx-mail", "%08x|%s|%s\n", msgid, result, address); } void lka_report_smtp_tx_rcpt(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid, const char *address, int ok) { const char *result; switch (ok) { case 1: result = "ok"; break; case 0: result = "permfail"; break; default: result = "tempfail"; break; } report_smtp_broadcast(reqid, direction, tv, "tx-rcpt", "%08x|%s|%s\n", msgid, result, address); } void lka_report_smtp_tx_envelope(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid, uint64_t evpid) { report_smtp_broadcast(reqid, direction, tv, "tx-envelope", "%08x|%016"PRIx64"\n", msgid, evpid); } void lka_report_smtp_tx_data(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid, int ok) { const char *result; switch (ok) { case 1: result = "ok"; break; case 0: result = "permfail"; break; default: result = "tempfail"; break; } report_smtp_broadcast(reqid, direction, tv, "tx-data", "%08x|%s\n", msgid, result); } void lka_report_smtp_tx_commit(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid, size_t msgsz) { report_smtp_broadcast(reqid, direction, tv, "tx-commit", "%08x|%zd\n", msgid, msgsz); } void lka_report_smtp_tx_rollback(const char *direction, struct timeval *tv, uint64_t reqid, uint32_t msgid) { report_smtp_broadcast(reqid, direction, tv, "tx-rollback", "%08x\n", msgid); } void lka_report_smtp_protocol_client(const char *direction, struct timeval *tv, uint64_t reqid, const char *command) { report_smtp_broadcast(reqid, direction, tv, "protocol-client", "%s\n", command); } void lka_report_smtp_protocol_server(const char *direction, struct timeval *tv, uint64_t reqid, const char *response) { report_smtp_broadcast(reqid, direction, tv, "protocol-server", "%s\n", response); } void lka_report_smtp_filter_response(const char *direction, struct timeval *tv, uint64_t reqid, int phase, int response, const char *param) { const char *phase_name; const char *response_name; switch (phase) { case FILTER_CONNECT: phase_name = "connected"; break; case FILTER_HELO: phase_name = "helo"; break; case FILTER_EHLO: phase_name = "ehlo"; break; case FILTER_STARTTLS: phase_name = "tls"; break; case FILTER_AUTH: phase_name = "auth"; break; case FILTER_MAIL_FROM: phase_name = "mail-from"; break; case FILTER_RCPT_TO: phase_name = "rcpt-to"; break; case FILTER_DATA: phase_name = "data"; break; case FILTER_DATA_LINE: phase_name = "data-line"; break; case FILTER_RSET: phase_name = "rset"; break; case FILTER_QUIT: phase_name = "quit"; break; case FILTER_NOOP: phase_name = "noop"; break; case FILTER_HELP: phase_name = "help"; break; case FILTER_WIZ: phase_name = "wiz"; break; case FILTER_COMMIT: phase_name = "commit"; break; default: phase_name = ""; } switch (response) { case FILTER_PROCEED: response_name = "proceed"; break; case FILTER_REPORT: response_name = "report"; break; case FILTER_JUNK: response_name = "junk"; break; case FILTER_REWRITE: response_name = "rewrite"; break; case FILTER_REJECT: response_name = "reject"; break; case FILTER_DISCONNECT: response_name = "disconnect"; break; default: response_name = ""; } report_smtp_broadcast(reqid, direction, tv, "filter-response", "%s|%s%s%s\n", phase_name, response_name, param ? "|" : "", param ? param : ""); } void lka_report_smtp_timeout(const char *direction, struct timeval *tv, uint64_t reqid) { report_smtp_broadcast(reqid, direction, tv, "timeout", "\n"); } void lka_report_filter_report(uint64_t reqid, const char *name, int builtin, const char *direction, struct timeval *tv, const char *message) { report_smtp_broadcast(reqid, direction, tv, "filter-report", "%s|%s|%s\n", builtin ? "builtin" : "proc", name, message); } void lka_report_proc(const char *name, const char *line) { char buffer[LINE_MAX]; struct timeval tv; char *ep, *sp, *direction; uint64_t reqid; if (strlcpy(buffer, line + 7, sizeof(buffer)) >= sizeof(buffer)) fatalx("Invalid report: line too long: %s", line); errno = 0; tv.tv_sec = strtoll(buffer, &ep, 10); if (ep[0] != '.' || errno != 0) fatalx("Invalid report: invalid time: %s", line); sp = ep + 1; tv.tv_usec = strtol(sp, &ep, 10); if (ep[0] != '|' || errno != 0) fatalx("Invalid report: invalid time: %s", line); if (ep - sp != 6) fatalx("Invalid report: invalid time: %s", line); direction = ep + 1; if (strncmp(direction, "smtp-in|", 8) == 0) { direction[7] = '\0'; direction += 7; #if 0 } else if (strncmp(direction, "smtp-out|", 9) == 0) { direction[8] = '\0'; direction += 8; #endif } else fatalx("Invalid report: invalid direction: %s", line); reqid = strtoull(sp, &ep, 16); if (ep[0] != '|' || errno != 0) fatalx("Invalid report: invalid reqid: %s", line); sp = ep + 1; lka_report_filter_report(reqid, name, 0, direction, &tv, sp); } opensmtpd-7.7.0p0/usr.sbin/smtpd/lka_session.c0000644000175000001440000003703414610663500015033 /* $OpenBSD: lka_session.c,v 1.100 2024/02/02 23:33:42 gilles Exp $ */ /* * Copyright (c) 2011 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define EXPAND_DEPTH 10 #define F_WAITING 0x01 struct lka_session { uint64_t id; /* given by smtp */ TAILQ_HEAD(, envelope) deliverylist; struct expand expand; int flags; int error; const char *errormsg; struct envelope envelope; struct xnodes nodes; /* waiting for fwdrq */ struct rule *rule; struct expandnode *node; }; static void lka_expand(struct lka_session *, struct rule *, struct expandnode *); static void lka_submit(struct lka_session *, struct rule *, struct expandnode *); static void lka_resume(struct lka_session *); static int init; static struct tree sessions; void lka_session(uint64_t id, struct envelope *envelope) { struct lka_session *lks; struct expandnode xn; if (init == 0) { init = 1; tree_init(&sessions); } lks = xcalloc(1, sizeof(*lks)); lks->id = id; RB_INIT(&lks->expand.tree); TAILQ_INIT(&lks->deliverylist); tree_xset(&sessions, lks->id, lks); lks->envelope = *envelope; TAILQ_INIT(&lks->nodes); memset(&xn, 0, sizeof xn); xn.type = EXPAND_ADDRESS; xn.u.mailaddr = lks->envelope.rcpt; lks->expand.parent = NULL; lks->expand.rule = NULL; lks->expand.queue = &lks->nodes; expand_insert(&lks->expand, &xn); lka_resume(lks); } void lka_session_forward_reply(struct forward_req *fwreq, int fd) { struct lka_session *lks; struct dispatcher *dsp; struct rule *rule; struct expandnode *xn; int ret; lks = tree_xget(&sessions, fwreq->id); xn = lks->node; rule = lks->rule; lks->flags &= ~F_WAITING; switch (fwreq->status) { case 0: /* permanent failure while lookup ~/.forward */ log_trace(TRACE_EXPAND, "expand: ~/.forward failed for user %s", fwreq->user); lks->error = LKA_PERMFAIL; break; case 1: if (fd == -1) { dsp = dict_get(env->sc_dispatchers, lks->rule->dispatcher); if (dsp->u.local.forward_only) { log_trace(TRACE_EXPAND, "expand: no .forward " "for user %s on forward-only rule", fwreq->user); lks->error = LKA_TEMPFAIL; } else if (dsp->u.local.expand_only) { log_trace(TRACE_EXPAND, "expand: no .forward " "for user %s and no default action on rule", fwreq->user); lks->error = LKA_PERMFAIL; } else { log_trace(TRACE_EXPAND, "expand: no .forward for " "user %s, just deliver", fwreq->user); lka_submit(lks, rule, xn); } } else { dsp = dict_get(env->sc_dispatchers, rule->dispatcher); /* expand for the current user and rule */ lks->expand.rule = rule; lks->expand.parent = xn; /* forwards_get() will close the descriptor no matter what */ ret = forwards_get(fd, &lks->expand); if (ret == -1) { log_trace(TRACE_EXPAND, "expand: temporary " "forward error for user %s", fwreq->user); lks->error = LKA_TEMPFAIL; } else if (ret == 0) { if (dsp->u.local.forward_only) { log_trace(TRACE_EXPAND, "expand: empty .forward " "for user %s on forward-only rule", fwreq->user); lks->error = LKA_TEMPFAIL; } else if (dsp->u.local.expand_only) { log_trace(TRACE_EXPAND, "expand: empty .forward " "for user %s and no default action on rule", fwreq->user); lks->error = LKA_PERMFAIL; } else { log_trace(TRACE_EXPAND, "expand: empty .forward " "for user %s, just deliver", fwreq->user); lka_submit(lks, rule, xn); } } } break; default: /* temporary failure while looking up ~/.forward */ lks->error = LKA_TEMPFAIL; } if (lks->error == LKA_TEMPFAIL && lks->errormsg == NULL) lks->errormsg = "424 4.2.4 Mailing list expansion problem"; if (lks->error == LKA_PERMFAIL && lks->errormsg == NULL) lks->errormsg = "524 5.2.4 Mailing list expansion problem"; lka_resume(lks); } static void lka_resume(struct lka_session *lks) { struct envelope *ep; struct expandnode *xn; if (lks->error) goto error; /* pop next node and expand it */ while ((xn = TAILQ_FIRST(&lks->nodes))) { TAILQ_REMOVE(&lks->nodes, xn, tq_entry); lka_expand(lks, xn->rule, xn); if (lks->flags & F_WAITING) return; if (lks->error) goto error; } /* delivery list is empty, reject */ if (TAILQ_FIRST(&lks->deliverylist) == NULL) { log_trace(TRACE_EXPAND, "expand: lka_done: expanded to empty " "delivery list"); lks->error = LKA_PERMFAIL; lks->errormsg = "524 5.2.4 Mailing list expansion problem"; } error: if (lks->error) { m_create(p_dispatcher, IMSG_SMTP_EXPAND_RCPT, 0, 0, -1); m_add_id(p_dispatcher, lks->id); m_add_int(p_dispatcher, lks->error); if (lks->errormsg) m_add_string(p_dispatcher, lks->errormsg); else { if (lks->error == LKA_PERMFAIL) m_add_string(p_dispatcher, "550 Invalid recipient"); else if (lks->error == LKA_TEMPFAIL) m_add_string(p_dispatcher, "451 Temporary failure"); } m_close(p_dispatcher); while ((ep = TAILQ_FIRST(&lks->deliverylist)) != NULL) { TAILQ_REMOVE(&lks->deliverylist, ep, entry); free(ep); } } else { /* Process the delivery list and submit envelopes to queue */ while ((ep = TAILQ_FIRST(&lks->deliverylist)) != NULL) { TAILQ_REMOVE(&lks->deliverylist, ep, entry); m_create(p_queue, IMSG_LKA_ENVELOPE_SUBMIT, 0, 0, -1); m_add_id(p_queue, lks->id); m_add_envelope(p_queue, ep); m_close(p_queue); free(ep); } m_create(p_queue, IMSG_LKA_ENVELOPE_COMMIT, 0, 0, -1); m_add_id(p_queue, lks->id); m_close(p_queue); } expand_clear(&lks->expand); tree_xpop(&sessions, lks->id); free(lks); } static void lka_expand(struct lka_session *lks, struct rule *rule, struct expandnode *xn) { struct forward_req fwreq; struct envelope ep; struct expandnode node; struct mailaddr maddr; struct dispatcher *dsp; struct table *userbase; int r; union lookup lk; char *tag; const char *srs_decoded; if (xn->depth >= EXPAND_DEPTH) { log_trace(TRACE_EXPAND, "expand: lka_expand: node too deep."); lks->error = LKA_PERMFAIL; lks->errormsg = "524 5.2.4 Mailing list expansion problem"; return; } switch (xn->type) { case EXPAND_INVALID: case EXPAND_INCLUDE: fatalx("lka_expand: unexpected type"); break; case EXPAND_ADDRESS: log_trace(TRACE_EXPAND, "expand: lka_expand: address: %s@%s " "[depth=%d]", xn->u.mailaddr.user, xn->u.mailaddr.domain, xn->depth); ep = lks->envelope; ep.dest = xn->u.mailaddr; if (xn->parent) /* nodes with parent are forward addresses */ ep.flags |= EF_INTERNAL; /* handle SRS */ if (env->sc_srs_key != NULL && ep.sender.user[0] == '\0' && (strncasecmp(ep.dest.user, "SRS0=", 5) == 0 || strncasecmp(ep.dest.user, "SRS1=", 5) == 0)) { srs_decoded = srs_decode(mailaddr_to_text(&ep.dest)); if (srs_decoded && text_to_mailaddr(&ep.dest, srs_decoded)) { /* flag envelope internal and override dest */ ep.flags |= EF_INTERNAL; xn->u.mailaddr = ep.dest; lks->envelope = ep; } else { log_warn("SRS failed to decode: %s", mailaddr_to_text(&ep.dest)); } } /* Pass the node through the ruleset */ rule = ruleset_match(&ep); if (rule == NULL || rule->reject) { lks->error = (errno == EAGAIN) ? LKA_TEMPFAIL : LKA_PERMFAIL; break; } dsp = dict_xget(env->sc_dispatchers, rule->dispatcher); if (dsp->type == DISPATCHER_REMOTE) { lka_submit(lks, rule, xn); } else if (dsp->u.local.table_virtual) { /* expand */ lks->expand.rule = rule; lks->expand.parent = xn; /* temporary replace the mailaddr with a copy where * we eventually strip the '+'-part before lookup. */ maddr = xn->u.mailaddr; xlowercase(maddr.user, xn->u.mailaddr.user, sizeof maddr.user); r = aliases_virtual_get(&lks->expand, &maddr); if (r == -1) { lks->error = LKA_TEMPFAIL; log_trace(TRACE_EXPAND, "expand: lka_expand: " "error in virtual alias lookup"); } else if (r == 0) { lks->error = LKA_PERMFAIL; log_trace(TRACE_EXPAND, "expand: lka_expand: " "no aliases for virtual"); } if (lks->error == LKA_TEMPFAIL && lks->errormsg == NULL) lks->errormsg = "424 4.2.4 Mailing list expansion problem"; if (lks->error == LKA_PERMFAIL && lks->errormsg == NULL) lks->errormsg = "524 5.2.4 Mailing list expansion problem"; } else { lks->expand.rule = rule; lks->expand.parent = xn; xn->rule = rule; memset(&node, 0, sizeof node); node.type = EXPAND_USERNAME; xlowercase(node.u.user, xn->u.mailaddr.user, sizeof node.u.user); expand_insert(&lks->expand, &node); } break; case EXPAND_USERNAME: log_trace(TRACE_EXPAND, "expand: lka_expand: username: %s " "[depth=%d, sameuser=%d]", xn->u.user, xn->depth, xn->sameuser); /* expand aliases with the given rule */ dsp = dict_xget(env->sc_dispatchers, rule->dispatcher); lks->expand.rule = rule; lks->expand.parent = xn; if (!xn->sameuser && (dsp->u.local.table_alias || dsp->u.local.table_virtual)) { if (dsp->u.local.table_alias) r = aliases_get(&lks->expand, xn->u.user); if (dsp->u.local.table_virtual) r = aliases_virtual_get(&lks->expand, &xn->u.mailaddr); if (r == -1) { log_trace(TRACE_EXPAND, "expand: lka_expand: " "error in alias lookup"); lks->error = LKA_TEMPFAIL; if (lks->errormsg == NULL) lks->errormsg = "424 4.2.4 Mailing list expansion problem"; } if (r) break; } /* gilles+hackers@ -> gilles@ */ if ((tag = strchr(xn->u.user, *env->sc_subaddressing_delim)) != NULL) { *tag++ = '\0'; (void)strlcpy(xn->subaddress, tag, sizeof xn->subaddress); } userbase = table_find(env, dsp->u.local.table_userbase); r = table_lookup(userbase, K_USERINFO, xn->u.user, &lk); if (r == -1) { log_trace(TRACE_EXPAND, "expand: lka_expand: " "backend error while searching user"); lks->error = LKA_TEMPFAIL; break; } if (r == 0) { log_trace(TRACE_EXPAND, "expand: lka_expand: " "user-part does not match system user"); lks->error = LKA_PERMFAIL; break; } xn->realuser = 1; xn->realuser_uid = lk.userinfo.uid; if (xn->sameuser && xn->parent->forwarded) { log_trace(TRACE_EXPAND, "expand: lka_expand: same " "user, submitting"); lka_submit(lks, rule, xn); break; } /* when alternate delivery user is provided, * skip other users forward files. */ if (dsp->u.local.user) { if (strcmp(dsp->u.local.user, xn->u.user) != 0) { log_trace(TRACE_EXPAND, "expand: lka_expand: " "alternate delivery user mismatch recipient " "user, skip .forward, submitting"); lka_submit(lks, rule, xn); break; } } /* no aliases found, query forward file */ lks->rule = rule; lks->node = xn; xn->forwarded = 1; memset(&fwreq, 0, sizeof(fwreq)); fwreq.id = lks->id; (void)strlcpy(fwreq.user, lk.userinfo.username, sizeof(fwreq.user)); (void)strlcpy(fwreq.directory, lk.userinfo.directory, sizeof(fwreq.directory)); fwreq.uid = lk.userinfo.uid; fwreq.gid = lk.userinfo.gid; m_compose(p_parent, IMSG_LKA_OPEN_FORWARD, 0, 0, -1, &fwreq, sizeof(fwreq)); lks->flags |= F_WAITING; break; case EXPAND_FILENAME: if (xn->parent->realuser && xn->parent->realuser_uid == 0) { log_trace(TRACE_EXPAND, "expand: filename not allowed in root's forward"); lks->error = LKA_TEMPFAIL; break; } dsp = dict_xget(env->sc_dispatchers, rule->dispatcher); if (dsp->u.local.forward_only) { log_trace(TRACE_EXPAND, "expand: filename matched on forward-only rule"); lks->error = LKA_TEMPFAIL; break; } log_trace(TRACE_EXPAND, "expand: lka_expand: filename: %s " "[depth=%d]", xn->u.buffer, xn->depth); lka_submit(lks, rule, xn); break; case EXPAND_ERROR: dsp = dict_xget(env->sc_dispatchers, rule->dispatcher); if (dsp->u.local.forward_only) { log_trace(TRACE_EXPAND, "expand: error matched on forward-only rule"); lks->error = LKA_TEMPFAIL; break; } log_trace(TRACE_EXPAND, "expand: lka_expand: error: %s " "[depth=%d]", xn->u.buffer, xn->depth); if (xn->u.buffer[0] == '4') lks->error = LKA_TEMPFAIL; else if (xn->u.buffer[0] == '5') lks->error = LKA_PERMFAIL; lks->errormsg = xn->u.buffer; break; case EXPAND_FILTER: if (xn->parent->realuser && xn->parent->realuser_uid == 0) { log_trace(TRACE_EXPAND, "expand: filter not allowed in root's forward"); lks->error = LKA_TEMPFAIL; break; } dsp = dict_xget(env->sc_dispatchers, rule->dispatcher); if (dsp->u.local.forward_only) { log_trace(TRACE_EXPAND, "expand: filter matched on forward-only rule"); lks->error = LKA_TEMPFAIL; break; } log_trace(TRACE_EXPAND, "expand: lka_expand: filter: %s " "[depth=%d]", xn->u.buffer, xn->depth); lka_submit(lks, rule, xn); break; } } static struct expandnode * lka_find_ancestor(struct expandnode *xn, enum expand_type type) { while (xn && (xn->type != type)) xn = xn->parent; if (xn == NULL) { log_warnx("warn: lka_find_ancestor: no ancestors of type %d", type); fatalx(NULL); } return (xn); } static void lka_submit(struct lka_session *lks, struct rule *rule, struct expandnode *xn) { struct envelope *ep; struct dispatcher *dsp; const char *user; const char *format; ep = xmemdup(&lks->envelope, sizeof *ep); (void)strlcpy(ep->dispatcher, rule->dispatcher, sizeof ep->dispatcher); dsp = dict_xget(env->sc_dispatchers, ep->dispatcher); switch (dsp->type) { case DISPATCHER_REMOTE: if (xn->type != EXPAND_ADDRESS) fatalx("lka_deliver: expect address"); ep->type = D_MTA; ep->dest = xn->u.mailaddr; break; case DISPATCHER_BOUNCE: case DISPATCHER_LOCAL: if (xn->type != EXPAND_USERNAME && xn->type != EXPAND_FILENAME && xn->type != EXPAND_FILTER) fatalx("lka_deliver: wrong type: %d", xn->type); ep->type = D_MDA; ep->dest = lka_find_ancestor(xn, EXPAND_ADDRESS)->u.mailaddr; if (xn->type == EXPAND_USERNAME) { (void)strlcpy(ep->mda_user, xn->u.user, sizeof(ep->mda_user)); (void)strlcpy(ep->mda_subaddress, xn->subaddress, sizeof(ep->mda_subaddress)); } else { user = !xn->parent->realuser ? SMTPD_USER : xn->parent->u.user; (void)strlcpy(ep->mda_user, user, sizeof (ep->mda_user)); /* this battle needs to be fought ... */ if (xn->type == EXPAND_FILTER && strcmp(ep->mda_user, SMTPD_USER) == 0) log_warnx("commands executed from aliases " "run with %s privileges", SMTPD_USER); format = "%s"; if (xn->type == EXPAND_FILENAME) format = PATH_LIBEXEC"/mail.mboxfile -f %%{mbox.from} %s"; (void)snprintf(ep->mda_exec, sizeof(ep->mda_exec), format, xn->u.buffer); } break; } TAILQ_INSERT_TAIL(&lks->deliverylist, ep, entry); } opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.mda.80000644000175000001440000000237414610663500014127 .\" $OpenBSD: mail.mda.8,v 1.1 2017/08/09 07:56:10 gilles Exp $ .\" .\" Copyright (c) 2017 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 9 2017 $ .Dt MAIL.MDA 8 .Os .Sh NAME .Nm mail.mda .Nd deliver mail to a program .Sh SYNOPSIS .Nm mail.mda .Ar program .Sh DESCRIPTION .Nm executes the program and its parameters. The program must read from the standard input up to an end-of-file and acknowledge delivery success or failure with its exit status. .Sh EXIT STATUS .Ex -std mail.mda .Sh SEE ALSO .Xr mail 1 , .Xr smtpd 8 opensmtpd-7.7.0p0/usr.sbin/smtpd/esc.c0000644000175000001440000001165614610663500013275 /* $OpenBSD: esc.c,v 1.6 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2014 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include "smtpd-defines.h" #include "smtpd-api.h" static struct escode { enum enhanced_status_code code; const char *description; } esc[] = { /* 0.0 */ { ESC_OTHER_STATUS, "Other/Undefined" }, /* 1.x */ { ESC_OTHER_ADDRESS_STATUS, "Other/Undefined address status" }, { ESC_BAD_DESTINATION_MAILBOX_ADDRESS, "Bad destination mailbox address" }, { ESC_BAD_DESTINATION_SYSTEM_ADDRESS, "Bad destination system address" }, { ESC_BAD_DESTINATION_MAILBOX_ADDRESS_SYNTAX, "Bad destination mailbox address syntax" }, { ESC_DESTINATION_MAILBOX_ADDRESS_AMBIGUOUS, "Destination mailbox address ambiguous" }, { ESC_DESTINATION_ADDRESS_VALID, "Destination address valid" }, { ESC_DESTINATION_MAILBOX_HAS_MOVED, "Destination mailbox has moved, No forwarding address" }, { ESC_BAD_SENDER_MAILBOX_ADDRESS_SYNTAX, "Bad sender's mailbox address syntax" }, { ESC_BAD_SENDER_SYSTEM_ADDRESS, "Bad sender's system address syntax" }, /* 2.x */ { ESC_OTHER_MAILBOX_STATUS, "Other/Undefined mailbox status" }, { ESC_MAILBOX_DISABLED, "Mailbox disabled, not accepting messages" }, { ESC_MAILBOX_FULL, "Mailbox full" }, { ESC_MESSAGE_LENGTH_TOO_LARGE, "Message length exceeds administrative limit" }, { ESC_MAILING_LIST_EXPANSION_PROBLEM, "Mailing list expansion problem" }, /* 3.x */ { ESC_OTHER_MAIL_SYSTEM_STATUS, "Other/Undefined mail system status" }, { ESC_MAIL_SYSTEM_FULL, "Mail system full" }, { ESC_SYSTEM_NOT_ACCEPTING_MESSAGES, "System not accepting network messages" }, { ESC_SYSTEM_NOT_CAPABLE_OF_SELECTED_FEATURES, "System not capable of selected features" }, { ESC_MESSAGE_TOO_BIG_FOR_SYSTEM, "Message too big for system" }, { ESC_SYSTEM_INCORRECTLY_CONFIGURED, "System incorrectly configured" }, /* 4.x */ { ESC_OTHER_NETWORK_ROUTING_STATUS, "Other/Undefined network or routing status" }, { ESC_NO_ANSWER_FROM_HOST, "No answer from host" }, { ESC_BAD_CONNECTION, "Bad connection" }, { ESC_DIRECTORY_SERVER_FAILURE, "Directory server failure" }, { ESC_UNABLE_TO_ROUTE, "Unable to route" }, { ESC_MAIL_SYSTEM_CONGESTION, "Mail system congestion" }, { ESC_ROUTING_LOOP_DETECTED, "Routing loop detected" }, { ESC_DELIVERY_TIME_EXPIRED, "Delivery time expired" }, /* 5.x */ { ESC_INVALID_RECIPIENT, "Invalid recipient" }, { ESC_INVALID_COMMAND, "Invalid command" }, { ESC_SYNTAX_ERROR, "Syntax error" }, { ESC_TOO_MANY_RECIPIENTS, "Too many recipients" }, { ESC_INVALID_COMMAND_ARGUMENTS, "Invalid command arguments" }, { ESC_WRONG_PROTOCOL_VERSION, "Wrong protocol version" }, /* 6.x */ { ESC_OTHER_MEDIA_ERROR, "Other/Undefined media error" }, { ESC_MEDIA_NOT_SUPPORTED, "Media not supported" }, { ESC_CONVERSION_REQUIRED_AND_PROHIBITED, "Conversion required and prohibited" }, { ESC_CONVERSION_REQUIRED_BUT_NOT_SUPPORTED, "Conversion required but not supported" }, { ESC_CONVERSION_WITH_LOSS_PERFORMED, "Conversion with loss performed" }, { ESC_CONVERSION_FAILED, "Conversion failed" }, /* 7.x */ { ESC_OTHER_SECURITY_STATUS, "Other/Undefined security status" }, { ESC_DELIVERY_NOT_AUTHORIZED_MESSAGE_REFUSED, "Delivery not authorized, message refused" }, { ESC_MAILING_LIST_EXPANSION_PROHIBITED, "Mailing list expansion prohibited" }, { ESC_SECURITY_CONVERSION_REQUIRED_NOT_POSSIBLE,"Security conversion required but not possible" }, { ESC_SECURITY_FEATURES_NOT_SUPPORTED, "Security features not supported" }, { ESC_CRYPTOGRAPHIC_FAILURE, "Cryptographic failure" }, { ESC_CRYPTOGRAPHIC_ALGORITHM_NOT_SUPPORTED, "Cryptographic algorithm not supported" }, { ESC_MESSAGE_TOO_BIG_FOR_SYSTEM, "Message integrity failure" }, }; const char * esc_code(enum enhanced_status_class class, enum enhanced_status_code code) { static char buffer[6]; (void)snprintf(buffer, sizeof buffer, "%d.%d.%d", class, code / 10, code % 10); return buffer; } const char * esc_description(enum enhanced_status_code code) { uint32_t i; for (i = 0; i < nitems(esc); ++i) if (code == esc[i].code) return esc[i].description; return "Other/Undefined"; } opensmtpd-7.7.0p0/usr.sbin/smtpd/queue_fs.c0000644000175000001440000003533414610663500014336 /* $OpenBSD: queue_fs.c,v 1.23 2023/05/31 16:51:46 op Exp $ */ /* * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #if HAVE_SYS_MOUNT_H #include #endif #include #include #include #include #ifdef HAVE_SYS_STATFS_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define PATH_QUEUE "/queue" #define PATH_INCOMING "/incoming" #define PATH_EVPTMP PATH_INCOMING "/envelope.tmp" #define PATH_MESSAGE "/message" /* percentage of remaining space / inodes required to accept new messages */ #define MINSPACE 5 #define MININODES 5 struct qwalk { FTS *fts; int depth; }; static int fsqueue_check_space(void); static void fsqueue_envelope_path(uint64_t, char *, size_t); static void fsqueue_envelope_incoming_path(uint64_t, char *, size_t); static int fsqueue_envelope_dump(char *, const char *, size_t, int, int); static void fsqueue_message_path(uint32_t, char *, size_t); static void fsqueue_message_incoming_path(uint32_t, char *, size_t); static void *fsqueue_qwalk_new(void); static int fsqueue_qwalk(void *, uint64_t *); static void fsqueue_qwalk_close(void *); struct tree evpcount; static struct timespec startup; #define REF (int*)0xf00 static int queue_fs_message_create(uint32_t *msgid) { char rootdir[PATH_MAX]; struct stat sb; if (!fsqueue_check_space()) return 0; again: *msgid = queue_generate_msgid(); /* prevent possible collision later when moving to Q_QUEUE */ fsqueue_message_path(*msgid, rootdir, sizeof(rootdir)); if (stat(rootdir, &sb) != -1) goto again; /* we hit an unexpected error, temporarily fail */ if (errno != ENOENT) { *msgid = 0; return 0; } fsqueue_message_incoming_path(*msgid, rootdir, sizeof(rootdir)); if (mkdir(rootdir, 0700) == -1) { if (errno == EEXIST) goto again; if (errno == ENOSPC) { *msgid = 0; return 0; } log_warn("warn: queue-fs: mkdir"); *msgid = 0; return 0; } return (1); } static int queue_fs_message_commit(uint32_t msgid, const char *path) { char incomingdir[PATH_MAX]; char queuedir[PATH_MAX]; char msgdir[PATH_MAX]; char msgpath[PATH_MAX]; /* before-first, move the message content in the incoming directory */ fsqueue_message_incoming_path(msgid, msgpath, sizeof(msgpath)); if (strlcat(msgpath, PATH_MESSAGE, sizeof(msgpath)) >= sizeof(msgpath)) return (0); if (rename(path, msgpath) == -1) return (0); fsqueue_message_incoming_path(msgid, incomingdir, sizeof(incomingdir)); fsqueue_message_path(msgid, msgdir, sizeof(msgdir)); if (strlcpy(queuedir, msgdir, sizeof(queuedir)) >= sizeof(queuedir)) return (0); /* first attempt to rename */ if (rename(incomingdir, msgdir) == 0) return 1; if (errno == ENOSPC) return 0; if (errno != ENOENT) { log_warn("warn: queue-fs: rename"); return 0; } /* create the bucket */ *strrchr(queuedir, '/') = '\0'; if (mkdir(queuedir, 0700) == -1) { if (errno == ENOSPC) return 0; if (errno != EEXIST) { log_warn("warn: queue-fs: mkdir"); return 0; } } /* rename */ if (rename(incomingdir, msgdir) == -1) { if (errno == ENOSPC) return 0; log_warn("warn: queue-fs: rename"); return 0; } return 1; } static int queue_fs_message_fd_r(uint32_t msgid) { int fd; char path[PATH_MAX]; fsqueue_message_path(msgid, path, sizeof(path)); if (strlcat(path, PATH_MESSAGE, sizeof(path)) >= sizeof(path)) return -1; if ((fd = open(path, O_RDONLY)) == -1) { log_warn("warn: queue-fs: open"); return -1; } return fd; } static int queue_fs_message_delete(uint32_t msgid) { char path[PATH_MAX]; struct stat sb; fsqueue_message_incoming_path(msgid, path, sizeof(path)); if (stat(path, &sb) == -1) fsqueue_message_path(msgid, path, sizeof(path)); if (rmtree(path, 0) == -1) log_warn("warn: queue-fs: rmtree"); tree_pop(&evpcount, msgid); return 1; } static int queue_fs_envelope_create(uint32_t msgid, const char *buf, size_t len, uint64_t *evpid) { char path[PATH_MAX]; int queued = 0, i, r = 0, *n; struct stat sb; if (msgid == 0) { log_warnx("warn: queue-fs: msgid=0, evpid=%016"PRIx64, *evpid); goto done; } fsqueue_message_incoming_path(msgid, path, sizeof(path)); if (stat(path, &sb) == -1) queued = 1; for (i = 0; i < 20; i ++) { *evpid = queue_generate_evpid(msgid); if (queued) fsqueue_envelope_path(*evpid, path, sizeof(path)); else fsqueue_envelope_incoming_path(*evpid, path, sizeof(path)); if ((r = fsqueue_envelope_dump(path, buf, len, 0, 0)) != 0) goto done; } r = 0; log_warnx("warn: queue-fs: could not allocate evpid"); done: if (r) { n = tree_pop(&evpcount, msgid); if (n == NULL) n = REF; n += 1; tree_xset(&evpcount, msgid, n); } return (r); } static int queue_fs_envelope_load(uint64_t evpid, char *buf, size_t len) { char pathname[PATH_MAX]; FILE *fp; size_t r; fsqueue_envelope_path(evpid, pathname, sizeof(pathname)); fp = fopen(pathname, "r"); if (fp == NULL) { if (errno != ENOENT && errno != ENFILE) log_warn("warn: queue-fs: fopen"); return 0; } r = fread(buf, 1, len, fp); if (r) { if (r == len) { log_warn("warn: queue-fs: too large"); r = 0; } else buf[r] = '\0'; } fclose(fp); return (r); } static int queue_fs_envelope_update(uint64_t evpid, const char *buf, size_t len) { char dest[PATH_MAX]; fsqueue_envelope_path(evpid, dest, sizeof(dest)); return (fsqueue_envelope_dump(dest, buf, len, 1, 1)); } static int queue_fs_envelope_delete(uint64_t evpid) { char pathname[PATH_MAX]; uint32_t msgid; int *n; fsqueue_envelope_path(evpid, pathname, sizeof(pathname)); if (unlink(pathname) == -1) if (errno != ENOENT) return 0; msgid = evpid_to_msgid(evpid); n = tree_pop(&evpcount, msgid); n -= 1; if (n - REF == 0) queue_fs_message_delete(msgid); else tree_xset(&evpcount, msgid, n); return (1); } static int queue_fs_message_walk(uint64_t *evpid, char *buf, size_t len, uint32_t msgid, int *done, void **data) { struct dirent *dp; DIR *dir = *data; char path[PATH_MAX]; char msgid_str[9]; char *tmp; int r, *n; if (*done) return (-1); if (!bsnprintf(path, sizeof path, "%s/%02x/%08x", PATH_QUEUE, (msgid & 0xff000000) >> 24, msgid)) fatalx("queue_fs_message_walk: path does not fit buffer"); if (dir == NULL) { if ((dir = opendir(path)) == NULL) { log_warn("warn: queue_fs: opendir: %s", path); *done = 1; return (-1); } *data = dir; } (void)snprintf(msgid_str, sizeof msgid_str, "%08" PRIx32, msgid); while ((dp = readdir(dir)) != NULL) { #if defined(HAVE_STRUCT_DIR_D_TYPE) if (dp->d_type != DT_REG) continue; #endif /* ignore files other than envelopes */ if (strlen(dp->d_name) != 16 || strncmp(dp->d_name, msgid_str, 8)) continue; tmp = NULL; *evpid = strtoull(dp->d_name, &tmp, 16); if (tmp && *tmp != '\0') { log_debug("debug: fsqueue: bogus file %s", dp->d_name); continue; } memset(buf, 0, len); r = queue_fs_envelope_load(*evpid, buf, len); if (r) { n = tree_pop(&evpcount, msgid); if (n == NULL) n = REF; n += 1; tree_xset(&evpcount, msgid, n); } return (r); } (void)closedir(dir); *done = 1; return (-1); } static int queue_fs_envelope_walk(uint64_t *evpid, char *buf, size_t len) { static int done = 0; static void *hdl = NULL; int r, *n; uint32_t msgid; if (done) return (-1); if (hdl == NULL) hdl = fsqueue_qwalk_new(); if (fsqueue_qwalk(hdl, evpid)) { memset(buf, 0, len); r = queue_fs_envelope_load(*evpid, buf, len); if (r) { msgid = evpid_to_msgid(*evpid); n = tree_pop(&evpcount, msgid); if (n == NULL) n = REF; n += 1; tree_xset(&evpcount, msgid, n); } return (r); } fsqueue_qwalk_close(hdl); done = 1; return (-1); } static int fsqueue_check_space(void) { #ifdef __OpenBSD__ struct statfs buf; uint64_t used; uint64_t total; if (statfs(PATH_QUEUE, &buf) == -1) { log_warn("warn: queue-fs: statfs"); return 0; } /* * f_bfree and f_ffree is not set on all filesystems. * They could be signed or unsigned integers. * Some systems will set them to 0, others will set them to -1. */ if (buf.f_bfree == 0 || buf.f_ffree == 0 || (int64_t)buf.f_bfree == -1 || (int64_t)buf.f_ffree == -1) return 1; used = buf.f_blocks - buf.f_bfree; total = buf.f_bavail + used; if (total != 0) used = (float)used / (float)total * 100; else used = 100; if (100 - used < MINSPACE) { log_warnx("warn: not enough disk space: %llu%% left", (unsigned long long) 100 - used); log_warnx("warn: temporarily rejecting messages"); return 0; } used = buf.f_files - buf.f_ffree; total = buf.f_favail + used; if (total != 0) used = (float)used / (float)total * 100; else used = 100; if (100 - used < MININODES) { log_warnx("warn: not enough inodes: %llu%% left", (unsigned long long) 100 - used); log_warnx("warn: temporarily rejecting messages"); return 0; } #endif return 1; } static void fsqueue_envelope_path(uint64_t evpid, char *buf, size_t len) { if (!bsnprintf(buf, len, "%s/%02x/%08x/%016" PRIx64, PATH_QUEUE, (evpid_to_msgid(evpid) & 0xff000000) >> 24, evpid_to_msgid(evpid), evpid)) fatalx("fsqueue_envelope_path: path does not fit buffer"); } static void fsqueue_envelope_incoming_path(uint64_t evpid, char *buf, size_t len) { if (!bsnprintf(buf, len, "%s/%08x/%016" PRIx64, PATH_INCOMING, evpid_to_msgid(evpid), evpid)) fatalx("fsqueue_envelope_incoming_path: path does not fit buffer"); } static int fsqueue_envelope_dump(char *dest, const char *evpbuf, size_t evplen, int do_atomic, int do_sync) { const char *path = do_atomic ? PATH_EVPTMP : dest; FILE *fp = NULL; int fd; size_t w; if ((fd = open(path, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) { log_warn("warn: queue-fs: open"); goto tempfail; } if ((fp = fdopen(fd, "w")) == NULL) { log_warn("warn: queue-fs: fdopen"); goto tempfail; } w = fwrite(evpbuf, 1, evplen, fp); if (w < evplen) { log_warn("warn: queue-fs: short write"); goto tempfail; } if (fflush(fp)) { log_warn("warn: queue-fs: fflush"); goto tempfail; } if (do_sync && fsync(fileno(fp))) { log_warn("warn: queue-fs: fsync"); goto tempfail; } if (fclose(fp) != 0) { log_warn("warn: queue-fs: fclose"); fp = NULL; goto tempfail; } fp = NULL; fd = -1; if (do_atomic && rename(path, dest) == -1) { log_warn("warn: queue-fs: rename"); goto tempfail; } return (1); tempfail: if (fp) fclose(fp); else if (fd != -1) close(fd); if (unlink(path) == -1) log_warn("warn: queue-fs: unlink"); return (0); } static void fsqueue_message_path(uint32_t msgid, char *buf, size_t len) { if (!bsnprintf(buf, len, "%s/%02x/%08x", PATH_QUEUE, (msgid & 0xff000000) >> 24, msgid)) fatalx("fsqueue_message_path: path does not fit buffer"); } static void fsqueue_message_incoming_path(uint32_t msgid, char *buf, size_t len) { if (!bsnprintf(buf, len, "%s/%08x", PATH_INCOMING, msgid)) fatalx("fsqueue_message_incoming_path: path does not fit buffer"); } static void * fsqueue_qwalk_new(void) { char path[PATH_MAX]; char * const path_argv[] = { path, NULL }; struct qwalk *q; q = xcalloc(1, sizeof(*q)); (void)strlcpy(path, PATH_QUEUE, sizeof(path)); q->fts = fts_open(path_argv, FTS_PHYSICAL | FTS_NOCHDIR, NULL); if (q->fts == NULL) fatal("fsqueue_qwalk_new: fts_open: %s", path); return (q); } static void fsqueue_qwalk_close(void *hdl) { struct qwalk *q = hdl; fts_close(q->fts); free(q); } static int fsqueue_qwalk(void *hdl, uint64_t *evpid) { struct qwalk *q = hdl; FTSENT *e; char *tmp; while ((e = fts_read(q->fts)) != NULL) { switch (e->fts_info) { case FTS_D: q->depth += 1; if (q->depth == 2 && e->fts_namelen != 2) { log_debug("debug: fsqueue: bogus directory %s", e->fts_path); fts_set(q->fts, e, FTS_SKIP); break; } if (q->depth == 3 && e->fts_namelen != 8) { log_debug("debug: fsqueue: bogus directory %s", e->fts_path); fts_set(q->fts, e, FTS_SKIP); break; } break; case FTS_DP: case FTS_DNR: q->depth -= 1; break; case FTS_F: if (q->depth != 3) break; if (e->fts_namelen != 16) break; #if HAVE_STRUCT_STAT_ST_MTIM if (timespeccmp(&e->fts_statp->st_mtim, &startup, >)) #endif #if HAVE_STRUCT_STAT_ST_MTIMSPEC if (timespeccmp(&e->fts_statp->st_mtimspec, &startup, >)) #endif break; tmp = NULL; *evpid = strtoull(e->fts_name, &tmp, 16); if (tmp && *tmp != '\0') { log_debug("debug: fsqueue: bogus file %s", e->fts_path); break; } return (1); default: break; } } return (0); } static int queue_fs_init(struct passwd *pw, int server, const char *conf) { unsigned int n; char *paths[] = { PATH_QUEUE, PATH_INCOMING }; char path[PATH_MAX]; int ret; /* remove incoming/ if it exists */ if (server) mvpurge(PATH_SPOOL PATH_INCOMING, PATH_SPOOL PATH_PURGE); fsqueue_envelope_path(0, path, sizeof(path)); ret = 1; for (n = 0; n < nitems(paths); n++) { (void)strlcpy(path, PATH_SPOOL, sizeof(path)); if (strlcat(path, paths[n], sizeof(path)) >= sizeof(path)) fatalx("path too long %s%s", PATH_SPOOL, paths[n]); if (ckdir(path, 0700, pw->pw_uid, 0, server) == 0) ret = 0; } if (clock_gettime(CLOCK_REALTIME, &startup)) fatal("clock_gettime"); tree_init(&evpcount); queue_api_on_message_create(queue_fs_message_create); queue_api_on_message_commit(queue_fs_message_commit); queue_api_on_message_delete(queue_fs_message_delete); queue_api_on_message_fd_r(queue_fs_message_fd_r); queue_api_on_envelope_create(queue_fs_envelope_create); queue_api_on_envelope_delete(queue_fs_envelope_delete); queue_api_on_envelope_update(queue_fs_envelope_update); queue_api_on_envelope_load(queue_fs_envelope_load); queue_api_on_envelope_walk(queue_fs_envelope_walk); queue_api_on_message_walk(queue_fs_message_walk); return (ret); } struct queue_backend queue_backend_fs = { queue_fs_init, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/table_static.c0000644000175000001440000001625114674615567015201 /* $OpenBSD: table_static.c,v 1.35 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" struct table_static_priv { int type; struct dict dict; void *iter; }; /* static backend */ static int table_static_config(struct table *); static int table_static_add(struct table *, const char *, const char *); static void table_static_dump(struct table *); static int table_static_update(struct table *); static int table_static_open(struct table *); static int table_static_lookup(struct table *, enum table_service, const char *, char **); static int table_static_fetch(struct table *, enum table_service, char **); static void table_static_close(struct table *); struct table_backend table_backend_static = { .name = "static", .services = K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| K_SOURCE|K_MAILADDR|K_ADDRNAME|K_MAILADDRMAP|K_RELAYHOST| K_STRING|K_REGEX, .config = table_static_config, .add = table_static_add, .dump = table_static_dump, .open = table_static_open, .update = table_static_update, .close = table_static_close, .lookup = table_static_lookup, .fetch = table_static_fetch }; static struct keycmp { enum table_service service; int (*func)(const char *, const char *); } keycmp[] = { { K_DOMAIN, table_domain_match }, { K_NETADDR, table_netaddr_match }, { K_MAILADDR, table_mailaddr_match }, { K_REGEX, table_regex_match }, }; static void table_static_priv_free(struct table_static_priv *priv) { void *p; while (dict_poproot(&priv->dict, (void **)&p)) if (p != priv) free(p); free(priv); } static int table_static_priv_add(struct table_static_priv *priv, const char *key, const char *val) { char lkey[1024]; void *old, *new = NULL; if (!lowercase(lkey, key, sizeof lkey)) { errno = ENAMETOOLONG; return (-1); } if (val) { new = strdup(val); if (new == NULL) return (-1); } /* use priv if value is null, so we can detect duplicate entries */ old = dict_set(&priv->dict, lkey, new ? new : priv); if (old) { if (old != priv) free(old); return (1); } return (0); } static int table_static_priv_load(struct table_static_priv *priv, const char *path) { FILE *fp; char *line = NULL; int lineno = 0; size_t linesize = 0; char *keyp; char *valp; int malformed, ret = 0; if ((fp = fopen(path, "r")) == NULL) { log_warn("%s: fopen", path); return 0; } while (parse_table_line(fp, &line, &linesize, &priv->type, &keyp, &valp, &malformed) != -1) { lineno++; if (malformed) { log_warnx("%s:%d invalid map entry", path, lineno); goto end; } if (keyp == NULL) continue; table_static_priv_add(priv, keyp, valp); } if (ferror(fp)) { log_warn("%s: getline", path); goto end; } /* Accept empty alias files; treat them as hashes */ if (priv->type == T_NONE) priv->type = T_HASH; ret = 1; end: free(line); fclose(fp); return ret; } static int table_static_config(struct table *t) { struct table_static_priv *priv, *old; /* already up, and no config file? ok */ if (t->t_handle && *t->t_config == '\0') return 1; /* new config */ priv = calloc(1, sizeof(*priv)); if (priv == NULL) return 0; priv->type = t->t_type; dict_init(&priv->dict); if (*t->t_config) { /* load the config file */ if (table_static_priv_load(priv, t->t_config) == 0) { table_static_priv_free(priv); return 0; } } if ((old = t->t_handle)) table_static_priv_free(old); t->t_handle = priv; t->t_type = priv->type; return 1; } static int table_static_add(struct table *table, const char *key, const char *val) { struct table_static_priv *priv = table->t_handle; int r; /* cannot add to a table read from a file */ if (*table->t_config) return 0; if (table->t_type == T_NONE) table->t_type = val ? T_HASH : T_LIST; else if (table->t_type == T_LIST && val) return 0; else if (table->t_type == T_HASH && val == NULL) return 0; if (priv == NULL) { if (table_static_config(table) == 0) return 0; priv = table->t_handle; } r = table_static_priv_add(priv, key, val); if (r == -1) return 0; return 1; } static void table_static_dump(struct table *table) { struct table_static_priv *priv = table->t_handle; const char *key; char *value; void *iter; iter = NULL; while (dict_iter(&priv->dict, &iter, &key, (void**)&value)) { if (value && (void*)value != (void*)priv) log_debug(" \"%s\" -> \"%s\"", key, value); else log_debug(" \"%s\"", key); } } static int table_static_update(struct table *table) { if (table_static_config(table) == 1) { log_info("info: Table \"%s\" successfully updated", table->t_name); return 1; } log_info("info: Failed to update table \"%s\"", table->t_name); return 0; } static int table_static_open(struct table *table) { if (table->t_handle == NULL) return table_static_config(table); return 1; } static void table_static_close(struct table *table) { struct table_static_priv *priv = table->t_handle; if (priv) table_static_priv_free(priv); table->t_handle = NULL; } static int table_static_lookup(struct table *table, enum table_service service, const char *key, char **dst) { struct table_static_priv *priv = table->t_handle; char *line; int ret; int (*match)(const char *, const char *) = NULL; size_t i; void *iter; const char *k; char *v; for (i = 0; i < nitems(keycmp); ++i) if (keycmp[i].service == service) match = keycmp[i].func; line = NULL; iter = NULL; ret = 0; while (dict_iter(&priv->dict, &iter, &k, (void **)&v)) { if (match) { if (match(key, k)) { line = v; ret = 1; } } else { if (strcmp(key, k) == 0) { line = v; ret = 1; } } if (ret) break; } if (dst == NULL) return ret ? 1 : 0; if (ret == 0) return 0; *dst = strdup(line); if (*dst == NULL) return -1; return 1; } static int table_static_fetch(struct table *t, enum table_service service, char **dst) { struct table_static_priv *priv = t->t_handle; const char *k; if (!dict_iter(&priv->dict, &priv->iter, &k, (void **)NULL)) { priv->iter = NULL; if (!dict_iter(&priv->dict, &priv->iter, &k, (void **)NULL)) return 0; } *dst = strdup(k); if (*dst == NULL) return -1; return 1; } opensmtpd-7.7.0p0/usr.sbin/smtpd/proxy.c0000644000175000001440000002152414610663500013677 /* * Copyright (c) 2017 Antoine Kaufmann * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" /* * The PROXYv2 protocol is described here: * http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt */ #define PROXY_CLOCAL 0x0 #define PROXY_CPROXY 0x1 #define PROXY_AF_UNSPEC 0x0 #define PROXY_AF_INET 0x1 #define PROXY_AF_INET6 0x2 #define PROXY_AF_UNIX 0x3 #define PROXY_TF_UNSPEC 0x0 #define PROXY_TF_STREAM 0x1 #define PROXY_TF_DGRAM 0x2 #define PROXY_SESSION_TIMEOUT 300 static const uint8_t pv2_signature[] = { 0x0D, 0x0A, 0x0D, 0x0A, 0x00, 0x0D, 0x0A, 0x51, 0x55, 0x49, 0x54, 0x0A }; struct proxy_hdr_v2 { uint8_t sig[12]; uint8_t ver_cmd; uint8_t fam; uint16_t len; } __attribute__((packed)); struct proxy_addr_ipv4 { uint32_t src_addr; uint32_t dst_addr; uint16_t src_port; uint16_t dst_port; } __attribute__((packed)); struct proxy_addr_ipv6 { uint8_t src_addr[16]; uint8_t dst_addr[16]; uint16_t src_port; uint16_t dst_port; } __attribute__((packed)); struct proxy_addr_unix { uint8_t src_addr[108]; uint8_t dst_addr[108]; } __attribute__((packed)); union proxy_addr { struct proxy_addr_ipv4 ipv4; struct proxy_addr_ipv6 ipv6; struct proxy_addr_unix un; } __attribute__((packed)); struct proxy_session { struct listener *l; struct io *io; uint64_t id; int fd; uint16_t header_len; uint16_t header_total; uint16_t addr_len; uint16_t addr_total; struct sockaddr_storage ss; struct proxy_hdr_v2 hdr; union proxy_addr addr; void (*cb_accepted)(struct listener *, int, const struct sockaddr_storage *, struct io *); void (*cb_dropped)(struct listener *, int, const struct sockaddr_storage *); }; static void proxy_io(struct io *, int, void *); static void proxy_error(struct proxy_session *, const char *, const char *); static int proxy_header_validate(struct proxy_session *); static int proxy_translate_ss(struct proxy_session *); int proxy_session(struct listener *listener, int sock, const struct sockaddr_storage *ss, void (*accepted)(struct listener *, int, const struct sockaddr_storage *, struct io *), void (*dropped)(struct listener *, int, const struct sockaddr_storage *)); int proxy_session(struct listener *listener, int sock, const struct sockaddr_storage *ss, void (*accepted)(struct listener *, int, const struct sockaddr_storage *, struct io *), void (*dropped)(struct listener *, int, const struct sockaddr_storage *)) { struct proxy_session *s; if ((s = calloc(1, sizeof(*s))) == NULL) return (-1); if ((s->io = io_new()) == NULL) { free(s); return (-1); } s->id = generate_uid(); s->l = listener; s->fd = sock; s->header_len = 0; s->addr_len = 0; s->ss = *ss; s->cb_accepted = accepted; s->cb_dropped = dropped; io_set_callback(s->io, proxy_io, s); io_set_fd(s->io, sock); io_set_timeout(s->io, PROXY_SESSION_TIMEOUT * 1000); io_set_read(s->io); log_info("%016"PRIx64" smtp event=proxy address=%s", s->id, ss_to_text(&s->ss)); return 0; } static void proxy_io(struct io *io, int evt, void *arg) { struct proxy_session *s = arg; struct proxy_hdr_v2 *h = &s->hdr; uint8_t *buf; size_t len, off; switch (evt) { case IO_DATAIN: buf = io_data(io); len = io_datalen(io); if (s->header_len < sizeof(s->hdr)) { /* header is incomplete */ off = sizeof(s->hdr) - s->header_len; off = (len < off ? len : off); memcpy((uint8_t *) &s->hdr + s->header_len, buf, off); s->header_len += off; buf += off; len -= off; io_drop(s->io, off); if (s->header_len < sizeof(s->hdr)) { /* header is still not complete */ return; } if (proxy_header_validate(s) != 0) return; } if (s->addr_len < s->addr_total) { /* address is incomplete */ off = s->addr_total - s->addr_len; off = (len < off ? len : off); memcpy((uint8_t *) &s->addr + s->addr_len, buf, off); s->header_len += off; s->addr_len += off; buf += off; len -= off; io_drop(s->io, off); if (s->addr_len < s->addr_total) { /* address is still not complete */ return; } } if (s->header_len < s->header_total) { /* additional parameters not complete */ /* these are ignored for now, but we still need to drop * the bytes from the buffer */ off = s->header_total - s->header_len; off = (len < off ? len : off); s->header_len += off; io_drop(s->io, off); if (s->header_len < s->header_total) /* not complete yet */ return; } switch(h->ver_cmd & 0xF) { case PROXY_CLOCAL: /* local address, no need to modify ss */ break; case PROXY_CPROXY: if (proxy_translate_ss(s) != 0) return; break; default: proxy_error(s, "protocol error", "unknown command"); return; } s->cb_accepted(s->l, s->fd, &s->ss, s->io); /* we passed off s->io, so it does not need to be freed here */ free(s); break; case IO_TIMEOUT: proxy_error(s, "timeout", NULL); break; case IO_DISCONNECTED: proxy_error(s, "disconnected", NULL); break; case IO_ERROR: proxy_error(s, "IO error", io_error(io)); break; default: fatalx("proxy_io()"); } } static void proxy_error(struct proxy_session *s, const char *reason, const char *extra) { if (extra) log_info("proxy %p event=closed address=%s reason=\"%s (%s)\"", s, ss_to_text(&s->ss), reason, extra); else log_info("proxy %p event=closed address=%s reason=\"%s\"", s, ss_to_text(&s->ss), reason); s->cb_dropped(s->l, s->fd, &s->ss); io_free(s->io); free(s); } static int proxy_header_validate(struct proxy_session *s) { struct proxy_hdr_v2 *h = &s->hdr; if (memcmp(h->sig, pv2_signature, sizeof(pv2_signature)) != 0) { proxy_error(s, "protocol error", "invalid signature"); return (-1); } if ((h->ver_cmd >> 4) != 2) { proxy_error(s, "protocol error", "invalid version"); return (-1); } switch (h->fam) { case (PROXY_AF_UNSPEC << 4 | PROXY_TF_UNSPEC): s->addr_total = 0; break; case (PROXY_AF_INET << 4 | PROXY_TF_STREAM): s->addr_total = sizeof(s->addr.ipv4); break; case (PROXY_AF_INET6 << 4 | PROXY_TF_STREAM): s->addr_total = sizeof(s->addr.ipv6); break; case (PROXY_AF_UNIX << 4 | PROXY_TF_STREAM): s->addr_total = sizeof(s->addr.un); break; default: proxy_error(s, "protocol error", "unsupported address family"); return (-1); } s->header_total = ntohs(h->len); if (s->header_total > UINT16_MAX - sizeof(struct proxy_hdr_v2)) { proxy_error(s, "protocol error", "header too long"); return (-1); } s->header_total += sizeof(struct proxy_hdr_v2); if (s->header_total < sizeof(struct proxy_hdr_v2) + s->addr_total) { proxy_error(s, "protocol error", "address info too short"); return (-1); } return 0; } static int proxy_translate_ss(struct proxy_session *s) { struct sockaddr_in *sin = (struct sockaddr_in *) &s->ss; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &s->ss; struct sockaddr_un *sun = (struct sockaddr_un *) &s->ss; size_t sun_len; switch (s->hdr.fam) { case (PROXY_AF_UNSPEC << 4 | PROXY_TF_UNSPEC): /* unspec: only supported for local */ proxy_error(s, "address translation", "UNSPEC family not " "supported for PROXYing"); return (-1); case (PROXY_AF_INET << 4 | PROXY_TF_STREAM): memset(&s->ss, 0, sizeof(s->ss)); sin->sin_family = AF_INET; sin->sin_port = s->addr.ipv4.src_port; sin->sin_addr.s_addr = s->addr.ipv4.src_addr; break; case (PROXY_AF_INET6 << 4 | PROXY_TF_STREAM): memset(&s->ss, 0, sizeof(s->ss)); sin6->sin6_family = AF_INET6; sin6->sin6_port = s->addr.ipv6.src_port; memcpy(sin6->sin6_addr.s6_addr, s->addr.ipv6.src_addr, sizeof(s->addr.ipv6.src_addr)); break; case (PROXY_AF_UNIX << 4 | PROXY_TF_STREAM): memset(&s->ss, 0, sizeof(s->ss)); sun_len = strnlen(s->addr.un.src_addr, sizeof(s->addr.un.src_addr)); if (sun_len > sizeof(sun->sun_path)) { proxy_error(s, "address translation", "Unix socket path" " longer than supported"); return (-1); } sun->sun_family = AF_UNIX; memcpy(sun->sun_path, s->addr.un.src_addr, sun_len); break; default: fatalx("proxy_translate_ss()"); } return 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/control.c0000644000175000001440000004363215007615667014216 /* $OpenBSD: control.c,v 1.132 2024/11/21 13:42:22 claudio Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2003, 2004 Henning Brauer * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define CONTROL_BACKLOG 5 struct ctl_conn { uint32_t id; uint8_t flags; #define CTL_CONN_NOTIFY 0x01 struct mproc mproc; uid_t euid; gid_t egid; }; struct { struct event ev; int fd; } control_state; static void control_imsg(struct mproc *, struct imsg *); static void control_shutdown(void); static void control_listen(void); static void control_accept(int, short, void *); static void control_close(struct ctl_conn *); static void control_dispatch_ext(struct mproc *, struct imsg *); static void control_digest_update(const char *, size_t, int); static void control_broadcast_verbose(int, int); static struct stat_backend *stat_backend = NULL; extern const char *backend_stat; static uint64_t connid = 0; static struct tree ctl_conns; static struct tree ctl_count; static struct stat_digest digest; #define CONTROL_FD_RESERVE 5 #define CONTROL_MAXCONN_PER_CLIENT 32 static void control_imsg(struct mproc *p, struct imsg *imsg) { struct ctl_conn *c; struct stat_value val; struct msg m; const char *key; const void *data; size_t sz; if (imsg == NULL) { if (p->proc != PROC_CLIENT) control_shutdown(); return; } switch (imsg->hdr.type) { case IMSG_CTL_OK: case IMSG_CTL_FAIL: case IMSG_CTL_LIST_MESSAGES: case IMSG_CTL_LIST_ENVELOPES: case IMSG_CTL_DISCOVER_EVPID: case IMSG_CTL_DISCOVER_MSGID: case IMSG_CTL_MTA_SHOW_HOSTS: case IMSG_CTL_MTA_SHOW_RELAYS: case IMSG_CTL_MTA_SHOW_ROUTES: case IMSG_CTL_MTA_SHOW_HOSTSTATS: case IMSG_CTL_MTA_SHOW_BLOCK: c = tree_get(&ctl_conns, imsg->hdr.peerid); if (c == NULL) return; imsg->hdr.peerid = 0; m_forward(&c->mproc, imsg); return; case IMSG_CTL_SMTP_SESSION: c = tree_get(&ctl_conns, imsg->hdr.peerid); if (c == NULL) return; m_compose(&c->mproc, IMSG_CTL_OK, 0, 0, imsg_get_fd(imsg), NULL, 0); return; case IMSG_STAT_INCREMENT: m_msg(&m, imsg); m_get_string(&m, &key); m_get_data(&m, &data, &sz); m_end(&m); if (sz != sizeof(val)) fatalx("control: IMSG_STAT_INCREMENT size mismatch"); memmove(&val, data, sz); if (stat_backend) stat_backend->increment(key, val.u.counter); control_digest_update(key, val.u.counter, 1); return; case IMSG_STAT_DECREMENT: m_msg(&m, imsg); m_get_string(&m, &key); m_get_data(&m, &data, &sz); m_end(&m); if (sz != sizeof(val)) fatalx("control: IMSG_STAT_DECREMENT size mismatch"); memmove(&val, data, sz); if (stat_backend) stat_backend->decrement(key, val.u.counter); control_digest_update(key, val.u.counter, 0); return; case IMSG_STAT_SET: m_msg(&m, imsg); m_get_string(&m, &key); m_get_data(&m, &data, &sz); m_end(&m); if (sz != sizeof(val)) fatalx("control: IMSG_STAT_SET size mismatch"); memmove(&val, data, sz); if (stat_backend) stat_backend->set(key, &val); return; } fatalx("control_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } int control_create_socket(void) { struct sockaddr_un s_un; int fd; mode_t old_umask; if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) fatal("control: socket"); memset(&s_un, 0, sizeof(s_un)); s_un.sun_family = AF_UNIX; if (strlcpy(s_un.sun_path, SMTPD_SOCKET, sizeof(s_un.sun_path)) >= sizeof(s_un.sun_path)) fatal("control: socket name too long"); if (connect(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == 0) fatalx("control socket already listening"); if (unlink(SMTPD_SOCKET) == -1) if (errno != ENOENT) fatal("control: cannot unlink socket"); old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH); if (bind(fd, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { (void)umask(old_umask); fatal("control: bind"); } (void)umask(old_umask); if (chmod(SMTPD_SOCKET, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) == -1) { (void)unlink(SMTPD_SOCKET); fatal("control: chmod"); } io_set_nonblocking(fd); control_state.fd = fd; return fd; } int control(void) { struct passwd *pw; purge_config(PURGE_EVERYTHING); if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); stat_backend = env->sc_stat; stat_backend->init(); if (chroot(PATH_CHROOT) == -1) fatal("control: chroot"); if (chdir("/") == -1) fatal("control: chdir(\"/\")"); config_process(PROC_CONTROL); if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("control: cannot drop privileges"); imsg_callback = control_imsg; event_init(); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); tree_init(&ctl_conns); tree_init(&ctl_count); memset(&digest, 0, sizeof digest); digest.startup = time(NULL); config_peer(PROC_SCHEDULER); config_peer(PROC_QUEUE); config_peer(PROC_PARENT); config_peer(PROC_LKA); config_peer(PROC_DISPATCHER); config_peer(PROC_CA); control_listen(); #if HAVE_PLEDGE if (pledge("stdio unix recvfd sendfd", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } static void control_shutdown(void) { log_debug("debug: control agent exiting"); _exit(0); } static void control_listen(void) { if (listen(control_state.fd, CONTROL_BACKLOG) == -1) fatal("control_listen"); event_set(&control_state.ev, control_state.fd, EV_READ|EV_PERSIST, control_accept, NULL); event_add(&control_state.ev, NULL); } static void control_accept(int listenfd, short event, void *arg) { int connfd; socklen_t len; struct sockaddr_un s_un; struct ctl_conn *c; size_t *count; uid_t euid; gid_t egid; if (getdtablesize() - getdtablecount() < CONTROL_FD_RESERVE) goto pause; len = sizeof(s_un); if ((connfd = accept(listenfd, (struct sockaddr *)&s_un, &len)) == -1) { if (errno == ENFILE || errno == EMFILE) goto pause; if (errno == EINTR || errno == EWOULDBLOCK || errno == ECONNABORTED) return; fatal("control_accept: accept"); } io_set_nonblocking(connfd); if (getpeereid(connfd, &euid, &egid) == -1) fatal("getpeereid"); count = tree_get(&ctl_count, euid); if (count == NULL) { count = xcalloc(1, sizeof *count); tree_xset(&ctl_count, euid, count); } if (*count == CONTROL_MAXCONN_PER_CLIENT) { close(connfd); log_warnx("warn: too many connections to control socket " "from user with uid %lu", (unsigned long int)euid); return; } (*count)++; do { ++connid; } while (tree_get(&ctl_conns, connid)); c = xcalloc(1, sizeof(*c)); c->euid = euid; c->egid = egid; c->id = connid; c->mproc.proc = PROC_CLIENT; c->mproc.handler = control_dispatch_ext; c->mproc.data = c; if ((c->mproc.name = strdup(proc_title(c->mproc.proc))) == NULL) fatal("strdup"); mproc_init(&c->mproc, connfd); mproc_enable(&c->mproc); tree_xset(&ctl_conns, c->id, c); stat_backend->increment("control.session", 1); return; pause: log_warnx("warn: ctl client limit hit, disabling new connections"); event_del(&control_state.ev); } static void control_close(struct ctl_conn *c) { size_t *count; count = tree_xget(&ctl_count, c->euid); (*count)--; if (*count == 0) { tree_xpop(&ctl_count, c->euid); free(count); } tree_xpop(&ctl_conns, c->id); mproc_clear(&c->mproc); free(c); stat_backend->decrement("control.session", 1); if (getdtablesize() - getdtablecount() < CONTROL_FD_RESERVE) return; if (!event_pending(&control_state.ev, EV_READ, NULL)) { log_warnx("warn: re-enabling ctl connections"); event_add(&control_state.ev, NULL); } } static void control_digest_update(const char *key, size_t value, int incr) { size_t *p; p = NULL; if (!strcmp(key, "smtp.session")) { if (incr) p = &digest.clt_connect; else digest.clt_disconnect += value; } else if (!strcmp(key, "scheduler.envelope")) { if (incr) p = &digest.evp_enqueued; else digest.evp_dequeued += value; } else if (!strcmp(key, "scheduler.envelope.expired")) p = &digest.evp_expired; else if (!strcmp(key, "scheduler.envelope.removed")) p = &digest.evp_removed; else if (!strcmp(key, "scheduler.delivery.ok")) p = &digest.dlv_ok; else if (!strcmp(key, "scheduler.delivery.permfail")) p = &digest.dlv_permfail; else if (!strcmp(key, "scheduler.delivery.tempfail")) p = &digest.dlv_tempfail; else if (!strcmp(key, "scheduler.delivery.loop")) p = &digest.dlv_loop; else if (!strcmp(key, "queue.bounce")) p = &digest.evp_bounce; if (p) { if (incr) *p = *p + value; else *p = *p - value; } } static void control_dispatch_ext(struct mproc *p, struct imsg *imsg) { struct sockaddr_storage ss; struct ctl_conn *c; int v; struct stat_kv *kvp; char *key; struct stat_value val; size_t len; uint64_t evpid; uint32_t msgid; c = p->data; if (imsg == NULL) { control_close(c); return; } if (imsg->hdr.peerid != IMSG_VERSION) { m_compose(p, IMSG_CTL_FAIL, IMSG_VERSION, 0, -1, NULL, 0); return; } switch (imsg->hdr.type) { case IMSG_CTL_SMTP_SESSION: imsgbuf_allow_fdpass(&p->imsgbuf); if (env->sc_flags & SMTPD_SMTP_PAUSED) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } m_compose(p_dispatcher, IMSG_CTL_SMTP_SESSION, c->id, 0, -1, &c->euid, sizeof(c->euid)); return; case IMSG_CTL_GET_DIGEST: if (c->euid) goto badcred; digest.timestamp = time(NULL); m_compose(p, IMSG_CTL_GET_DIGEST, 0, 0, -1, &digest, sizeof digest); return; case IMSG_CTL_GET_STATS: if (c->euid) goto badcred; kvp = imsg->data; if (!stat_backend->iter(&kvp->iter, &key, &val)) kvp->iter = NULL; else { (void)strlcpy(kvp->key, key, sizeof kvp->key); kvp->val = val; } m_compose(p, IMSG_CTL_GET_STATS, 0, 0, -1, kvp, sizeof *kvp); return; case IMSG_CTL_VERBOSE: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof(v)) goto badcred; memcpy(&v, imsg->data, sizeof(v)); log_trace_verbose(v); control_broadcast_verbose(IMSG_CTL_VERBOSE, v); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_TRACE_ENABLE: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof(v)) goto badcred; memcpy(&v, imsg->data, sizeof(v)); tracing |= v; log_trace_verbose(tracing); control_broadcast_verbose(IMSG_CTL_VERBOSE, tracing); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_TRACE_DISABLE: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof(v)) goto badcred; memcpy(&v, imsg->data, sizeof(v)); tracing &= ~v; log_trace_verbose(tracing); control_broadcast_verbose(IMSG_CTL_VERBOSE, tracing); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_PROFILE_ENABLE: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof(v)) goto badcred; memcpy(&v, imsg->data, sizeof(v)); profiling |= v; control_broadcast_verbose(IMSG_CTL_PROFILE, profiling); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_PROFILE_DISABLE: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof(v)) goto badcred; memcpy(&v, imsg->data, sizeof(v)); profiling &= ~v; control_broadcast_verbose(IMSG_CTL_PROFILE, profiling); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_PAUSE_EVP: if (c->euid) goto badcred; imsg->hdr.peerid = c->id; m_forward(p_scheduler, imsg); return; case IMSG_CTL_PAUSE_MDA: if (c->euid) goto badcred; if (env->sc_flags & SMTPD_MDA_PAUSED) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: mda paused"); env->sc_flags |= SMTPD_MDA_PAUSED; m_compose(p_queue, IMSG_CTL_PAUSE_MDA, 0, 0, -1, NULL, 0); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_PAUSE_MTA: if (c->euid) goto badcred; if (env->sc_flags & SMTPD_MTA_PAUSED) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: mta paused"); env->sc_flags |= SMTPD_MTA_PAUSED; m_compose(p_queue, IMSG_CTL_PAUSE_MTA, 0, 0, -1, NULL, 0); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_PAUSE_SMTP: if (c->euid) goto badcred; if (env->sc_flags & SMTPD_SMTP_PAUSED) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: smtp paused"); env->sc_flags |= SMTPD_SMTP_PAUSED; m_compose(p_dispatcher, IMSG_CTL_PAUSE_SMTP, 0, 0, -1, NULL, 0); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_RESUME_EVP: if (c->euid) goto badcred; imsg->hdr.peerid = c->id; m_forward(p_scheduler, imsg); return; case IMSG_CTL_RESUME_MDA: if (c->euid) goto badcred; if (!(env->sc_flags & SMTPD_MDA_PAUSED)) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: mda resumed"); env->sc_flags &= ~SMTPD_MDA_PAUSED; m_compose(p_queue, IMSG_CTL_RESUME_MDA, 0, 0, -1, NULL, 0); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_RESUME_MTA: if (c->euid) goto badcred; if (!(env->sc_flags & SMTPD_MTA_PAUSED)) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: mta resumed"); env->sc_flags &= ~SMTPD_MTA_PAUSED; m_compose(p_queue, IMSG_CTL_RESUME_MTA, 0, 0, -1, NULL, 0); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_RESUME_SMTP: if (c->euid) goto badcred; if (!(env->sc_flags & SMTPD_SMTP_PAUSED)) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } log_info("info: smtp resumed"); env->sc_flags &= ~SMTPD_SMTP_PAUSED; m_forward(p_dispatcher, imsg); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_RESUME_ROUTE: if (c->euid) goto badcred; m_forward(p_dispatcher, imsg); m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); return; case IMSG_CTL_LIST_MESSAGES: if (c->euid) goto badcred; m_compose(p_scheduler, IMSG_CTL_LIST_MESSAGES, c->id, 0, -1, imsg->data, imsg->hdr.len - sizeof(imsg->hdr)); return; case IMSG_CTL_LIST_ENVELOPES: if (c->euid) goto badcred; m_compose(p_scheduler, IMSG_CTL_LIST_ENVELOPES, c->id, 0, -1, imsg->data, imsg->hdr.len - sizeof(imsg->hdr)); return; case IMSG_CTL_MTA_SHOW_HOSTS: case IMSG_CTL_MTA_SHOW_RELAYS: case IMSG_CTL_MTA_SHOW_ROUTES: case IMSG_CTL_MTA_SHOW_HOSTSTATS: case IMSG_CTL_MTA_SHOW_BLOCK: if (c->euid) goto badcred; imsg->hdr.peerid = c->id; m_forward(p_dispatcher, imsg); return; case IMSG_CTL_SHOW_STATUS: if (c->euid) goto badcred; m_compose(p, IMSG_CTL_SHOW_STATUS, 0, 0, -1, &env->sc_flags, sizeof(env->sc_flags)); return; case IMSG_CTL_MTA_BLOCK: case IMSG_CTL_MTA_UNBLOCK: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE <= sizeof(ss)) goto invalid; memmove(&ss, imsg->data, sizeof(ss)); m_create(p_dispatcher, imsg->hdr.type, c->id, 0, -1); m_add_sockaddr(p_dispatcher, (struct sockaddr *)&ss); m_add_string(p_dispatcher, (char *)imsg->data + sizeof(ss)); m_close(p_dispatcher); return; case IMSG_CTL_SCHEDULE: if (c->euid) goto badcred; imsg->hdr.peerid = c->id; m_forward(p_scheduler, imsg); return; case IMSG_CTL_REMOVE: if (c->euid) goto badcred; imsg->hdr.peerid = c->id; m_forward(p_scheduler, imsg); return; case IMSG_CTL_UPDATE_TABLE: if (c->euid) goto badcred; /* table name too long */ len = strlen(imsg->data); if (len >= LINE_MAX) goto invalid; imsg->hdr.peerid = c->id; m_forward(p_lka, imsg); return; case IMSG_CTL_DISCOVER_EVPID: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof evpid) goto invalid; memmove(&evpid, imsg->data, sizeof evpid); m_create(p_queue, imsg->hdr.type, c->id, 0, -1); m_add_evpid(p_queue, evpid); m_close(p_queue); return; case IMSG_CTL_DISCOVER_MSGID: if (c->euid) goto badcred; if (imsg->hdr.len - IMSG_HEADER_SIZE != sizeof msgid) goto invalid; memmove(&msgid, imsg->data, sizeof msgid); m_create(p_queue, imsg->hdr.type, c->id, 0, -1); m_add_msgid(p_queue, msgid); m_close(p_queue); return; default: log_debug("debug: control_dispatch_ext: " "error handling %s imsg", imsg_to_str(imsg->hdr.type)); return; } badcred: invalid: m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); } static void control_broadcast_verbose(int msg, int v) { m_create(p_lka, msg, 0, 0, -1); m_add_int(p_lka, v); m_close(p_lka); m_create(p_dispatcher, msg, 0, 0, -1); m_add_int(p_dispatcher, v); m_close(p_dispatcher); m_create(p_queue, msg, 0, 0, -1); m_add_int(p_queue, v); m_close(p_queue); m_create(p_ca, msg, 0, 0, -1); m_add_int(p_ca, v); m_close(p_ca); m_create(p_scheduler, msg, 0, 0, -1); m_add_int(p_scheduler, v); m_close(p_scheduler); m_create(p_parent, msg, 0, 0, -1); m_add_int(p_parent, v); m_close(p_parent); } opensmtpd-7.7.0p0/usr.sbin/smtpd/tree.h0000644000175000001440000000341414610663500013460 /* $OpenBSD: tree.h,v 1.1 2018/12/23 16:06:24 gilles Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _TREE_H_ #define _TREE_H_ SPLAY_HEAD(_tree, treeentry); struct tree { struct _tree tree; size_t count; }; /* tree.c */ #define tree_init(t) do { SPLAY_INIT(&((t)->tree)); (t)->count = 0; } while(0) #define tree_empty(t) SPLAY_EMPTY(&((t)->tree)) #define tree_count(t) ((t)->count) int tree_check(struct tree *, uint64_t); void *tree_set(struct tree *, uint64_t, void *); void tree_xset(struct tree *, uint64_t, void *); void *tree_get(struct tree *, uint64_t); void *tree_xget(struct tree *, uint64_t); void *tree_pop(struct tree *, uint64_t); void *tree_xpop(struct tree *, uint64_t); int tree_poproot(struct tree *, uint64_t *, void **); int tree_root(struct tree *, uint64_t *, void **); int tree_iter(struct tree *, void **, uint64_t *, void **); int tree_iterfrom(struct tree *, void **, uint64_t, uint64_t *, void **); void tree_merge(struct tree *, struct tree *); #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/parser.h0000644000175000001440000000235514610663500014020 /* $OpenBSD: parser.h,v 1.29 2014/02/04 15:22:39 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ enum { P_TOKEN, P_STR, P_INT, P_MSGID, P_EVPID, P_ROUTEID, P_ADDR, }; struct parameter { int type; union { const char *u_str; int u_int; uint32_t u_msgid; uint64_t u_evpid; uint64_t u_routeid; struct sockaddr_storage u_ss; } u; }; int cmd_install(const char *, int (*)(int, struct parameter *)); int cmd_run(int, char **); int cmd_show_params(int argc, struct parameter *argv); opensmtpd-7.7.0p0/usr.sbin/smtpd/smtp.c0000644000175000001440000002500314610663500013475 /* $OpenBSD: smtp.c,v 1.174 2023/05/16 17:48:52 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2009 Jacek Masiulaniec * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #include "ssl.h" static void smtp_setup_events(void); static void smtp_pause(void); static void smtp_resume(void); static void smtp_accept(int, short, void *); static void smtp_dropped(struct listener *, int, const struct sockaddr_storage *); static int smtp_enqueue(void); static int smtp_can_accept(void); static void smtp_setup_listeners(void); static void smtp_setup_listener_tls(struct listener *); int proxy_session(struct listener *listener, int sock, const struct sockaddr_storage *ss, void (*accepted)(struct listener *, int, const struct sockaddr_storage *, struct io *), void (*dropped)(struct listener *, int, const struct sockaddr_storage *)); static void smtp_accepted(struct listener *, int, const struct sockaddr_storage *, struct io *); /* * This function are not publicy exported because it is a hack until libtls * has a proper privsep setup */ void tls_config_use_fake_private_key(struct tls_config *config); #define SMTP_FD_RESERVE 5 static size_t sessions; static size_t maxsessions; void smtp_imsg(struct mproc *p, struct imsg *imsg) { switch (imsg->hdr.type) { case IMSG_SMTP_CHECK_SENDER: case IMSG_SMTP_EXPAND_RCPT: case IMSG_SMTP_LOOKUP_HELO: case IMSG_SMTP_AUTHENTICATE: case IMSG_FILTER_SMTP_PROTOCOL: case IMSG_FILTER_SMTP_DATA_BEGIN: smtp_session_imsg(p, imsg); return; case IMSG_SMTP_MESSAGE_COMMIT: case IMSG_SMTP_MESSAGE_CREATE: case IMSG_SMTP_MESSAGE_OPEN: case IMSG_QUEUE_ENVELOPE_SUBMIT: case IMSG_QUEUE_ENVELOPE_COMMIT: smtp_session_imsg(p, imsg); return; case IMSG_QUEUE_SMTP_SESSION: m_compose(p, IMSG_QUEUE_SMTP_SESSION, 0, 0, smtp_enqueue(), imsg->data, imsg->hdr.len - sizeof imsg->hdr); return; case IMSG_CTL_SMTP_SESSION: m_compose(p, IMSG_CTL_SMTP_SESSION, imsg->hdr.peerid, 0, smtp_enqueue(), NULL, 0); return; case IMSG_CTL_PAUSE_SMTP: log_debug("debug: smtp: pausing listening sockets"); smtp_pause(); env->sc_flags |= SMTPD_SMTP_PAUSED; return; case IMSG_CTL_RESUME_SMTP: log_debug("debug: smtp: resuming listening sockets"); env->sc_flags &= ~SMTPD_SMTP_PAUSED; smtp_resume(); return; } fatalx("smtp_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } void smtp_postfork(void) { smtp_setup_listeners(); } void smtp_postprivdrop(void) { } void smtp_configure(void) { smtp_setup_events(); } static void smtp_setup_listeners(void) { struct listener *l; int opt; TAILQ_FOREACH(l, env->sc_listeners, entry) { if ((l->fd = socket(l->ss.ss_family, SOCK_STREAM, 0)) == -1) { if (errno == EAFNOSUPPORT) { log_warn("smtpd: socket"); continue; } fatal("smtpd: socket"); } if (l->flags & F_SSL) smtp_setup_listener_tls(l); opt = 1; #ifdef SO_REUSEADDR if (setsockopt(l->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1) fatal("smtpd: setsockopt"); #else if (setsockopt(l->fd, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) fatal("smtpd: setsockopt"); #endif #ifdef IPV6_V6ONLY /* * If using IPv6, bind only to IPv6 if possible. * This avoids ambiguities with IPv4-mapped IPv6 addresses. */ if (l->ss.ss_family == AF_INET6) if (setsockopt(l->fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt)) < 0) fatal("smtpd: setsockopt"); #endif if (bind(l->fd, (struct sockaddr *)&l->ss, SS_LEN(&l->ss)) == -1) fatal("smtpd: bind"); } } static void smtp_setup_listener_tls(struct listener *l) { static const char *dheparams[] = { "none", "auto", "legacy" }; struct tls_config *config; const char *ciphers; uint32_t protos; struct pki *pki; struct ca *ca; int i; if ((config = tls_config_new()) == NULL) fatal("smtpd: tls_config_new"); ciphers = env->sc_tls_ciphers; if (l->tls_ciphers) ciphers = l->tls_ciphers; if (ciphers && tls_config_set_ciphers(config, ciphers) == -1) fatalx("%s", tls_config_error(config)); if (l->tls_protocols) { if (tls_config_parse_protocols(&protos, l->tls_protocols) == -1) fatalx("failed to parse protocols \"%s\"", l->tls_protocols); if (tls_config_set_protocols(config, protos) == -1) fatalx("%s", tls_config_error(config)); } pki = l->pki[0]; if (pki == NULL) fatal("no pki defined"); if (tls_config_set_dheparams(config, dheparams[pki->pki_dhe]) == -1) fatalx("tls_config_set_dheparams: %s", tls_config_error(config)); tls_config_use_fake_private_key(config); for (i = 0; i < l->pkicount; i++) { pki = l->pki[i]; if (i == 0) { if (tls_config_set_keypair_mem(config, pki->pki_cert, pki->pki_cert_len, NULL, 0) == -1) fatalx("tls_config_set_keypair_mem: %s", tls_config_error(config)); } else { if (tls_config_add_keypair_mem(config, pki->pki_cert, pki->pki_cert_len, NULL, 0) == -1) fatalx("tls_config_add_keypair_mem: %s", tls_config_error(config)); } } free(l->pki); l->pkicount = 0; if (l->ca_name[0]) { ca = dict_get(env->sc_ca_dict, l->ca_name); if (tls_config_set_ca_mem(config, ca->ca_cert, ca->ca_cert_len) == -1) fatalx("tls_config_set_ca_mem: %s", tls_config_error(config)); } else if (tls_config_set_ca_file(config, tls_default_ca_cert_file()) == -1) fatal("tls_config_set_ca_file"); if (l->flags & F_TLS_VERIFY) tls_config_verify_client(config); l->tls = tls_server(); if (l->tls == NULL) fatal("tls_server"); if (tls_configure(l->tls, config) == -1) { fatalx("tls_configure: %s", tls_error(l->tls)); } tls_config_free(config); } static void smtp_setup_events(void) { struct listener *l; TAILQ_FOREACH(l, env->sc_listeners, entry) { log_debug("debug: smtp: listen on %s port %d flags 0x%01x", ss_to_text(&l->ss), ntohs(l->port), l->flags); io_set_nonblocking(l->fd); if (listen(l->fd, SMTPD_BACKLOG) == -1) fatal("listen"); event_set(&l->ev, l->fd, EV_READ|EV_PERSIST, smtp_accept, l); if (!(env->sc_flags & SMTPD_SMTP_PAUSED)) event_add(&l->ev, NULL); } purge_config(PURGE_PKI_KEYS); maxsessions = (getdtablesize() - getdtablecount()) / 2 - SMTP_FD_RESERVE; log_debug("debug: smtp: will accept at most %zu clients", maxsessions); } static void smtp_pause(void) { struct listener *l; if (env->sc_flags & (SMTPD_SMTP_DISABLED|SMTPD_SMTP_PAUSED)) return; TAILQ_FOREACH(l, env->sc_listeners, entry) event_del(&l->ev); } static void smtp_resume(void) { struct listener *l; if (env->sc_flags & (SMTPD_SMTP_DISABLED|SMTPD_SMTP_PAUSED)) return; TAILQ_FOREACH(l, env->sc_listeners, entry) event_add(&l->ev, NULL); } static int smtp_enqueue(void) { struct listener *listener = env->sc_sock_listener; int fd[2]; /* * Some enqueue requests buffered in IMSG may still arrive even after * call to smtp_pause() because enqueue listener is not a real socket * and thus cannot be paused properly. */ if (env->sc_flags & SMTPD_SMTP_PAUSED) return (-1); if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fd)) return (-1); if ((smtp_session(listener, fd[0], &listener->ss, env->sc_hostname, NULL)) == -1) { close(fd[0]); close(fd[1]); return (-1); } sessions++; stat_increment("smtp.session", 1); stat_increment("smtp.session.local", 1); return (fd[1]); } static void smtp_accept(int fd, short event, void *p) { struct listener *listener = p; struct sockaddr_storage ss; socklen_t len; int sock; if (env->sc_flags & SMTPD_SMTP_PAUSED) fatalx("smtp_session: unexpected client"); if (!smtp_can_accept()) { log_warnx("warn: Disabling incoming SMTP connections: " "Client limit reached"); goto pause; } len = sizeof(ss); if ((sock = accept(fd, (struct sockaddr *)&ss, &len)) == -1) { if (errno == ENFILE || errno == EMFILE) { log_warn("warn: Disabling incoming SMTP connections"); goto pause; } if (errno == EINTR || errno == EWOULDBLOCK || errno == ECONNABORTED) return; fatal("smtp_accept"); } if (listener->flags & F_PROXY) { io_set_nonblocking(sock); if (proxy_session(listener, sock, &ss, smtp_accepted, smtp_dropped) == -1) { close(sock); return; } return; } smtp_accepted(listener, sock, &ss, NULL); return; pause: smtp_pause(); env->sc_flags |= SMTPD_SMTP_DISABLED; return; } static int smtp_can_accept(void) { if (sessions + 1 == maxsessions) return 0; return (getdtablesize() - getdtablecount() - SMTP_FD_RESERVE >= 2); } void smtp_collect(void) { sessions--; stat_decrement("smtp.session", 1); if (!smtp_can_accept()) return; if (env->sc_flags & SMTPD_SMTP_DISABLED) { log_warnx("warn: smtp: " "fd exhaustion over, re-enabling incoming connections"); env->sc_flags &= ~SMTPD_SMTP_DISABLED; smtp_resume(); } } static void smtp_accepted(struct listener *listener, int sock, const struct sockaddr_storage *ss, struct io *io) { int ret; ret = smtp_session(listener, sock, ss, NULL, io); if (ret == -1) { log_warn("warn: Failed to create SMTP session"); close(sock); return; } io_set_nonblocking(sock); sessions++; stat_increment("smtp.session", 1); if (listener->ss.ss_family == AF_LOCAL) stat_increment("smtp.session.local", 1); if (listener->ss.ss_family == AF_INET) stat_increment("smtp.session.inet4", 1); if (listener->ss.ss_family == AF_INET6) stat_increment("smtp.session.inet6", 1); } static void smtp_dropped(struct listener *listener, int sock, const struct sockaddr_storage *ss) { close(sock); sessions--; } opensmtpd-7.7.0p0/usr.sbin/smtpd/scheduler_proc.c0000644000175000001440000002201415007615667015526 /* $OpenBSD: scheduler_proc.c,v 1.13 2024/11/21 13:42:22 claudio Exp $ */ /* * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static struct imsgbuf ibuf; static struct imsg imsg; static size_t rlen; static char *rdata; static void scheduler_proc_call(void) { ssize_t n; if (imsgbuf_flush(&ibuf) == -1) { log_warn("warn: scheduler-proc: imsgbuf_flush"); fatalx("scheduler-proc: exiting"); } while (1) { if ((n = imsg_get(&ibuf, &imsg)) == -1) { log_warn("warn: scheduler-proc: imsg_get"); break; } if (n) { rlen = imsg.hdr.len - IMSG_HEADER_SIZE; rdata = imsg.data; if (imsg.hdr.type != PROC_SCHEDULER_OK) { log_warnx("warn: scheduler-proc: bad response"); break; } return; } if ((n = imsgbuf_read(&ibuf)) == -1) { log_warn("warn: scheduler-proc: imsgbuf_read"); break; } if (n == 0) { log_warnx("warn: scheduler-proc: pipe closed"); break; } } fatalx("scheduler-proc: exiting"); } static void scheduler_proc_read(void *dst, size_t len) { if (len > rlen) { log_warnx("warn: scheduler-proc: bad msg len"); fatalx("scheduler-proc: exiting"); } memmove(dst, rdata, len); rlen -= len; rdata += len; } static void scheduler_proc_end(void) { if (rlen) { log_warnx("warn: scheduler-proc: bogus data"); fatalx("scheduler-proc: exiting"); } imsg_free(&imsg); } /* * API */ static int scheduler_proc_init(const char *conf) { int fd, r; uint32_t version; fd = fork_proc_backend("scheduler", conf, "scheduler-proc", 0); if (fd == -1) fatalx("scheduler-proc: exiting"); if (imsgbuf_init(&ibuf, fd) == -1) fatal("scheduler-proc: exiting"); imsgbuf_allow_fdpass(&ibuf); version = PROC_SCHEDULER_API_VERSION; imsg_compose(&ibuf, PROC_SCHEDULER_INIT, 0, 0, -1, &version, sizeof(version)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (1); } static int scheduler_proc_insert(struct scheduler_info *si) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_INSERT"); imsg_compose(&ibuf, PROC_SCHEDULER_INSERT, 0, 0, -1, si, sizeof(*si)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static size_t scheduler_proc_commit(uint32_t msgid) { size_t s; log_debug("debug: scheduler-proc: PROC_SCHEDULER_COMMIT"); imsg_compose(&ibuf, PROC_SCHEDULER_COMMIT, 0, 0, -1, &msgid, sizeof(msgid)); scheduler_proc_call(); scheduler_proc_read(&s, sizeof(s)); scheduler_proc_end(); return (s); } static size_t scheduler_proc_rollback(uint32_t msgid) { size_t s; log_debug("debug: scheduler-proc: PROC_SCHEDULER_ROLLBACK"); imsg_compose(&ibuf, PROC_SCHEDULER_ROLLBACK, 0, 0, -1, &msgid, sizeof(msgid)); scheduler_proc_call(); scheduler_proc_read(&s, sizeof(s)); scheduler_proc_end(); return (s); } static int scheduler_proc_update(struct scheduler_info *si) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_UPDATE"); imsg_compose(&ibuf, PROC_SCHEDULER_UPDATE, 0, 0, -1, si, sizeof(*si)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); if (r == 1) scheduler_proc_read(si, sizeof(*si)); scheduler_proc_end(); return (r); } static int scheduler_proc_delete(uint64_t evpid) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_DELETE"); imsg_compose(&ibuf, PROC_SCHEDULER_DELETE, 0, 0, -1, &evpid, sizeof(evpid)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_hold(uint64_t evpid, uint64_t holdq) { struct ibuf *buf; int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_HOLD"); buf = imsg_create(&ibuf, PROC_SCHEDULER_HOLD, 0, 0, sizeof(evpid) + sizeof(holdq)); if (buf == NULL) return (-1); if (imsg_add(buf, &evpid, sizeof(evpid)) == -1) return (-1); if (imsg_add(buf, &holdq, sizeof(holdq)) == -1) return (-1); imsg_close(&ibuf, buf); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_release(int type, uint64_t holdq, int n) { struct ibuf *buf; int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_RELEASE"); buf = imsg_create(&ibuf, PROC_SCHEDULER_RELEASE, 0, 0, sizeof(holdq) + sizeof(n)); if (buf == NULL) return (-1); if (imsg_add(buf, &type, sizeof(type)) == -1) return (-1); if (imsg_add(buf, &holdq, sizeof(holdq)) == -1) return (-1); if (imsg_add(buf, &n, sizeof(n)) == -1) return (-1); imsg_close(&ibuf, buf); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_batch(int typemask, int *delay, size_t *count, uint64_t *evpids, int *types) { struct ibuf *buf; int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_BATCH"); buf = imsg_create(&ibuf, PROC_SCHEDULER_BATCH, 0, 0, sizeof(typemask) + sizeof(*count)); if (buf == NULL) return (-1); if (imsg_add(buf, &typemask, sizeof(typemask)) == -1) return (-1); if (imsg_add(buf, count, sizeof(*count)) == -1) return (-1); imsg_close(&ibuf, buf); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_read(delay, sizeof(*delay)); scheduler_proc_read(count, sizeof(*count)); if (r > 0) { scheduler_proc_read(evpids, sizeof(*evpids) * (*count)); scheduler_proc_read(types, sizeof(*types) * (*count)); } scheduler_proc_end(); return (r); } static size_t scheduler_proc_messages(uint32_t from, uint32_t *dst, size_t size) { struct ibuf *buf; size_t s; log_debug("debug: scheduler-proc: PROC_SCHEDULER_MESSAGES"); buf = imsg_create(&ibuf, PROC_SCHEDULER_MESSAGES, 0, 0, sizeof(from) + sizeof(size)); if (buf == NULL) return (-1); if (imsg_add(buf, &from, sizeof(from)) == -1) return (-1); if (imsg_add(buf, &size, sizeof(size)) == -1) return (-1); imsg_close(&ibuf, buf); scheduler_proc_call(); s = rlen / sizeof(*dst); scheduler_proc_read(dst, s * sizeof(*dst)); scheduler_proc_end(); return (s); } static size_t scheduler_proc_envelopes(uint64_t from, struct evpstate *dst, size_t size) { struct ibuf *buf; size_t s; log_debug("debug: scheduler-proc: PROC_SCHEDULER_ENVELOPES"); buf = imsg_create(&ibuf, PROC_SCHEDULER_ENVELOPES, 0, 0, sizeof(from) + sizeof(size)); if (buf == NULL) return (-1); if (imsg_add(buf, &from, sizeof(from)) == -1) return (-1); if (imsg_add(buf, &size, sizeof(size)) == -1) return (-1); imsg_close(&ibuf, buf); scheduler_proc_call(); s = rlen / sizeof(*dst); scheduler_proc_read(dst, s * sizeof(*dst)); scheduler_proc_end(); return (s); } static int scheduler_proc_schedule(uint64_t evpid) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_SCHEDULE"); imsg_compose(&ibuf, PROC_SCHEDULER_SCHEDULE, 0, 0, -1, &evpid, sizeof(evpid)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_remove(uint64_t evpid) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_REMOVE"); imsg_compose(&ibuf, PROC_SCHEDULER_REMOVE, 0, 0, -1, &evpid, sizeof(evpid)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_suspend(uint64_t evpid) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_SUSPEND"); imsg_compose(&ibuf, PROC_SCHEDULER_SUSPEND, 0, 0, -1, &evpid, sizeof(evpid)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } static int scheduler_proc_resume(uint64_t evpid) { int r; log_debug("debug: scheduler-proc: PROC_SCHEDULER_RESUME"); imsg_compose(&ibuf, PROC_SCHEDULER_RESUME, 0, 0, -1, &evpid, sizeof(evpid)); scheduler_proc_call(); scheduler_proc_read(&r, sizeof(r)); scheduler_proc_end(); return (r); } struct scheduler_backend scheduler_backend_proc = { scheduler_proc_init, scheduler_proc_insert, scheduler_proc_commit, scheduler_proc_rollback, scheduler_proc_update, scheduler_proc_delete, scheduler_proc_hold, scheduler_proc_release, scheduler_proc_batch, scheduler_proc_messages, scheduler_proc_envelopes, scheduler_proc_schedule, scheduler_proc_remove, scheduler_proc_suspend, scheduler_proc_resume, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/log.h0000644000175000001440000000331414610663500013301 /* $OpenBSD: log.h,v 1.9 2021/12/13 18:28:40 deraadt Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef LOG_H #define LOG_H #include #include void log_init(int, int); void log_procinit(const char *); void log_setverbose(int); int log_getverbose(void); void log_warn(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_warnx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_info(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void log_debug(const char *, ...) __attribute__((__format__ (printf, 1, 2))); void logit(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); void vlog(int, const char *, va_list) __attribute__((__format__ (printf, 2, 0))); __dead void fatal(const char *, ...) __attribute__((__format__ (printf, 1, 2))); __dead void fatalx(const char *, ...) __attribute__((__format__ (printf, 1, 2))); #endif /* LOG_H */ opensmtpd-7.7.0p0/usr.sbin/smtpd/queue_ram.c0000644000175000001440000001572014610663500014502 /* $OpenBSD: queue_ram.c,v 1.11 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" struct qr_envelope { char *buf; size_t len; }; struct qr_message { char *buf; size_t len; struct tree envelopes; }; static struct tree messages; static struct qr_message * get_message(uint32_t msgid) { struct qr_message *msg; msg = tree_get(&messages, msgid); if (msg == NULL) log_warn("warn: queue-ram: message not found"); return (msg); } static int queue_ram_message_create(uint32_t *msgid) { struct qr_message *msg; msg = calloc(1, sizeof(*msg)); if (msg == NULL) { log_warn("warn: queue-ram: calloc"); return (0); } tree_init(&msg->envelopes); do { *msgid = queue_generate_msgid(); } while (tree_check(&messages, *msgid)); tree_xset(&messages, *msgid, msg); return (1); } static int queue_ram_message_commit(uint32_t msgid, const char *path) { struct qr_message *msg; struct stat sb; size_t n; FILE *f; int ret; if ((msg = tree_get(&messages, msgid)) == NULL) { log_warnx("warn: queue-ram: msgid not found"); return (0); } f = fopen(path, "rb"); if (f == NULL) { log_warn("warn: queue-ram: fopen: %s", path); return (0); } if (fstat(fileno(f), &sb) == -1) { log_warn("warn: queue-ram: fstat"); fclose(f); return (0); } msg->len = sb.st_size; msg->buf = malloc(msg->len); if (msg->buf == NULL) { log_warn("warn: queue-ram: malloc"); fclose(f); return (0); } ret = 0; n = fread(msg->buf, 1, msg->len, f); if (ferror(f)) log_warn("warn: queue-ram: fread"); else if ((off_t)n != sb.st_size) log_warnx("warn: queue-ram: bad read"); else { ret = 1; stat_increment("queue.ram.message.size", msg->len); } fclose(f); return (ret); } static int queue_ram_message_delete(uint32_t msgid) { struct qr_message *msg; struct qr_envelope *evp; uint64_t evpid; if ((msg = tree_pop(&messages, msgid)) == NULL) { log_warnx("warn: queue-ram: not found"); return (0); } while (tree_poproot(&messages, &evpid, (void**)&evp)) { stat_decrement("queue.ram.envelope.size", evp->len); free(evp->buf); free(evp); } stat_decrement("queue.ram.message.size", msg->len); free(msg->buf); free(msg); return (0); } static int queue_ram_message_fd_r(uint32_t msgid) { struct qr_message *msg; size_t n; FILE *f; int fd, fd2; if ((msg = tree_get(&messages, msgid)) == NULL) { log_warnx("warn: queue-ram: not found"); return (-1); } fd = mktmpfile(); if (fd == -1) { log_warn("warn: queue-ram: mktmpfile"); return (-1); } fd2 = dup(fd); if (fd2 == -1) { log_warn("warn: queue-ram: dup"); close(fd); return (-1); } f = fdopen(fd2, "w"); if (f == NULL) { log_warn("warn: queue-ram: fdopen"); close(fd); close(fd2); return (-1); } n = fwrite(msg->buf, 1, msg->len, f); if (n != msg->len) { log_warn("warn: queue-ram: write"); close(fd); fclose(f); return (-1); } fclose(f); lseek(fd, 0, SEEK_SET); return (fd); } static int queue_ram_envelope_create(uint32_t msgid, const char *buf, size_t len, uint64_t *evpid) { struct qr_envelope *evp; struct qr_message *msg; if ((msg = get_message(msgid)) == NULL) return (0); do { *evpid = queue_generate_evpid(msgid); } while (tree_check(&msg->envelopes, *evpid)); evp = calloc(1, sizeof *evp); if (evp == NULL) { log_warn("warn: queue-ram: calloc"); return (0); } evp->len = len; evp->buf = malloc(len); if (evp->buf == NULL) { log_warn("warn: queue-ram: malloc"); free(evp); return (0); } memmove(evp->buf, buf, len); tree_xset(&msg->envelopes, *evpid, evp); stat_increment("queue.ram.envelope.size", len); return (1); } static int queue_ram_envelope_delete(uint64_t evpid) { struct qr_envelope *evp; struct qr_message *msg; if ((msg = get_message(evpid_to_msgid(evpid))) == NULL) return (0); if ((evp = tree_pop(&msg->envelopes, evpid)) == NULL) { log_warnx("warn: queue-ram: not found"); return (0); } stat_decrement("queue.ram.envelope.size", evp->len); free(evp->buf); free(evp); if (tree_empty(&msg->envelopes)) { tree_xpop(&messages, evpid_to_msgid(evpid)); stat_decrement("queue.ram.message.size", msg->len); free(msg->buf); free(msg); } return (1); } static int queue_ram_envelope_update(uint64_t evpid, const char *buf, size_t len) { struct qr_envelope *evp; struct qr_message *msg; void *tmp; if ((msg = get_message(evpid_to_msgid(evpid))) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) { log_warn("warn: queue-ram: not found"); return (0); } tmp = malloc(len); if (tmp == NULL) { log_warn("warn: queue-ram: malloc"); return (0); } memmove(tmp, buf, len); free(evp->buf); evp->len = len; evp->buf = tmp; stat_decrement("queue.ram.envelope.size", evp->len); stat_increment("queue.ram.envelope.size", len); return (1); } static int queue_ram_envelope_load(uint64_t evpid, char *buf, size_t len) { struct qr_envelope *evp; struct qr_message *msg; if ((msg = get_message(evpid_to_msgid(evpid))) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) { log_warn("warn: queue-ram: not found"); return (0); } if (len < evp->len) { log_warnx("warn: queue-ram: buffer too small"); return (0); } memmove(buf, evp->buf, evp->len); return (evp->len); } static int queue_ram_envelope_walk(uint64_t *evpid, char *buf, size_t len) { return (-1); } static int queue_ram_init(struct passwd *pw, int server, const char * conf) { tree_init(&messages); queue_api_on_message_create(queue_ram_message_create); queue_api_on_message_commit(queue_ram_message_commit); queue_api_on_message_delete(queue_ram_message_delete); queue_api_on_message_fd_r(queue_ram_message_fd_r); queue_api_on_envelope_create(queue_ram_envelope_create); queue_api_on_envelope_delete(queue_ram_envelope_delete); queue_api_on_envelope_update(queue_ram_envelope_update); queue_api_on_envelope_load(queue_ram_envelope_load); queue_api_on_envelope_walk(queue_ram_envelope_walk); return (1); } struct queue_backend queue_backend_ram = { queue_ram_init, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/resolver.c0000644000175000001440000002437114610663500014362 /* $OpenBSD: resolver.c,v 1.7 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2017-2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define p_resolver p_lka struct request { SPLAY_ENTRY(request) entry; uint32_t id; void (*cb_ai)(void *, int, struct addrinfo *); void (*cb_ni)(void *, int, const char *, const char *); void (*cb_res)(void *, int, int, int, const void *, int); void *arg; struct addrinfo *ai; }; struct session { uint32_t reqid; struct mproc *proc; char *host; char *serv; }; SPLAY_HEAD(reqtree, request); static void resolver_init(void); static void resolver_getaddrinfo_cb(struct asr_result *, void *); static void resolver_getnameinfo_cb(struct asr_result *, void *); static void resolver_res_query_cb(struct asr_result *, void *); static int request_cmp(struct request *, struct request *); SPLAY_PROTOTYPE(reqtree, request, entry, request_cmp); static struct reqtree reqs; void resolver_getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, void (*cb)(void *, int, struct addrinfo *), void *arg) { struct request *req; resolver_init(); req = calloc(1, sizeof(*req)); if (req == NULL) { cb(arg, EAI_MEMORY, NULL); return; } while (req->id == 0 || SPLAY_FIND(reqtree, &reqs, req)) req->id = arc4random(); req->cb_ai = cb; req->arg = arg; SPLAY_INSERT(reqtree, &reqs, req); m_create(p_resolver, IMSG_GETADDRINFO, req->id, 0, -1); m_add_int(p_resolver, hints ? hints->ai_flags : 0); m_add_int(p_resolver, hints ? hints->ai_family : 0); m_add_int(p_resolver, hints ? hints->ai_socktype : 0); m_add_int(p_resolver, hints ? hints->ai_protocol : 0); m_add_string(p_resolver, hostname); m_add_string(p_resolver, servname); m_close(p_resolver); } void resolver_getnameinfo(const struct sockaddr *sa, int flags, void(*cb)(void *, int, const char *, const char *), void *arg) { struct request *req; resolver_init(); req = calloc(1, sizeof(*req)); if (req == NULL) { cb(arg, EAI_MEMORY, NULL, NULL); return; } while (req->id == 0 || SPLAY_FIND(reqtree, &reqs, req)) req->id = arc4random(); req->cb_ni = cb; req->arg = arg; SPLAY_INSERT(reqtree, &reqs, req); m_create(p_resolver, IMSG_GETNAMEINFO, req->id, 0, -1); m_add_sockaddr(p_resolver, sa); m_add_int(p_resolver, flags); m_close(p_resolver); } void resolver_res_query(const char *dname, int class, int type, void (*cb)(void *, int, int, int, const void *, int), void *arg) { struct request *req; resolver_init(); req = calloc(1, sizeof(*req)); if (req == NULL) { cb(arg, NETDB_INTERNAL, 0, 0, NULL, 0); return; } while (req->id == 0 || SPLAY_FIND(reqtree, &reqs, req)) req->id = arc4random(); req->cb_res = cb; req->arg = arg; SPLAY_INSERT(reqtree, &reqs, req); m_create(p_resolver, IMSG_RES_QUERY, req->id, 0, -1); m_add_string(p_resolver, dname); m_add_int(p_resolver, class); m_add_int(p_resolver, type); m_close(p_resolver); } void resolver_dispatch_request(struct mproc *proc, struct imsg *imsg) { const char *hostname, *servname, *dname; struct session *s; struct asr_query *q; struct addrinfo hints; struct sockaddr_storage ss; struct sockaddr *sa; struct msg m; uint32_t reqid; int class, type, flags, save_errno; reqid = imsg->hdr.peerid; m_msg(&m, imsg); switch (imsg->hdr.type) { case IMSG_GETADDRINFO: servname = NULL; memset(&hints, 0 , sizeof(hints)); m_get_int(&m, &hints.ai_flags); m_get_int(&m, &hints.ai_family); m_get_int(&m, &hints.ai_socktype); m_get_int(&m, &hints.ai_protocol); m_get_string(&m, &hostname); m_get_string(&m, &servname); m_end(&m); s = NULL; q = NULL; if ((s = calloc(1, sizeof(*s))) && (q = getaddrinfo_async(hostname, servname, &hints, NULL)) && (event_asr_run(q, resolver_getaddrinfo_cb, s))) { s->reqid = reqid; s->proc = proc; break; } save_errno = errno; if (q) asr_abort(q); if (s) free(s); m_create(proc, IMSG_GETADDRINFO_END, reqid, 0, -1); m_add_int(proc, EAI_SYSTEM); m_add_int(proc, save_errno); m_close(proc); break; case IMSG_GETNAMEINFO: sa = (struct sockaddr*)&ss; m_get_sockaddr(&m, sa); m_get_int(&m, &flags); m_end(&m); s = NULL; q = NULL; if ((s = calloc(1, sizeof(*s))) && (s->host = malloc(NI_MAXHOST)) && (s->serv = malloc(NI_MAXSERV)) && (q = getnameinfo_async(sa, SA_LEN(sa), s->host, NI_MAXHOST, s->serv, NI_MAXSERV, flags, NULL)) && (event_asr_run(q, resolver_getnameinfo_cb, s))) { s->reqid = reqid; s->proc = proc; break; } save_errno = errno; if (q) asr_abort(q); if (s) { free(s->host); free(s->serv); free(s); } m_create(proc, IMSG_GETNAMEINFO, reqid, 0, -1); m_add_int(proc, EAI_SYSTEM); m_add_int(proc, save_errno); m_add_string(proc, NULL); m_add_string(proc, NULL); m_close(proc); break; case IMSG_RES_QUERY: m_get_string(&m, &dname); m_get_int(&m, &class); m_get_int(&m, &type); m_end(&m); s = NULL; q = NULL; if ((s = calloc(1, sizeof(*s))) && (q = res_query_async(dname, class, type, NULL)) && (event_asr_run(q, resolver_res_query_cb, s))) { s->reqid = reqid; s->proc = proc; break; } save_errno = errno; if (q) asr_abort(q); if (s) free(s); m_create(proc, IMSG_RES_QUERY, reqid, 0, -1); m_add_int(proc, NETDB_INTERNAL); m_add_int(proc, save_errno); m_add_int(proc, 0); m_add_int(proc, 0); m_add_data(proc, NULL, 0); m_close(proc); break; default: fatalx("%s: %s", __func__, imsg_to_str(imsg->hdr.type)); } } static struct addrinfo * _alloc_addrinfo(const struct addrinfo *ai0, const struct sockaddr *sa, const char *cname) { struct addrinfo *ai; ai = calloc(1, sizeof(*ai) + SA_LEN(sa)); if (ai == NULL) { log_warn("%s: calloc", __func__); return NULL; } *ai = *ai0; ai->ai_addr = (void *)(ai + 1); memcpy(ai->ai_addr, sa, SA_LEN(sa)); if (cname) { ai->ai_canonname = strdup(cname); if (ai->ai_canonname == NULL) { log_warn("%s: strdup", __func__); free(ai); return NULL; } } return ai; } void resolver_dispatch_result(struct mproc *proc, struct imsg *imsg) { struct request key, *req; struct sockaddr_storage ss; struct addrinfo *ai, tai; struct msg m; const char *cname, *host, *serv; const void *data; size_t datalen; int gai_errno, herrno, rcode, count; key.id = imsg->hdr.peerid; req = SPLAY_FIND(reqtree, &reqs, &key); if (req == NULL) fatalx("%s: unknown request %08x", __func__, imsg->hdr.peerid); m_msg(&m, imsg); switch (imsg->hdr.type) { case IMSG_GETADDRINFO: memset(&tai, 0, sizeof(tai)); m_get_int(&m, &tai.ai_flags); m_get_int(&m, &tai.ai_family); m_get_int(&m, &tai.ai_socktype); m_get_int(&m, &tai.ai_protocol); m_get_sockaddr(&m, (struct sockaddr *)&ss); m_get_string(&m, &cname); m_end(&m); ai = _alloc_addrinfo(&tai, (struct sockaddr *)&ss, cname); if (ai) { ai->ai_next = req->ai; req->ai = ai; } break; case IMSG_GETADDRINFO_END: m_get_int(&m, &gai_errno); m_get_int(&m, &errno); m_end(&m); SPLAY_REMOVE(reqtree, &reqs, req); req->cb_ai(req->arg, gai_errno, req->ai); free(req); break; case IMSG_GETNAMEINFO: m_get_int(&m, &gai_errno); m_get_int(&m, &errno); m_get_string(&m, &host); m_get_string(&m, &serv); m_end(&m); SPLAY_REMOVE(reqtree, &reqs, req); req->cb_ni(req->arg, gai_errno, host, serv); free(req); break; case IMSG_RES_QUERY: m_get_int(&m, &herrno); m_get_int(&m, &errno); m_get_int(&m, &rcode); m_get_int(&m, &count); m_get_data(&m, &data, &datalen); m_end(&m); SPLAY_REMOVE(reqtree, &reqs, req); req->cb_res(req->arg, herrno, rcode, count, data, datalen); free(req); break; } } static void resolver_init(void) { static int init = 0; if (init == 0) { SPLAY_INIT(&reqs); init = 1; } } static void resolver_getaddrinfo_cb(struct asr_result *ar, void *arg) { struct session *s = arg; struct addrinfo *ai; for (ai = ar->ar_addrinfo; ai; ai = ai->ai_next) { m_create(s->proc, IMSG_GETADDRINFO, s->reqid, 0, -1); m_add_int(s->proc, ai->ai_flags); m_add_int(s->proc, ai->ai_family); m_add_int(s->proc, ai->ai_socktype); m_add_int(s->proc, ai->ai_protocol); m_add_sockaddr(s->proc, ai->ai_addr); m_add_string(s->proc, ai->ai_canonname); m_close(s->proc); } m_create(s->proc, IMSG_GETADDRINFO_END, s->reqid, 0, -1); m_add_int(s->proc, ar->ar_gai_errno); m_add_int(s->proc, ar->ar_errno); m_close(s->proc); if (ar->ar_addrinfo) asr_freeaddrinfo(ar->ar_addrinfo); free(s); } static void resolver_getnameinfo_cb(struct asr_result *ar, void *arg) { struct session *s = arg; m_create(s->proc, IMSG_GETNAMEINFO, s->reqid, 0, -1); m_add_int(s->proc, ar->ar_gai_errno); m_add_int(s->proc, ar->ar_errno); m_add_string(s->proc, ar->ar_gai_errno ? NULL : s->host); m_add_string(s->proc, ar->ar_gai_errno ? NULL : s->serv); m_close(s->proc); free(s->host); free(s->serv); free(s); } static void resolver_res_query_cb(struct asr_result *ar, void *arg) { struct session *s = arg; m_create(s->proc, IMSG_RES_QUERY, s->reqid, 0, -1); m_add_int(s->proc, ar->ar_h_errno); m_add_int(s->proc, ar->ar_errno); m_add_int(s->proc, ar->ar_rcode); m_add_int(s->proc, ar->ar_count); m_add_data(s->proc, ar->ar_data, ar->ar_datalen); m_close(s->proc); free(ar->ar_data); free(s); } static int request_cmp(struct request *a, struct request *b) { if (a->id < b->id) return -1; if (a->id > b->id) return 1; return 0; } SPLAY_GENERATE(reqtree, request, entry, request_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/table_db.c0000644000175000001440000001422014674615567014271 /* $OpenBSD: table_db.c,v 1.26 2024/05/14 13:28:08 op Exp $ */ /* * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #ifdef HAVE_DB_H #include #elif defined(HAVE_DB1_DB_H) #include #elif defined(HAVE_DB_185_H) #include #endif #include #include #include #include #include #include "smtpd.h" #include "log.h" /* db(3) backend */ static int table_db_config(struct table *); static int table_db_update(struct table *); static int table_db_open(struct table *); static void *table_db_open2(struct table *); static int table_db_lookup(struct table *, enum table_service, const char *, char **); static int table_db_fetch(struct table *, enum table_service, char **); static void table_db_close(struct table *); static void table_db_close2(void *); static char *table_db_get_entry(void *, const char *, size_t *); static char *table_db_get_entry_match(void *, const char *, size_t *, int(*)(const char *, const char *)); struct table_backend table_backend_db = { .name = "db", .services = K_ALIAS|K_CREDENTIALS|K_DOMAIN|K_NETADDR|K_USERINFO| K_SOURCE|K_MAILADDR|K_ADDRNAME|K_MAILADDRMAP|K_RELAYHOST| K_STRING|K_REGEX, .config = table_db_config, .add = NULL, .dump = NULL, .open = table_db_open, .update = table_db_update, .close = table_db_close, .lookup = table_db_lookup, .fetch = table_db_fetch, }; static struct keycmp { enum table_service service; int (*func)(const char *, const char *); } keycmp[] = { { K_DOMAIN, table_domain_match }, { K_NETADDR, table_netaddr_match }, { K_MAILADDR, table_mailaddr_match }, { K_REGEX, table_regex_match }, }; struct dbhandle { DB *db; char pathname[PATH_MAX]; time_t mtime; int iter; }; static int table_db_config(struct table *table) { struct dbhandle *handle; handle = table_db_open2(table); if (handle == NULL) return 0; table_db_close2(handle); return 1; } static int table_db_update(struct table *table) { struct dbhandle *handle; handle = table_db_open2(table); if (handle == NULL) return 0; table_db_close2(table->t_handle); table->t_handle = handle; return 1; } static int table_db_open(struct table *table) { table->t_handle = table_db_open2(table); if (table->t_handle == NULL) return 0; return 1; } static void table_db_close(struct table *table) { table_db_close2(table->t_handle); table->t_handle = NULL; } static void * table_db_open2(struct table *table) { struct dbhandle *handle; struct stat sb; handle = xcalloc(1, sizeof *handle); if (strlcpy(handle->pathname, table->t_config, sizeof handle->pathname) >= sizeof handle->pathname) goto error; if (stat(handle->pathname, &sb) == -1) goto error; handle->mtime = sb.st_mtime; handle->db = dbopen(table->t_config, O_RDONLY, 0600, DB_HASH, NULL); if (handle->db == NULL) goto error; return handle; error: if (handle->db) handle->db->close(handle->db); free(handle); return NULL; } static void table_db_close2(void *hdl) { struct dbhandle *handle = hdl; handle->db->close(handle->db); free(handle); } static int table_db_lookup(struct table *table, enum table_service service, const char *key, char **dst) { struct dbhandle *handle = table->t_handle; char *line; size_t len = 0; int ret; int (*match)(const char *, const char *) = NULL; size_t i; struct stat sb; if (stat(handle->pathname, &sb) == -1) return -1; /* DB has changed, close and reopen */ if (sb.st_mtime != handle->mtime) { table_db_update(table); handle = table->t_handle; } for (i = 0; i < nitems(keycmp); ++i) if (keycmp[i].service == service) match = keycmp[i].func; if (match == NULL) line = table_db_get_entry(handle, key, &len); else line = table_db_get_entry_match(handle, key, &len, match); if (line == NULL) return 0; ret = 1; if (dst) *dst = line; else free(line); return ret; } static int table_db_fetch(struct table *table, enum table_service service, char **dst) { struct dbhandle *handle = table->t_handle; DBT dbk; DBT dbd; int r; if (handle->iter == 0) r = handle->db->seq(handle->db, &dbk, &dbd, R_FIRST); else r = handle->db->seq(handle->db, &dbk, &dbd, R_NEXT); handle->iter = 1; if (!r) { r = handle->db->seq(handle->db, &dbk, &dbd, R_FIRST); if (!r) return 0; } *dst = strdup(dbk.data); if (*dst == NULL) return -1; return 1; } static char * table_db_get_entry_match(void *hdl, const char *key, size_t *len, int(*func)(const char *, const char *)) { struct dbhandle *handle = hdl; DBT dbk; DBT dbd; int r; char *buf = NULL; for (r = handle->db->seq(handle->db, &dbk, &dbd, R_FIRST); !r; r = handle->db->seq(handle->db, &dbk, &dbd, R_NEXT)) { buf = xmemdup(dbk.data, dbk.size); if (func(key, buf)) { *len = dbk.size; return buf; } free(buf); } return NULL; } static char * table_db_get_entry(void *hdl, const char *key, size_t *len) { struct dbhandle *handle = hdl; DBT dbk; DBT dbv; char pkey[LINE_MAX]; /* workaround the stupidity of the DB interface */ if (strlcpy(pkey, key, sizeof pkey) >= sizeof pkey) fatalx("table_db_get_entry: key too long"); dbk.data = pkey; dbk.size = strlen(pkey) + 1; if (handle->db->get(handle->db, &dbk, &dbv, 0) != 0) return NULL; *len = dbv.size; return xmemdup(dbv.data, dbv.size); } opensmtpd-7.7.0p0/usr.sbin/smtpd/forward.c0000644000175000001440000000456414610663500014167 /* $OpenBSD: forward.c,v 1.40 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include /* for fparseln(3) on FreeBSD */ #include #include #ifdef HAVE_UTIL_H #include #endif #ifdef HAVE_LIBUTIL_H #include #endif #include #include "smtpd.h" #include "log.h" #define MAX_FORWARD_SIZE (4 * 1024) #define MAX_EXPAND_NODES (100) int forwards_get(int fd, struct expand *expand) { FILE *fp = NULL; char *line = NULL; size_t len; size_t lineno; size_t save; int ret; struct stat sb; ret = -1; if (fstat(fd, &sb) == -1) goto end; /* if it's empty just pretend that no expansion took place */ if (sb.st_size == 0) { log_info("info: forward file is empty"); ret = 0; goto end; } /* over MAX_FORWARD_SIZE, temporarily fail */ if (sb.st_size >= MAX_FORWARD_SIZE) { log_info("info: forward file exceeds max size"); goto end; } if ((fp = fdopen(fd, "r")) == NULL) { log_warn("warn: fdopen failure in forwards_get()"); goto end; } lineno = 0; save = expand->nb_nodes; while ((line = fparseln(fp, &len, &lineno, NULL, 0)) != NULL) { if (!expand_line(expand, line, 0)) { log_info("info: parse error in forward file"); goto end; } if (expand->nb_nodes > MAX_EXPAND_NODES) { log_info("info: forward file expanded too many nodes"); goto end; } free(line); } ret = expand->nb_nodes > save ? 1 : 0; end: free(line); if (fp) fclose(fp); else close(fd); return ret; } opensmtpd-7.7.0p0/usr.sbin/smtpd/newaliases.80000644000175000001440000000426414610663500014600 .\" $OpenBSD: newaliases.8,v 1.12 2018/07/20 15:35:33 millert Exp $ .\" .\" Copyright (c) 2009 Jacek Masiulaniec .\" Copyright (c) 2008-2009 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 20 2018 $ .Dt NEWALIASES 8 .Os .Sh NAME .Nm newaliases .Nd rebuild mail aliases .Sh SYNOPSIS .Nm newaliases .Op Fl f Ar file .Sh DESCRIPTION The .Nm utility makes changes to the mail aliases file visible to .Xr smtpd 8 . It should be run every time the .Xr aliases 5 file is changed. The location of the alias file is defined in .Xr smtpd.conf 5 , and defaults to .Pa /etc/mail/aliases . .Pp The options are as follows: .Bl -tag -width Ds .It Fl f Ar file Use .Ar file as the configuration file, instead of the default .Pa /etc/mail/smtpd.conf . .El .Pp If using database (db) files, .Nm is equivalent to running .Xr makemap 8 as follows: .Bd -literal -offset indent # makemap -t aliases /etc/mail/aliases .Ed .Pp If using plain text files, .Nm is equivalent to running .Xr smtpctl 8 as follows: .Bd -literal -offset indent # smtpctl update table aliases .Ed .Sh FILES .Bl -tag -width "/etc/mail/aliasesXXX" -compact .It Pa /etc/mail/aliases List of local user mail aliases. .It Pa /etc/mail/virtual List of virtual host aliases. .El .Sh EXIT STATUS .Ex -std newaliases .Sh SEE ALSO .Xr smtpd.conf 5 , .Xr makemap 8 , .Xr smtpctl 8 , .Xr smtpd 8 .Sh HISTORY The .Nm command first appeared in .Ox 4.6 as a replacement for the equivalent command shipped with sendmail. opensmtpd-7.7.0p0/usr.sbin/smtpd/lka.c0000644000175000001440000005124714674615567013316 /* $OpenBSD: lka.c,v 1.250 2024/06/11 16:30:06 tb Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static void lka_imsg(struct mproc *, struct imsg *); static void lka_shutdown(void); static void lka_sig_handler(int, short, void *); static int lka_authenticate(const char *, const char *, const char *); static int lka_credentials(const char *, const char *, char *, size_t); static int lka_userinfo(const char *, const char *, struct userinfo *); static int lka_addrname(const char *, const struct sockaddr *, struct addrname *); static int lka_mailaddrmap(const char *, const char *, const struct mailaddr *); static void proc_timeout(int fd, short event, void *p); struct event ev_proc_ready; static void lka_imsg(struct mproc *p, struct imsg *imsg) { struct table *table; int ret, fd; struct sockaddr_storage ss; struct userinfo userinfo; struct addrname addrname; struct envelope evp; struct mailaddr maddr; struct msg m; union lookup lk; char buf[LINE_MAX]; const char *tablename, *username, *password, *label, *procname; uint64_t reqid; int v; struct timeval tv; const char *direction; const char *rdns; const char *command; const char *response; const char *ciphers; const char *address; const char *domain; const char *helomethod; const char *heloname; const char *filter_name; const char *result; struct sockaddr_storage ss_src, ss_dest; int filter_response; int filter_phase; const char *filter_param; uint32_t msgid; uint32_t subsystems; uint64_t evpid; size_t msgsz; int ok; int fcrdns; if (imsg == NULL) lka_shutdown(); switch (imsg->hdr.type) { case IMSG_GETADDRINFO: case IMSG_GETNAMEINFO: case IMSG_RES_QUERY: resolver_dispatch_request(p, imsg); return; case IMSG_MTA_DNS_HOST: case IMSG_MTA_DNS_MX: case IMSG_MTA_DNS_MX_PREFERENCE: dns_imsg(p, imsg); return; case IMSG_SMTP_CHECK_SENDER: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_string(&m, &username); m_get_mailaddr(&m, &maddr); m_end(&m); ret = lka_mailaddrmap(tablename, username, &maddr); m_create(p, IMSG_SMTP_CHECK_SENDER, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); m_close(p); return; case IMSG_SMTP_EXPAND_RCPT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_envelope(&m, &evp); m_end(&m); lka_session(reqid, &evp); return; case IMSG_SMTP_LOOKUP_HELO: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_sockaddr(&m, (struct sockaddr *)&ss); m_end(&m); ret = lka_addrname(tablename, (struct sockaddr*)&ss, &addrname); m_create(p, IMSG_SMTP_LOOKUP_HELO, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); if (ret == LKA_OK) m_add_string(p, addrname.name); m_close(p); return; case IMSG_SMTP_AUTHENTICATE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_string(&m, &username); m_get_string(&m, &password); m_end(&m); if (!tablename[0]) { m_create(p_parent, IMSG_LKA_AUTHENTICATE, 0, 0, -1); m_add_id(p_parent, reqid); m_add_string(p_parent, username); m_add_string(p_parent, password); m_close(p_parent); return; } ret = lka_authenticate(tablename, username, password); m_create(p, IMSG_SMTP_AUTHENTICATE, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); m_close(p); return; case IMSG_MDA_LOOKUP_USERINFO: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_string(&m, &username); m_end(&m); ret = lka_userinfo(tablename, username, &userinfo); m_create(p, IMSG_MDA_LOOKUP_USERINFO, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); if (ret == LKA_OK) m_add_data(p, &userinfo, sizeof(userinfo)); m_close(p); return; case IMSG_MTA_LOOKUP_CREDENTIALS: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_string(&m, &label); m_end(&m); lka_credentials(tablename, label, buf, sizeof(buf)); m_create(p, IMSG_MTA_LOOKUP_CREDENTIALS, 0, 0, -1); m_add_id(p, reqid); m_add_string(p, buf); m_close(p); return; case IMSG_MTA_LOOKUP_SOURCE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_end(&m); table = table_find(env, tablename); m_create(p, IMSG_MTA_LOOKUP_SOURCE, 0, 0, -1); m_add_id(p, reqid); if (table == NULL) { log_warn("warn: source address table %s missing", tablename); m_add_int(p, LKA_TEMPFAIL); } else { ret = table_fetch(table, K_SOURCE, &lk); if (ret == -1) m_add_int(p, LKA_TEMPFAIL); else if (ret == 0) m_add_int(p, LKA_PERMFAIL); else { m_add_int(p, LKA_OK); m_add_sockaddr(p, (struct sockaddr *)&lk.source.addr); } } m_close(p); return; case IMSG_MTA_LOOKUP_HELO: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &tablename); m_get_sockaddr(&m, (struct sockaddr *)&ss); m_end(&m); ret = lka_addrname(tablename, (struct sockaddr*)&ss, &addrname); m_create(p, IMSG_MTA_LOOKUP_HELO, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); if (ret == LKA_OK) m_add_string(p, addrname.name); m_close(p); return; case IMSG_MTA_LOOKUP_SMARTHOST: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &domain); m_get_string(&m, &tablename); m_end(&m); table = table_find(env, tablename); m_create(p, IMSG_MTA_LOOKUP_SMARTHOST, 0, 0, -1); m_add_id(p, reqid); if (table == NULL) { log_warn("warn: smarthost table %s missing", tablename); m_add_int(p, LKA_TEMPFAIL); } else { if (domain == NULL) ret = table_fetch(table, K_RELAYHOST, &lk); else ret = table_lookup(table, K_RELAYHOST, domain, &lk); if (ret == -1) m_add_int(p, LKA_TEMPFAIL); else if (ret == 0) m_add_int(p, LKA_PERMFAIL); else { m_add_int(p, LKA_OK); m_add_string(p, lk.relayhost); } } m_close(p); return; case IMSG_CONF_START: return; case IMSG_CONF_END: if (tracing & TRACE_TABLES) table_dump_all(env); /* fork & exec tables that need it */ table_open_all(env); #if HAVE_PLEDGE /* revoke proc & exec */ if (pledge("stdio rpath inet dns getpw recvfd sendfd", NULL) == -1) fatal("pledge"); #endif /* setup proc registering task */ evtimer_set(&ev_proc_ready, proc_timeout, &ev_proc_ready); tv.tv_sec = 0; tv.tv_usec = 10; evtimer_add(&ev_proc_ready, &tv); return; case IMSG_LKA_OPEN_FORWARD: lka_session_forward_reply(imsg->data, imsg_get_fd(imsg)); return; case IMSG_LKA_AUTHENTICATE: imsg->hdr.type = IMSG_SMTP_AUTHENTICATE; m_forward(p_dispatcher, imsg); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_trace_verbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; case IMSG_CTL_UPDATE_TABLE: ret = 0; table = table_find(env, imsg->data); if (table == NULL) { log_warnx("warn: Lookup table not found: " "\"%s\"", (char *)imsg->data); } else ret = table_update(table); m_compose(p_control, (ret == 1) ? IMSG_CTL_OK : IMSG_CTL_FAIL, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_LKA_PROCESSOR_FORK: m_msg(&m, imsg); m_get_string(&m, &procname); m_get_u32(&m, &subsystems); m_end(&m); m_create(p, IMSG_LKA_PROCESSOR_ERRFD, 0, 0, -1); m_add_string(p, procname); m_close(p); lka_proc_forked(procname, subsystems, imsg_get_fd(imsg)); return; case IMSG_LKA_PROCESSOR_ERRFD: m_msg(&m, imsg); m_get_string(&m, &procname); m_end(&m); fd = imsg_get_fd(imsg); lka_proc_errfd(procname, fd); shutdown(fd, SHUT_WR); return; case IMSG_REPORT_SMTP_LINK_CONNECT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &rdns); m_get_int(&m, &fcrdns); m_get_sockaddr(&m, (struct sockaddr *)&ss_src); m_get_sockaddr(&m, (struct sockaddr *)&ss_dest); m_end(&m); lka_report_smtp_link_connect(direction, &tv, reqid, rdns, fcrdns, &ss_src, &ss_dest); return; case IMSG_REPORT_SMTP_LINK_GREETING: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &domain); m_end(&m); lka_report_smtp_link_greeting(direction, reqid, &tv, domain); return; case IMSG_REPORT_SMTP_LINK_DISCONNECT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_end(&m); lka_report_smtp_link_disconnect(direction, &tv, reqid); return; case IMSG_REPORT_SMTP_LINK_IDENTIFY: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &helomethod); m_get_string(&m, &heloname); m_end(&m); lka_report_smtp_link_identify(direction, &tv, reqid, helomethod, heloname); return; case IMSG_REPORT_SMTP_LINK_TLS: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &ciphers); m_end(&m); lka_report_smtp_link_tls(direction, &tv, reqid, ciphers); return; case IMSG_REPORT_SMTP_LINK_AUTH: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &username); m_get_string(&m, &result); m_end(&m); lka_report_smtp_link_auth(direction, &tv, reqid, username, result); return; case IMSG_REPORT_SMTP_TX_RESET: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_end(&m); lka_report_smtp_tx_reset(direction, &tv, reqid, msgid); return; case IMSG_REPORT_SMTP_TX_BEGIN: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_end(&m); lka_report_smtp_tx_begin(direction, &tv, reqid, msgid); return; case IMSG_REPORT_SMTP_TX_MAIL: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_get_string(&m, &address); m_get_int(&m, &ok); m_end(&m); lka_report_smtp_tx_mail(direction, &tv, reqid, msgid, address, ok); return; case IMSG_REPORT_SMTP_TX_RCPT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_get_string(&m, &address); m_get_int(&m, &ok); m_end(&m); lka_report_smtp_tx_rcpt(direction, &tv, reqid, msgid, address, ok); return; case IMSG_REPORT_SMTP_TX_ENVELOPE: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_get_id(&m, &evpid); m_end(&m); lka_report_smtp_tx_envelope(direction, &tv, reqid, msgid, evpid); return; case IMSG_REPORT_SMTP_TX_DATA: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_get_int(&m, &ok); m_end(&m); lka_report_smtp_tx_data(direction, &tv, reqid, msgid, ok); return; case IMSG_REPORT_SMTP_TX_COMMIT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_get_size(&m, &msgsz); m_end(&m); lka_report_smtp_tx_commit(direction, &tv, reqid, msgid, msgsz); return; case IMSG_REPORT_SMTP_TX_ROLLBACK: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_u32(&m, &msgid); m_end(&m); lka_report_smtp_tx_rollback(direction, &tv, reqid, msgid); return; case IMSG_REPORT_SMTP_PROTOCOL_CLIENT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &command); m_end(&m); lka_report_smtp_protocol_client(direction, &tv, reqid, command); return; case IMSG_REPORT_SMTP_PROTOCOL_SERVER: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_string(&m, &response); m_end(&m); lka_report_smtp_protocol_server(direction, &tv, reqid, response); return; case IMSG_REPORT_SMTP_FILTER_RESPONSE: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_get_int(&m, &filter_phase); m_get_int(&m, &filter_response); m_get_string(&m, &filter_param); m_end(&m); lka_report_smtp_filter_response(direction, &tv, reqid, filter_phase, filter_response, filter_param); return; case IMSG_REPORT_SMTP_TIMEOUT: m_msg(&m, imsg); m_get_string(&m, &direction); m_get_timeval(&m, &tv); m_get_id(&m, &reqid); m_end(&m); lka_report_smtp_timeout(direction, &tv, reqid); return; case IMSG_FILTER_SMTP_PROTOCOL: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &filter_phase); m_get_string(&m, &filter_param); m_end(&m); lka_filter_protocol(reqid, filter_phase, filter_param); return; case IMSG_FILTER_SMTP_BEGIN: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &filter_name); m_end(&m); lka_filter_begin(reqid, filter_name); return; case IMSG_FILTER_SMTP_END: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); lka_filter_end(reqid); return; case IMSG_FILTER_SMTP_DATA_BEGIN: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); lka_filter_data_begin(reqid); return; case IMSG_FILTER_SMTP_DATA_END: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); lka_filter_data_end(reqid); return; } fatalx("lka_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } static void lka_sig_handler(int sig, short event, void *p) { int status; pid_t pid; switch (sig) { case SIGCHLD: do { pid = waitpid(-1, &status, WNOHANG); } while (pid > 0 || (pid == -1 && errno == EINTR)); break; default: fatalx("lka_sig_handler: unexpected signal"); } } void lka_shutdown(void) { log_debug("debug: lookup agent exiting"); _exit(0); } int lka(void) { struct passwd *pw; struct event ev_sigchld; purge_config(PURGE_LISTENERS); if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); config_process(PROC_LKA); if (initgroups(pw->pw_name, pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("lka: cannot drop privileges"); imsg_callback = lka_imsg; event_init(); signal_set(&ev_sigchld, SIGCHLD, lka_sig_handler, NULL); signal_add(&ev_sigchld, NULL); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); config_peer(PROC_PARENT); config_peer(PROC_QUEUE); config_peer(PROC_CONTROL); config_peer(PROC_DISPATCHER); /* Ignore them until we get our config */ mproc_disable(p_dispatcher); lka_report_init(); lka_filter_init(); #if HAVE_PLEDGE /* proc & exec will be revoked before serving requests */ if (pledge("stdio rpath inet dns getpw recvfd sendfd proc exec", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } static void proc_timeout(int fd, short event, void *p) { struct event *ev = p; struct timeval tv; if (!lka_proc_ready()) goto reset; lka_filter_ready(); mproc_enable(p_dispatcher); return; reset: tv.tv_sec = 0; tv.tv_usec = 10; evtimer_add(ev, &tv); } static int lka_authenticate(const char *tablename, const char *user, const char *password) { struct table *table; char offloadkey[LINE_MAX]; union lookup lk; log_debug("debug: lka: authenticating for %s:%s", tablename, user); table = table_find(env, tablename); if (table == NULL) { log_warnx("warn: could not find table %s needed for authentication", tablename); return (LKA_TEMPFAIL); } /* table backend supports authentication offloading */ if (table_check_service(table, K_AUTH)) { if (!bsnprintf(offloadkey, sizeof(offloadkey), "%s:%s", user, password)) { log_warnx("warn: key serialization failed for %s:%s", tablename, user); return (LKA_TEMPFAIL); } switch (table_match(table, K_AUTH, offloadkey)) { case -1: log_warnx("warn: user credentials lookup fail for %s:%s", tablename, user); return (LKA_TEMPFAIL); case 0: return (LKA_PERMFAIL); default: return (LKA_OK); } } switch (table_lookup(table, K_CREDENTIALS, user, &lk)) { case -1: log_warnx("warn: user credentials lookup fail for %s:%s", tablename, user); return (LKA_TEMPFAIL); case 0: return (LKA_PERMFAIL); default: if (crypt_checkpass(password, lk.creds.password) == 0) return (LKA_OK); return (LKA_PERMFAIL); } } static int lka_credentials(const char *tablename, const char *label, char *dst, size_t sz) { struct table *table; union lookup lk; char *buf; int buflen, r; table = table_find(env, tablename); if (table == NULL) { log_warnx("warn: credentials table %s missing", tablename); return (LKA_TEMPFAIL); } dst[0] = '\0'; switch (table_lookup(table, K_CREDENTIALS, label, &lk)) { case -1: log_warnx("warn: credentials lookup fail for %s:%s", tablename, label); return (LKA_TEMPFAIL); case 0: log_warnx("warn: credentials not found for %s:%s", tablename, label); return (LKA_PERMFAIL); default: if ((buflen = asprintf(&buf, "%c%s%c%s", '\0', lk.creds.username, '\0', lk.creds.password)) == -1) { log_warn("warn"); return (LKA_TEMPFAIL); } r = base64_encode((unsigned char *)buf, buflen, dst, sz); free(buf); if (r == -1) { log_warnx("warn: credentials parse error for %s:%s", tablename, label); return (LKA_TEMPFAIL); } return (LKA_OK); } } static int lka_userinfo(const char *tablename, const char *username, struct userinfo *res) { struct table *table; union lookup lk; log_debug("debug: lka: userinfo %s:%s", tablename, username); table = table_find(env, tablename); if (table == NULL) { log_warnx("warn: cannot find user table %s", tablename); return (LKA_TEMPFAIL); } switch (table_lookup(table, K_USERINFO, username, &lk)) { case -1: log_warnx("warn: failure during userinfo lookup %s:%s", tablename, username); return (LKA_TEMPFAIL); case 0: return (LKA_PERMFAIL); default: *res = lk.userinfo; return (LKA_OK); } } static int lka_addrname(const char *tablename, const struct sockaddr *sa, struct addrname *res) { struct table *table; union lookup lk; const char *source; source = sa_to_text(sa); log_debug("debug: lka: helo %s:%s", tablename, source); table = table_find(env, tablename); if (table == NULL) { log_warnx("warn: cannot find helo table %s", tablename); return (LKA_TEMPFAIL); } switch (table_lookup(table, K_ADDRNAME, source, &lk)) { case -1: log_warnx("warn: failure during helo lookup %s:%s", tablename, source); return (LKA_TEMPFAIL); case 0: return (LKA_PERMFAIL); default: *res = lk.addrname; return (LKA_OK); } } static int lka_mailaddrmap(const char *tablename, const char *username, const struct mailaddr *maddr) { struct table *table; struct maddrnode *mn; union lookup lk; int found; log_debug("debug: lka: mailaddrmap %s:%s", tablename, username); table = table_find(env, tablename); if (table == NULL) { log_warnx("warn: cannot find mailaddrmap table %s", tablename); return (LKA_TEMPFAIL); } switch (table_lookup(table, K_MAILADDRMAP, username, &lk)) { case -1: log_warnx("warn: failure during mailaddrmap lookup %s:%s", tablename, username); return (LKA_TEMPFAIL); case 0: return (LKA_PERMFAIL); default: found = 0; TAILQ_FOREACH(mn, &lk.maddrmap->queue, entries) { if (!mailaddr_match(maddr, &mn->mailaddr)) continue; found = 1; break; } maddrmap_free(lk.maddrmap); if (found) return (LKA_OK); return (LKA_PERMFAIL); } return (LKA_OK); } opensmtpd-7.7.0p0/usr.sbin/smtpd/waitq.c0000644000175000001440000000461614610663500013646 /* $OpenBSD: waitq.c,v 1.7 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include "smtpd.h" struct waiter { TAILQ_ENTRY(waiter) entry; void (*cb)(void *, void *, void *); void *arg; }; struct waitq { SPLAY_ENTRY(waitq) entry; void *tag; TAILQ_HEAD(, waiter) waiters; }; static int waitq_cmp(struct waitq *, struct waitq *); SPLAY_HEAD(waitqtree, waitq); SPLAY_PROTOTYPE(waitqtree, waitq, entry, waitq_cmp); static struct waitqtree waitqs = SPLAY_INITIALIZER(&waitqs); static int waitq_cmp(struct waitq *a, struct waitq *b) { if (a->tag < b->tag) return (-1); if (a->tag > b->tag) return (1); return (0); } SPLAY_GENERATE(waitqtree, waitq, entry, waitq_cmp); int waitq_wait(void *tag, void (*cb)(void *, void *, void *), void *arg) { struct waitq *wq, key; struct waiter *w; key.tag = tag; wq = SPLAY_FIND(waitqtree, &waitqs, &key); if (wq == NULL) { wq = xmalloc(sizeof *wq); wq->tag = tag; TAILQ_INIT(&wq->waiters); SPLAY_INSERT(waitqtree, &waitqs, wq); } w = xmalloc(sizeof *w); w->cb = cb; w->arg = arg; TAILQ_INSERT_TAIL(&wq->waiters, w, entry); return (w == TAILQ_FIRST(&wq->waiters)); } void waitq_run(void *tag, void *result) { struct waitq *wq, key; struct waiter *w; key.tag = tag; wq = SPLAY_FIND(waitqtree, &waitqs, &key); SPLAY_REMOVE(waitqtree, &waitqs, wq); while ((w = TAILQ_FIRST(&wq->waiters))) { TAILQ_REMOVE(&wq->waiters, w, entry); w->cb(tag, w->arg, result); free(w); } free(wq); } opensmtpd-7.7.0p0/usr.sbin/smtpd/table_getpwnam.c0000644000175000001440000000402614674615567015531 /* $OpenBSD: table_getpwnam.c,v 1.16 2024/05/14 13:30:37 op Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include "smtpd.h" /* getpwnam(3) backend */ static int table_getpwnam_config(struct table *); static int table_getpwnam_lookup(struct table *, enum table_service, const char *, char **); struct table_backend table_backend_getpwnam = { .name = "getpwnam", .services = K_USERINFO, .config = table_getpwnam_config, .add = NULL, .dump = NULL, .open = NULL, .update = NULL, .close = NULL, .lookup = table_getpwnam_lookup, .fetch = NULL, }; static int table_getpwnam_config(struct table *table) { if (table->t_config[0]) return 0; return 1; } static int table_getpwnam_lookup(struct table *table, enum table_service kind, const char *key, char **dst) { struct passwd *pw; if (kind != K_USERINFO) return -1; errno = 0; do { pw = getpwnam(key); } while (pw == NULL && errno == EINTR); if (pw == NULL) { if (errno) return -1; return 0; } if (dst == NULL) return 1; if (asprintf(dst, "%d:%d:%s", pw->pw_uid, pw->pw_gid, pw->pw_dir) == -1) { *dst = NULL; return -1; } return (1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/parse.c0000644000175000001440000061745614665031016013650 /* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ #define YYBISON 30802 /* Bison version string. */ #define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 24 "../../usr.sbin/smtpd/parse.y" #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #include "smtpd.h" #include "ssl.h" #include "log.h" TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files); static struct file { TAILQ_ENTRY(file) entry; FILE *stream; char *name; size_t ungetpos; size_t ungetsize; u_char *ungetbuf; int eof_reached; int lineno; int errors; } *file, *topfile; struct file *pushfile(const char *, int); int popfile(void); int check_file_secrecy(int, const char *); int yyparse(void); int yylex(void); int kw_cmp(const void *, const void *); int lookup(char *); int igetc(void); int lgetc(int); void lungetc(int); int findeol(void); int yyerror(const char *, ...) __attribute__((__format__ (printf, 1, 2))) __attribute__((__nonnull__ (1))); TAILQ_HEAD(symhead, sym) symhead = TAILQ_HEAD_INITIALIZER(symhead); struct sym { TAILQ_ENTRY(sym) entry; int used; int persist; char *nam; char *val; }; int symset(const char *, const char *, int); char *symget(const char *); struct smtpd *conf = NULL; static int errors = 0; struct table *table = NULL; struct mta_limits *limits; static struct pki *pki; static struct ca *sca; struct dispatcher *dsp; struct rule *rule; struct filter_proc *processor; struct filter_config *filter_config; static uint32_t last_dynchain_id = 1; enum listen_options { LO_FAMILY = 0x000001, LO_PORT = 0x000002, LO_SSL = 0x000004, LO_FILTER = 0x000008, LO_PKI = 0x000010, LO_AUTH = 0x000020, LO_TAG = 0x000040, LO_HOSTNAME = 0x000080, LO_HOSTNAMES = 0x000100, LO_MASKSOURCE = 0x000200, LO_NODSN = 0x000400, LO_SENDERS = 0x000800, LO_RECEIVEDAUTH = 0x001000, LO_MASQUERADE = 0x002000, LO_CA = 0x004000, LO_PROXY = 0x008000, }; #define PKI_MAX 32 static struct listen_opts { char *ifx; int family; in_port_t port; uint16_t ssl; char *filtername; char *pki[PKI_MAX]; int pkicount; char *tls_ciphers; char *tls_protocols; char *ca; uint16_t auth; struct table *authtable; char *tag; char *hostname; struct table *hostnametable; struct table *sendertable; uint16_t flags; uint32_t options; } listen_opts; static void create_sock_listener(struct listen_opts *); static void create_if_listener(struct listen_opts *); static void config_listener(struct listener *, struct listen_opts *); static int host_v4(struct listen_opts *); static int host_v6(struct listen_opts *); static int host_dns(struct listen_opts *); static int interface(struct listen_opts *); int delaytonum(char *); int is_if_in_group(const char *, const char *); static int config_lo_mask_source(struct listen_opts *); typedef struct { union { int64_t number; struct table *table; char *string; struct host *host; struct mailaddr *maddr; } v; int lineno; } YYSTYPE; #line 227 "../../usr.sbin/smtpd/parse.c" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ ACTION = 258, /* ACTION */ ADMD = 259, /* ADMD */ ALIAS = 260, /* ALIAS */ ANY = 261, /* ANY */ ARROW = 262, /* ARROW */ AUTH = 263, /* AUTH */ AUTH_OPTIONAL = 264, /* AUTH_OPTIONAL */ BACKUP = 265, /* BACKUP */ BOUNCE = 266, /* BOUNCE */ BYPASS = 267, /* BYPASS */ CA = 268, /* CA */ CERT = 269, /* CERT */ CHAIN = 270, /* CHAIN */ CHROOT = 271, /* CHROOT */ CIPHERS = 272, /* CIPHERS */ COMMIT = 273, /* COMMIT */ COMPRESSION = 274, /* COMPRESSION */ CONNECT = 275, /* CONNECT */ DATA = 276, /* DATA */ DATA_LINE = 277, /* DATA_LINE */ DHE = 278, /* DHE */ DISCONNECT = 279, /* DISCONNECT */ DOMAIN = 280, /* DOMAIN */ EHLO = 281, /* EHLO */ ENABLE = 282, /* ENABLE */ ENCRYPTION = 283, /* ENCRYPTION */ ERROR = 284, /* ERROR */ EXPAND_ONLY = 285, /* EXPAND_ONLY */ FCRDNS = 286, /* FCRDNS */ FILTER = 287, /* FILTER */ FOR = 288, /* FOR */ FORWARD_ONLY = 289, /* FORWARD_ONLY */ FROM = 290, /* FROM */ GROUP = 291, /* GROUP */ HELO = 292, /* HELO */ HELO_SRC = 293, /* HELO_SRC */ HOST = 294, /* HOST */ HOSTNAME = 295, /* HOSTNAME */ HOSTNAMES = 296, /* HOSTNAMES */ INCLUDE = 297, /* INCLUDE */ INET4 = 298, /* INET4 */ INET6 = 299, /* INET6 */ JUNK = 300, /* JUNK */ KEY = 301, /* KEY */ LIMIT = 302, /* LIMIT */ LISTEN = 303, /* LISTEN */ LMTP = 304, /* LMTP */ LOCAL = 305, /* LOCAL */ MAIL_FROM = 306, /* MAIL_FROM */ MAILDIR = 307, /* MAILDIR */ MASK_SRC = 308, /* MASK_SRC */ MASQUERADE = 309, /* MASQUERADE */ MATCH = 310, /* MATCH */ MAX_MESSAGE_SIZE = 311, /* MAX_MESSAGE_SIZE */ MAX_DEFERRED = 312, /* MAX_DEFERRED */ MBOX = 313, /* MBOX */ MDA = 314, /* MDA */ MTA = 315, /* MTA */ MX = 316, /* MX */ NO_DSN = 317, /* NO_DSN */ NO_VERIFY = 318, /* NO_VERIFY */ NOOP = 319, /* NOOP */ ON = 320, /* ON */ PHASE = 321, /* PHASE */ PKI = 322, /* PKI */ PORT = 323, /* PORT */ PROC = 324, /* PROC */ PROC_EXEC = 325, /* PROC_EXEC */ PROTOCOLS = 326, /* PROTOCOLS */ PROXY_V2 = 327, /* PROXY_V2 */ QUEUE = 328, /* QUEUE */ QUIT = 329, /* QUIT */ RCPT_TO = 330, /* RCPT_TO */ RDNS = 331, /* RDNS */ RECIPIENT = 332, /* RECIPIENT */ RECEIVEDAUTH = 333, /* RECEIVEDAUTH */ REGEX = 334, /* REGEX */ RELAY = 335, /* RELAY */ REJECT = 336, /* REJECT */ REPORT = 337, /* REPORT */ REWRITE = 338, /* REWRITE */ RSET = 339, /* RSET */ SCHEDULER = 340, /* SCHEDULER */ SENDER = 341, /* SENDER */ SENDERS = 342, /* SENDERS */ SMTP = 343, /* SMTP */ SMTP_IN = 344, /* SMTP_IN */ SMTP_OUT = 345, /* SMTP_OUT */ SMTPS = 346, /* SMTPS */ SOCKET = 347, /* SOCKET */ SRC = 348, /* SRC */ SRS = 349, /* SRS */ SUB_ADDR_DELIM = 350, /* SUB_ADDR_DELIM */ TABLE = 351, /* TABLE */ TAG = 352, /* TAG */ TAGGED = 353, /* TAGGED */ TLS = 354, /* TLS */ TLS_REQUIRE = 355, /* TLS_REQUIRE */ TTL = 356, /* TTL */ USER = 357, /* USER */ USERBASE = 358, /* USERBASE */ VERIFY = 359, /* VERIFY */ VIRTUAL = 360, /* VIRTUAL */ WARN_INTERVAL = 361, /* WARN_INTERVAL */ WRAPPER = 362, /* WRAPPER */ STRING = 363, /* STRING */ NUMBER = 364 /* NUMBER */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define ACTION 258 #define ADMD 259 #define ALIAS 260 #define ANY 261 #define ARROW 262 #define AUTH 263 #define AUTH_OPTIONAL 264 #define BACKUP 265 #define BOUNCE 266 #define BYPASS 267 #define CA 268 #define CERT 269 #define CHAIN 270 #define CHROOT 271 #define CIPHERS 272 #define COMMIT 273 #define COMPRESSION 274 #define CONNECT 275 #define DATA 276 #define DATA_LINE 277 #define DHE 278 #define DISCONNECT 279 #define DOMAIN 280 #define EHLO 281 #define ENABLE 282 #define ENCRYPTION 283 #define ERROR 284 #define EXPAND_ONLY 285 #define FCRDNS 286 #define FILTER 287 #define FOR 288 #define FORWARD_ONLY 289 #define FROM 290 #define GROUP 291 #define HELO 292 #define HELO_SRC 293 #define HOST 294 #define HOSTNAME 295 #define HOSTNAMES 296 #define INCLUDE 297 #define INET4 298 #define INET6 299 #define JUNK 300 #define KEY 301 #define LIMIT 302 #define LISTEN 303 #define LMTP 304 #define LOCAL 305 #define MAIL_FROM 306 #define MAILDIR 307 #define MASK_SRC 308 #define MASQUERADE 309 #define MATCH 310 #define MAX_MESSAGE_SIZE 311 #define MAX_DEFERRED 312 #define MBOX 313 #define MDA 314 #define MTA 315 #define MX 316 #define NO_DSN 317 #define NO_VERIFY 318 #define NOOP 319 #define ON 320 #define PHASE 321 #define PKI 322 #define PORT 323 #define PROC 324 #define PROC_EXEC 325 #define PROTOCOLS 326 #define PROXY_V2 327 #define QUEUE 328 #define QUIT 329 #define RCPT_TO 330 #define RDNS 331 #define RECIPIENT 332 #define RECEIVEDAUTH 333 #define REGEX 334 #define RELAY 335 #define REJECT 336 #define REPORT 337 #define REWRITE 338 #define RSET 339 #define SCHEDULER 340 #define SENDER 341 #define SENDERS 342 #define SMTP 343 #define SMTP_IN 344 #define SMTP_OUT 345 #define SMTPS 346 #define SOCKET 347 #define SRC 348 #define SRS 349 #define SUB_ADDR_DELIM 350 #define TABLE 351 #define TAG 352 #define TAGGED 353 #define TLS 354 #define TLS_REQUIRE 355 #define TTL 356 #define USER 357 #define USERBASE 358 #define VERIFY 359 #define VIRTUAL 360 #define WARN_INTERVAL 361 #define WRAPPER 362 #define STRING 363 #define NUMBER 364 /* Value type. */ extern YYSTYPE yylval; int yyparse (void); /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_ACTION = 3, /* ACTION */ YYSYMBOL_ADMD = 4, /* ADMD */ YYSYMBOL_ALIAS = 5, /* ALIAS */ YYSYMBOL_ANY = 6, /* ANY */ YYSYMBOL_ARROW = 7, /* ARROW */ YYSYMBOL_AUTH = 8, /* AUTH */ YYSYMBOL_AUTH_OPTIONAL = 9, /* AUTH_OPTIONAL */ YYSYMBOL_BACKUP = 10, /* BACKUP */ YYSYMBOL_BOUNCE = 11, /* BOUNCE */ YYSYMBOL_BYPASS = 12, /* BYPASS */ YYSYMBOL_CA = 13, /* CA */ YYSYMBOL_CERT = 14, /* CERT */ YYSYMBOL_CHAIN = 15, /* CHAIN */ YYSYMBOL_CHROOT = 16, /* CHROOT */ YYSYMBOL_CIPHERS = 17, /* CIPHERS */ YYSYMBOL_COMMIT = 18, /* COMMIT */ YYSYMBOL_COMPRESSION = 19, /* COMPRESSION */ YYSYMBOL_CONNECT = 20, /* CONNECT */ YYSYMBOL_DATA = 21, /* DATA */ YYSYMBOL_DATA_LINE = 22, /* DATA_LINE */ YYSYMBOL_DHE = 23, /* DHE */ YYSYMBOL_DISCONNECT = 24, /* DISCONNECT */ YYSYMBOL_DOMAIN = 25, /* DOMAIN */ YYSYMBOL_EHLO = 26, /* EHLO */ YYSYMBOL_ENABLE = 27, /* ENABLE */ YYSYMBOL_ENCRYPTION = 28, /* ENCRYPTION */ YYSYMBOL_ERROR = 29, /* ERROR */ YYSYMBOL_EXPAND_ONLY = 30, /* EXPAND_ONLY */ YYSYMBOL_FCRDNS = 31, /* FCRDNS */ YYSYMBOL_FILTER = 32, /* FILTER */ YYSYMBOL_FOR = 33, /* FOR */ YYSYMBOL_FORWARD_ONLY = 34, /* FORWARD_ONLY */ YYSYMBOL_FROM = 35, /* FROM */ YYSYMBOL_GROUP = 36, /* GROUP */ YYSYMBOL_HELO = 37, /* HELO */ YYSYMBOL_HELO_SRC = 38, /* HELO_SRC */ YYSYMBOL_HOST = 39, /* HOST */ YYSYMBOL_HOSTNAME = 40, /* HOSTNAME */ YYSYMBOL_HOSTNAMES = 41, /* HOSTNAMES */ YYSYMBOL_INCLUDE = 42, /* INCLUDE */ YYSYMBOL_INET4 = 43, /* INET4 */ YYSYMBOL_INET6 = 44, /* INET6 */ YYSYMBOL_JUNK = 45, /* JUNK */ YYSYMBOL_KEY = 46, /* KEY */ YYSYMBOL_LIMIT = 47, /* LIMIT */ YYSYMBOL_LISTEN = 48, /* LISTEN */ YYSYMBOL_LMTP = 49, /* LMTP */ YYSYMBOL_LOCAL = 50, /* LOCAL */ YYSYMBOL_MAIL_FROM = 51, /* MAIL_FROM */ YYSYMBOL_MAILDIR = 52, /* MAILDIR */ YYSYMBOL_MASK_SRC = 53, /* MASK_SRC */ YYSYMBOL_MASQUERADE = 54, /* MASQUERADE */ YYSYMBOL_MATCH = 55, /* MATCH */ YYSYMBOL_MAX_MESSAGE_SIZE = 56, /* MAX_MESSAGE_SIZE */ YYSYMBOL_MAX_DEFERRED = 57, /* MAX_DEFERRED */ YYSYMBOL_MBOX = 58, /* MBOX */ YYSYMBOL_MDA = 59, /* MDA */ YYSYMBOL_MTA = 60, /* MTA */ YYSYMBOL_MX = 61, /* MX */ YYSYMBOL_NO_DSN = 62, /* NO_DSN */ YYSYMBOL_NO_VERIFY = 63, /* NO_VERIFY */ YYSYMBOL_NOOP = 64, /* NOOP */ YYSYMBOL_ON = 65, /* ON */ YYSYMBOL_PHASE = 66, /* PHASE */ YYSYMBOL_PKI = 67, /* PKI */ YYSYMBOL_PORT = 68, /* PORT */ YYSYMBOL_PROC = 69, /* PROC */ YYSYMBOL_PROC_EXEC = 70, /* PROC_EXEC */ YYSYMBOL_PROTOCOLS = 71, /* PROTOCOLS */ YYSYMBOL_PROXY_V2 = 72, /* PROXY_V2 */ YYSYMBOL_QUEUE = 73, /* QUEUE */ YYSYMBOL_QUIT = 74, /* QUIT */ YYSYMBOL_RCPT_TO = 75, /* RCPT_TO */ YYSYMBOL_RDNS = 76, /* RDNS */ YYSYMBOL_RECIPIENT = 77, /* RECIPIENT */ YYSYMBOL_RECEIVEDAUTH = 78, /* RECEIVEDAUTH */ YYSYMBOL_REGEX = 79, /* REGEX */ YYSYMBOL_RELAY = 80, /* RELAY */ YYSYMBOL_REJECT = 81, /* REJECT */ YYSYMBOL_REPORT = 82, /* REPORT */ YYSYMBOL_REWRITE = 83, /* REWRITE */ YYSYMBOL_RSET = 84, /* RSET */ YYSYMBOL_SCHEDULER = 85, /* SCHEDULER */ YYSYMBOL_SENDER = 86, /* SENDER */ YYSYMBOL_SENDERS = 87, /* SENDERS */ YYSYMBOL_SMTP = 88, /* SMTP */ YYSYMBOL_SMTP_IN = 89, /* SMTP_IN */ YYSYMBOL_SMTP_OUT = 90, /* SMTP_OUT */ YYSYMBOL_SMTPS = 91, /* SMTPS */ YYSYMBOL_SOCKET = 92, /* SOCKET */ YYSYMBOL_SRC = 93, /* SRC */ YYSYMBOL_SRS = 94, /* SRS */ YYSYMBOL_SUB_ADDR_DELIM = 95, /* SUB_ADDR_DELIM */ YYSYMBOL_TABLE = 96, /* TABLE */ YYSYMBOL_TAG = 97, /* TAG */ YYSYMBOL_TAGGED = 98, /* TAGGED */ YYSYMBOL_TLS = 99, /* TLS */ YYSYMBOL_TLS_REQUIRE = 100, /* TLS_REQUIRE */ YYSYMBOL_TTL = 101, /* TTL */ YYSYMBOL_USER = 102, /* USER */ YYSYMBOL_USERBASE = 103, /* USERBASE */ YYSYMBOL_VERIFY = 104, /* VERIFY */ YYSYMBOL_VIRTUAL = 105, /* VIRTUAL */ YYSYMBOL_WARN_INTERVAL = 106, /* WARN_INTERVAL */ YYSYMBOL_WRAPPER = 107, /* WRAPPER */ YYSYMBOL_STRING = 108, /* STRING */ YYSYMBOL_NUMBER = 109, /* NUMBER */ YYSYMBOL_110_n_ = 110, /* '\n' */ YYSYMBOL_111_ = 111, /* '=' */ YYSYMBOL_112_ = 112, /* ',' */ YYSYMBOL_113_ = 113, /* '!' */ YYSYMBOL_114_ = 114, /* '{' */ YYSYMBOL_115_ = 115, /* '}' */ YYSYMBOL_116_ = 116, /* '<' */ YYSYMBOL_117_ = 117, /* '>' */ YYSYMBOL_YYACCEPT = 118, /* $accept */ YYSYMBOL_grammar = 119, /* grammar */ YYSYMBOL_include = 120, /* include */ YYSYMBOL_varset = 121, /* varset */ YYSYMBOL_comma = 122, /* comma */ YYSYMBOL_optnl = 123, /* optnl */ YYSYMBOL_nl = 124, /* nl */ YYSYMBOL_negation = 125, /* negation */ YYSYMBOL_assign = 126, /* assign */ YYSYMBOL_keyval = 127, /* keyval */ YYSYMBOL_keyval_list = 128, /* keyval_list */ YYSYMBOL_stringel = 129, /* stringel */ YYSYMBOL_string_list = 130, /* string_list */ YYSYMBOL_tableval_list = 131, /* tableval_list */ YYSYMBOL_bounce = 132, /* bounce */ YYSYMBOL_133_1 = 133, /* $@1 */ YYSYMBOL_admd = 134, /* admd */ YYSYMBOL_ca = 135, /* ca */ YYSYMBOL_136_2 = 136, /* $@2 */ YYSYMBOL_ca_params_opt = 137, /* ca_params_opt */ YYSYMBOL_ca_params = 138, /* ca_params */ YYSYMBOL_mda = 139, /* mda */ YYSYMBOL_mta = 140, /* mta */ YYSYMBOL_141_3 = 141, /* $@3 */ YYSYMBOL_142_4 = 142, /* $@4 */ YYSYMBOL_pki = 143, /* pki */ YYSYMBOL_144_5 = 144, /* $@5 */ YYSYMBOL_pki_params_opt = 145, /* pki_params_opt */ YYSYMBOL_pki_params = 146, /* pki_params */ YYSYMBOL_proc = 147, /* proc */ YYSYMBOL_148_6 = 148, /* $@6 */ YYSYMBOL_proc_params_opt = 149, /* proc_params_opt */ YYSYMBOL_proc_params = 150, /* proc_params */ YYSYMBOL_queue = 151, /* queue */ YYSYMBOL_scheduler = 152, /* scheduler */ YYSYMBOL_smtp = 153, /* smtp */ YYSYMBOL_srs = 154, /* srs */ YYSYMBOL_dispatcher_local_option = 155, /* dispatcher_local_option */ YYSYMBOL_dispatcher_local_options = 156, /* dispatcher_local_options */ YYSYMBOL_dispatcher_local = 157, /* dispatcher_local */ YYSYMBOL_158_7 = 158, /* $@7 */ YYSYMBOL_159_8 = 159, /* $@8 */ YYSYMBOL_160_9 = 160, /* $@9 */ YYSYMBOL_161_10 = 161, /* $@10 */ YYSYMBOL_162_11 = 162, /* $@11 */ YYSYMBOL_163_12 = 163, /* $@12 */ YYSYMBOL_164_13 = 164, /* $@13 */ YYSYMBOL_165_14 = 165, /* $@14 */ YYSYMBOL_166_15 = 166, /* $@15 */ YYSYMBOL_167_16 = 167, /* $@16 */ YYSYMBOL_dispatcher_remote_option = 168, /* dispatcher_remote_option */ YYSYMBOL_169_17 = 169, /* $@17 */ YYSYMBOL_dispatcher_remote_options = 170, /* dispatcher_remote_options */ YYSYMBOL_dispatcher_remote = 171, /* dispatcher_remote */ YYSYMBOL_dispatcher_type = 172, /* dispatcher_type */ YYSYMBOL_dispatcher_option = 173, /* dispatcher_option */ YYSYMBOL_dispatcher_options = 174, /* dispatcher_options */ YYSYMBOL_dispatcher = 175, /* dispatcher */ YYSYMBOL_176_18 = 176, /* $@18 */ YYSYMBOL_match_option = 177, /* match_option */ YYSYMBOL_match_options = 178, /* match_options */ YYSYMBOL_match_dispatcher = 179, /* match_dispatcher */ YYSYMBOL_action = 180, /* action */ YYSYMBOL_match = 181, /* match */ YYSYMBOL_182_19 = 182, /* $@19 */ YYSYMBOL_filter_action_builtin = 183, /* filter_action_builtin */ YYSYMBOL_filter_action_builtin_nojunk = 184, /* filter_action_builtin_nojunk */ YYSYMBOL_filter_phase_check_fcrdns = 185, /* filter_phase_check_fcrdns */ YYSYMBOL_filter_phase_check_rdns = 186, /* filter_phase_check_rdns */ YYSYMBOL_filter_phase_check_rdns_table = 187, /* filter_phase_check_rdns_table */ YYSYMBOL_filter_phase_check_rdns_regex = 188, /* filter_phase_check_rdns_regex */ YYSYMBOL_filter_phase_check_src_table = 189, /* filter_phase_check_src_table */ YYSYMBOL_filter_phase_check_src_regex = 190, /* filter_phase_check_src_regex */ YYSYMBOL_filter_phase_check_helo_table = 191, /* filter_phase_check_helo_table */ YYSYMBOL_filter_phase_check_helo_regex = 192, /* filter_phase_check_helo_regex */ YYSYMBOL_filter_phase_check_auth = 193, /* filter_phase_check_auth */ YYSYMBOL_filter_phase_check_auth_table = 194, /* filter_phase_check_auth_table */ YYSYMBOL_filter_phase_check_auth_regex = 195, /* filter_phase_check_auth_regex */ YYSYMBOL_filter_phase_check_mail_from_table = 196, /* filter_phase_check_mail_from_table */ YYSYMBOL_filter_phase_check_mail_from_regex = 197, /* filter_phase_check_mail_from_regex */ YYSYMBOL_filter_phase_check_rcpt_to_table = 198, /* filter_phase_check_rcpt_to_table */ YYSYMBOL_filter_phase_check_rcpt_to_regex = 199, /* filter_phase_check_rcpt_to_regex */ YYSYMBOL_filter_phase_global_options = 200, /* filter_phase_global_options */ YYSYMBOL_filter_phase_connect_options = 201, /* filter_phase_connect_options */ YYSYMBOL_filter_phase_helo_options = 202, /* filter_phase_helo_options */ YYSYMBOL_filter_phase_auth_options = 203, /* filter_phase_auth_options */ YYSYMBOL_filter_phase_mail_from_options = 204, /* filter_phase_mail_from_options */ YYSYMBOL_filter_phase_rcpt_to_options = 205, /* filter_phase_rcpt_to_options */ YYSYMBOL_filter_phase_data_options = 206, /* filter_phase_data_options */ YYSYMBOL_filter_phase_commit_options = 207, /* filter_phase_commit_options */ YYSYMBOL_filter_phase_connect = 208, /* filter_phase_connect */ YYSYMBOL_209_20 = 209, /* $@20 */ YYSYMBOL_filter_phase_helo = 210, /* filter_phase_helo */ YYSYMBOL_211_21 = 211, /* $@21 */ YYSYMBOL_filter_phase_ehlo = 212, /* filter_phase_ehlo */ YYSYMBOL_213_22 = 213, /* $@22 */ YYSYMBOL_filter_phase_auth = 214, /* filter_phase_auth */ YYSYMBOL_215_23 = 215, /* $@23 */ YYSYMBOL_filter_phase_mail_from = 216, /* filter_phase_mail_from */ YYSYMBOL_217_24 = 217, /* $@24 */ YYSYMBOL_filter_phase_rcpt_to = 218, /* filter_phase_rcpt_to */ YYSYMBOL_219_25 = 219, /* $@25 */ YYSYMBOL_filter_phase_data = 220, /* filter_phase_data */ YYSYMBOL_221_26 = 221, /* $@26 */ YYSYMBOL_filter_phase_commit = 222, /* filter_phase_commit */ YYSYMBOL_223_27 = 223, /* $@27 */ YYSYMBOL_filter_phase = 224, /* filter_phase */ YYSYMBOL_filterel = 225, /* filterel */ YYSYMBOL_filter_list = 226, /* filter_list */ YYSYMBOL_filter = 227, /* filter */ YYSYMBOL_228_28 = 228, /* $@28 */ YYSYMBOL_229_29 = 229, /* $@29 */ YYSYMBOL_230_30 = 230, /* $@30 */ YYSYMBOL_size = 231, /* size */ YYSYMBOL_bouncedelay = 232, /* bouncedelay */ YYSYMBOL_bouncedelays = 233, /* bouncedelays */ YYSYMBOL_opt_limit_mda = 234, /* opt_limit_mda */ YYSYMBOL_limits_smtp = 235, /* limits_smtp */ YYSYMBOL_opt_limit_smtp = 236, /* opt_limit_smtp */ YYSYMBOL_limits_mda = 237, /* limits_mda */ YYSYMBOL_opt_limit_mta = 238, /* opt_limit_mta */ YYSYMBOL_limits_mta = 239, /* limits_mta */ YYSYMBOL_opt_limit_scheduler = 240, /* opt_limit_scheduler */ YYSYMBOL_limits_scheduler = 241, /* limits_scheduler */ YYSYMBOL_opt_sock_listen = 242, /* opt_sock_listen */ YYSYMBOL_243_31 = 243, /* $@31 */ YYSYMBOL_opt_if_listen = 244, /* opt_if_listen */ YYSYMBOL_245_32 = 245, /* $@32 */ YYSYMBOL_listener_type = 246, /* listener_type */ YYSYMBOL_socket_listener = 247, /* socket_listener */ YYSYMBOL_if_listener = 248, /* if_listener */ YYSYMBOL_sock_listen = 249, /* sock_listen */ YYSYMBOL_if_listen = 250, /* if_listen */ YYSYMBOL_listen = 251, /* listen */ YYSYMBOL_252_33 = 252, /* $@33 */ YYSYMBOL_table = 253, /* table */ YYSYMBOL_254_34 = 254, /* $@34 */ YYSYMBOL_tablenew = 255, /* tablenew */ YYSYMBOL_256_35 = 256, /* $@35 */ YYSYMBOL_tableref = 257, /* tableref */ YYSYMBOL_tables = 258 /* tables */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 521 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 118 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 141 /* YYNRULES -- Number of rules. */ #define YYNRULES 357 /* YYNSTATES -- Number of states. */ #define YYNSTATES 582 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 364 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 110, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 116, 111, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 114, 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 211, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 234, 249, 267, 268, 269, 272, 273, 276, 279, 280, 283, 283, 286, 293, 294, 297, 303, 304, 307, 308, 312, 312, 319, 334, 334, 358, 364, 369, 370, 381, 384, 384, 396, 396, 403, 403, 426, 429, 432, 450, 451, 456, 456, 473, 481, 489, 500, 501, 506, 509, 512, 521, 534, 539, 540, 543, 546, 562, 565, 568, 588, 611, 632, 653, 669, 679, 680, 684, 684, 687, 687, 690, 690, 693, 693, 701, 701, 709, 709, 713, 713, 717, 717, 721, 721, 724, 724, 731, 739, 754, 762, 770, 778, 786, 802, 810, 823, 835, 855, 876, 885, 893, 914, 930, 930, 953, 968, 969, 973, 977, 980, 986, 1003, 1004, 1008, 1008, 1024, 1042, 1061, 1078, 1096, 1103, 1110, 1127, 1145, 1162, 1180, 1197, 1216, 1224, 1234, 1244, 1261, 1279, 1287, 1305, 1325, 1337, 1357, 1379, 1399, 1421, 1431, 1441, 1458, 1476, 1496, 1520, 1521, 1525, 1535, 1538, 1542, 1542, 1559, 1560, 1563, 1569, 1572, 1575, 1578, 1584, 1591, 1598, 1604, 1611, 1617, 1624, 1630, 1637, 1643, 1649, 1656, 1662, 1669, 1675, 1682, 1683, 1684, 1685, 1686, 1687, 1690, 1693, 1694, 1695, 1698, 1699, 1700, 1701, 1702, 1703, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1766, 1766, 1773, 1773, 1779, 1779, 1785, 1785, 1790, 1790, 1796, 1796, 1802, 1802, 1834, 1834, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1853, 1858, 1900, 1901, 1905, 1927, 1927, 1949, 1949, 1963, 1963, 1978, 1985, 1998, 2018, 2019, 2022, 2047, 2048, 2051, 2067, 2068, 2071, 2074, 2077, 2087, 2088, 2091, 2113, 2114, 2118, 2135, 2135, 2157, 2162, 2170, 2186, 2194, 2202, 2220, 2236, 2252, 2265, 2281, 2281, 2303, 2311, 2319, 2327, 2335, 2343, 2350, 2357, 2364, 2372, 2380, 2388, 2397, 2406, 2420, 2429, 2445, 2450, 2458, 2466, 2474, 2490, 2508, 2509, 2512, 2521, 2527, 2528, 2531, 2532, 2536, 2536, 2547, 2585, 2585, 2593, 2601, 2601, 2609, 2622, 2623 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "ACTION", "ADMD", "ALIAS", "ANY", "ARROW", "AUTH", "AUTH_OPTIONAL", "BACKUP", "BOUNCE", "BYPASS", "CA", "CERT", "CHAIN", "CHROOT", "CIPHERS", "COMMIT", "COMPRESSION", "CONNECT", "DATA", "DATA_LINE", "DHE", "DISCONNECT", "DOMAIN", "EHLO", "ENABLE", "ENCRYPTION", "ERROR", "EXPAND_ONLY", "FCRDNS", "FILTER", "FOR", "FORWARD_ONLY", "FROM", "GROUP", "HELO", "HELO_SRC", "HOST", "HOSTNAME", "HOSTNAMES", "INCLUDE", "INET4", "INET6", "JUNK", "KEY", "LIMIT", "LISTEN", "LMTP", "LOCAL", "MAIL_FROM", "MAILDIR", "MASK_SRC", "MASQUERADE", "MATCH", "MAX_MESSAGE_SIZE", "MAX_DEFERRED", "MBOX", "MDA", "MTA", "MX", "NO_DSN", "NO_VERIFY", "NOOP", "ON", "PHASE", "PKI", "PORT", "PROC", "PROC_EXEC", "PROTOCOLS", "PROXY_V2", "QUEUE", "QUIT", "RCPT_TO", "RDNS", "RECIPIENT", "RECEIVEDAUTH", "REGEX", "RELAY", "REJECT", "REPORT", "REWRITE", "RSET", "SCHEDULER", "SENDER", "SENDERS", "SMTP", "SMTP_IN", "SMTP_OUT", "SMTPS", "SOCKET", "SRC", "SRS", "SUB_ADDR_DELIM", "TABLE", "TAG", "TAGGED", "TLS", "TLS_REQUIRE", "TTL", "USER", "USERBASE", "VERIFY", "VIRTUAL", "WARN_INTERVAL", "WRAPPER", "STRING", "NUMBER", "'\\n'", "'='", "','", "'!'", "'{'", "'}'", "'<'", "'>'", "$accept", "grammar", "include", "varset", "comma", "optnl", "nl", "negation", "assign", "keyval", "keyval_list", "stringel", "string_list", "tableval_list", "bounce", "$@1", "admd", "ca", "$@2", "ca_params_opt", "ca_params", "mda", "mta", "$@3", "$@4", "pki", "$@5", "pki_params_opt", "pki_params", "proc", "$@6", "proc_params_opt", "proc_params", "queue", "scheduler", "smtp", "srs", "dispatcher_local_option", "dispatcher_local_options", "dispatcher_local", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", "$@14", "$@15", "$@16", "dispatcher_remote_option", "$@17", "dispatcher_remote_options", "dispatcher_remote", "dispatcher_type", "dispatcher_option", "dispatcher_options", "dispatcher", "$@18", "match_option", "match_options", "match_dispatcher", "action", "match", "$@19", "filter_action_builtin", "filter_action_builtin_nojunk", "filter_phase_check_fcrdns", "filter_phase_check_rdns", "filter_phase_check_rdns_table", "filter_phase_check_rdns_regex", "filter_phase_check_src_table", "filter_phase_check_src_regex", "filter_phase_check_helo_table", "filter_phase_check_helo_regex", "filter_phase_check_auth", "filter_phase_check_auth_table", "filter_phase_check_auth_regex", "filter_phase_check_mail_from_table", "filter_phase_check_mail_from_regex", "filter_phase_check_rcpt_to_table", "filter_phase_check_rcpt_to_regex", "filter_phase_global_options", "filter_phase_connect_options", "filter_phase_helo_options", "filter_phase_auth_options", "filter_phase_mail_from_options", "filter_phase_rcpt_to_options", "filter_phase_data_options", "filter_phase_commit_options", "filter_phase_connect", "$@20", "filter_phase_helo", "$@21", "filter_phase_ehlo", "$@22", "filter_phase_auth", "$@23", "filter_phase_mail_from", "$@24", "filter_phase_rcpt_to", "$@25", "filter_phase_data", "$@26", "filter_phase_commit", "$@27", "filter_phase", "filterel", "filter_list", "filter", "$@28", "$@29", "$@30", "size", "bouncedelay", "bouncedelays", "opt_limit_mda", "limits_smtp", "opt_limit_smtp", "limits_mda", "opt_limit_mta", "limits_mta", "opt_limit_scheduler", "limits_scheduler", "opt_sock_listen", "$@31", "opt_if_listen", "$@32", "listener_type", "socket_listener", "if_listener", "sock_listen", "if_listen", "listen", "$@33", "table", "$@34", "tablenew", "$@35", "tableref", "tables", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #define YYPACT_NINF (-370) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-172) #define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -370, 21, -370, -66, -61, -53, -49, -34, -15, -10, -370, -370, -28, -17, 41, 43, 1, 60, 26, 10, 47, 13, -370, 49, 63, 70, 79, 81, 87, 90, 97, 100, 102, 104, 112, 120, 133, 136, 138, 146, 147, -370, -370, -370, -370, -370, -2, -370, 185, 6, 161, 162, 243, 173, -370, 172, -370, 176, 178, 180, 182, 190, 67, 191, -3, 201, 203, 213, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 135, 217, 312, -370, -370, 222, 228, -8, -370, 0, 6, 14, 223, 161, -370, 235, 327, 103, -370, 140, -370, -370, -370, 233, 180, -370, -370, 249, -370, 190, -370, -370, -370, -370, 254, -370, -370, -370, 252, -370, -370, -370, 269, -31, -370, 278, 234, -370, -370, 291, -370, -370, 267, 293, -370, -370, 285, 271, -370, -370, -14, 196, -370, -370, -370, -56, 142, 20, 198, 199, 202, 215, -370, -370, 295, -370, -370, -370, -370, -370, 297, -370, -370, 298, 103, -370, 304, 309, 315, 140, -370, 25, -370, -370, -370, -370, -370, 316, 31, 31, 349, -370, 382, 31, 31, -370, 52, 371, 332, 333, 52, 337, 338, 52, 52, 341, 343, 344, 52, -370, 392, 234, -370, 350, 291, -370, 217, -370, 316, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 25, 351, -370, -370, 352, -14, -370, 52, 52, 353, 354, 355, 356, 52, -370, -370, -370, -370, 357, 53, 358, -370, -370, 52, 363, 360, -370, 365, 196, -370, 52, -370, 316, 362, -370, -370, -370, -370, 240, -370, 241, -370, 245, -370, 255, 256, -370, 259, 52, -370, 52, -370, 52, -370, 52, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 364, 366, 367, 25, -370, 316, 368, 52, 369, 52, 52, 370, 31, -370, -370, -370, 31, 31, -370, 31, -370, -370, 31, -370, 372, -370, -370, -370, -370, 359, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 373, 402, 416, 424, 427, 428, 429, 430, 431, -370, -370, 374, -370, -370, -370, -370, -370, -370, -370, 375, -370, -370, -370, -370, -370, -370, -370, -370, 433, -370, -370, -370, -370, -370, -370, 376, 52, -370, 52, -370, 52, -370, 52, -370, 52, -370, 52, -370, -370, -370, -370, -370, 103, -370, -370, -370, -370, -370, -1, 150, -370, 150, -370, 377, -370, -370, -370, -370, -370, -370, 31, -370, -370, 31, -370, -370, -370, 316, -370, 150, 379, 378, 378, 378, 378, 378, 378, 378, 378, 316, 316, -370, 368, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 387, 316, 316, 388, -370, -370, 389, -370, -370, -370, -370, 373, 373, -370, -370, 148, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 171, 224, -370, -370, -370, -370, -370, -370, -370, -370, 221, -4, -370, 171, -370, -370, -370, -370, -370, -370, -370, -370, 171, 127, -370, -370, -370, 171, 171, -370, -370, -370, -370, -370, -370, -370, -370, 171, 106, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 171, 373, 373, 383, -370, 391, -370, -1, -370, -370, -370, 385, -370, 260, -370, 281, 286, 305, -370, 393, -370, 394, 395, 396, -370, -370, 314, -370, -370, -370, -370, -370, -370, 317, -370, 390, 397, -370, -370, 52, -370, 52, -370, 52, -370, 52, -370, -370, -370, -370, -370, 52, -370, 52, -370, -370, -370, -370, -370, -370, -370, -370, -370 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_int16 yydefact[] = { 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 347, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 137, 45, 43, 46, 0, 23, 0, 32, 293, 0, 55, 0, 57, 0, 71, 72, 0, 301, 0, 290, 0, 0, 0, 0, 350, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 17, 18, 0, 0, 0, 281, 279, 0, 0, 0, 31, 0, 32, 0, 0, 293, 50, 0, 0, 298, 52, 63, 64, 73, 74, 0, 301, 75, 77, 0, 76, 290, 284, 283, 78, 79, 0, 80, 82, 349, 0, 24, 108, 106, 0, 92, 90, 0, 130, 132, 133, 136, 285, 287, 44, 0, 49, 47, 0, 0, 276, 277, 344, 346, 348, 339, 340, 144, 0, 0, 0, 0, 0, 0, 143, 170, 0, 173, 176, 288, 292, 51, 0, 294, 295, 0, 298, 56, 0, 0, 0, 63, 58, 70, 299, 300, 291, 289, 81, 29, 89, 89, 100, 94, 96, 89, 89, 104, 0, 119, 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, 0, 128, 122, 130, 131, 0, 136, 138, 0, 48, 29, 255, 263, 249, 261, 253, 251, 257, 259, 265, 266, 267, 268, 269, 270, 271, 272, 280, 70, 303, 305, 306, 0, 344, 341, 326, 327, 0, 0, 315, 0, 0, 308, 309, 333, 335, 0, 0, 0, 336, 334, 0, 317, 0, 319, 320, 346, 342, 0, 352, 29, 0, 356, 357, 145, 165, 0, 164, 0, 153, 159, 152, 0, 156, 151, 0, 0, 141, 0, 147, 0, 149, 0, 139, 172, 174, 53, 296, 297, 59, 61, 60, 62, 0, 0, 0, 70, 65, 29, 0, 0, 0, 0, 0, 0, 89, 109, 107, 102, 89, 89, 98, 89, 93, 91, 89, 124, 0, 113, 114, 121, 125, 0, 110, 111, 120, 117, 112, 115, 116, 123, 129, 134, 135, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 302, 0, 307, 343, 328, 329, 325, 322, 314, 0, 331, 332, 324, 311, 312, 310, 313, 323, 337, 318, 330, 321, 345, 146, 353, 0, 0, 166, 0, 168, 0, 160, 0, 162, 0, 157, 0, 154, 142, 148, 150, 140, 298, 68, 67, 66, 69, 28, 38, 27, 42, 27, 41, 0, 84, 83, 86, 85, 87, 88, 89, 101, 95, 89, 97, 105, 118, 29, 273, 27, 0, 32, 32, 32, 32, 32, 32, 32, 32, 29, 29, 338, 0, 355, 167, 169, 161, 163, 158, 155, 54, 34, 33, 0, 29, 29, 0, 36, 26, 0, 39, 351, 103, 99, 0, 0, 274, 282, 0, 199, 200, 202, 201, 204, 203, 209, 210, 211, 212, 213, 214, 0, 0, 241, 242, 243, 244, 245, 246, 247, 248, 0, 0, 205, 0, 233, 234, 235, 236, 237, 238, 239, 240, 0, 0, 206, 207, 208, 0, 0, 215, 216, 217, 218, 219, 220, 221, 222, 0, 0, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 0, 0, 0, 0, 35, 28, 25, 0, 37, 38, 40, 0, 275, 192, 184, 0, 185, 0, 179, 0, 178, 0, 0, 0, 256, 177, 0, 264, 250, 262, 254, 252, 258, 0, 260, 0, 0, 354, 127, 0, 193, 0, 190, 0, 186, 0, 188, 181, 180, 183, 182, 0, 195, 0, 197, 304, 316, 194, 191, 187, 189, 196, 198 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -370, -370, -370, -370, -369, -210, -370, -37, -370, -370, 45, -370, 58, 76, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 334, -370, -370, -370, -222, -370, -370, -370, -370, -370, -174, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, 301, -370, -370, -370, 300, -370, -370, -370, 415, -370, -370, -370, -370, -63, 33, -370, -370, -370, -370, -370, -370, -76, 27, -249, -225, -12, -361, -86, -370, -370, 16, -370, 89, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -370, -350, -370, -370, -370, -370, -370, 303, -370, -370, 401, -370, 418, -370, -165, -370, 408, -370, -370, -370, -370, -370, -370, -370, 282, 261, -370, -370, -370, -370, -370, -370, -370, -154 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 1, 23, 24, 445, 303, 447, 471, 442, 398, 399, 400, 401, 402, 25, 87, 26, 27, 88, 140, 141, 28, 29, 391, 103, 30, 105, 175, 176, 31, 177, 300, 301, 32, 33, 34, 35, 309, 310, 133, 190, 189, 314, 316, 412, 313, 409, 319, 185, 184, 207, 326, 208, 134, 135, 210, 211, 36, 86, 96, 97, 289, 162, 37, 49, 543, 544, 458, 459, 460, 461, 462, 463, 494, 495, 466, 467, 468, 477, 478, 516, 517, 496, 483, 497, 470, 507, 519, 492, 480, 223, 342, 224, 345, 225, 344, 226, 340, 227, 346, 228, 347, 229, 343, 230, 341, 231, 418, 419, 38, 232, 143, 142, 118, 137, 138, 99, 114, 115, 100, 170, 171, 110, 111, 237, 350, 260, 358, 148, 149, 150, 238, 261, 39, 48, 40, 124, 266, 431, 267, 268 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 281, 283, 285, 287, 339, 292, 440, 120, 151, -171, 348, 311, 95, 89, 187, 317, 318, 160, 233, 50, 56, 2, 3, 262, 4, 5, 273, 533, 274, 57, 52, 448, 6, 152, 7, 153, 304, 154, 320, 234, 53, 297, 324, 60, 41, 328, 329, 42, 235, 454, 333, 155, 263, 8, 373, 43, 64, 44, 264, 95, 265, 298, 489, 9, 90, 504, 514, 91, 92, 10, 275, 276, 535, 61, 45, 156, 11, 188, 395, 51, 12, 13, 62, 236, 146, 353, 354, -171, 14, 536, 15, 360, 396, 46, 16, 161, 277, 157, 47, 158, 147, 367, 58, 530, 531, 121, 17, 59, 372, 18, 441, 65, 278, 279, 532, 19, 376, 20, 378, 94, 380, 63, 382, 384, 67, 386, 387, 299, 388, 21, 389, 22, 390, 305, 306, 408, 307, 533, 308, 410, 411, 362, 413, 534, 363, 414, 167, 168, 269, 54, 403, 55, 405, 406, 172, 66, 532, 545, 533, 68, 263, 364, 365, 173, 534, 126, 264, 270, 265, 127, 554, 555, 474, 69, 486, 116, 117, 501, 511, 533, 70, 552, 535, 537, 128, 534, 174, 129, 446, 71, 449, 72, 271, 130, 131, 538, 475, 73, 487, 536, 74, 502, 512, 535, 239, 240, 453, 75, 455, 241, 76, 169, 77, 242, 78, 132, 539, 272, 520, 521, 536, 433, 79, 434, 535, 435, 439, 436, 243, 437, 80, 438, 532, 524, 525, 451, 244, 245, 452, 246, 247, 536, 192, 81, 193, 538, 82, 194, 83, 248, 93, 195, 540, 541, 542, 533, 84, 85, 249, 196, 443, 534, 444, 250, 251, -29, 197, 252, 253, 98, 101, 198, 199, 200, 254, 545, 102, 280, 282, 215, 106, 284, 104, 255, 107, 201, 108, 256, 109, 216, 112, 217, 218, 257, 286, 258, 259, 219, 113, 119, 535, 202, 540, 541, 542, 203, 263, 263, 220, 122, 263, 123, 264, 264, 265, 265, 264, 536, 265, 375, 377, 125, 221, 263, 379, 136, 139, 204, 205, 264, 144, 265, 163, 206, 381, 383, 145, 490, 385, 558, 505, 515, 178, 165, 464, 472, 222, 484, 263, 263, 499, 509, 166, 263, 264, 264, 265, 265, 180, 264, 560, 265, 182, 263, 263, 562, 183, 263, 263, 264, 264, 265, 265, 264, 264, 265, 265, 186, 559, 212, 561, 563, 565, 457, 564, 481, 191, 493, 493, 263, 508, 571, 209, 570, 263, 264, 572, 265, 573, 214, 264, 213, 265, 288, 576, 290, 577, 291, 578, 476, 579, 488, 293, 263, 503, 513, 580, 294, 581, 264, 547, 265, 263, 295, 312, 263, 302, 315, 264, 548, 265, 264, 321, 265, 549, 550, 469, 479, 482, 491, 322, 323, 506, 518, 551, 325, 327, 465, 473, 330, 485, 331, 332, 500, 510, 334, 553, 420, 336, 349, 351, 355, 356, 357, 359, 361, 366, 368, 369, 370, 374, 421, 392, 416, 393, 394, 397, 404, 407, 422, 415, 417, 423, 424, 425, 426, 427, 430, 428, 429, 527, 94, 450, 432, 456, 523, 526, 528, 556, -30, 557, 566, 567, 568, 569, 574, 529, 522, 335, 296, 337, 159, 575, 546, 498, 338, 181, 164, 179, 352, 0, 371 }; static const yytype_int16 yycheck[] = { 154, 155, 156, 157, 214, 170, 7, 10, 8, 3, 232, 185, 49, 15, 45, 189, 190, 3, 32, 47, 19, 0, 1, 79, 3, 4, 6, 31, 8, 28, 47, 400, 11, 33, 13, 35, 5, 37, 192, 53, 57, 16, 196, 17, 110, 199, 200, 108, 62, 418, 204, 51, 108, 32, 264, 108, 46, 106, 114, 96, 116, 36, 423, 42, 66, 426, 427, 69, 70, 48, 50, 51, 76, 47, 108, 75, 55, 108, 300, 107, 59, 60, 56, 97, 92, 239, 240, 81, 67, 93, 69, 245, 302, 108, 73, 81, 76, 97, 108, 99, 108, 255, 101, 453, 454, 108, 85, 47, 262, 88, 111, 101, 92, 93, 8, 94, 270, 96, 272, 113, 274, 95, 276, 277, 111, 279, 280, 102, 282, 108, 284, 110, 286, 102, 103, 309, 105, 31, 107, 313, 314, 88, 316, 37, 91, 319, 43, 44, 6, 108, 304, 108, 306, 307, 14, 108, 8, 51, 31, 110, 108, 108, 109, 23, 37, 30, 114, 25, 116, 34, 520, 521, 421, 110, 423, 108, 109, 426, 427, 31, 110, 75, 76, 12, 49, 37, 46, 52, 398, 110, 400, 110, 50, 58, 59, 24, 421, 110, 423, 93, 110, 426, 427, 76, 8, 9, 416, 110, 418, 13, 110, 108, 110, 17, 110, 80, 45, 75, 428, 429, 93, 375, 110, 377, 76, 379, 391, 381, 32, 383, 110, 385, 8, 443, 444, 409, 40, 41, 412, 43, 44, 93, 8, 110, 10, 24, 110, 13, 110, 53, 65, 17, 81, 82, 83, 31, 110, 110, 62, 25, 110, 37, 112, 67, 68, 115, 32, 71, 72, 108, 108, 37, 38, 39, 78, 51, 33, 79, 79, 8, 108, 79, 109, 87, 108, 51, 108, 91, 108, 18, 108, 20, 21, 97, 79, 99, 100, 26, 108, 108, 76, 67, 81, 82, 83, 71, 108, 108, 37, 108, 108, 108, 114, 114, 116, 116, 114, 93, 116, 79, 79, 108, 51, 108, 79, 108, 14, 93, 94, 114, 108, 116, 109, 99, 79, 79, 108, 423, 79, 79, 426, 427, 109, 108, 420, 421, 75, 423, 108, 108, 426, 427, 25, 108, 114, 114, 116, 116, 109, 114, 79, 116, 108, 108, 108, 79, 114, 108, 108, 114, 114, 116, 116, 114, 114, 116, 116, 108, 532, 112, 534, 535, 536, 420, 79, 422, 108, 424, 425, 108, 427, 545, 101, 79, 108, 114, 79, 116, 552, 114, 114, 108, 116, 108, 558, 108, 560, 109, 562, 421, 564, 423, 108, 108, 426, 427, 570, 108, 572, 114, 483, 116, 108, 108, 75, 108, 110, 45, 114, 492, 116, 114, 61, 116, 497, 498, 420, 421, 422, 423, 108, 108, 426, 427, 507, 108, 108, 420, 421, 108, 423, 108, 108, 426, 427, 63, 519, 55, 108, 108, 108, 108, 108, 108, 108, 108, 108, 104, 108, 104, 108, 55, 108, 114, 108, 108, 108, 108, 108, 55, 108, 108, 55, 55, 55, 55, 55, 54, 114, 114, 445, 113, 115, 117, 115, 108, 108, 108, 115, 108, 115, 108, 108, 108, 108, 115, 448, 431, 207, 175, 210, 96, 115, 480, 425, 212, 115, 99, 110, 237, -1, 260 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = { 0, 119, 0, 1, 3, 4, 11, 13, 32, 42, 48, 55, 59, 60, 67, 69, 73, 85, 88, 94, 96, 108, 110, 120, 121, 132, 134, 135, 139, 140, 143, 147, 151, 152, 153, 154, 175, 181, 227, 251, 253, 110, 108, 108, 106, 108, 108, 108, 252, 182, 47, 107, 47, 57, 108, 108, 19, 28, 101, 47, 17, 47, 56, 95, 46, 101, 108, 111, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 176, 133, 136, 15, 66, 69, 70, 65, 113, 125, 177, 178, 108, 234, 237, 108, 33, 142, 109, 144, 108, 108, 108, 108, 240, 241, 108, 108, 235, 236, 108, 109, 231, 108, 10, 108, 108, 108, 254, 108, 30, 34, 49, 52, 58, 59, 80, 157, 171, 172, 108, 232, 233, 14, 137, 138, 230, 229, 108, 108, 92, 108, 246, 247, 248, 8, 33, 35, 37, 51, 75, 97, 99, 178, 3, 81, 180, 109, 237, 108, 25, 43, 44, 108, 238, 239, 14, 23, 46, 145, 146, 148, 109, 241, 109, 235, 108, 114, 167, 166, 108, 45, 108, 159, 158, 108, 8, 10, 13, 17, 25, 32, 37, 38, 39, 51, 67, 71, 93, 94, 99, 168, 170, 101, 173, 174, 112, 108, 114, 8, 18, 20, 21, 26, 37, 51, 75, 208, 210, 212, 214, 216, 218, 220, 222, 224, 228, 32, 53, 62, 97, 242, 249, 8, 9, 13, 17, 32, 40, 41, 43, 44, 53, 62, 67, 68, 71, 72, 78, 87, 91, 97, 99, 100, 244, 250, 79, 108, 114, 116, 255, 257, 258, 6, 25, 50, 75, 6, 8, 50, 51, 76, 92, 93, 79, 258, 79, 258, 79, 258, 79, 258, 108, 179, 108, 109, 239, 108, 108, 108, 146, 16, 36, 102, 149, 150, 110, 123, 5, 102, 103, 105, 107, 155, 156, 156, 75, 163, 160, 45, 161, 156, 156, 165, 258, 61, 108, 108, 258, 108, 169, 108, 258, 258, 108, 108, 108, 258, 63, 170, 108, 174, 232, 123, 215, 223, 209, 221, 213, 211, 217, 219, 150, 108, 243, 108, 249, 258, 258, 108, 108, 108, 245, 108, 258, 108, 88, 91, 108, 109, 108, 258, 104, 108, 104, 250, 258, 123, 108, 79, 258, 79, 258, 79, 258, 79, 258, 79, 258, 79, 258, 258, 258, 258, 258, 141, 108, 108, 108, 150, 123, 108, 127, 128, 129, 130, 131, 258, 108, 258, 258, 108, 156, 164, 156, 156, 162, 156, 156, 108, 114, 108, 225, 226, 55, 55, 55, 55, 55, 55, 55, 55, 114, 114, 54, 256, 117, 258, 258, 258, 258, 258, 258, 239, 7, 111, 126, 110, 112, 122, 123, 124, 122, 123, 115, 156, 156, 123, 122, 123, 115, 125, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 200, 203, 125, 191, 192, 193, 194, 195, 196, 197, 200, 207, 125, 200, 201, 191, 192, 193, 194, 195, 196, 197, 200, 206, 125, 191, 192, 200, 202, 202, 191, 192, 193, 194, 195, 196, 197, 200, 204, 125, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 205, 123, 123, 131, 108, 123, 123, 108, 128, 108, 130, 226, 226, 8, 31, 37, 76, 93, 12, 24, 45, 81, 82, 83, 183, 184, 51, 184, 183, 183, 183, 183, 183, 75, 183, 226, 226, 115, 115, 79, 258, 79, 258, 79, 258, 79, 258, 108, 108, 108, 108, 79, 258, 79, 258, 115, 115, 258, 258, 258, 258, 258, 258 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { 0, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 121, 122, 122, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 131, 133, 132, 134, 136, 135, 137, 138, 139, 139, 140, 141, 140, 142, 140, 144, 143, 145, 145, 145, 146, 146, 148, 147, 149, 149, 149, 150, 150, 151, 151, 151, 151, 152, 153, 153, 153, 153, 154, 154, 154, 155, 155, 155, 155, 155, 156, 156, 158, 157, 159, 157, 160, 157, 161, 157, 162, 157, 163, 157, 164, 157, 165, 157, 166, 157, 167, 157, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 168, 168, 170, 170, 171, 172, 172, 173, 174, 174, 176, 175, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, 179, 180, 180, 182, 181, 183, 183, 183, 184, 184, 184, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 200, 200, 200, 200, 200, 201, 202, 202, 202, 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 209, 208, 211, 210, 213, 212, 215, 214, 217, 216, 219, 218, 221, 220, 223, 222, 224, 224, 224, 224, 224, 224, 224, 224, 225, 226, 226, 227, 228, 227, 229, 227, 230, 227, 231, 231, 232, 233, 233, 234, 235, 235, 236, 237, 237, 238, 238, 238, 239, 239, 240, 241, 241, 242, 243, 242, 242, 242, 242, 244, 244, 244, 244, 244, 244, 244, 245, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 246, 246, 247, 248, 249, 249, 250, 250, 252, 251, 253, 254, 253, 255, 256, 255, 257, 258, 258 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 1, 0, 2, 0, 2, 1, 0, 1, 1, 3, 2, 3, 1, 2, 3, 1, 1, 0, 4, 2, 0, 4, 2, 1, 3, 4, 3, 0, 7, 0, 4, 0, 4, 2, 2, 2, 2, 0, 0, 5, 2, 2, 2, 2, 0, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 2, 2, 2, 2, 2, 2, 0, 0, 3, 0, 3, 0, 4, 0, 4, 0, 5, 0, 4, 0, 5, 0, 4, 0, 3, 0, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 1, 2, 2, 2, 0, 6, 1, 2, 0, 2, 1, 1, 2, 2, 0, 0, 5, 3, 4, 3, 4, 2, 2, 3, 4, 3, 4, 3, 4, 3, 3, 3, 4, 5, 3, 4, 5, 3, 4, 5, 4, 5, 3, 3, 4, 5, 4, 5, 2, 0, 1, 1, 2, 0, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 3, 4, 3, 4, 2, 3, 4, 3, 4, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 0, 6, 0, 5, 0, 8, 1, 1, 1, 3, 1, 2, 2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 2, 2, 0, 2, 0, 6, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 0, 6, 1, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 3, 1, 1, 2, 2, 2, 0, 2, 0, 0, 4, 3, 0, 7, 1, 0, 5, 3, 1, 1 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YY_USE (yyoutput); if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Discard the shifted token. */ yychar = YYEMPTY; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 22: /* grammar: grammar error '\n' */ #line 231 "../../usr.sbin/smtpd/parse.y" { file->errors++; } #line 2180 "../../usr.sbin/smtpd/parse.c" break; case 23: /* include: INCLUDE STRING */ #line 234 "../../usr.sbin/smtpd/parse.y" { struct file *nfile; if ((nfile = pushfile((yyvsp[0].v.string), 0)) == NULL) { yyerror("failed to include file %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); file = nfile; lungetc('\n'); } #line 2198 "../../usr.sbin/smtpd/parse.c" break; case 24: /* varset: STRING '=' STRING */ #line 249 "../../usr.sbin/smtpd/parse.y" { char *s = (yyvsp[-2].v.string); while (*s++) { if (isspace((unsigned char)*s)) { yyerror("macro name cannot contain " "whitespace"); free((yyvsp[-2].v.string)); free((yyvsp[0].v.string)); YYERROR; } } if (symset((yyvsp[-2].v.string), (yyvsp[0].v.string), 0) == -1) fatal("cannot store variable"); free((yyvsp[-2].v.string)); free((yyvsp[0].v.string)); } #line 2219 "../../usr.sbin/smtpd/parse.c" break; case 31: /* negation: '!' */ #line 279 "../../usr.sbin/smtpd/parse.y" { (yyval.v.number) = 1; } #line 2225 "../../usr.sbin/smtpd/parse.c" break; case 32: /* negation: %empty */ #line 280 "../../usr.sbin/smtpd/parse.y" { (yyval.v.number) = 0; } #line 2231 "../../usr.sbin/smtpd/parse.c" break; case 35: /* keyval: STRING assign STRING */ #line 286 "../../usr.sbin/smtpd/parse.y" { table_add(table, (yyvsp[-2].v.string), (yyvsp[0].v.string)); free((yyvsp[-2].v.string)); free((yyvsp[0].v.string)); } #line 2241 "../../usr.sbin/smtpd/parse.c" break; case 38: /* stringel: STRING */ #line 297 "../../usr.sbin/smtpd/parse.y" { table_add(table, (yyvsp[0].v.string), NULL); free((yyvsp[0].v.string)); } #line 2250 "../../usr.sbin/smtpd/parse.c" break; case 41: /* tableval_list: string_list */ #line 307 "../../usr.sbin/smtpd/parse.y" { } #line 2256 "../../usr.sbin/smtpd/parse.c" break; case 42: /* tableval_list: keyval_list */ #line 308 "../../usr.sbin/smtpd/parse.y" { } #line 2262 "../../usr.sbin/smtpd/parse.c" break; case 43: /* $@1: %empty */ #line 312 "../../usr.sbin/smtpd/parse.y" { memset(conf->sc_bounce_warn, 0, sizeof conf->sc_bounce_warn); } #line 2270 "../../usr.sbin/smtpd/parse.c" break; case 45: /* admd: ADMD STRING */ #line 319 "../../usr.sbin/smtpd/parse.y" { size_t i; for (i = 0; (yyvsp[0].v.string)[i] != '\0'; i++) { if (!isprint((yyvsp[0].v.string)[i])) { yyerror("not a valid admd"); free((yyvsp[0].v.string)); YYERROR; } } conf->sc_admd = (yyvsp[0].v.string); } #line 2287 "../../usr.sbin/smtpd/parse.c" break; case 46: /* $@2: %empty */ #line 334 "../../usr.sbin/smtpd/parse.y" { char buf[HOST_NAME_MAX+1]; /* if not catchall, check that it is a valid domain */ if (strcmp((yyvsp[0].v.string), "*") != 0) { if (!res_hnok((yyvsp[0].v.string))) { yyerror("not a valid domain name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } } xlowercase(buf, (yyvsp[0].v.string), sizeof(buf)); free((yyvsp[0].v.string)); sca = dict_get(conf->sc_ca_dict, buf); if (sca == NULL) { sca = xcalloc(1, sizeof *sca); (void)strlcpy(sca->ca_name, buf, sizeof(sca->ca_name)); dict_set(conf->sc_ca_dict, sca->ca_name, sca); } } #line 2312 "../../usr.sbin/smtpd/parse.c" break; case 48: /* ca_params_opt: CERT STRING */ #line 358 "../../usr.sbin/smtpd/parse.y" { sca->ca_cert_file = (yyvsp[0].v.string); } #line 2320 "../../usr.sbin/smtpd/parse.c" break; case 51: /* mda: MDA WRAPPER STRING STRING */ #line 370 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_mda_wrappers, (yyvsp[-1].v.string))) { yyerror("mda wrapper already declared with that name: %s", (yyvsp[-1].v.string)); YYERROR; } dict_set(conf->sc_mda_wrappers, (yyvsp[-1].v.string), (yyvsp[0].v.string)); } #line 2332 "../../usr.sbin/smtpd/parse.c" break; case 52: /* mta: MTA MAX_DEFERRED NUMBER */ #line 381 "../../usr.sbin/smtpd/parse.y" { conf->sc_mta_max_deferred = (yyvsp[0].v.number); } #line 2340 "../../usr.sbin/smtpd/parse.c" break; case 53: /* $@3: %empty */ #line 384 "../../usr.sbin/smtpd/parse.y" { struct mta_limits *d; limits = dict_get(conf->sc_limits_dict, (yyvsp[0].v.string)); if (limits == NULL) { limits = xcalloc(1, sizeof(*limits)); dict_xset(conf->sc_limits_dict, (yyvsp[0].v.string), limits); d = dict_xget(conf->sc_limits_dict, "default"); memmove(limits, d, sizeof(*limits)); } free((yyvsp[0].v.string)); } #line 2357 "../../usr.sbin/smtpd/parse.c" break; case 55: /* $@4: %empty */ #line 396 "../../usr.sbin/smtpd/parse.y" { limits = dict_get(conf->sc_limits_dict, "default"); } #line 2365 "../../usr.sbin/smtpd/parse.c" break; case 57: /* $@5: %empty */ #line 403 "../../usr.sbin/smtpd/parse.y" { char buf[HOST_NAME_MAX+1]; /* if not catchall, check that it is a valid domain */ if (strcmp((yyvsp[0].v.string), "*") != 0) { if (!res_hnok((yyvsp[0].v.string))) { yyerror("not a valid domain name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } } xlowercase(buf, (yyvsp[0].v.string), sizeof(buf)); free((yyvsp[0].v.string)); pki = dict_get(conf->sc_pki_dict, buf); if (pki == NULL) { pki = xcalloc(1, sizeof *pki); (void)strlcpy(pki->pki_name, buf, sizeof(pki->pki_name)); dict_set(conf->sc_pki_dict, pki->pki_name, pki); } } #line 2390 "../../usr.sbin/smtpd/parse.c" break; case 59: /* pki_params_opt: CERT STRING */ #line 426 "../../usr.sbin/smtpd/parse.y" { pki->pki_cert_file = (yyvsp[0].v.string); } #line 2398 "../../usr.sbin/smtpd/parse.c" break; case 60: /* pki_params_opt: KEY STRING */ #line 429 "../../usr.sbin/smtpd/parse.y" { pki->pki_key_file = (yyvsp[0].v.string); } #line 2406 "../../usr.sbin/smtpd/parse.c" break; case 61: /* pki_params_opt: DHE STRING */ #line 432 "../../usr.sbin/smtpd/parse.y" { if (strcasecmp((yyvsp[0].v.string), "none") == 0) pki->pki_dhe = 0; else if (strcasecmp((yyvsp[0].v.string), "auto") == 0) pki->pki_dhe = 1; else if (strcasecmp((yyvsp[0].v.string), "legacy") == 0) pki->pki_dhe = 2; else { yyerror("invalid DHE keyword: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); } #line 2425 "../../usr.sbin/smtpd/parse.c" break; case 64: /* $@6: %empty */ #line 456 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_filter_processes_dict, (yyvsp[-1].v.string))) { yyerror("processor already exists with that name: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); free((yyvsp[0].v.string)); YYERROR; } processor = xcalloc(1, sizeof *processor); processor->command = (yyvsp[0].v.string); } #line 2440 "../../usr.sbin/smtpd/parse.c" break; case 65: /* proc: PROC STRING STRING $@6 proc_params */ #line 465 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filter_processes_dict, (yyvsp[-3].v.string), processor); processor = NULL; } #line 2449 "../../usr.sbin/smtpd/parse.c" break; case 66: /* proc_params_opt: USER STRING */ #line 473 "../../usr.sbin/smtpd/parse.y" { if (processor->user) { yyerror("user already specified for this processor"); free((yyvsp[0].v.string)); YYERROR; } processor->user = (yyvsp[0].v.string); } #line 2462 "../../usr.sbin/smtpd/parse.c" break; case 67: /* proc_params_opt: GROUP STRING */ #line 481 "../../usr.sbin/smtpd/parse.y" { if (processor->group) { yyerror("group already specified for this processor"); free((yyvsp[0].v.string)); YYERROR; } processor->group = (yyvsp[0].v.string); } #line 2475 "../../usr.sbin/smtpd/parse.c" break; case 68: /* proc_params_opt: CHROOT STRING */ #line 489 "../../usr.sbin/smtpd/parse.y" { if (processor->chroot) { yyerror("chroot already specified for this processor"); free((yyvsp[0].v.string)); YYERROR; } processor->chroot = (yyvsp[0].v.string); } #line 2488 "../../usr.sbin/smtpd/parse.c" break; case 71: /* queue: QUEUE COMPRESSION */ #line 506 "../../usr.sbin/smtpd/parse.y" { conf->sc_queue_flags |= QUEUE_COMPRESSION; } #line 2496 "../../usr.sbin/smtpd/parse.c" break; case 72: /* queue: QUEUE ENCRYPTION */ #line 509 "../../usr.sbin/smtpd/parse.y" { conf->sc_queue_flags |= QUEUE_ENCRYPTION; } #line 2504 "../../usr.sbin/smtpd/parse.c" break; case 73: /* queue: QUEUE ENCRYPTION STRING */ #line 512 "../../usr.sbin/smtpd/parse.y" { if (strcasecmp((yyvsp[0].v.string), "stdin") == 0 || strcasecmp((yyvsp[0].v.string), "-") == 0) { conf->sc_queue_key = "stdin"; free((yyvsp[0].v.string)); } else conf->sc_queue_key = (yyvsp[0].v.string); conf->sc_queue_flags |= QUEUE_ENCRYPTION; } #line 2518 "../../usr.sbin/smtpd/parse.c" break; case 74: /* queue: QUEUE TTL STRING */ #line 521 "../../usr.sbin/smtpd/parse.y" { conf->sc_ttl = delaytonum((yyvsp[0].v.string)); if (conf->sc_ttl == -1) { yyerror("invalid ttl delay: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); } #line 2532 "../../usr.sbin/smtpd/parse.c" break; case 77: /* smtp: SMTP CIPHERS STRING */ #line 540 "../../usr.sbin/smtpd/parse.y" { conf->sc_tls_ciphers = (yyvsp[0].v.string); } #line 2540 "../../usr.sbin/smtpd/parse.c" break; case 78: /* smtp: SMTP MAX_MESSAGE_SIZE size */ #line 543 "../../usr.sbin/smtpd/parse.y" { conf->sc_maxsize = (yyvsp[0].v.number); } #line 2548 "../../usr.sbin/smtpd/parse.c" break; case 79: /* smtp: SMTP SUB_ADDR_DELIM STRING */ #line 546 "../../usr.sbin/smtpd/parse.y" { if (strlen((yyvsp[0].v.string)) != 1) { yyerror("subaddressing-delimiter must be one character"); free((yyvsp[0].v.string)); YYERROR; } if (isspace((unsigned char)*(yyvsp[0].v.string)) || !isprint((unsigned char)*(yyvsp[0].v.string)) || *(yyvsp[0].v.string) == '@') { yyerror("sub-addr-delim uses invalid character"); free((yyvsp[0].v.string)); YYERROR; } conf->sc_subaddressing_delim = (yyvsp[0].v.string); } #line 2566 "../../usr.sbin/smtpd/parse.c" break; case 80: /* srs: SRS KEY STRING */ #line 562 "../../usr.sbin/smtpd/parse.y" { conf->sc_srs_key = (yyvsp[0].v.string); } #line 2574 "../../usr.sbin/smtpd/parse.c" break; case 81: /* srs: SRS KEY BACKUP STRING */ #line 565 "../../usr.sbin/smtpd/parse.y" { conf->sc_srs_key_backup = (yyvsp[0].v.string); } #line 2582 "../../usr.sbin/smtpd/parse.c" break; case 82: /* srs: SRS TTL STRING */ #line 568 "../../usr.sbin/smtpd/parse.y" { conf->sc_srs_ttl = delaytonum((yyvsp[0].v.string)); if (conf->sc_srs_ttl == -1) { yyerror("ttl delay \"%s\" is invalid", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } conf->sc_srs_ttl /= 86400; if (conf->sc_srs_ttl == 0) { yyerror("ttl delay \"%s\" is too short", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); } #line 2603 "../../usr.sbin/smtpd/parse.c" break; case 83: /* dispatcher_local_option: USER STRING */ #line 588 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.local.is_mbox) { yyerror("user may not be specified for this dispatcher"); YYERROR; } if (dsp->u.local.forward_only) { yyerror("user may not be specified for forward-only"); YYERROR; } if (dsp->u.local.expand_only) { yyerror("user may not be specified for expand-only"); YYERROR; } if (dsp->u.local.user) { yyerror("user already specified for this dispatcher"); YYERROR; } dsp->u.local.user = (yyvsp[0].v.string); } #line 2631 "../../usr.sbin/smtpd/parse.c" break; case 84: /* dispatcher_local_option: ALIAS tables */ #line 611 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.local.table_alias) { yyerror("alias mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.local.table_virtual) { yyerror("virtual mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("table \"%s\" may not be used for alias lookups", t->t_name); YYERROR; } dsp->u.local.table_alias = strdup(t->t_name); } #line 2657 "../../usr.sbin/smtpd/parse.c" break; case 85: /* dispatcher_local_option: VIRTUAL tables */ #line 632 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.local.table_virtual) { yyerror("virtual mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.local.table_alias) { yyerror("alias mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("table \"%s\" may not be used for virtual lookups", t->t_name); YYERROR; } dsp->u.local.table_virtual = strdup(t->t_name); } #line 2683 "../../usr.sbin/smtpd/parse.c" break; case 86: /* dispatcher_local_option: USERBASE tables */ #line 653 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.local.table_userbase) { yyerror("userbase mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_USERINFO)) { yyerror("table \"%s\" may not be used for userbase lookups", t->t_name); YYERROR; } dsp->u.local.table_userbase = strdup(t->t_name); } #line 2704 "../../usr.sbin/smtpd/parse.c" break; case 87: /* dispatcher_local_option: WRAPPER STRING */ #line 669 "../../usr.sbin/smtpd/parse.y" { if (! dict_get(conf->sc_mda_wrappers, (yyvsp[0].v.string))) { yyerror("no mda wrapper with that name: %s", (yyvsp[0].v.string)); YYERROR; } dsp->u.local.mda_wrapper = (yyvsp[0].v.string); } #line 2716 "../../usr.sbin/smtpd/parse.c" break; case 90: /* $@7: %empty */ #line 684 "../../usr.sbin/smtpd/parse.y" { dsp->u.local.is_mbox = 1; } #line 2724 "../../usr.sbin/smtpd/parse.c" break; case 92: /* $@8: %empty */ #line 687 "../../usr.sbin/smtpd/parse.y" { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir"); } #line 2732 "../../usr.sbin/smtpd/parse.c" break; case 94: /* $@9: %empty */ #line 690 "../../usr.sbin/smtpd/parse.y" { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j"); } #line 2740 "../../usr.sbin/smtpd/parse.c" break; case 96: /* $@10: %empty */ #line 693 "../../usr.sbin/smtpd/parse.y" { if (strncmp((yyvsp[0].v.string), "~/", 2) == 0) asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir \"%%{user.directory}/%s\"", (yyvsp[0].v.string)+2); else asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir \"%s\"", (yyvsp[0].v.string)); } #line 2753 "../../usr.sbin/smtpd/parse.c" break; case 98: /* $@11: %empty */ #line 701 "../../usr.sbin/smtpd/parse.y" { if (strncmp((yyvsp[-1].v.string), "~/", 2) == 0) asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j \"%%{user.directory}/%s\"", (yyvsp[-1].v.string)+2); else asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j \"%s\"", (yyvsp[-1].v.string)); } #line 2766 "../../usr.sbin/smtpd/parse.c" break; case 100: /* $@12: %empty */ #line 709 "../../usr.sbin/smtpd/parse.y" { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.lmtp -d %s -u", (yyvsp[0].v.string)); } #line 2775 "../../usr.sbin/smtpd/parse.c" break; case 102: /* $@13: %empty */ #line 713 "../../usr.sbin/smtpd/parse.y" { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.lmtp -d %s -r", (yyvsp[-1].v.string)); } #line 2784 "../../usr.sbin/smtpd/parse.c" break; case 104: /* $@14: %empty */ #line 717 "../../usr.sbin/smtpd/parse.y" { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.mda \"%s\"", (yyvsp[0].v.string)); } #line 2793 "../../usr.sbin/smtpd/parse.c" break; case 106: /* $@15: %empty */ #line 721 "../../usr.sbin/smtpd/parse.y" { dsp->u.local.forward_only = 1; } #line 2801 "../../usr.sbin/smtpd/parse.c" break; case 108: /* $@16: %empty */ #line 724 "../../usr.sbin/smtpd/parse.y" { dsp->u.local.expand_only = 1; } #line 2809 "../../usr.sbin/smtpd/parse.c" break; case 110: /* dispatcher_remote_option: HELO STRING */ #line 731 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.helo) { yyerror("helo already specified for this dispatcher"); YYERROR; } dsp->u.remote.helo = (yyvsp[0].v.string); } #line 2822 "../../usr.sbin/smtpd/parse.c" break; case 111: /* dispatcher_remote_option: HELO_SRC tables */ #line 739 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.remote.helo_source) { yyerror("helo-source mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("table \"%s\" may not be used for helo-source lookups", t->t_name); YYERROR; } dsp->u.remote.helo_source = strdup(t->t_name); } #line 2842 "../../usr.sbin/smtpd/parse.c" break; case 112: /* dispatcher_remote_option: PKI STRING */ #line 754 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.pki) { yyerror("pki already specified for this dispatcher"); YYERROR; } dsp->u.remote.pki = (yyvsp[0].v.string); } #line 2855 "../../usr.sbin/smtpd/parse.c" break; case 113: /* dispatcher_remote_option: CA STRING */ #line 762 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.ca) { yyerror("ca already specified for this dispatcher"); YYERROR; } dsp->u.remote.ca = (yyvsp[0].v.string); } #line 2868 "../../usr.sbin/smtpd/parse.c" break; case 114: /* dispatcher_remote_option: CIPHERS STRING */ #line 770 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.tls_ciphers) { yyerror("ciphers already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_ciphers = (yyvsp[0].v.string); } #line 2881 "../../usr.sbin/smtpd/parse.c" break; case 115: /* dispatcher_remote_option: PROTOCOLS STRING */ #line 778 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.tls_protocols) { yyerror("protocols already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_protocols = (yyvsp[0].v.string); } #line 2894 "../../usr.sbin/smtpd/parse.c" break; case 116: /* dispatcher_remote_option: SRC tables */ #line 786 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.remote.source) { yyerror("source mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_SOURCE)) { yyerror("table \"%s\" may not be used for source lookups", t->t_name); YYERROR; } dsp->u.remote.source = strdup(t->t_name); } #line 2915 "../../usr.sbin/smtpd/parse.c" break; case 117: /* dispatcher_remote_option: MAIL_FROM STRING */ #line 802 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.mail_from) { yyerror("mail-from already specified for this dispatcher"); YYERROR; } dsp->u.remote.mail_from = (yyvsp[0].v.string); } #line 2928 "../../usr.sbin/smtpd/parse.c" break; case 118: /* dispatcher_remote_option: BACKUP MX STRING */ #line 810 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.backup) { yyerror("backup already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.smarthost) { yyerror("backup and host are mutually exclusive"); YYERROR; } dsp->u.remote.backup = 1; dsp->u.remote.backupmx = (yyvsp[0].v.string); } #line 2946 "../../usr.sbin/smtpd/parse.c" break; case 119: /* dispatcher_remote_option: BACKUP */ #line 823 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.backup) { yyerror("backup already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.smarthost) { yyerror("backup and host are mutually exclusive"); YYERROR; } dsp->u.remote.backup = 1; } #line 2963 "../../usr.sbin/smtpd/parse.c" break; case 120: /* dispatcher_remote_option: HOST tables */ #line 835 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.remote.smarthost) { yyerror("host mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.backup) { yyerror("backup and host are mutually exclusive"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_RELAYHOST)) { yyerror("table \"%s\" may not be used for host lookups", t->t_name); YYERROR; } dsp->u.remote.smarthost = strdup(t->t_name); } #line 2988 "../../usr.sbin/smtpd/parse.c" break; case 121: /* dispatcher_remote_option: DOMAIN tables */ #line 855 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.remote.smarthost) { yyerror("host mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.backup) { yyerror("backup and domain are mutually exclusive"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_RELAYHOST)) { yyerror("table \"%s\" may not be used for host lookups", t->t_name); YYERROR; } dsp->u.remote.smarthost = strdup(t->t_name); dsp->u.remote.smarthost_domain = 1; } #line 3014 "../../usr.sbin/smtpd/parse.c" break; case 122: /* dispatcher_remote_option: TLS */ #line 876 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.tls_required == 1) { yyerror("tls already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_required = 1; dsp->u.remote.tls_verify = 1; } #line 3028 "../../usr.sbin/smtpd/parse.c" break; case 123: /* dispatcher_remote_option: TLS NO_VERIFY */ #line 885 "../../usr.sbin/smtpd/parse.y" { if (dsp->u.remote.tls_required == 1) { yyerror("tls already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_required = 1; } #line 3041 "../../usr.sbin/smtpd/parse.c" break; case 124: /* dispatcher_remote_option: AUTH tables */ #line 893 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (dsp->u.remote.smarthost == NULL) { yyerror("auth may not be specified without host on a dispatcher"); YYERROR; } if (dsp->u.remote.auth) { yyerror("auth mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } dsp->u.remote.auth = strdup(t->t_name); } #line 3067 "../../usr.sbin/smtpd/parse.c" break; case 125: /* dispatcher_remote_option: FILTER STRING */ #line 914 "../../usr.sbin/smtpd/parse.y" { struct filter_config *fc; if (dsp->u.remote.filtername) { yyerror("filter already specified for this dispatcher"); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, (yyvsp[0].v.string))) == NULL) { yyerror("no filter exist with that name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_OUT; dsp->u.remote.filtername = (yyvsp[0].v.string); } #line 3088 "../../usr.sbin/smtpd/parse.c" break; case 126: /* $@17: %empty */ #line 930 "../../usr.sbin/smtpd/parse.y" { char buffer[128]; char *filtername; if (dsp->u.remote.filtername) { yyerror("filter already specified for this dispatcher"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_OUT; dict_init(&filter_config->chain_procs); dsp->u.remote.filtername = filtername; } #line 3113 "../../usr.sbin/smtpd/parse.c" break; case 127: /* dispatcher_remote_option: FILTER $@17 '{' optnl filter_list '}' */ #line 949 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filters_dict, dsp->u.remote.filtername, filter_config); filter_config = NULL; } #line 3122 "../../usr.sbin/smtpd/parse.c" break; case 128: /* dispatcher_remote_option: SRS */ #line 953 "../../usr.sbin/smtpd/parse.y" { if (conf->sc_srs_key == NULL) { yyerror("an srs key is required for srs to be specified in an action"); YYERROR; } if (dsp->u.remote.srs == 1) { yyerror("srs already specified for this dispatcher"); YYERROR; } dsp->u.remote.srs = 1; } #line 3139 "../../usr.sbin/smtpd/parse.c" break; case 132: /* dispatcher_type: dispatcher_local */ #line 977 "../../usr.sbin/smtpd/parse.y" { dsp->type = DISPATCHER_LOCAL; } #line 3147 "../../usr.sbin/smtpd/parse.c" break; case 133: /* dispatcher_type: dispatcher_remote */ #line 980 "../../usr.sbin/smtpd/parse.y" { dsp->type = DISPATCHER_REMOTE; } #line 3155 "../../usr.sbin/smtpd/parse.c" break; case 134: /* dispatcher_option: TTL STRING */ #line 986 "../../usr.sbin/smtpd/parse.y" { if (dsp->ttl) { yyerror("ttl already specified for this dispatcher"); YYERROR; } dsp->ttl = delaytonum((yyvsp[0].v.string)); if (dsp->ttl == -1) { yyerror("ttl delay \"%s\" is invalid", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); } #line 3174 "../../usr.sbin/smtpd/parse.c" break; case 137: /* $@18: %empty */ #line 1008 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_dispatchers, (yyvsp[0].v.string))) { yyerror("dispatcher already declared with that name: %s", (yyvsp[0].v.string)); YYERROR; } dsp = xcalloc(1, sizeof *dsp); } #line 3186 "../../usr.sbin/smtpd/parse.c" break; case 138: /* dispatcher: ACTION STRING $@18 dispatcher_type dispatcher_options */ #line 1014 "../../usr.sbin/smtpd/parse.y" { if (dsp->type == DISPATCHER_LOCAL) if (dsp->u.local.table_userbase == NULL) dsp->u.local.table_userbase = ""; dict_set(conf->sc_dispatchers, (yyvsp[-3].v.string), dsp); dsp = NULL; } #line 3198 "../../usr.sbin/smtpd/parse.c" break; case 139: /* match_option: negation TAG tables */ #line 1024 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_tag) { yyerror("tag already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_STRING)) { yyerror("table \"%s\" may not be used for tag lookups", t->t_name); YYERROR; } rule->flag_tag = (yyvsp[-2].v.number) ? -1 : 1; rule->table_tag = strdup(t->t_name); } #line 3220 "../../usr.sbin/smtpd/parse.c" break; case 140: /* match_option: negation TAG REGEX tables */ #line 1042 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_tag) { yyerror("tag already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for tag lookups", t->t_name); YYERROR; } rule->flag_tag = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_tag_regex = 1; rule->table_tag = strdup(t->t_name); } #line 3243 "../../usr.sbin/smtpd/parse.c" break; case 141: /* match_option: negation HELO tables */ #line 1061 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_helo) { yyerror("helo already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for helo lookups", t->t_name); YYERROR; } rule->flag_smtp_helo = (yyvsp[-2].v.number) ? -1 : 1; rule->table_smtp_helo = strdup(t->t_name); } #line 3265 "../../usr.sbin/smtpd/parse.c" break; case 142: /* match_option: negation HELO REGEX tables */ #line 1078 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_helo) { yyerror("helo already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for helo lookups", t->t_name); YYERROR; } rule->flag_smtp_helo = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_smtp_helo_regex = 1; rule->table_smtp_helo = strdup(t->t_name); } #line 3288 "../../usr.sbin/smtpd/parse.c" break; case 143: /* match_option: negation TLS */ #line 1096 "../../usr.sbin/smtpd/parse.y" { if (rule->flag_smtp_starttls) { yyerror("tls already specified for this rule"); YYERROR; } rule->flag_smtp_starttls = (yyvsp[-1].v.number) ? -1 : 1; } #line 3300 "../../usr.sbin/smtpd/parse.c" break; case 144: /* match_option: negation AUTH */ #line 1103 "../../usr.sbin/smtpd/parse.y" { if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } rule->flag_smtp_auth = (yyvsp[-1].v.number) ? -1 : 1; } #line 3312 "../../usr.sbin/smtpd/parse.c" break; case 145: /* match_option: negation AUTH tables */ #line 1110 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_STRING|K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } rule->flag_smtp_auth = (yyvsp[-2].v.number) ? -1 : 1; rule->table_smtp_auth = strdup(t->t_name); } #line 3334 "../../usr.sbin/smtpd/parse.c" break; case 146: /* match_option: negation AUTH REGEX tables */ #line 1127 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } rule->flag_smtp_auth = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_smtp_auth_regex = 1; rule->table_smtp_auth = strdup(t->t_name); } #line 3357 "../../usr.sbin/smtpd/parse.c" break; case 147: /* match_option: negation MAIL_FROM tables */ #line 1145 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_mail_from) { yyerror("mail-from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for mail-from lookups", t->t_name); YYERROR; } rule->flag_smtp_mail_from = (yyvsp[-2].v.number) ? -1 : 1; rule->table_smtp_mail_from = strdup(t->t_name); } #line 3379 "../../usr.sbin/smtpd/parse.c" break; case 148: /* match_option: negation MAIL_FROM REGEX tables */ #line 1162 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_mail_from) { yyerror("mail-from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for mail-from lookups", t->t_name); YYERROR; } rule->flag_smtp_mail_from = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_smtp_mail_from_regex = 1; rule->table_smtp_mail_from = strdup(t->t_name); } #line 3402 "../../usr.sbin/smtpd/parse.c" break; case 149: /* match_option: negation RCPT_TO tables */ #line 1180 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_rcpt_to) { yyerror("rcpt-to already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for rcpt-to lookups", t->t_name); YYERROR; } rule->flag_smtp_rcpt_to = (yyvsp[-2].v.number) ? -1 : 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } #line 3424 "../../usr.sbin/smtpd/parse.c" break; case 150: /* match_option: negation RCPT_TO REGEX tables */ #line 1197 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_smtp_rcpt_to) { yyerror("rcpt-to already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for rcpt-to lookups", t->t_name); YYERROR; } rule->flag_smtp_rcpt_to = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_smtp_rcpt_to_regex = 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } #line 3447 "../../usr.sbin/smtpd/parse.c" break; case 151: /* match_option: negation FROM SOCKET */ #line 1216 "../../usr.sbin/smtpd/parse.y" { if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = (yyvsp[-2].v.number) ? -1 : 1; rule->flag_from_socket = 1; } #line 3460 "../../usr.sbin/smtpd/parse.c" break; case 152: /* match_option: negation FROM LOCAL */ #line 1224 "../../usr.sbin/smtpd/parse.y" { struct table *t = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = (yyvsp[-2].v.number) ? -1 : 1; rule->table_from = strdup(t->t_name); } #line 3475 "../../usr.sbin/smtpd/parse.c" break; case 153: /* match_option: negation FROM ANY */ #line 1234 "../../usr.sbin/smtpd/parse.y" { struct table *t = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = (yyvsp[-2].v.number) ? -1 : 1; rule->table_from = strdup(t->t_name); } #line 3490 "../../usr.sbin/smtpd/parse.c" break; case 154: /* match_option: negation FROM SRC tables */ #line 1244 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_NETADDR)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = (yyvsp[-3].v.number) ? -1 : 1; rule->table_from = strdup(t->t_name); } #line 3512 "../../usr.sbin/smtpd/parse.c" break; case 155: /* match_option: negation FROM SRC REGEX tables */ #line 1261 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_from_regex = 1; rule->table_from = strdup(t->t_name); } #line 3535 "../../usr.sbin/smtpd/parse.c" break; case 156: /* match_option: negation FROM RDNS */ #line 1279 "../../usr.sbin/smtpd/parse.y" { if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = (yyvsp[-2].v.number) ? -1 : 1; rule->flag_from_rdns = 1; } #line 3548 "../../usr.sbin/smtpd/parse.c" break; case 157: /* match_option: negation FROM RDNS tables */ #line 1287 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for rdns lookups", t->t_name); YYERROR; } rule->flag_from = (yyvsp[-3].v.number) ? -1 : 1; rule->flag_from_rdns = 1; rule->table_from = strdup(t->t_name); } #line 3571 "../../usr.sbin/smtpd/parse.c" break; case 158: /* match_option: negation FROM RDNS REGEX tables */ #line 1305 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for rdns lookups", t->t_name); YYERROR; } rule->flag_from = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_from_regex = 1; rule->flag_from_rdns = 1; rule->table_from = strdup(t->t_name); } #line 3595 "../../usr.sbin/smtpd/parse.c" break; case 159: /* match_option: negation FROM AUTH */ #line 1325 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = (yyvsp[-2].v.number) ? -1 : 1; } #line 3612 "../../usr.sbin/smtpd/parse.c" break; case 160: /* match_option: negation FROM AUTH tables */ #line 1337 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_STRING|K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = (yyvsp[-3].v.number) ? -1 : 1; rule->table_smtp_auth = strdup(t->t_name); } #line 3637 "../../usr.sbin/smtpd/parse.c" break; case 161: /* match_option: negation FROM AUTH REGEX tables */ #line 1357 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_smtp_auth_regex = 1; rule->table_smtp_auth = strdup(t->t_name); } #line 3663 "../../usr.sbin/smtpd/parse.c" break; case 162: /* match_option: negation FROM MAIL_FROM tables */ #line 1379 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_mail_from = (yyvsp[-3].v.number) ? -1 : 1; rule->table_smtp_mail_from = strdup(t->t_name); } #line 3688 "../../usr.sbin/smtpd/parse.c" break; case 163: /* match_option: negation FROM MAIL_FROM REGEX tables */ #line 1399 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_mail_from = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_smtp_mail_from_regex = 1; rule->table_smtp_mail_from = strdup(t->t_name); } #line 3714 "../../usr.sbin/smtpd/parse.c" break; case 164: /* match_option: negation FOR LOCAL */ #line 1421 "../../usr.sbin/smtpd/parse.y" { struct table *t = table_find(conf, ""); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } rule->flag_for = (yyvsp[-2].v.number) ? -1 : 1; rule->table_for = strdup(t->t_name); } #line 3729 "../../usr.sbin/smtpd/parse.c" break; case 165: /* match_option: negation FOR ANY */ #line 1431 "../../usr.sbin/smtpd/parse.y" { struct table *t = table_find(conf, ""); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } rule->flag_for = (yyvsp[-2].v.number) ? -1 : 1; rule->table_for = strdup(t->t_name); } #line 3744 "../../usr.sbin/smtpd/parse.c" break; case 166: /* match_option: negation FOR DOMAIN tables */ #line 1441 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for 'for' lookups", t->t_name); YYERROR; } rule->flag_for = (yyvsp[-3].v.number) ? -1 : 1; rule->table_for = strdup(t->t_name); } #line 3766 "../../usr.sbin/smtpd/parse.c" break; case 167: /* match_option: negation FOR DOMAIN REGEX tables */ #line 1458 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for 'for' lookups", t->t_name); YYERROR; } rule->flag_for = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_for_regex = 1; rule->table_for = strdup(t->t_name); } #line 3789 "../../usr.sbin/smtpd/parse.c" break; case 168: /* match_option: negation FOR RCPT_TO tables */ #line 1476 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for for lookups", t->t_name); YYERROR; } rule->flag_for = 1; rule->table_for = strdup(anyhost->t_name); rule->flag_smtp_rcpt_to = (yyvsp[-3].v.number) ? -1 : 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } #line 3814 "../../usr.sbin/smtpd/parse.c" break; case 169: /* match_option: negation FOR RCPT_TO REGEX tables */ #line 1496 "../../usr.sbin/smtpd/parse.y" { struct table *anyhost = table_find(conf, ""); struct table *t = (yyvsp[0].v.table); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for for lookups", t->t_name); YYERROR; } rule->flag_for = 1; rule->table_for = strdup(anyhost->t_name); rule->flag_smtp_rcpt_to = (yyvsp[-4].v.number) ? -1 : 1; rule->flag_smtp_rcpt_to_regex = 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } #line 3840 "../../usr.sbin/smtpd/parse.c" break; case 172: /* match_dispatcher: STRING */ #line 1525 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_dispatchers, (yyvsp[0].v.string)) == NULL) { yyerror("no such dispatcher: %s", (yyvsp[0].v.string)); YYERROR; } rule->dispatcher = (yyvsp[0].v.string); } #line 3852 "../../usr.sbin/smtpd/parse.c" break; case 173: /* action: REJECT */ #line 1535 "../../usr.sbin/smtpd/parse.y" { rule->reject = 1; } #line 3860 "../../usr.sbin/smtpd/parse.c" break; case 175: /* $@19: %empty */ #line 1542 "../../usr.sbin/smtpd/parse.y" { rule = xcalloc(1, sizeof *rule); } #line 3868 "../../usr.sbin/smtpd/parse.c" break; case 176: /* match: MATCH $@19 match_options action */ #line 1544 "../../usr.sbin/smtpd/parse.y" { if (!rule->flag_from) { rule->table_from = strdup(""); rule->flag_from = 1; } if (!rule->flag_for) { rule->table_for = strdup(""); rule->flag_for = 1; } TAILQ_INSERT_TAIL(conf->sc_rules, rule, r_entry); rule = NULL; } #line 3885 "../../usr.sbin/smtpd/parse.c" break; case 178: /* filter_action_builtin: JUNK */ #line 1560 "../../usr.sbin/smtpd/parse.y" { filter_config->junk = 1; } #line 3893 "../../usr.sbin/smtpd/parse.c" break; case 179: /* filter_action_builtin: BYPASS */ #line 1563 "../../usr.sbin/smtpd/parse.y" { filter_config->bypass = 1; } #line 3901 "../../usr.sbin/smtpd/parse.c" break; case 180: /* filter_action_builtin_nojunk: REJECT STRING */ #line 1569 "../../usr.sbin/smtpd/parse.y" { filter_config->reject = (yyvsp[0].v.string); } #line 3909 "../../usr.sbin/smtpd/parse.c" break; case 181: /* filter_action_builtin_nojunk: DISCONNECT STRING */ #line 1572 "../../usr.sbin/smtpd/parse.y" { filter_config->disconnect = (yyvsp[0].v.string); } #line 3917 "../../usr.sbin/smtpd/parse.c" break; case 182: /* filter_action_builtin_nojunk: REWRITE STRING */ #line 1575 "../../usr.sbin/smtpd/parse.y" { filter_config->rewrite = (yyvsp[0].v.string); } #line 3925 "../../usr.sbin/smtpd/parse.c" break; case 183: /* filter_action_builtin_nojunk: REPORT STRING */ #line 1578 "../../usr.sbin/smtpd/parse.y" { filter_config->report = (yyvsp[0].v.string); } #line 3933 "../../usr.sbin/smtpd/parse.c" break; case 184: /* filter_phase_check_fcrdns: negation FCRDNS */ #line 1584 "../../usr.sbin/smtpd/parse.y" { filter_config->not_fcrdns = (yyvsp[-1].v.number) ? -1 : 1; filter_config->fcrdns = 1; } #line 3942 "../../usr.sbin/smtpd/parse.c" break; case 185: /* filter_phase_check_rdns: negation RDNS */ #line 1591 "../../usr.sbin/smtpd/parse.y" { filter_config->not_rdns = (yyvsp[-1].v.number) ? -1 : 1; filter_config->rdns = 1; } #line 3951 "../../usr.sbin/smtpd/parse.c" break; case 186: /* filter_phase_check_rdns_table: negation RDNS tables */ #line 1598 "../../usr.sbin/smtpd/parse.y" { filter_config->not_rdns_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->rdns_table = (yyvsp[0].v.table); } #line 3960 "../../usr.sbin/smtpd/parse.c" break; case 187: /* filter_phase_check_rdns_regex: negation RDNS REGEX tables */ #line 1604 "../../usr.sbin/smtpd/parse.y" { filter_config->not_rdns_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->rdns_regex = (yyvsp[0].v.table); } #line 3969 "../../usr.sbin/smtpd/parse.c" break; case 188: /* filter_phase_check_src_table: negation SRC tables */ #line 1611 "../../usr.sbin/smtpd/parse.y" { filter_config->not_src_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->src_table = (yyvsp[0].v.table); } #line 3978 "../../usr.sbin/smtpd/parse.c" break; case 189: /* filter_phase_check_src_regex: negation SRC REGEX tables */ #line 1617 "../../usr.sbin/smtpd/parse.y" { filter_config->not_src_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->src_regex = (yyvsp[0].v.table); } #line 3987 "../../usr.sbin/smtpd/parse.c" break; case 190: /* filter_phase_check_helo_table: negation HELO tables */ #line 1624 "../../usr.sbin/smtpd/parse.y" { filter_config->not_helo_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->helo_table = (yyvsp[0].v.table); } #line 3996 "../../usr.sbin/smtpd/parse.c" break; case 191: /* filter_phase_check_helo_regex: negation HELO REGEX tables */ #line 1630 "../../usr.sbin/smtpd/parse.y" { filter_config->not_helo_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->helo_regex = (yyvsp[0].v.table); } #line 4005 "../../usr.sbin/smtpd/parse.c" break; case 192: /* filter_phase_check_auth: negation AUTH */ #line 1637 "../../usr.sbin/smtpd/parse.y" { filter_config->not_auth = (yyvsp[-1].v.number) ? -1 : 1; filter_config->auth = 1; } #line 4014 "../../usr.sbin/smtpd/parse.c" break; case 193: /* filter_phase_check_auth_table: negation AUTH tables */ #line 1643 "../../usr.sbin/smtpd/parse.y" { filter_config->not_auth_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->auth_table = (yyvsp[0].v.table); } #line 4023 "../../usr.sbin/smtpd/parse.c" break; case 194: /* filter_phase_check_auth_regex: negation AUTH REGEX tables */ #line 1649 "../../usr.sbin/smtpd/parse.y" { filter_config->not_auth_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->auth_regex = (yyvsp[0].v.table); } #line 4032 "../../usr.sbin/smtpd/parse.c" break; case 195: /* filter_phase_check_mail_from_table: negation MAIL_FROM tables */ #line 1656 "../../usr.sbin/smtpd/parse.y" { filter_config->not_mail_from_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->mail_from_table = (yyvsp[0].v.table); } #line 4041 "../../usr.sbin/smtpd/parse.c" break; case 196: /* filter_phase_check_mail_from_regex: negation MAIL_FROM REGEX tables */ #line 1662 "../../usr.sbin/smtpd/parse.y" { filter_config->not_mail_from_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->mail_from_regex = (yyvsp[0].v.table); } #line 4050 "../../usr.sbin/smtpd/parse.c" break; case 197: /* filter_phase_check_rcpt_to_table: negation RCPT_TO tables */ #line 1669 "../../usr.sbin/smtpd/parse.y" { filter_config->not_rcpt_to_table = (yyvsp[-2].v.number) ? -1 : 1; filter_config->rcpt_to_table = (yyvsp[0].v.table); } #line 4059 "../../usr.sbin/smtpd/parse.c" break; case 198: /* filter_phase_check_rcpt_to_regex: negation RCPT_TO REGEX tables */ #line 1675 "../../usr.sbin/smtpd/parse.y" { filter_config->not_rcpt_to_regex = (yyvsp[-3].v.number) ? -1 : 1; filter_config->rcpt_to_regex = (yyvsp[0].v.table); } #line 4068 "../../usr.sbin/smtpd/parse.c" break; case 249: /* $@20: %empty */ #line 1766 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_CONNECT; } #line 4076 "../../usr.sbin/smtpd/parse.c" break; case 251: /* $@21: %empty */ #line 1773 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_HELO; } #line 4084 "../../usr.sbin/smtpd/parse.c" break; case 253: /* $@22: %empty */ #line 1779 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_EHLO; } #line 4092 "../../usr.sbin/smtpd/parse.c" break; case 255: /* $@23: %empty */ #line 1785 "../../usr.sbin/smtpd/parse.y" { } #line 4099 "../../usr.sbin/smtpd/parse.c" break; case 257: /* $@24: %empty */ #line 1790 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_MAIL_FROM; } #line 4107 "../../usr.sbin/smtpd/parse.c" break; case 259: /* $@25: %empty */ #line 1796 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_RCPT_TO; } #line 4115 "../../usr.sbin/smtpd/parse.c" break; case 261: /* $@26: %empty */ #line 1802 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_DATA; } #line 4123 "../../usr.sbin/smtpd/parse.c" break; case 263: /* $@27: %empty */ #line 1834 "../../usr.sbin/smtpd/parse.y" { filter_config->phase = FILTER_COMMIT; } #line 4131 "../../usr.sbin/smtpd/parse.c" break; case 273: /* filterel: STRING */ #line 1858 "../../usr.sbin/smtpd/parse.y" { struct filter_config *fr; size_t i; if ((fr = dict_get(conf->sc_filters_dict, (yyvsp[0].v.string))) == NULL) { yyerror("no filter exist with that name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } if (fr->filter_type == FILTER_TYPE_CHAIN) { yyerror("no filter chain allowed within a filter chain: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } for (i = 0; i < filter_config->chain_size; i++) { if (strcmp(filter_config->chain[i], (yyvsp[0].v.string)) == 0) { yyerror("no filter allowed twice within a filter chain: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } } if (fr->proc) { if (dict_get(&filter_config->chain_procs, fr->proc)) { yyerror("no proc allowed twice within a filter chain: %s", fr->proc); free((yyvsp[0].v.string)); YYERROR; } dict_set(&filter_config->chain_procs, fr->proc, NULL); } fr->filter_subsystem |= filter_config->filter_subsystem; filter_config->chain_size += 1; filter_config->chain = reallocarray(filter_config->chain, filter_config->chain_size, sizeof(char *)); if (filter_config->chain == NULL) fatal("reallocarray"); filter_config->chain[filter_config->chain_size - 1] = (yyvsp[0].v.string); } #line 4175 "../../usr.sbin/smtpd/parse.c" break; case 276: /* filter: FILTER STRING PROC STRING */ #line 1905 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_filters_dict, (yyvsp[-2].v.string))) { yyerror("filter already exists with that name: %s", (yyvsp[-2].v.string)); free((yyvsp[-2].v.string)); free((yyvsp[0].v.string)); YYERROR; } if (dict_get(conf->sc_filter_processes_dict, (yyvsp[0].v.string)) == NULL) { yyerror("no processor exist with that name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_PROC; filter_config->name = (yyvsp[-2].v.string); filter_config->proc = (yyvsp[0].v.string); dict_set(conf->sc_filters_dict, (yyvsp[-2].v.string), filter_config); filter_config = NULL; } #line 4201 "../../usr.sbin/smtpd/parse.c" break; case 277: /* $@28: %empty */ #line 1927 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_filters_dict, (yyvsp[-2].v.string))) { yyerror("filter already exists with that name: %s", (yyvsp[-2].v.string)); free((yyvsp[-2].v.string)); free((yyvsp[0].v.string)); YYERROR; } processor = xcalloc(1, sizeof *processor); processor->command = (yyvsp[0].v.string); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_PROC; filter_config->name = (yyvsp[-2].v.string); filter_config->proc = xstrdup((yyvsp[-2].v.string)); dict_set(conf->sc_filters_dict, (yyvsp[-2].v.string), filter_config); } #line 4223 "../../usr.sbin/smtpd/parse.c" break; case 278: /* filter: FILTER STRING PROC_EXEC STRING $@28 proc_params */ #line 1943 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filter_processes_dict, filter_config->proc, processor); processor = NULL; filter_config = NULL; } #line 4233 "../../usr.sbin/smtpd/parse.c" break; case 279: /* $@29: %empty */ #line 1949 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_filters_dict, (yyvsp[-1].v.string))) { yyerror("filter already exists with that name: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->name = (yyvsp[-1].v.string); filter_config->filter_type = FILTER_TYPE_BUILTIN; dict_set(conf->sc_filters_dict, (yyvsp[-1].v.string), filter_config); } #line 4249 "../../usr.sbin/smtpd/parse.c" break; case 280: /* filter: FILTER STRING PHASE $@29 filter_phase */ #line 1959 "../../usr.sbin/smtpd/parse.y" { filter_config = NULL; } #line 4257 "../../usr.sbin/smtpd/parse.c" break; case 281: /* $@30: %empty */ #line 1963 "../../usr.sbin/smtpd/parse.y" { if (dict_get(conf->sc_filters_dict, (yyvsp[-1].v.string))) { yyerror("filter already exists with that name: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; dict_init(&filter_config->chain_procs); } #line 4272 "../../usr.sbin/smtpd/parse.c" break; case 282: /* filter: FILTER STRING CHAIN $@30 '{' optnl filter_list '}' */ #line 1972 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filters_dict, (yyvsp[-6].v.string), filter_config); filter_config = NULL; } #line 4281 "../../usr.sbin/smtpd/parse.c" break; case 283: /* size: NUMBER */ #line 1978 "../../usr.sbin/smtpd/parse.y" { if ((yyvsp[0].v.number) < 0) { yyerror("invalid size: %" PRId64, (yyvsp[0].v.number)); YYERROR; } (yyval.v.number) = (yyvsp[0].v.number); } #line 4293 "../../usr.sbin/smtpd/parse.c" break; case 284: /* size: STRING */ #line 1985 "../../usr.sbin/smtpd/parse.y" { long long result; if (scan_scaled((yyvsp[0].v.string), &result) == -1 || result < 0) { yyerror("invalid size: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); (yyval.v.number) = result; } #line 4309 "../../usr.sbin/smtpd/parse.c" break; case 285: /* bouncedelay: STRING */ #line 1998 "../../usr.sbin/smtpd/parse.y" { time_t d; int i; d = delaytonum((yyvsp[0].v.string)); if (d < 0) { yyerror("invalid bounce delay: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); for (i = 0; i < MAX_BOUNCE_WARN; i++) { if (conf->sc_bounce_warn[i] != 0) continue; conf->sc_bounce_warn[i] = d; break; } } #line 4332 "../../usr.sbin/smtpd/parse.c" break; case 288: /* opt_limit_mda: STRING NUMBER */ #line 2022 "../../usr.sbin/smtpd/parse.y" { if (!strcmp((yyvsp[-1].v.string), "max-session")) { conf->sc_mda_max_session = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "max-session-per-user")) { conf->sc_mda_max_user_session = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "task-lowat")) { conf->sc_mda_task_lowat = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "task-hiwat")) { conf->sc_mda_task_hiwat = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "task-release")) { conf->sc_mda_task_release = (yyvsp[0].v.number); } else { yyerror("invalid scheduler limit keyword: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } free((yyvsp[-1].v.string)); } #line 4360 "../../usr.sbin/smtpd/parse.c" break; case 291: /* opt_limit_smtp: STRING NUMBER */ #line 2051 "../../usr.sbin/smtpd/parse.y" { if (!strcmp((yyvsp[-1].v.string), "max-rcpt")) { conf->sc_session_max_rcpt = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "max-mails")) { conf->sc_session_max_mails = (yyvsp[0].v.number); } else { yyerror("invalid session limit keyword: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } free((yyvsp[-1].v.string)); } #line 4379 "../../usr.sbin/smtpd/parse.c" break; case 294: /* opt_limit_mta: INET4 */ #line 2071 "../../usr.sbin/smtpd/parse.y" { limits->family = AF_INET; } #line 4387 "../../usr.sbin/smtpd/parse.c" break; case 295: /* opt_limit_mta: INET6 */ #line 2074 "../../usr.sbin/smtpd/parse.y" { limits->family = AF_INET6; } #line 4395 "../../usr.sbin/smtpd/parse.c" break; case 296: /* opt_limit_mta: STRING NUMBER */ #line 2077 "../../usr.sbin/smtpd/parse.y" { if (!limit_mta_set(limits, (yyvsp[-1].v.string), (yyvsp[0].v.number))) { yyerror("invalid mta limit keyword: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } free((yyvsp[-1].v.string)); } #line 4408 "../../usr.sbin/smtpd/parse.c" break; case 299: /* opt_limit_scheduler: STRING NUMBER */ #line 2091 "../../usr.sbin/smtpd/parse.y" { if (!strcmp((yyvsp[-1].v.string), "max-inflight")) { conf->sc_scheduler_max_inflight = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "max-evp-batch-size")) { conf->sc_scheduler_max_evp_batch_size = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "max-msg-batch-size")) { conf->sc_scheduler_max_msg_batch_size = (yyvsp[0].v.number); } else if (!strcmp((yyvsp[-1].v.string), "max-schedule")) { conf->sc_scheduler_max_schedule = (yyvsp[0].v.number); } else { yyerror("invalid scheduler limit keyword: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } free((yyvsp[-1].v.string)); } #line 4433 "../../usr.sbin/smtpd/parse.c" break; case 302: /* opt_sock_listen: FILTER STRING */ #line 2118 "../../usr.sbin/smtpd/parse.y" { struct filter_config *fc; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); free((yyvsp[0].v.string)); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, (yyvsp[0].v.string))) == NULL) { yyerror("no filter exist with that name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; listen_opts.options |= LO_FILTER; listen_opts.filtername = (yyvsp[0].v.string); } #line 4455 "../../usr.sbin/smtpd/parse.c" break; case 303: /* $@31: %empty */ #line 2135 "../../usr.sbin/smtpd/parse.y" { char buffer[128]; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); listen_opts.options |= LO_FILTER; listen_opts.filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; dict_init(&filter_config->chain_procs); } #line 4479 "../../usr.sbin/smtpd/parse.c" break; case 304: /* opt_sock_listen: FILTER $@31 '{' optnl filter_list '}' */ #line 2153 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filters_dict, listen_opts.filtername, filter_config); filter_config = NULL; } #line 4488 "../../usr.sbin/smtpd/parse.c" break; case 305: /* opt_sock_listen: MASK_SRC */ #line 2157 "../../usr.sbin/smtpd/parse.y" { if (config_lo_mask_source(&listen_opts)) { YYERROR; } } #line 4498 "../../usr.sbin/smtpd/parse.c" break; case 306: /* opt_sock_listen: NO_DSN */ #line 2162 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_NODSN) { yyerror("no-dsn already specified"); YYERROR; } listen_opts.options |= LO_NODSN; listen_opts.flags &= ~F_EXT_DSN; } #line 4511 "../../usr.sbin/smtpd/parse.c" break; case 307: /* opt_sock_listen: TAG STRING */ #line 2170 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_TAG) { yyerror("tag already specified"); YYERROR; } listen_opts.options |= LO_TAG; if (strlen((yyvsp[0].v.string)) >= SMTPD_TAG_SIZE) { yyerror("tag name too long"); free((yyvsp[0].v.string)); YYERROR; } listen_opts.tag = (yyvsp[0].v.string); } #line 4530 "../../usr.sbin/smtpd/parse.c" break; case 308: /* opt_if_listen: INET4 */ #line 2186 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_FAMILY) { yyerror("address family already specified"); YYERROR; } listen_opts.options |= LO_FAMILY; listen_opts.family = AF_INET; } #line 4543 "../../usr.sbin/smtpd/parse.c" break; case 309: /* opt_if_listen: INET6 */ #line 2194 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_FAMILY) { yyerror("address family already specified"); YYERROR; } listen_opts.options |= LO_FAMILY; listen_opts.family = AF_INET6; } #line 4556 "../../usr.sbin/smtpd/parse.c" break; case 310: /* opt_if_listen: PORT STRING */ #line 2202 "../../usr.sbin/smtpd/parse.y" { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname((yyvsp[0].v.string), "tcp"); if (servent == NULL) { yyerror("invalid port: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } free((yyvsp[0].v.string)); listen_opts.port = ntohs(servent->s_port); } #line 4579 "../../usr.sbin/smtpd/parse.c" break; case 311: /* opt_if_listen: PORT SMTP */ #line 2220 "../../usr.sbin/smtpd/parse.y" { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname("smtp", "tcp"); if (servent == NULL) { yyerror("invalid port: smtp"); YYERROR; } listen_opts.port = ntohs(servent->s_port); } #line 4600 "../../usr.sbin/smtpd/parse.c" break; case 312: /* opt_if_listen: PORT SMTPS */ #line 2236 "../../usr.sbin/smtpd/parse.y" { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname("smtps", "tcp"); if (servent == NULL) { yyerror("invalid port: smtps"); YYERROR; } listen_opts.port = ntohs(servent->s_port); } #line 4621 "../../usr.sbin/smtpd/parse.c" break; case 313: /* opt_if_listen: PORT NUMBER */ #line 2252 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; if ((yyvsp[0].v.number) <= 0 || (yyvsp[0].v.number) > (int)USHRT_MAX) { yyerror("invalid port: %" PRId64, (yyvsp[0].v.number)); YYERROR; } listen_opts.port = (yyvsp[0].v.number); } #line 4639 "../../usr.sbin/smtpd/parse.c" break; case 314: /* opt_if_listen: FILTER STRING */ #line 2265 "../../usr.sbin/smtpd/parse.y" { struct filter_config *fc; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, (yyvsp[0].v.string))) == NULL) { yyerror("no filter exist with that name: %s", (yyvsp[0].v.string)); free((yyvsp[0].v.string)); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; listen_opts.options |= LO_FILTER; listen_opts.filtername = (yyvsp[0].v.string); } #line 4660 "../../usr.sbin/smtpd/parse.c" break; case 315: /* $@32: %empty */ #line 2281 "../../usr.sbin/smtpd/parse.y" { char buffer[128]; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); listen_opts.options |= LO_FILTER; listen_opts.filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; dict_init(&filter_config->chain_procs); } #line 4684 "../../usr.sbin/smtpd/parse.c" break; case 316: /* opt_if_listen: FILTER $@32 '{' optnl filter_list '}' */ #line 2299 "../../usr.sbin/smtpd/parse.y" { dict_set(conf->sc_filters_dict, listen_opts.filtername, filter_config); filter_config = NULL; } #line 4693 "../../usr.sbin/smtpd/parse.c" break; case 317: /* opt_if_listen: SMTPS */ #line 2303 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_SMTPS; } #line 4706 "../../usr.sbin/smtpd/parse.c" break; case 318: /* opt_if_listen: SMTPS VERIFY */ #line 2311 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_SMTPS|F_TLS_VERIFY; } #line 4719 "../../usr.sbin/smtpd/parse.c" break; case 319: /* opt_if_listen: TLS */ #line 2319 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS; } #line 4732 "../../usr.sbin/smtpd/parse.c" break; case 320: /* opt_if_listen: TLS_REQUIRE */ #line 2327 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS|F_STARTTLS_REQUIRE; } #line 4745 "../../usr.sbin/smtpd/parse.c" break; case 321: /* opt_if_listen: TLS_REQUIRE VERIFY */ #line 2335 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS|F_STARTTLS_REQUIRE|F_TLS_VERIFY; } #line 4758 "../../usr.sbin/smtpd/parse.c" break; case 322: /* opt_if_listen: CIPHERS STRING */ #line 2343 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.tls_ciphers) { yyerror("ciphers already specified"); YYERROR; } listen_opts.tls_ciphers = (yyvsp[0].v.string); } #line 4770 "../../usr.sbin/smtpd/parse.c" break; case 323: /* opt_if_listen: PROTOCOLS STRING */ #line 2350 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.tls_protocols) { yyerror("protocols already specified"); YYERROR; } listen_opts.tls_protocols = (yyvsp[0].v.string); } #line 4782 "../../usr.sbin/smtpd/parse.c" break; case 324: /* opt_if_listen: PKI STRING */ #line 2357 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.pkicount == PKI_MAX) { yyerror("too many pki specified"); YYERROR; } listen_opts.pki[listen_opts.pkicount++] = (yyvsp[0].v.string); } #line 4794 "../../usr.sbin/smtpd/parse.c" break; case 325: /* opt_if_listen: CA STRING */ #line 2364 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_CA) { yyerror("ca already specified"); YYERROR; } listen_opts.options |= LO_CA; listen_opts.ca = (yyvsp[0].v.string); } #line 4807 "../../usr.sbin/smtpd/parse.c" break; case 326: /* opt_if_listen: AUTH */ #line 2372 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.auth = F_AUTH|F_AUTH_REQUIRE; } #line 4820 "../../usr.sbin/smtpd/parse.c" break; case 327: /* opt_if_listen: AUTH_OPTIONAL */ #line 2380 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.auth = F_AUTH; } #line 4833 "../../usr.sbin/smtpd/parse.c" break; case 328: /* opt_if_listen: AUTH tables */ #line 2388 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.authtable = (yyvsp[0].v.table); listen_opts.auth = F_AUTH|F_AUTH_REQUIRE; } #line 4847 "../../usr.sbin/smtpd/parse.c" break; case 329: /* opt_if_listen: AUTH_OPTIONAL tables */ #line 2397 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.authtable = (yyvsp[0].v.table); listen_opts.auth = F_AUTH; } #line 4861 "../../usr.sbin/smtpd/parse.c" break; case 330: /* opt_if_listen: TAG STRING */ #line 2406 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_TAG) { yyerror("tag already specified"); YYERROR; } listen_opts.options |= LO_TAG; if (strlen((yyvsp[0].v.string)) >= SMTPD_TAG_SIZE) { yyerror("tag name too long"); free((yyvsp[0].v.string)); YYERROR; } listen_opts.tag = (yyvsp[0].v.string); } #line 4880 "../../usr.sbin/smtpd/parse.c" break; case 331: /* opt_if_listen: HOSTNAME STRING */ #line 2420 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_HOSTNAME) { yyerror("hostname already specified"); YYERROR; } listen_opts.options |= LO_HOSTNAME; listen_opts.hostname = (yyvsp[0].v.string); } #line 4894 "../../usr.sbin/smtpd/parse.c" break; case 332: /* opt_if_listen: HOSTNAMES tables */ #line 2429 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (listen_opts.options & LO_HOSTNAMES) { yyerror("hostnames already specified"); YYERROR; } listen_opts.options |= LO_HOSTNAMES; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("invalid use of table \"%s\" as " "HOSTNAMES parameter", t->t_name); YYERROR; } listen_opts.hostnametable = t; } #line 4915 "../../usr.sbin/smtpd/parse.c" break; case 333: /* opt_if_listen: MASK_SRC */ #line 2445 "../../usr.sbin/smtpd/parse.y" { if (config_lo_mask_source(&listen_opts)) { YYERROR; } } #line 4925 "../../usr.sbin/smtpd/parse.c" break; case 334: /* opt_if_listen: RECEIVEDAUTH */ #line 2450 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_RECEIVEDAUTH) { yyerror("received-auth already specified"); YYERROR; } listen_opts.options |= LO_RECEIVEDAUTH; listen_opts.flags |= F_RECEIVEDAUTH; } #line 4938 "../../usr.sbin/smtpd/parse.c" break; case 335: /* opt_if_listen: NO_DSN */ #line 2458 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_NODSN) { yyerror("no-dsn already specified"); YYERROR; } listen_opts.options |= LO_NODSN; listen_opts.flags &= ~F_EXT_DSN; } #line 4951 "../../usr.sbin/smtpd/parse.c" break; case 336: /* opt_if_listen: PROXY_V2 */ #line 2466 "../../usr.sbin/smtpd/parse.y" { if (listen_opts.options & LO_PROXY) { yyerror("proxy-v2 already specified"); YYERROR; } listen_opts.options |= LO_PROXY; listen_opts.flags |= F_PROXY; } #line 4964 "../../usr.sbin/smtpd/parse.c" break; case 337: /* opt_if_listen: SENDERS tables */ #line 2474 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[0].v.table); if (listen_opts.options & LO_SENDERS) { yyerror("senders already specified"); YYERROR; } listen_opts.options |= LO_SENDERS; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; } listen_opts.sendertable = t; } #line 4985 "../../usr.sbin/smtpd/parse.c" break; case 338: /* opt_if_listen: SENDERS tables MASQUERADE */ #line 2490 "../../usr.sbin/smtpd/parse.y" { struct table *t = (yyvsp[-1].v.table); if (listen_opts.options & LO_SENDERS) { yyerror("senders already specified"); YYERROR; } listen_opts.options |= LO_SENDERS|LO_MASQUERADE; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; } listen_opts.sendertable = t; } #line 5006 "../../usr.sbin/smtpd/parse.c" break; case 341: /* socket_listener: SOCKET sock_listen */ #line 2512 "../../usr.sbin/smtpd/parse.y" { if (conf->sc_sock_listener) { yyerror("socket listener already configured"); YYERROR; } create_sock_listener(&listen_opts); } #line 5018 "../../usr.sbin/smtpd/parse.c" break; case 342: /* if_listener: STRING if_listen */ #line 2521 "../../usr.sbin/smtpd/parse.y" { listen_opts.ifx = (yyvsp[-1].v.string); create_if_listener(&listen_opts); } #line 5027 "../../usr.sbin/smtpd/parse.c" break; case 347: /* $@33: %empty */ #line 2536 "../../usr.sbin/smtpd/parse.y" { memset(&listen_opts, 0, sizeof listen_opts); listen_opts.family = AF_UNSPEC; listen_opts.flags |= F_EXT_DSN; } #line 5037 "../../usr.sbin/smtpd/parse.c" break; case 348: /* listen: LISTEN $@33 ON listener_type */ #line 2540 "../../usr.sbin/smtpd/parse.y" { free(listen_opts.tls_protocols); free(listen_opts.tls_ciphers); memset(&listen_opts, 0, sizeof listen_opts); } #line 5047 "../../usr.sbin/smtpd/parse.c" break; case 349: /* table: TABLE STRING STRING */ #line 2547 "../../usr.sbin/smtpd/parse.y" { char *p, *backend, *config; p = (yyvsp[0].v.string); if (*p == '/') { backend = "static"; config = (yyvsp[0].v.string); } else { backend = (yyvsp[0].v.string); config = NULL; for (p = (yyvsp[0].v.string); *p && *p != ':'; p++) ; if (*p == ':') { *p = '\0'; backend = (yyvsp[0].v.string); config = p+1; } } if (config != NULL && *config != '/') { yyerror("invalid backend parameter for table: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); free((yyvsp[0].v.string)); YYERROR; } table = table_create(conf, backend, (yyvsp[-1].v.string), config); if (!table_config(table)) { yyerror("invalid configuration file %s for table %s", config, table->t_name); free((yyvsp[-1].v.string)); free((yyvsp[0].v.string)); YYERROR; } table = NULL; free((yyvsp[-1].v.string)); free((yyvsp[0].v.string)); } #line 5090 "../../usr.sbin/smtpd/parse.c" break; case 350: /* $@34: %empty */ #line 2585 "../../usr.sbin/smtpd/parse.y" { table = table_create(conf, "static", (yyvsp[0].v.string), NULL); free((yyvsp[0].v.string)); } #line 5099 "../../usr.sbin/smtpd/parse.c" break; case 351: /* table: TABLE STRING $@34 '{' optnl tableval_list '}' */ #line 2588 "../../usr.sbin/smtpd/parse.y" { table = NULL; } #line 5107 "../../usr.sbin/smtpd/parse.c" break; case 352: /* tablenew: STRING */ #line 2593 "../../usr.sbin/smtpd/parse.y" { struct table *t; t = table_create(conf, "static", NULL, NULL); table_add(t, (yyvsp[0].v.string), NULL); free((yyvsp[0].v.string)); (yyval.v.table) = t; } #line 5120 "../../usr.sbin/smtpd/parse.c" break; case 353: /* $@35: %empty */ #line 2601 "../../usr.sbin/smtpd/parse.y" { table = table_create(conf, "static", NULL, NULL); } #line 5128 "../../usr.sbin/smtpd/parse.c" break; case 354: /* tablenew: '{' optnl $@35 tableval_list '}' */ #line 2603 "../../usr.sbin/smtpd/parse.y" { (yyval.v.table) = table; table = NULL; } #line 5137 "../../usr.sbin/smtpd/parse.c" break; case 355: /* tableref: '<' STRING '>' */ #line 2609 "../../usr.sbin/smtpd/parse.y" { struct table *t; if ((t = table_find(conf, (yyvsp[-1].v.string))) == NULL) { yyerror("no such table: %s", (yyvsp[-1].v.string)); free((yyvsp[-1].v.string)); YYERROR; } free((yyvsp[-1].v.string)); (yyval.v.table) = t; } #line 5153 "../../usr.sbin/smtpd/parse.c" break; case 356: /* tables: tablenew */ #line 2622 "../../usr.sbin/smtpd/parse.y" { (yyval.v.table) = (yyvsp[0].v.table); } #line 5159 "../../usr.sbin/smtpd/parse.c" break; case 357: /* tables: tableref */ #line 2623 "../../usr.sbin/smtpd/parse.y" { (yyval.v.table) = (yyvsp[0].v.table); } #line 5165 "../../usr.sbin/smtpd/parse.c" break; #line 5169 "../../usr.sbin/smtpd/parse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (YY_("syntax error")); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturnlab; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturnlab; /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 2627 "../../usr.sbin/smtpd/parse.y" struct keywords { const char *k_name; int k_val; }; int yyerror(const char *fmt, ...) { va_list ap; char *msg; file->errors++; va_start(ap, fmt); if (vasprintf(&msg, fmt, ap) == -1) fatalx("yyerror vasprintf"); va_end(ap); logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg); free(msg); return (0); } int kw_cmp(const void *k, const void *e) { return (strcmp(k, ((const struct keywords *)e)->k_name)); } int lookup(char *s) { /* this has to be sorted always */ static const struct keywords keywords[] = { { "action", ACTION }, { "admd", ADMD }, { "alias", ALIAS }, { "any", ANY }, { "auth", AUTH }, { "auth-optional", AUTH_OPTIONAL }, { "backup", BACKUP }, { "bounce", BOUNCE }, { "bypass", BYPASS }, { "ca", CA }, { "cert", CERT }, { "chain", CHAIN }, { "chroot", CHROOT }, { "ciphers", CIPHERS }, { "commit", COMMIT }, { "compression", COMPRESSION }, { "connect", CONNECT }, { "data", DATA }, { "data-line", DATA_LINE }, { "dhe", DHE }, { "disconnect", DISCONNECT }, { "domain", DOMAIN }, { "ehlo", EHLO }, { "encryption", ENCRYPTION }, { "expand-only", EXPAND_ONLY }, { "fcrdns", FCRDNS }, { "filter", FILTER }, { "for", FOR }, { "forward-only", FORWARD_ONLY }, { "from", FROM }, { "group", GROUP }, { "helo", HELO }, { "helo-src", HELO_SRC }, { "host", HOST }, { "hostname", HOSTNAME }, { "hostnames", HOSTNAMES }, { "include", INCLUDE }, { "inet4", INET4 }, { "inet6", INET6 }, { "junk", JUNK }, { "key", KEY }, { "limit", LIMIT }, { "listen", LISTEN }, { "lmtp", LMTP }, { "local", LOCAL }, { "mail-from", MAIL_FROM }, { "maildir", MAILDIR }, { "mask-src", MASK_SRC }, { "masquerade", MASQUERADE }, { "match", MATCH }, { "max-deferred", MAX_DEFERRED }, { "max-message-size", MAX_MESSAGE_SIZE }, { "mbox", MBOX }, { "mda", MDA }, { "mta", MTA }, { "mx", MX }, { "no-dsn", NO_DSN }, { "no-verify", NO_VERIFY }, { "noop", NOOP }, { "on", ON }, { "phase", PHASE }, { "pki", PKI }, { "port", PORT }, { "proc", PROC }, { "proc-exec", PROC_EXEC }, { "protocols", PROTOCOLS }, { "proxy-v2", PROXY_V2 }, { "queue", QUEUE }, { "quit", QUIT }, { "rcpt-to", RCPT_TO }, { "rdns", RDNS }, { "received-auth", RECEIVEDAUTH }, { "recipient", RECIPIENT }, { "regex", REGEX }, { "reject", REJECT }, { "relay", RELAY }, { "report", REPORT }, { "rewrite", REWRITE }, { "rset", RSET }, { "scheduler", SCHEDULER }, { "senders", SENDERS }, { "smtp", SMTP }, { "smtp-in", SMTP_IN }, { "smtp-out", SMTP_OUT }, { "smtps", SMTPS }, { "socket", SOCKET }, { "src", SRC }, { "srs", SRS }, { "sub-addr-delim", SUB_ADDR_DELIM }, { "table", TABLE }, { "tag", TAG }, { "tagged", TAGGED }, { "tls", TLS }, { "tls-require", TLS_REQUIRE }, { "ttl", TTL }, { "user", USER }, { "userbase", USERBASE }, { "verify", VERIFY }, { "virtual", VIRTUAL }, { "warn-interval", WARN_INTERVAL }, { "wrapper", WRAPPER }, }; const struct keywords *p; p = bsearch(s, keywords, sizeof(keywords)/sizeof(keywords[0]), sizeof(keywords[0]), kw_cmp); if (p) return (p->k_val); else return (STRING); } #define START_EXPAND 1 #define DONE_EXPAND 2 static int expanding; int igetc(void) { int c; while (1) { if (file->ungetpos > 0) c = file->ungetbuf[--file->ungetpos]; else c = getc(file->stream); if (c == START_EXPAND) expanding = 1; else if (c == DONE_EXPAND) expanding = 0; else break; } return (c); } int lgetc(int quotec) { int c, next; if (quotec) { if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing " "quoted string"); if (file == topfile || popfile() == EOF) return (EOF); return (quotec); } return (c); } while ((c = igetc()) == '\\') { next = igetc(); if (next != '\n') { c = next; break; } yylval.lineno = file->lineno; file->lineno++; } if (c == EOF) { /* * Fake EOL when hit EOF for the first time. This gets line * count right if last line in included file is syntactically * invalid and has no newline. */ if (file->eof_reached == 0) { file->eof_reached = 1; return ('\n'); } while (c == EOF) { if (file == topfile || popfile() == EOF) return (EOF); c = igetc(); } } return (c); } void lungetc(int c) { if (c == EOF) return; if (file->ungetpos >= file->ungetsize) { void *p = reallocarray(file->ungetbuf, file->ungetsize, 2); if (p == NULL) fatal("%s", __func__); file->ungetbuf = p; file->ungetsize *= 2; } file->ungetbuf[file->ungetpos++] = c; } int findeol(void) { int c; /* skip to either EOF or the first real EOL */ while (1) { c = lgetc(0); if (c == '\n') { file->lineno++; break; } if (c == EOF) break; } return (ERROR); } int yylex(void) { char buf[8096]; char *p, *val; int quotec, next, c; int token; top: p = buf; while ((c = lgetc(0)) == ' ' || c == '\t') ; /* nothing */ yylval.lineno = file->lineno; if (c == '#') while ((c = lgetc(0)) != '\n' && c != EOF) ; /* nothing */ if (c == '$' && !expanding) { while (1) { if ((c = lgetc(0)) == EOF) return (0); if (p + 1 >= buf + sizeof(buf) - 1) { yyerror("string too long"); return (findeol()); } if (isalnum(c) || c == '_') { *p++ = c; continue; } *p = '\0'; lungetc(c); break; } val = symget(buf); if (val == NULL) { yyerror("macro '%s' not defined", buf); return (findeol()); } p = val + strlen(val) - 1; lungetc(DONE_EXPAND); while (p >= val) { lungetc((unsigned char)*p); p--; } lungetc(START_EXPAND); goto top; } switch (c) { case '\'': case '"': quotec = c; while (1) { if ((c = lgetc(quotec)) == EOF) return (0); if (c == '\n') { file->lineno++; continue; } else if (c == '\\') { if ((next = lgetc(quotec)) == EOF) return (0); if (next == quotec || next == ' ' || next == '\t') c = next; else if (next == '\n') { file->lineno++; continue; } else lungetc(next); } else if (c == quotec) { *p = '\0'; break; } else if (c == '\0') { yyerror("syntax error"); return (findeol()); } if (p + 1 >= buf + sizeof(buf) - 1) { yyerror("string too long"); return (findeol()); } *p++ = c; } yylval.v.string = strdup(buf); if (yylval.v.string == NULL) fatal("%s", __func__); return (STRING); } #define allowed_to_end_number(x) \ (isspace(x) || x == ')' || x ==',' || x == '/' || x == '}' || x == '=') if (c == '-' || isdigit(c)) { do { *p++ = c; if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } } while ((c = lgetc(0)) != EOF && isdigit(c)); lungetc(c); if (p == buf + 1 && buf[0] == '-') goto nodigits; if (c == EOF || allowed_to_end_number(c)) { const char *errstr = NULL; *p = '\0'; yylval.v.number = strtonum(buf, LLONG_MIN, LLONG_MAX, &errstr); if (errstr) { yyerror("\"%s\" invalid number: %s", buf, errstr); return (findeol()); } return (NUMBER); } else { nodigits: while (p > buf + 1) lungetc((unsigned char)*--p); c = (unsigned char)*--p; if (c == '-') return (c); } } if (c == '=') { if ((c = lgetc(0)) != EOF && c == '>') return (ARROW); lungetc(c); c = '='; } #define allowed_in_string(x) \ (isalnum(x) || (ispunct(x) && x != '(' && x != ')' && \ x != '{' && x != '}' && x != '<' && x != '>' && \ x != '!' && x != '=' && x != '#' && \ x != ',')) if (isalnum(c) || c == ':' || c == '_') { do { *p++ = c; if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } } while ((c = lgetc(0)) != EOF && (allowed_in_string(c))); lungetc(c); *p = '\0'; if ((token = lookup(buf)) == STRING) if ((yylval.v.string = strdup(buf)) == NULL) fatal("%s", __func__); return (token); } if (c == '\n') { yylval.lineno = file->lineno; file->lineno++; } if (c == EOF) return (0); return (c); } int check_file_secrecy(int fd, const char *fname) { struct stat st; if (fstat(fd, &st)) { log_warn("warn: cannot stat %s", fname); return (-1); } if (st.st_uid != 0 && st.st_uid != getuid()) { log_warnx("warn: %s: owner not root or current user", fname); return (-1); } if (st.st_mode & (S_IWGRP | S_IXGRP | S_IRWXO)) { log_warnx("warn: %s: group/world readable/writeable", fname); return (-1); } return (0); } struct file * pushfile(const char *name, int secret) { struct file *nfile; if ((nfile = calloc(1, sizeof(struct file))) == NULL) { log_warn("%s", __func__); return (NULL); } if ((nfile->name = strdup(name)) == NULL) { log_warn("%s", __func__); free(nfile); return (NULL); } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { log_warn("%s: %s", __func__, nfile->name); free(nfile->name); free(nfile); return (NULL); } else if (secret && check_file_secrecy(fileno(nfile->stream), nfile->name)) { fclose(nfile->stream); free(nfile->name); free(nfile); return (NULL); } nfile->lineno = TAILQ_EMPTY(&files) ? 1 : 0; nfile->ungetsize = 16; nfile->ungetbuf = malloc(nfile->ungetsize); if (nfile->ungetbuf == NULL) { log_warn("%s", __func__); fclose(nfile->stream); free(nfile->name); free(nfile); return (NULL); } TAILQ_INSERT_TAIL(&files, nfile, entry); return (nfile); } int popfile(void) { struct file *prev; if ((prev = TAILQ_PREV(file, files, entry)) != NULL) prev->errors += file->errors; TAILQ_REMOVE(&files, file, entry); fclose(file->stream); free(file->name); free(file->ungetbuf); free(file); file = prev; return (file ? 0 : EOF); } int parse_config(struct smtpd *x_conf, const char *filename, int opts) { struct sym *sym, *next; conf = x_conf; errors = 0; if ((file = pushfile(filename, 0)) == NULL) { purge_config(PURGE_EVERYTHING); return (-1); } topfile = file; /* * parse configuration */ setservent(1); yyparse(); errors = file->errors; popfile(); endservent(); /* If the socket listener was not configured, create a default one. */ if (!conf->sc_sock_listener) { memset(&listen_opts, 0, sizeof listen_opts); listen_opts.family = AF_UNSPEC; listen_opts.flags |= F_EXT_DSN; create_sock_listener(&listen_opts); } /* Free macros and check which have not been used. */ TAILQ_FOREACH_SAFE(sym, &symhead, entry, next) { if ((conf->sc_opts & SMTPD_OPT_VERBOSE) && !sym->used) fprintf(stderr, "warning: macro '%s' not " "used\n", sym->nam); if (!sym->persist) { free(sym->nam); free(sym->val); TAILQ_REMOVE(&symhead, sym, entry); free(sym); } } if (TAILQ_EMPTY(conf->sc_rules)) { log_warnx("warn: no rules, nothing to do"); errors++; } if (errors) { purge_config(PURGE_EVERYTHING); return (-1); } return (0); } int symset(const char *nam, const char *val, int persist) { struct sym *sym; TAILQ_FOREACH(sym, &symhead, entry) { if (strcmp(nam, sym->nam) == 0) break; } if (sym != NULL) { if (sym->persist == 1) return (0); else { free(sym->nam); free(sym->val); TAILQ_REMOVE(&symhead, sym, entry); free(sym); } } if ((sym = calloc(1, sizeof(*sym))) == NULL) return (-1); sym->nam = strdup(nam); if (sym->nam == NULL) { free(sym); return (-1); } sym->val = strdup(val); if (sym->val == NULL) { free(sym->nam); free(sym); return (-1); } sym->used = 0; sym->persist = persist; TAILQ_INSERT_TAIL(&symhead, sym, entry); return (0); } int cmdline_symset(char *s) { char *sym, *val; int ret; if ((val = strrchr(s, '=')) == NULL) return (-1); sym = strndup(s, val - s); if (sym == NULL) fatalx("%s: strndup", __func__); ret = symset(sym, val + 1, 1); free(sym); return (ret); } char * symget(const char *nam) { struct sym *sym; TAILQ_FOREACH(sym, &symhead, entry) { if (strcmp(nam, sym->nam) == 0) { sym->used = 1; return (sym->val); } } return (NULL); } static void create_sock_listener(struct listen_opts *lo) { struct listener *l = xcalloc(1, sizeof(*l)); lo->hostname = conf->sc_hostname; l->ss.ss_family = AF_LOCAL; #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN l->ss.ss_len = sizeof(struct sockaddr *); #endif l->local = 1; conf->sc_sock_listener = l; config_listener(l, lo); } static void create_if_listener(struct listen_opts *lo) { uint16_t flags; if (lo->port != 0 && lo->ssl == F_SSL) fatalx("invalid listen option: tls/smtps on same port"); if (lo->auth != 0 && !lo->ssl) fatalx("invalid listen option: auth requires tls/smtps"); if (lo->pkicount && !lo->ssl) fatalx("invalid listen option: pki requires tls/smtps"); if (lo->pkicount == 0 && lo->ssl) fatalx("invalid listen option: pki required for tls/smtps"); flags = lo->flags; if (lo->port) { lo->flags = lo->ssl|lo->auth|flags; lo->port = htons(lo->port); } else { if (lo->ssl & F_SMTPS) { lo->port = htons(465); lo->flags = F_SMTPS|lo->auth|flags; } if (!lo->ssl || (lo->ssl & F_STARTTLS)) { lo->port = htons(25); lo->flags = lo->auth|flags; if (lo->ssl & F_STARTTLS) lo->flags |= F_STARTTLS; } } if (interface(lo)) return; if (host_v4(lo)) return; if (host_v6(lo)) return; if (host_dns(lo)) return; fatalx("invalid virtual ip or interface: %s", lo->ifx); } static void config_listener(struct listener *h, struct listen_opts *lo) { int i; h->fd = -1; h->port = lo->port; h->flags = lo->flags; if (lo->hostname == NULL) lo->hostname = conf->sc_hostname; if (lo->options & LO_FILTER) { h->flags |= F_FILTERED; (void)strlcpy(h->filter_name, lo->filtername, sizeof(h->filter_name)); } if (lo->authtable != NULL) (void)strlcpy(h->authtable, lo->authtable->t_name, sizeof(h->authtable)); h->pkicount = lo->pkicount; if (h->pkicount) { h->pki = calloc(h->pkicount, sizeof(*h->pki)); if (h->pki == NULL) fatal("calloc"); } for (i = 0; i < lo->pkicount; i++) { h->pki[i] = dict_get(conf->sc_pki_dict, lo->pki[i]); if (h->pki[i] == NULL) { log_warnx("pki name not found: %s", lo->pki[i]); fatalx(NULL); } } if (lo->tls_ciphers != NULL && (h->tls_ciphers = strdup(lo->tls_ciphers)) == NULL) { fatal("strdup"); } if (lo->tls_protocols != NULL && (h->tls_protocols = strdup(lo->tls_protocols)) == NULL) { fatal("strdup"); } if (lo->ca != NULL) { if (!lowercase(h->ca_name, lo->ca, sizeof(h->ca_name))) { log_warnx("ca name too long: %s", lo->ca); fatalx(NULL); } if (dict_get(conf->sc_ca_dict, h->ca_name) == NULL) { log_warnx("ca name not found: %s", lo->ca); fatalx(NULL); } } if (lo->tag != NULL) (void)strlcpy(h->tag, lo->tag, sizeof(h->tag)); (void)strlcpy(h->hostname, lo->hostname, sizeof(h->hostname)); if (lo->hostnametable) (void)strlcpy(h->hostnametable, lo->hostnametable->t_name, sizeof(h->hostnametable)); if (lo->sendertable) { (void)strlcpy(h->sendertable, lo->sendertable->t_name, sizeof(h->sendertable)); if (lo->options & LO_MASQUERADE) h->flags |= F_MASQUERADE; } if (lo->ssl & F_TLS_VERIFY) h->flags |= F_TLS_VERIFY; if (lo->ssl & F_STARTTLS_REQUIRE) h->flags |= F_STARTTLS_REQUIRE; if (h != conf->sc_sock_listener) TAILQ_INSERT_TAIL(conf->sc_listeners, h, entry); } static int host_v4(struct listen_opts *lo) { struct in_addr ina; struct sockaddr_in *sain; struct listener *h; if (lo->family != AF_UNSPEC && lo->family != AF_INET) return (0); memset(&ina, 0, sizeof(ina)); if (inet_pton(AF_INET, lo->ifx, &ina) != 1) return (0); h = xcalloc(1, sizeof(*h)); sain = (struct sockaddr_in *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_family = AF_INET; sain->sin_addr.s_addr = ina.s_addr; sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; config_listener(h, lo); return (1); } static int host_v6(struct listen_opts *lo) { struct in6_addr ina6; struct sockaddr_in6 *sin6; struct listener *h; if (lo->family != AF_UNSPEC && lo->family != AF_INET6) return (0); memset(&ina6, 0, sizeof(ina6)); if (inet_pton(AF_INET6, lo->ifx, &ina6) != 1) return (0); h = xcalloc(1, sizeof(*h)); sin6 = (struct sockaddr_in6 *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_family = AF_INET6; sin6->sin6_port = lo->port; memcpy(&sin6->sin6_addr, &ina6, sizeof(ina6)); if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; config_listener(h, lo); return (1); } static int host_dns(struct listen_opts *lo) { struct addrinfo hints, *res0, *res; int error, cnt = 0; struct sockaddr_in *sain; struct sockaddr_in6 *sin6; struct listener *h; memset(&hints, 0, sizeof(hints)); hints.ai_family = lo->family; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_ADDRCONFIG; error = getaddrinfo(lo->ifx, NULL, &hints, &res0); if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME) return (0); if (error) { log_warnx("warn: host_dns: could not parse \"%s\": %s", lo->ifx, gai_strerror(error)); return (-1); } for (res = res0; res; res = res->ai_next) { if (res->ai_family != AF_INET && res->ai_family != AF_INET6) continue; h = xcalloc(1, sizeof(*h)); h->ss.ss_family = res->ai_family; if (res->ai_family == AF_INET) { sain = (struct sockaddr_in *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_addr.s_addr = ((struct sockaddr_in *) res->ai_addr)->sin_addr.s_addr; sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; } else { sin6 = (struct sockaddr_in6 *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif memcpy(&sin6->sin6_addr, &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr, sizeof(struct in6_addr)); sin6->sin6_port = lo->port; if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; } config_listener(h, lo); cnt++; } freeaddrinfo(res0); return (cnt); } static int interface(struct listen_opts *lo) { struct ifaddrs *ifap, *p; struct sockaddr_in *sain; struct sockaddr_in6 *sin6; struct listener *h; int ret = 0; if (getifaddrs(&ifap) == -1) fatal("getifaddrs"); for (p = ifap; p != NULL; p = p->ifa_next) { if (p->ifa_addr == NULL) continue; if (strcmp(p->ifa_name, lo->ifx) != 0 && !is_if_in_group(p->ifa_name, lo->ifx)) continue; if (lo->family != AF_UNSPEC && lo->family != p->ifa_addr->sa_family) continue; h = xcalloc(1, sizeof(*h)); switch (p->ifa_addr->sa_family) { case AF_INET: sain = (struct sockaddr_in *)&h->ss; *sain = *(struct sockaddr_in *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; break; case AF_INET6: sin6 = (struct sockaddr_in6 *)&h->ss; *sin6 = *(struct sockaddr_in6 *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_port = lo->port; #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sin6->sin6_addr) || #ifdef USE_IPV6_ADDR_SCOPE_NODELOCAL IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) && #else IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr)) && #endif sin6->sin6_scope_id == 0) { sin6->sin6_scope_id = ntohs( *(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); sin6->sin6_addr.s6_addr[2] = 0; sin6->sin6_addr.s6_addr[3] = 0; } #endif if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; break; default: free(h); continue; } config_listener(h, lo); ret = 1; } freeifaddrs(ifap); return ret; } int delaytonum(char *str) { unsigned int factor; size_t len; const char *errstr = NULL; int delay; /* we need at least 1 digit and 1 unit */ len = strlen(str); if (len < 2) goto bad; switch(str[len - 1]) { case 's': factor = 1; break; case 'm': factor = 60; break; case 'h': factor = 60 * 60; break; case 'd': factor = 24 * 60 * 60; break; default: goto bad; } str[len - 1] = '\0'; delay = strtonum(str, 1, INT_MAX / factor, &errstr); if (errstr) goto bad; return (delay * factor); bad: return (-1); } int is_if_in_group(const char *ifname, const char *groupname) { #ifdef HAVE_STRUCT_IFGROUPREQ unsigned int len; struct ifgroupreq ifgr; struct ifg_req *ifg; int s; int ret = 0; if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) fatal("socket"); memset(&ifgr, 0, sizeof(ifgr)); if (strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ) >= IFNAMSIZ) fatalx("interface name too large"); if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { if (errno == EINVAL || errno == ENOTTY) goto end; fatal("SIOCGIFGROUP"); } len = ifgr.ifgr_len; ifgr.ifgr_groups = xcalloc(len/sizeof(struct ifg_req), sizeof(struct ifg_req)); if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) fatal("SIOCGIFGROUP"); ifg = ifgr.ifgr_groups; for (; ifg && len >= sizeof(struct ifg_req); ifg++) { len -= sizeof(struct ifg_req); if (strcmp(ifg->ifgrq_group, groupname) == 0) { ret = 1; break; } } free(ifgr.ifgr_groups); end: close(s); return ret; #else return (0); #endif } static int config_lo_mask_source(struct listen_opts *lo) { if (lo->options & LO_MASKSOURCE) { yyerror("mask-source already specified"); return -1; } lo->options |= LO_MASKSOURCE; lo->flags |= F_MASK_SOURCE; return 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/crypto.c0000644000175000001440000002120014665030612014027 /* $OpenBSD: crypto.c,v 1.10 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2013 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #define CRYPTO_BUFFER_SIZE 16384 #define GCM_TAG_SIZE 16 #define IV_SIZE 12 #define KEY_SIZE 32 /* bump if we ever switch from aes-256-gcm to anything else */ #define API_VERSION 1 int crypto_setup(const char *, size_t); int crypto_encrypt_file(FILE *, FILE *); int crypto_decrypt_file(FILE *, FILE *); size_t crypto_encrypt_buffer(const char *, size_t, char *, size_t); size_t crypto_decrypt_buffer(const char *, size_t, char *, size_t); static struct crypto_ctx { unsigned char key[KEY_SIZE]; } cp; int crypto_setup(const char *key, size_t len) { if (len != KEY_SIZE) return 0; memset(&cp, 0, sizeof cp); /* openssl rand -hex 16 */ memcpy(cp.key, key, sizeof cp.key); return 1; } int crypto_encrypt_file(FILE * in, FILE * out) { EVP_CIPHER_CTX *ctx; uint8_t ibuf[CRYPTO_BUFFER_SIZE]; uint8_t obuf[CRYPTO_BUFFER_SIZE]; uint8_t iv[IV_SIZE]; uint8_t tag[GCM_TAG_SIZE]; uint8_t version = API_VERSION; size_t r; int len; int ret = 0; struct stat sb; /* XXX - Do NOT encrypt files bigger than 64GB */ if (fstat(fileno(in), &sb) == -1) return 0; if (sb.st_size >= 0x1000000000LL) return 0; /* prepend version byte*/ if (fwrite(&version, 1, sizeof version, out) != sizeof version) return 0; /* generate and prepend IV */ memset(iv, 0, sizeof iv); arc4random_buf(iv, sizeof iv); if (fwrite(iv, 1, sizeof iv, out) != sizeof iv) return 0; ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) return 0; EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv); /* encrypt until end of file */ while ((r = fread(ibuf, 1, CRYPTO_BUFFER_SIZE, in)) != 0) { if (!EVP_EncryptUpdate(ctx, obuf, &len, ibuf, r)) goto end; if (len && fwrite(obuf, len, 1, out) != 1) goto end; } if (!feof(in)) goto end; /* finalize and write last chunk if any */ if (!EVP_EncryptFinal_ex(ctx, obuf, &len)) goto end; if (len && fwrite(obuf, len, 1, out) != 1) goto end; /* get and append tag */ EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, sizeof tag, tag); if (fwrite(tag, sizeof tag, 1, out) != 1) goto end; fflush(out); ret = 1; end: EVP_CIPHER_CTX_free(ctx); return ret; } int crypto_decrypt_file(FILE * in, FILE * out) { EVP_CIPHER_CTX *ctx; uint8_t ibuf[CRYPTO_BUFFER_SIZE]; uint8_t obuf[CRYPTO_BUFFER_SIZE]; uint8_t iv[IV_SIZE]; uint8_t tag[GCM_TAG_SIZE]; uint8_t version; size_t r; off_t sz; int len; int ret = 0; struct stat sb; /* input file too small to be an encrypted file */ if (fstat(fileno(in), &sb) == -1) return 0; if (sb.st_size <= (off_t) (sizeof version + sizeof tag + sizeof iv)) return 0; sz = sb.st_size; /* extract tag */ if (fseek(in, -sizeof(tag), SEEK_END) == -1) return 0; if ((r = fread(tag, 1, sizeof tag, in)) != sizeof tag) return 0; if (fseek(in, 0, SEEK_SET) == -1) return 0; /* extract version */ if ((r = fread(&version, 1, sizeof version, in)) != sizeof version) return 0; if (version != API_VERSION) return 0; /* extract IV */ memset(iv, 0, sizeof iv); if ((r = fread(iv, 1, sizeof iv, in)) != sizeof iv) return 0; /* real ciphertext length */ sz -= sizeof version; sz -= sizeof iv; sz -= sizeof tag; ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) return 0; EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv); /* set expected tag */ EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof tag, tag); /* decrypt until end of ciphertext */ while (sz) { if (sz > CRYPTO_BUFFER_SIZE) r = fread(ibuf, 1, CRYPTO_BUFFER_SIZE, in); else r = fread(ibuf, 1, sz, in); if (!r) break; if (!EVP_DecryptUpdate(ctx, obuf, &len, ibuf, r)) goto end; if (len && fwrite(obuf, len, 1, out) != 1) goto end; sz -= r; } if (ferror(in)) goto end; /* finalize, write last chunk if any and perform authentication check */ if (!EVP_DecryptFinal_ex(ctx, obuf, &len)) goto end; if (len && fwrite(obuf, len, 1, out) != 1) goto end; fflush(out); ret = 1; end: EVP_CIPHER_CTX_free(ctx); return ret; } size_t crypto_encrypt_buffer(const char *in, size_t inlen, char *out, size_t outlen) { EVP_CIPHER_CTX *ctx; uint8_t iv[IV_SIZE]; uint8_t tag[GCM_TAG_SIZE]; uint8_t version = API_VERSION; off_t sz; int olen; int len = 0; int ret = 0; /* output buffer does not have enough room */ if (outlen < inlen + sizeof version + sizeof tag + sizeof iv) return 0; /* input should not exceed 64GB */ sz = inlen; if (sz >= 0x1000000000LL) return 0; /* prepend version */ *out = version; len++; /* generate IV */ memset(iv, 0, sizeof iv); arc4random_buf(iv, sizeof iv); memcpy(out + len, iv, sizeof iv); len += sizeof iv; ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) return 0; EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv); /* encrypt buffer */ if (!EVP_EncryptUpdate(ctx, out + len, &olen, in, inlen)) goto end; len += olen; /* finalize and write last chunk if any */ if (!EVP_EncryptFinal_ex(ctx, out + len, &olen)) goto end; len += olen; /* get and append tag */ EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, sizeof tag, tag); memcpy(out + len, tag, sizeof tag); ret = len + sizeof tag; end: EVP_CIPHER_CTX_free(ctx); return ret; } size_t crypto_decrypt_buffer(const char *in, size_t inlen, char *out, size_t outlen) { EVP_CIPHER_CTX *ctx; uint8_t iv[IV_SIZE]; uint8_t tag[GCM_TAG_SIZE]; int olen; int len = 0; int ret = 0; /* out does not have enough room */ if (outlen < inlen - sizeof tag + sizeof iv) return 0; /* extract tag */ memcpy(tag, in + inlen - sizeof tag, sizeof tag); inlen -= sizeof tag; /* check version */ if (*in != API_VERSION) return 0; in++; inlen--; /* extract IV */ memset(iv, 0, sizeof iv); memcpy(iv, in, sizeof iv); inlen -= sizeof iv; in += sizeof iv; ctx = EVP_CIPHER_CTX_new(); if (ctx == NULL) return 0; EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv); /* set expected tag */ EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof tag, tag); /* decrypt buffer */ if (!EVP_DecryptUpdate(ctx, out, &olen, in, inlen)) goto end; len += olen; /* finalize, write last chunk if any and perform authentication check */ if (!EVP_DecryptFinal_ex(ctx, out + len, &olen)) goto end; ret = len + olen; end: EVP_CIPHER_CTX_free(ctx); return ret; } #if 0 int main(int argc, char *argv[]) { if (argc != 3) { printf("usage: crypto \n"); return 1; } if (!crypto_setup(argv[1], strlen(argv[1]))) { printf("crypto_setup failed\n"); return 1; } { char encbuffer[4096]; size_t enclen; char decbuffer[4096]; size_t declen; printf("encrypt/decrypt buffer: "); enclen = crypto_encrypt_buffer(argv[2], strlen(argv[2]), encbuffer, sizeof encbuffer); /* uncomment below to provoke integrity check failure */ /* * encbuffer[13] = 0x42; * encbuffer[14] = 0x42; * encbuffer[15] = 0x42; * encbuffer[16] = 0x42; */ declen = crypto_decrypt_buffer(encbuffer, enclen, decbuffer, sizeof decbuffer); if (declen != 0 && !strncmp(argv[2], decbuffer, declen)) printf("ok\n"); else printf("nope\n"); } { FILE *fpin; FILE *fpout; printf("encrypt/decrypt file: "); fpin = fopen("/etc/passwd", "r"); fpout = fopen("/tmp/passwd.enc", "w"); if (!crypto_encrypt_file(fpin, fpout)) { printf("encryption failed\n"); return 1; } fclose(fpin); fclose(fpout); /* uncomment below to provoke integrity check failure */ /* * fpin = fopen("/tmp/passwd.enc", "a"); * fprintf(fpin, "borken"); * fclose(fpin); */ fpin = fopen("/tmp/passwd.enc", "r"); fpout = fopen("/tmp/passwd.dec", "w"); if (!crypto_decrypt_file(fpin, fpout)) printf("nope\n"); else printf("ok\n"); fclose(fpin); fclose(fpout); } return 0; } #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/dispatcher.c0000644000175000001440000001105114610663500014636 /* $OpenBSD: dispatcher.c,v 1.7 2022/02/18 16:57:36 millert Exp $ */ /* * Copyright (c) 2014 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include "smtpd.h" #include "log.h" void mda_imsg(struct mproc *, struct imsg *); void mta_imsg(struct mproc *, struct imsg *); void smtp_imsg(struct mproc *, struct imsg *); static void dispatcher_shutdown(void); void dispatcher_imsg(struct mproc *p, struct imsg *imsg) { struct msg m; int v; if (imsg == NULL) dispatcher_shutdown(); switch (imsg->hdr.type) { case IMSG_GETADDRINFO: case IMSG_GETADDRINFO_END: case IMSG_GETNAMEINFO: case IMSG_RES_QUERY: resolver_dispatch_result(p, imsg); return; case IMSG_CONF_START: return; case IMSG_CONF_END: smtp_configure(); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_trace_verbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; /* smtp imsg */ case IMSG_SMTP_CHECK_SENDER: case IMSG_SMTP_EXPAND_RCPT: case IMSG_SMTP_LOOKUP_HELO: case IMSG_SMTP_AUTHENTICATE: case IMSG_SMTP_MESSAGE_COMMIT: case IMSG_SMTP_MESSAGE_CREATE: case IMSG_SMTP_MESSAGE_OPEN: case IMSG_FILTER_SMTP_PROTOCOL: case IMSG_FILTER_SMTP_DATA_BEGIN: case IMSG_QUEUE_ENVELOPE_SUBMIT: case IMSG_QUEUE_ENVELOPE_COMMIT: case IMSG_QUEUE_SMTP_SESSION: case IMSG_CTL_SMTP_SESSION: case IMSG_CTL_PAUSE_SMTP: case IMSG_CTL_RESUME_SMTP: smtp_imsg(p, imsg); return; /* mta imsg */ case IMSG_QUEUE_TRANSFER: case IMSG_MTA_OPEN_MESSAGE: case IMSG_MTA_LOOKUP_CREDENTIALS: case IMSG_MTA_LOOKUP_SMARTHOST: case IMSG_MTA_LOOKUP_SOURCE: case IMSG_MTA_LOOKUP_HELO: case IMSG_MTA_DNS_HOST: case IMSG_MTA_DNS_HOST_END: case IMSG_MTA_DNS_MX_PREFERENCE: case IMSG_CTL_RESUME_ROUTE: case IMSG_CTL_MTA_SHOW_HOSTS: case IMSG_CTL_MTA_SHOW_RELAYS: case IMSG_CTL_MTA_SHOW_ROUTES: case IMSG_CTL_MTA_SHOW_HOSTSTATS: case IMSG_CTL_MTA_BLOCK: case IMSG_CTL_MTA_UNBLOCK: case IMSG_CTL_MTA_SHOW_BLOCK: mta_imsg(p, imsg); return; /* mda imsg */ case IMSG_MDA_LOOKUP_USERINFO: case IMSG_QUEUE_DELIVER: case IMSG_MDA_OPEN_MESSAGE: case IMSG_MDA_FORK: case IMSG_MDA_DONE: mda_imsg(p, imsg); return; default: break; } fatalx("session_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } static void dispatcher_shutdown(void) { log_debug("debug: dispatcher agent exiting"); _exit(0); } int dispatcher(void) { struct passwd *pw; ca_engine_init(); mda_postfork(); mta_postfork(); smtp_postfork(); /* do not purge listeners and pki, they are purged * in smtp_configure() */ purge_config(PURGE_TABLES|PURGE_RULES); if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); if (chroot(PATH_CHROOT) == -1) fatal("dispatcher: chroot"); if (chdir("/") == -1) fatal("dispatcher: chdir(\"/\")"); config_process(PROC_DISPATCHER); if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("dispatcher: cannot drop privileges"); imsg_callback = dispatcher_imsg; event_init(); mda_postprivdrop(); mta_postprivdrop(); smtp_postprivdrop(); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); config_peer(PROC_PARENT); config_peer(PROC_QUEUE); config_peer(PROC_LKA); config_peer(PROC_CONTROL); config_peer(PROC_CA); #if HAVE_PLEDGE if (pledge("stdio inet unix recvfd sendfd", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } opensmtpd-7.7.0p0/usr.sbin/smtpd/util.c0000644000175000001440000004047514674615567013525 /* $OpenBSD: util.c,v 1.159 2024/06/02 23:26:39 jsg Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static int parse_mailname_file(char *, size_t); int tracing = 0; int foreground_log = 0; void * xmalloc(size_t size) { void *r; if ((r = malloc(size)) == NULL) fatal("malloc"); return (r); } void * xcalloc(size_t nmemb, size_t size) { void *r; if ((r = calloc(nmemb, size)) == NULL) fatal("calloc"); return (r); } char * xstrdup(const char *str) { char *r; if ((r = strdup(str)) == NULL) fatal("strdup"); return (r); } void * xmemdup(const void *ptr, size_t size) { void *r; if ((r = malloc(size)) == NULL) fatal("malloc"); memmove(r, ptr, size); return (r); } int xasprintf(char **ret, const char *format, ...) { int r; va_list ap; va_start(ap, format); r = vasprintf(ret, format, ap); va_end(ap); if (r == -1) fatal("vasprintf"); return (r); } #if !defined(NO_IO) int io_xprintf(struct io *io, const char *fmt, ...) { va_list ap; int len; va_start(ap, fmt); len = io_vprintf(io, fmt, ap); va_end(ap); if (len == -1) fatal("io_xprintf(%p, %s, ...)", io, fmt); return len; } int io_xprint(struct io *io, const char *str) { int len; len = io_print(io, str); if (len == -1) fatal("io_xprint(%p, %s, ...)", io, str); return len; } #endif char * strip(char *s) { size_t l; while (isspace((unsigned char)*s)) s++; for (l = strlen(s); l; l--) { if (!isspace((unsigned char)s[l-1])) break; s[l-1] = '\0'; } return (s); } int bsnprintf(char *str, size_t size, const char *format, ...) { int ret; va_list ap; va_start(ap, format); ret = vsnprintf(str, size, format, ap); va_end(ap); if (ret < 0 || (size_t)ret >= size) return 0; return 1; } int ckdir(const char *path, mode_t mode, uid_t owner, gid_t group, int create) { char mode_str[12]; int ret; struct stat sb; if (stat(path, &sb) == -1) { if (errno != ENOENT || create == 0) { log_warn("stat: %s", path); return (0); } /* chmod is deferred to avoid umask effect */ if (mkdir(path, 0) == -1) { log_warn("mkdir: %s", path); return (0); } if (chown(path, owner, group) == -1) { log_warn("chown: %s", path); return (0); } if (chmod(path, mode) == -1) { log_warn("chmod: %s", path); return (0); } if (stat(path, &sb) == -1) { log_warn("stat: %s", path); return (0); } } ret = 1; /* check if it's a directory */ if (!S_ISDIR(sb.st_mode)) { ret = 0; log_warnx("%s is not a directory", path); } /* check that it is owned by owner/group */ if (sb.st_uid != owner) { ret = 0; log_warnx("%s is not owned by uid %d", path, owner); } if (sb.st_gid != group) { ret = 0; log_warnx("%s is not owned by gid %d", path, group); } /* check permission */ if ((sb.st_mode & 07777) != mode) { ret = 0; strmode(mode, mode_str); mode_str[10] = '\0'; log_warnx("%s must be %s (%o)", path, mode_str + 1, mode); } return ret; } int rmtree(char *path, int keepdir) { char *path_argv[2]; FTS *fts; FTSENT *e; int ret, depth; path_argv[0] = path; path_argv[1] = NULL; ret = 0; depth = 0; fts = fts_open(path_argv, FTS_PHYSICAL | FTS_NOCHDIR, NULL); if (fts == NULL) { log_warn("fts_open: %s", path); return (-1); } while ((e = fts_read(fts)) != NULL) { switch (e->fts_info) { case FTS_D: depth++; break; case FTS_DP: case FTS_DNR: depth--; if (keepdir && depth == 0) continue; if (rmdir(e->fts_path) == -1) { log_warn("rmdir: %s", e->fts_path); ret = -1; } break; case FTS_F: if (unlink(e->fts_path) == -1) { log_warn("unlink: %s", e->fts_path); ret = -1; } } } fts_close(fts); return (ret); } int mvpurge(char *from, char *to) { size_t n; int retry; const char *sep; char buf[PATH_MAX]; if ((n = strlen(to)) == 0) fatalx("to is empty"); sep = (to[n - 1] == '/') ? "" : "/"; retry = 0; again: (void)snprintf(buf, sizeof buf, "%s%s%u", to, sep, arc4random()); if (rename(from, buf) == -1) { /* ENOTDIR has actually 2 meanings, and incorrect input * could lead to an infinite loop. Consider that after * 20 tries something is hopelessly wrong. */ if (errno == ENOTEMPTY || errno == EISDIR || errno == ENOTDIR) { if ((retry++) >= 20) return (-1); goto again; } return -1; } return 0; } int mktmpfile(void) { char path[PATH_MAX]; int fd; if (!bsnprintf(path, sizeof(path), "%s/smtpd.XXXXXXXXXX", PATH_TEMPORARY)) { log_warn("snprintf"); fatal("exiting"); } if ((fd = mkstemp(path)) == -1) { log_warn("cannot create temporary file %s", path); fatal("exiting"); } unlink(path); return (fd); } /* Close file, signifying temporary error condition (if any) to the caller. */ int safe_fclose(FILE *fp) { if (ferror(fp)) { fclose(fp); return 0; } if (fflush(fp)) { fclose(fp); if (errno == ENOSPC) return 0; fatal("safe_fclose: fflush"); } if (fsync(fileno(fp))) fatal("safe_fclose: fsync"); if (fclose(fp)) fatal("safe_fclose: fclose"); return 1; } int hostname_match(const char *hostname, const char *pattern) { while (*pattern != '\0' && *hostname != '\0') { if (*pattern == '*') { while (*pattern == '*') pattern++; while (*hostname != '\0' && tolower((unsigned char)*hostname) != tolower((unsigned char)*pattern)) hostname++; continue; } if (tolower((unsigned char)*pattern) != tolower((unsigned char)*hostname)) return 0; pattern++; hostname++; } return (*hostname == '\0' && *pattern == '\0'); } int mailaddr_match(const struct mailaddr *maddr1, const struct mailaddr *maddr2) { struct mailaddr m1 = *maddr1; struct mailaddr m2 = *maddr2; char *p; /* catchall */ if (m2.user[0] == '\0' && m2.domain[0] == '\0') return 1; if (m2.domain[0] && !hostname_match(m1.domain, m2.domain)) return 0; if (m2.user[0]) { /* if address from table has a tag, we must respect it */ if (strchr(m2.user, *env->sc_subaddressing_delim) == NULL) { /* otherwise, strip tag from session address if any */ p = strchr(m1.user, *env->sc_subaddressing_delim); if (p) *p = '\0'; } if (strcasecmp(m1.user, m2.user)) return 0; } return 1; } int valid_localpart(const char *s) { #define IS_ATEXT(c) (isalnum((unsigned char)(c)) || strchr(MAILADDR_ALLOWED, (c))) nextatom: if (!IS_ATEXT(*s) || *s == '\0') return 0; while (*(++s) != '\0') { if (*s == '.') break; if (IS_ATEXT(*s)) continue; return 0; } if (*s == '.') { s++; goto nextatom; } return 1; } int valid_domainpart(const char *s) { struct in_addr ina; struct in6_addr ina6; char *c, domain[SMTPD_MAXDOMAINPARTSIZE]; const char *p; size_t dlen; if (*s == '[') { if (strncasecmp("[IPv6:", s, 6) == 0) p = s + 6; else p = s + 1; if (strlcpy(domain, p, sizeof domain) >= sizeof domain) return 0; c = strchr(domain, ']'); if (!c || c[1] != '\0') return 0; *c = '\0'; if (inet_pton(AF_INET6, domain, &ina6) == 1) return 1; if (inet_pton(AF_INET, domain, &ina) == 1) return 1; return 0; } if (*s == '\0') return 0; dlen = strlen(s); if (dlen >= sizeof domain) return 0; if (s[dlen - 1] == '.') return 0; return res_hnok(s); } #define LABELCHR(c) ((c) == '-' || (c) == '_' || isalpha((unsigned char)(c)) || isdigit((unsigned char)(c))) #define LABELMAX 63 #define DNAMEMAX 253 int valid_domainname(const char *str) { const char *label, *s; /* * Expect a sequence of dot-separated labels, possibly with a trailing * dot. The empty string is rejected, as well a single dot. */ for (s = str; *s; s++) { /* Start of a new label. */ label = s; while (LABELCHR(*s)) s++; /* Must have at least one char and at most LABELMAX. */ if (s == label || s - label > LABELMAX) return 0; /* If last label, stop here. */ if (*s == '\0') break; /* Expect a dot as label separator or last char. */ if (*s != '.') return 0; } /* Must have at leat one label and no more than DNAMEMAX chars. */ if (s == str || s - str > DNAMEMAX) return 0; return 1; } int valid_smtp_response(const char *s) { if (strlen(s) < 5) return 0; if ((s[0] < '2' || s[0] > '5') || (s[1] < '0' || s[1] > '9') || (s[2] < '0' || s[2] > '9') || (s[3] != ' ')) return 0; return 1; } int valid_xtext(const char *s) { for (; *s != '\0'; ++s) { if (*s < '!' || *s > '~' || *s == '=') return 0; if (*s != '+') continue; s++; if (!isdigit((unsigned char)*s) && !(*s >= 'A' && *s <= 'F')) return 0; s++; if (!isdigit((unsigned char)*s) && !(*s >= 'A' && *s <= 'F')) return 0; } return 1; } int secure_file(int fd, char *path, char *userdir, uid_t uid, int mayread) { char buf[PATH_MAX]; char homedir[PATH_MAX]; struct stat st; char *cp; if (realpath(path, buf) == NULL) return 0; if (realpath(userdir, homedir) == NULL) homedir[0] = '\0'; /* Check the open file to avoid races. */ if (fstat(fd, &st) == -1 || !S_ISREG(st.st_mode) || st.st_uid != uid || (st.st_mode & (mayread ? 022 : 066)) != 0) return 0; /* For each component of the canonical path, walking upwards. */ for (;;) { if ((cp = dirname(buf)) == NULL) return 0; (void)strlcpy(buf, cp, sizeof(buf)); if (stat(buf, &st) == -1 || (st.st_uid != 0 && st.st_uid != uid) || (st.st_mode & 022) != 0) return 0; /* We can stop checking after reaching homedir level. */ if (strcmp(homedir, buf) == 0) break; /* * dirname should always complete with a "/" path, * but we can be paranoid and check for "." too */ if ((strcmp("/", buf) == 0) || (strcmp(".", buf) == 0)) break; } return 1; } void addargs(arglist *args, char *fmt, ...) { va_list ap; char *cp; uint nalloc; int r; char **tmp; va_start(ap, fmt); r = vasprintf(&cp, fmt, ap); va_end(ap); if (r == -1) fatal("addargs: argument too long"); nalloc = args->nalloc; if (args->list == NULL) { nalloc = 32; args->num = 0; } else if (args->num+2 >= nalloc) nalloc *= 2; tmp = reallocarray(args->list, nalloc, sizeof(char *)); if (tmp == NULL) fatal("addargs: reallocarray"); args->list = tmp; args->nalloc = nalloc; args->list[args->num++] = cp; args->list[args->num] = NULL; } int lowercase(char *buf, const char *s, size_t len) { if (len == 0) return 0; if (strlcpy(buf, s, len) >= len) return 0; while (*buf != '\0') { *buf = tolower((unsigned char)*buf); buf++; } return 1; } int uppercase(char *buf, const char *s, size_t len) { if (len == 0) return 0; if (strlcpy(buf, s, len) >= len) return 0; while (*buf != '\0') { *buf = toupper((unsigned char)*buf); buf++; } return 1; } void xlowercase(char *buf, const char *s, size_t len) { if (len == 0) fatalx("lowercase: len == 0"); if (!lowercase(buf, s, len)) fatalx("lowercase: truncation"); } uint64_t generate_uid(void) { static uint32_t id; static uint8_t inited; uint64_t uid; if (!inited) { id = arc4random(); inited = 1; } while ((uid = ((uint64_t)(id++) << 32 | arc4random())) == 0) ; return (uid); } int session_socket_error(int fd) { int error; socklen_t len; len = sizeof(error); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) == -1) fatal("session_socket_error: getsockopt"); return (error); } const char * parse_smtp_response(char *line, size_t len, char **msg, int *cont) { if (len >= LINE_MAX) return "line too long"; if (len > 3) { if (msg) *msg = line + 4; if (cont) *cont = (line[3] == '-'); } else if (len == 3) { if (msg) *msg = line + 3; if (cont) *cont = 0; } else return "line too short"; /* validate reply code */ if (line[0] < '2' || line[0] > '5' || !isdigit((unsigned char)line[1]) || !isdigit((unsigned char)line[2])) return "reply code out of range"; return NULL; } static int parse_mailname_file(char *hostname, size_t len) { FILE *fp; char *buf = NULL; size_t bufsz = 0; ssize_t buflen; if ((fp = fopen(MAILNAME_FILE, "r")) == NULL) return 1; buflen = getline(&buf, &bufsz, fp); fclose(fp); if (buflen == -1) { free(buf); return 1; } if (buf[buflen - 1] == '\n') buf[buflen - 1] = '\0'; bufsz = strlcpy(hostname, buf, len); free(buf); if (bufsz >= len) { fprintf(stderr, MAILNAME_FILE " entry too long"); return 1; } return 0; } int getmailname(char *hostname, size_t len) { struct addrinfo hints, *res = NULL; int error; /* Try MAILNAME_FILE first */ if (parse_mailname_file(hostname, len) == 0) return 0; /* Next, gethostname(3) */ if (gethostname(hostname, len) == -1) { fprintf(stderr, "getmailname: gethostname() failed\n"); return -1; } if (strchr(hostname, '.') != NULL) return 0; /* Canonicalize if domain part is missing */ memset(&hints, 0, sizeof hints); hints.ai_family = PF_UNSPEC; hints.ai_flags = AI_CANONNAME; error = getaddrinfo(hostname, NULL, &hints, &res); if (error) return 0; /* Continue with non-canon hostname */ if (strlcpy(hostname, res->ai_canonname, len) >= len) { fprintf(stderr, "hostname too long"); freeaddrinfo(res); return -1; } freeaddrinfo(res); return 0; } int base64_encode(unsigned char const *src, size_t srclen, char *dest, size_t destsize) { return __b64_ntop(src, srclen, dest, destsize); } int base64_decode(char const *src, unsigned char *dest, size_t destsize) { return __b64_pton(src, dest, destsize); } int base64_encode_rfc3548(unsigned char const *src, size_t srclen, char *dest, size_t destsize) { size_t i; int ret; if ((ret = base64_encode(src, srclen, dest, destsize)) == -1) return -1; for (i = 0; i < destsize; ++i) { if (dest[i] == '/') dest[i] = '_'; else if (dest[i] == '+') dest[i] = '-'; } return ret; } void log_trace0(const char *emsg, ...) { va_list ap; va_start(ap, emsg); vlog(LOG_DEBUG, emsg, ap); va_end(ap); } void log_trace_verbose(int v) { tracing = v; /* Set debug logging in log.c */ log_setverbose(v & TRACE_DEBUG ? 2 : foreground_log); } int parse_table_line(FILE *fp, char **line, size_t *linesize, int *type, char **key, char **val, int *malformed) { char *keyp, *valp; ssize_t linelen; *key = NULL; *val = NULL; *malformed = 0; if ((linelen = getline(line, linesize, fp)) == -1) return (-1); keyp = *line; while (isspace((unsigned char)*keyp)) { ++keyp; --linelen; } if (*keyp == '\0') return 0; while (linelen > 0 && isspace((unsigned char)keyp[linelen - 1])) keyp[--linelen] = '\0'; if (*keyp == '#') { if (*type == T_NONE) { keyp++; while (isspace((unsigned char)*keyp)) ++keyp; if (!strcmp(keyp, "@list")) *type = T_LIST; } return 0; } if (*keyp == '[') { if ((valp = strchr(keyp, ']')) == NULL) { *malformed = 1; return (0); } valp++; } else valp = keyp + strcspn(keyp, " \t:"); if (*type == T_NONE) *type = (*valp == '\0') ? T_LIST : T_HASH; if (*type == T_LIST) { *key = keyp; return (0); } /* T_HASH */ if (*valp != '\0') { *valp++ = '\0'; valp += strspn(valp, " \t"); } if (*valp == '\0') *malformed = 1; *key = keyp; *val = valp; return (0); } void xclosefrom(int lowfd) { #if defined HAVE_CLOSEFROM_INT if (closefrom(lowfd) == -1) fatal("closefrom"); #else closefrom(lowfd); #endif } opensmtpd-7.7.0p0/usr.sbin/smtpd/compress_gzip.c0000644000175000001440000000723014610663500015400 /* $OpenBSD: compress_gzip.c,v 1.13 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * Copyright (c) 2012 Charles Longeau * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #define GZIP_BUFFER_SIZE 16384 static size_t compress_gzip_chunk(void *, size_t, void *, size_t); static size_t uncompress_gzip_chunk(void *, size_t, void *, size_t); static int compress_gzip_file(FILE *, FILE *); static int uncompress_gzip_file(FILE *, FILE *); struct compress_backend compress_gzip = { compress_gzip_chunk, uncompress_gzip_chunk, compress_gzip_file, uncompress_gzip_file, }; static size_t compress_gzip_chunk(void *ib, size_t ibsz, void *ob, size_t obsz) { z_stream *strm; size_t ret = 0; if ((strm = calloc(1, sizeof *strm)) == NULL) return 0; strm->zalloc = Z_NULL; strm->zfree = Z_NULL; strm->opaque = Z_NULL; if (deflateInit2(strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, (15+16), 8, Z_DEFAULT_STRATEGY) != Z_OK) goto end; strm->avail_in = ibsz; strm->next_in = (unsigned char *)ib; strm->avail_out = obsz; strm->next_out = (unsigned char *)ob; if (deflate(strm, Z_FINISH) != Z_STREAM_END) goto end; ret = strm->total_out; end: deflateEnd(strm); free(strm); return ret; } static size_t uncompress_gzip_chunk(void *ib, size_t ibsz, void *ob, size_t obsz) { z_stream *strm; size_t ret = 0; if ((strm = calloc(1, sizeof *strm)) == NULL) return 0; strm->zalloc = Z_NULL; strm->zfree = Z_NULL; strm->opaque = Z_NULL; strm->avail_in = 0; strm->next_in = Z_NULL; if (inflateInit2(strm, (15+16)) != Z_OK) goto end; strm->avail_in = ibsz; strm->next_in = (unsigned char *)ib; strm->avail_out = obsz; strm->next_out = (unsigned char *)ob; if (inflate(strm, Z_FINISH) != Z_STREAM_END) goto end; ret = strm->total_out; end: deflateEnd(strm); free(strm); return ret; } static int compress_gzip_file(FILE *in, FILE *out) { gzFile gzf; char ibuf[GZIP_BUFFER_SIZE]; int r; int ret = 0; if (in == NULL || out == NULL) return (0); gzf = gzdopen(fileno(out), "wb"); if (gzf == NULL) return (0); while ((r = fread(ibuf, 1, GZIP_BUFFER_SIZE, in)) != 0) { if (gzwrite(gzf, ibuf, r) != r) goto end; } if (!feof(in)) goto end; ret = 1; end: gzclose(gzf); return (ret); } static int uncompress_gzip_file(FILE *in, FILE *out) { gzFile gzf; char obuf[GZIP_BUFFER_SIZE]; int r; int ret = 0; if (in == NULL || out == NULL) return (0); gzf = gzdopen(fileno(in), "r"); if (gzf == NULL) return (0); while ((r = gzread(gzf, obuf, sizeof(obuf))) > 0) { if (fwrite(obuf, r, 1, out) != 1) goto end; } if (!gzeof(gzf)) goto end; ret = 1; end: gzclose(gzf); return (ret); } opensmtpd-7.7.0p0/usr.sbin/smtpd/queue_backend.c0000644000175000001440000004205214610663500015310 /* $OpenBSD: queue_backend.c,v 1.69 2023/05/31 16:51:46 op Exp $ */ /* * Copyright (c) 2011 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static const char* envelope_validate(struct envelope *); extern struct queue_backend queue_backend_fs; extern struct queue_backend queue_backend_null; extern struct queue_backend queue_backend_proc; extern struct queue_backend queue_backend_ram; static void queue_envelope_cache_add(struct envelope *); static void queue_envelope_cache_update(struct envelope *); static void queue_envelope_cache_del(uint64_t evpid); TAILQ_HEAD(evplst, envelope); static struct tree evpcache_tree; static struct evplst evpcache_list; static struct queue_backend *backend; static int (*handler_close)(void); static int (*handler_message_create)(uint32_t *); static int (*handler_message_commit)(uint32_t, const char*); static int (*handler_message_delete)(uint32_t); static int (*handler_message_fd_r)(uint32_t); static int (*handler_envelope_create)(uint32_t, const char *, size_t, uint64_t *); static int (*handler_envelope_delete)(uint64_t); static int (*handler_envelope_update)(uint64_t, const char *, size_t); static int (*handler_envelope_load)(uint64_t, char *, size_t); static int (*handler_envelope_walk)(uint64_t *, char *, size_t); static int (*handler_message_walk)(uint64_t *, char *, size_t, uint32_t, int *, void **); #ifdef QUEUE_PROFILING static struct { struct timespec t0; const char *name; } profile; static inline void profile_enter(const char *name) { if ((profiling & PROFILE_QUEUE) == 0) return; profile.name = name; clock_gettime(CLOCK_MONOTONIC, &profile.t0); } static inline void profile_leave(void) { struct timespec t1, dt; if ((profiling & PROFILE_QUEUE) == 0) return; clock_gettime(CLOCK_MONOTONIC, &t1); timespecsub(&t1, &profile.t0, &dt); log_debug("profile-queue: %s %lld.%09ld", profile.name, (long long)dt.tv_sec, dt.tv_nsec); } #else #define profile_enter(x) do {} while (0) #define profile_leave() do {} while (0) #endif static int queue_message_path(uint32_t msgid, char *buf, size_t len) { return bsnprintf(buf, len, "%s/%08"PRIx32, PATH_TEMPORARY, msgid); } int queue_init(const char *name, int server) { struct passwd *pwq; struct group *gr; int r; pwq = getpwnam(SMTPD_QUEUE_USER); if (pwq == NULL) fatalx("unknown user %s", SMTPD_QUEUE_USER); gr = getgrnam(SMTPD_QUEUE_GROUP); if (gr == NULL) fatalx("unknown group %s", SMTPD_QUEUE_GROUP); tree_init(&evpcache_tree); TAILQ_INIT(&evpcache_list); if (!strcmp(name, "fs")) backend = &queue_backend_fs; else if (!strcmp(name, "null")) backend = &queue_backend_null; else if (!strcmp(name, "ram")) backend = &queue_backend_ram; else backend = &queue_backend_proc; if (server) { if (ckdir(PATH_SPOOL, 0711, 0, 0, 1) == 0) fatalx("error in spool directory setup"); if (ckdir(PATH_SPOOL PATH_OFFLINE, 0770, 0, gr->gr_gid, 1) == 0) fatalx("error in offline directory setup"); if (ckdir(PATH_SPOOL PATH_PURGE, 0700, pwq->pw_uid, 0, 1) == 0) fatalx("error in purge directory setup"); mvpurge(PATH_SPOOL PATH_TEMPORARY, PATH_SPOOL PATH_PURGE); if (ckdir(PATH_SPOOL PATH_TEMPORARY, 0700, pwq->pw_uid, 0, 1) == 0) fatalx("error in purge directory setup"); } r = backend->init(pwq, server, name); log_trace(TRACE_QUEUE, "queue-backend: queue_init(%d) -> %d", server, r); return (r); } int queue_close(void) { if (handler_close) return (handler_close()); return (1); } int queue_message_create(uint32_t *msgid) { int r; profile_enter("queue_message_create"); r = handler_message_create(msgid); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_message_create() -> %d (%08"PRIx32")", r, *msgid); return (r); } int queue_message_delete(uint32_t msgid) { char msgpath[PATH_MAX]; uint64_t evpid; void *iter; int r; profile_enter("queue_message_delete"); r = handler_message_delete(msgid); profile_leave(); /* in case the message is incoming */ queue_message_path(msgid, msgpath, sizeof(msgpath)); unlink(msgpath); /* remove remaining envelopes from the cache if any (on rollback) */ evpid = msgid_to_evpid(msgid); for (;;) { iter = NULL; if (!tree_iterfrom(&evpcache_tree, &iter, evpid, &evpid, NULL)) break; if (evpid_to_msgid(evpid) != msgid) break; queue_envelope_cache_del(evpid); } log_trace(TRACE_QUEUE, "queue-backend: queue_message_delete(%08"PRIx32") -> %d", msgid, r); return (r); } int queue_message_commit(uint32_t msgid) { int r; char msgpath[PATH_MAX]; char tmppath[PATH_MAX]; FILE *ifp = NULL; FILE *ofp = NULL; profile_enter("queue_message_commit"); queue_message_path(msgid, msgpath, sizeof(msgpath)); if (env->sc_queue_flags & QUEUE_COMPRESSION) { bsnprintf(tmppath, sizeof tmppath, "%s.comp", msgpath); ifp = fopen(msgpath, "r"); ofp = fopen(tmppath, "w+"); if (ifp == NULL || ofp == NULL) goto err; if (!compress_file(ifp, ofp)) goto err; fclose(ifp); fclose(ofp); ifp = NULL; ofp = NULL; if (rename(tmppath, msgpath) == -1) { if (errno == ENOSPC) return (0); unlink(tmppath); log_warn("rename"); return (0); } } if (env->sc_queue_flags & QUEUE_ENCRYPTION) { bsnprintf(tmppath, sizeof tmppath, "%s.enc", msgpath); ifp = fopen(msgpath, "r"); ofp = fopen(tmppath, "w+"); if (ifp == NULL || ofp == NULL) goto err; if (!crypto_encrypt_file(ifp, ofp)) goto err; fclose(ifp); fclose(ofp); ifp = NULL; ofp = NULL; if (rename(tmppath, msgpath) == -1) { if (errno == ENOSPC) return (0); unlink(tmppath); log_warn("rename"); return (0); } } r = handler_message_commit(msgid, msgpath); profile_leave(); /* in case it's not done by the backend */ unlink(msgpath); log_trace(TRACE_QUEUE, "queue-backend: queue_message_commit(%08"PRIx32") -> %d", msgid, r); return (r); err: if (ifp) fclose(ifp); if (ofp) fclose(ofp); return 0; } int queue_message_fd_r(uint32_t msgid) { int fdin = -1, fdout = -1, fd = -1; FILE *ifp = NULL; FILE *ofp = NULL; profile_enter("queue_message_fd_r"); fdin = handler_message_fd_r(msgid); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_message_fd_r(%08"PRIx32") -> %d", msgid, fdin); if (fdin == -1) return (-1); if (env->sc_queue_flags & QUEUE_ENCRYPTION) { if ((fdout = mktmpfile()) == -1) goto err; if ((fd = dup(fdout)) == -1) goto err; if ((ifp = fdopen(fdin, "r")) == NULL) goto err; fdin = fd; fd = -1; if ((ofp = fdopen(fdout, "w+")) == NULL) goto err; if (!crypto_decrypt_file(ifp, ofp)) goto err; fclose(ifp); ifp = NULL; fclose(ofp); ofp = NULL; lseek(fdin, SEEK_SET, 0); } if (env->sc_queue_flags & QUEUE_COMPRESSION) { if ((fdout = mktmpfile()) == -1) goto err; if ((fd = dup(fdout)) == -1) goto err; if ((ifp = fdopen(fdin, "r")) == NULL) goto err; fdin = fd; fd = -1; if ((ofp = fdopen(fdout, "w+")) == NULL) goto err; if (!uncompress_file(ifp, ofp)) goto err; fclose(ifp); ifp = NULL; fclose(ofp); ofp = NULL; lseek(fdin, SEEK_SET, 0); } return (fdin); err: if (fd != -1) close(fd); if (fdin != -1) close(fdin); if (fdout != -1) close(fdout); if (ifp) fclose(ifp); if (ofp) fclose(ofp); return -1; } int queue_message_fd_rw(uint32_t msgid) { char buf[PATH_MAX]; queue_message_path(msgid, buf, sizeof(buf)); return open(buf, O_RDWR | O_CREAT | O_EXCL, 0600); } static int queue_envelope_dump_buffer(struct envelope *ep, char *evpbuf, size_t evpbufsize) { char *evp; size_t evplen; size_t complen; char compbuf[sizeof(struct envelope)]; size_t enclen; char encbuf[sizeof(struct envelope)]; evp = evpbuf; evplen = envelope_dump_buffer(ep, evpbuf, evpbufsize); if (evplen == 0) return (0); if (env->sc_queue_flags & QUEUE_COMPRESSION) { complen = compress_chunk(evp, evplen, compbuf, sizeof compbuf); if (complen == 0) return (0); evp = compbuf; evplen = complen; } if (env->sc_queue_flags & QUEUE_ENCRYPTION) { enclen = crypto_encrypt_buffer(evp, evplen, encbuf, sizeof encbuf); if (enclen == 0) return (0); evp = encbuf; evplen = enclen; } memmove(evpbuf, evp, evplen); return (evplen); } static int queue_envelope_load_buffer(struct envelope *ep, char *evpbuf, size_t evpbufsize) { char *evp; size_t evplen; char compbuf[sizeof(struct envelope)]; size_t complen; char encbuf[sizeof(struct envelope)]; size_t enclen; evp = evpbuf; evplen = evpbufsize; if (env->sc_queue_flags & QUEUE_ENCRYPTION) { enclen = crypto_decrypt_buffer(evp, evplen, encbuf, sizeof encbuf); if (enclen == 0) return (0); evp = encbuf; evplen = enclen; } if (env->sc_queue_flags & QUEUE_COMPRESSION) { complen = uncompress_chunk(evp, evplen, compbuf, sizeof compbuf); if (complen == 0) return (0); evp = compbuf; evplen = complen; } return (envelope_load_buffer(ep, evp, evplen)); } static void queue_envelope_cache_add(struct envelope *e) { struct envelope *cached; while (tree_count(&evpcache_tree) >= env->sc_queue_evpcache_size) queue_envelope_cache_del(TAILQ_LAST(&evpcache_list, evplst)->id); cached = xcalloc(1, sizeof *cached); *cached = *e; TAILQ_INSERT_HEAD(&evpcache_list, cached, entry); tree_xset(&evpcache_tree, e->id, cached); stat_increment("queue.evpcache.size", 1); } static void queue_envelope_cache_update(struct envelope *e) { struct envelope *cached; if ((cached = tree_get(&evpcache_tree, e->id)) == NULL) { queue_envelope_cache_add(e); stat_increment("queue.evpcache.update.missed", 1); } else { TAILQ_REMOVE(&evpcache_list, cached, entry); *cached = *e; TAILQ_INSERT_HEAD(&evpcache_list, cached, entry); stat_increment("queue.evpcache.update.hit", 1); } } static void queue_envelope_cache_del(uint64_t evpid) { struct envelope *cached; if ((cached = tree_pop(&evpcache_tree, evpid)) == NULL) return; TAILQ_REMOVE(&evpcache_list, cached, entry); free(cached); stat_decrement("queue.evpcache.size", 1); } int queue_envelope_create(struct envelope *ep) { int r; char evpbuf[sizeof(struct envelope)]; size_t evplen; uint64_t evpid; uint32_t msgid; ep->creation = time(NULL); evplen = queue_envelope_dump_buffer(ep, evpbuf, sizeof evpbuf); if (evplen == 0) return (0); evpid = ep->id; msgid = evpid_to_msgid(evpid); profile_enter("queue_envelope_create"); r = handler_envelope_create(msgid, evpbuf, evplen, &ep->id); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_envelope_create(%016"PRIx64", %zu) -> %d (%016"PRIx64")", evpid, evplen, r, ep->id); if (!r) { ep->creation = 0; ep->id = 0; } if (r && env->sc_queue_flags & QUEUE_EVPCACHE) queue_envelope_cache_add(ep); return (r); } int queue_envelope_delete(uint64_t evpid) { int r; if (env->sc_queue_flags & QUEUE_EVPCACHE) queue_envelope_cache_del(evpid); profile_enter("queue_envelope_delete"); r = handler_envelope_delete(evpid); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_envelope_delete(%016"PRIx64") -> %d", evpid, r); return (r); } int queue_envelope_load(uint64_t evpid, struct envelope *ep) { const char *e; char evpbuf[sizeof(struct envelope)]; size_t evplen; struct envelope *cached; if ((env->sc_queue_flags & QUEUE_EVPCACHE) && (cached = tree_get(&evpcache_tree, evpid))) { *ep = *cached; stat_increment("queue.evpcache.load.hit", 1); return (1); } ep->id = evpid; profile_enter("queue_envelope_load"); evplen = handler_envelope_load(ep->id, evpbuf, sizeof evpbuf); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_envelope_load(%016"PRIx64") -> %zu", evpid, evplen); if (evplen == 0) return (0); if (queue_envelope_load_buffer(ep, evpbuf, evplen)) { if ((e = envelope_validate(ep)) == NULL) { ep->id = evpid; if (env->sc_queue_flags & QUEUE_EVPCACHE) { queue_envelope_cache_add(ep); stat_increment("queue.evpcache.load.missed", 1); } return (1); } log_warnx("warn: invalid envelope %016" PRIx64 ": %s", evpid, e); } return (0); } int queue_envelope_update(struct envelope *ep) { char evpbuf[sizeof(struct envelope)]; size_t evplen; int r; evplen = queue_envelope_dump_buffer(ep, evpbuf, sizeof evpbuf); if (evplen == 0) return (0); profile_enter("queue_envelope_update"); r = handler_envelope_update(ep->id, evpbuf, evplen); profile_leave(); if (r && env->sc_queue_flags & QUEUE_EVPCACHE) queue_envelope_cache_update(ep); log_trace(TRACE_QUEUE, "queue-backend: queue_envelope_update(%016"PRIx64") -> %d", ep->id, r); return (r); } int queue_message_walk(struct envelope *ep, uint32_t msgid, int *done, void **data) { char evpbuf[sizeof(struct envelope)]; uint64_t evpid; int r; const char *e; profile_enter("queue_message_walk"); r = handler_message_walk(&evpid, evpbuf, sizeof evpbuf, msgid, done, data); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_message_walk() -> %d (%016"PRIx64")", r, evpid); if (r == -1) return (r); if (r && queue_envelope_load_buffer(ep, evpbuf, (size_t)r)) { if ((e = envelope_validate(ep)) == NULL) { ep->id = evpid; /* * do not cache the envelope here, while discovering * envelopes one could re-run discover on already * scheduled envelopes which leads to triggering of * strict checks in caching. Envelopes could anyway * be loaded from backend if it isn't cached. */ return (1); } log_warnx("warn: invalid envelope %016" PRIx64 ": %s", evpid, e); } return (0); } int queue_envelope_walk(struct envelope *ep) { const char *e; uint64_t evpid; char evpbuf[sizeof(struct envelope)]; int r; profile_enter("queue_envelope_walk"); r = handler_envelope_walk(&evpid, evpbuf, sizeof evpbuf); profile_leave(); log_trace(TRACE_QUEUE, "queue-backend: queue_envelope_walk() -> %d (%016"PRIx64")", r, evpid); if (r == -1) return (r); if (r && queue_envelope_load_buffer(ep, evpbuf, (size_t)r)) { if ((e = envelope_validate(ep)) == NULL) { ep->id = evpid; if (env->sc_queue_flags & QUEUE_EVPCACHE) queue_envelope_cache_add(ep); return (1); } log_warnx("warn: invalid envelope %016" PRIx64 ": %s", evpid, e); } return (0); } uint32_t queue_generate_msgid(void) { uint32_t msgid; while ((msgid = arc4random()) == 0) ; return msgid; } uint64_t queue_generate_evpid(uint32_t msgid) { uint32_t rnd; uint64_t evpid; while ((rnd = arc4random()) == 0) ; evpid = msgid; evpid <<= 32; evpid |= rnd; return evpid; } static const char* envelope_validate(struct envelope *ep) { if (ep->version != SMTPD_ENVELOPE_VERSION) return "version mismatch"; if (memchr(ep->helo, '\0', sizeof(ep->helo)) == NULL) return "invalid helo"; if (ep->helo[0] == '\0') return "empty helo"; if (memchr(ep->hostname, '\0', sizeof(ep->hostname)) == NULL) return "invalid hostname"; if (ep->hostname[0] == '\0') return "empty hostname"; if (memchr(ep->errorline, '\0', sizeof(ep->errorline)) == NULL) return "invalid error line"; if (dict_get(env->sc_dispatchers, ep->dispatcher) == NULL) return "unknown dispatcher"; return NULL; } void queue_api_on_close(int(*cb)(void)) { handler_close = cb; } void queue_api_on_message_create(int(*cb)(uint32_t *)) { handler_message_create = cb; } void queue_api_on_message_commit(int(*cb)(uint32_t, const char *)) { handler_message_commit = cb; } void queue_api_on_message_delete(int(*cb)(uint32_t)) { handler_message_delete = cb; } void queue_api_on_message_fd_r(int(*cb)(uint32_t)) { handler_message_fd_r = cb; } void queue_api_on_envelope_create(int(*cb)(uint32_t, const char *, size_t, uint64_t *)) { handler_envelope_create = cb; } void queue_api_on_envelope_delete(int(*cb)(uint64_t)) { handler_envelope_delete = cb; } void queue_api_on_envelope_update(int(*cb)(uint64_t, const char *, size_t)) { handler_envelope_update = cb; } void queue_api_on_envelope_load(int(*cb)(uint64_t, char *, size_t)) { handler_envelope_load = cb; } void queue_api_on_envelope_walk(int(*cb)(uint64_t *, char *, size_t)) { handler_envelope_walk = cb; } void queue_api_on_message_walk(int(*cb)(uint64_t *, char *, size_t, uint32_t, int *, void **)) { handler_message_walk = cb; } opensmtpd-7.7.0p0/usr.sbin/smtpd/ioev.c0000644000175000001440000004422014610663500013456 /* $OpenBSD: ioev.c,v 1.49 2023/02/08 08:20:54 tb Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #ifdef IO_TLS #include #endif #include #include "ioev.h" #include "iobuf.h" #include "log.h" enum { IO_STATE_NONE, IO_STATE_CONNECT, IO_STATE_CONNECT_TLS, IO_STATE_ACCEPT_TLS, IO_STATE_UP, IO_STATE_MAX, }; #define IO_PAUSE_IN IO_IN #define IO_PAUSE_OUT IO_OUT #define IO_READ 0x04 #define IO_WRITE 0x08 #define IO_RW (IO_READ | IO_WRITE) #define IO_RESET 0x10 /* internal */ #define IO_HELD 0x20 /* internal */ struct io { int sock; void *arg; void (*cb)(struct io*, int, void *); struct iobuf iobuf; size_t lowat; int timeout; int flags; int state; struct event ev; struct tls *tls; const char *error; /* only valid immediately on callback */ }; const char* io_strflags(int); const char* io_evstr(short); void _io_init(void); void io_hold(struct io *); void io_release(struct io *); void io_callback(struct io*, int); void io_dispatch(int, short, void *); void io_dispatch_connect(int, short, void *); size_t io_pending(struct io *); size_t io_queued(struct io*); void io_reset(struct io *, short, void (*)(int, short, void*)); void io_frame_enter(const char *, struct io *, int); void io_frame_leave(struct io *); #ifdef IO_TLS void io_dispatch_handshake_tls(int, short, void *); void io_dispatch_accept_tls(int, short, void *); void io_dispatch_connect_tls(int, short, void *); void io_dispatch_read_tls(int, short, void *); void io_dispatch_write_tls(int, short, void *); void io_reload_tls(struct io *io); #endif static struct io *current = NULL; static uint64_t frame = 0; static int _io_debug = 0; #define io_debug(args...) do { if (_io_debug) printf(args); } while(0) const char* io_strio(struct io *io) { static char buf[128]; char ssl[128]; ssl[0] = '\0'; #ifdef IO_TLS if (io->tls) { (void)snprintf(ssl, sizeof ssl, " tls=%s:%s", tls_conn_version(io->tls), tls_conn_cipher(io->tls)); } #endif (void)snprintf(buf, sizeof buf, "", io, io->sock, io->timeout, io_strflags(io->flags), ssl, io_pending(io), io_queued(io)); return (buf); } #define CASE(x) case x : return #x const char* io_strevent(int evt) { static char buf[32]; switch (evt) { CASE(IO_CONNECTED); CASE(IO_TLSREADY); CASE(IO_DATAIN); CASE(IO_LOWAT); CASE(IO_DISCONNECTED); CASE(IO_TIMEOUT); CASE(IO_ERROR); default: (void)snprintf(buf, sizeof(buf), "IO_? %d", evt); return buf; } } void io_set_nonblocking(int fd) { int flags; if ((flags = fcntl(fd, F_GETFL)) == -1) fatal("io_set_blocking:fcntl(F_GETFL)"); flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) == -1) fatal("io_set_blocking:fcntl(F_SETFL)"); } void io_set_nolinger(int fd) { struct linger l; memset(&l, 0, sizeof(l)); if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) == -1) fatal("io_set_linger:setsockopt"); } /* * Event framing must not rely on an io pointer to refer to the "same" io * throughout the frame, because this is not always the case: * * 1) enter(addr0) -> free(addr0) -> leave(addr0) = SEGV * 2) enter(addr0) -> free(addr0) -> malloc == addr0 -> leave(addr0) = BAD! * * In both case, the problem is that the io is freed in the callback, so * the pointer becomes invalid. If that happens, the user is required to * call io_clear, so we can adapt the frame state there. */ void io_frame_enter(const char *where, struct io *io, int ev) { io_debug("\n=== %" PRIu64 " ===\n" "io_frame_enter(%s, %s, %s)\n", frame, where, io_evstr(ev), io_strio(io)); if (current) fatalx("io_frame_enter: interleaved frames"); current = io; io_hold(io); } void io_frame_leave(struct io *io) { io_debug("io_frame_leave(%" PRIu64 ")\n", frame); if (current && current != io) fatalx("io_frame_leave: io mismatch"); /* io has been cleared */ if (current == NULL) goto done; /* TODO: There is a possible optimization there: * In a typical half-duplex request/response scenario, * the io is waiting to read a request, and when done, it queues * the response in the output buffer and goes to write mode. * There, the write event is set and will be triggered in the next * event frame. In most case, the write call could be done * immediately as part of the last read frame, thus avoiding to go * through the event loop machinery. So, as an optimisation, we * could detect that case here and force an event dispatching. */ /* Reload the io if it has not been reset already. */ io_release(io); current = NULL; done: io_debug("=== /%" PRIu64 "\n", frame); frame += 1; } void _io_init(void) { static int init = 0; if (init) return; init = 1; _io_debug = getenv("IO_DEBUG") != NULL; } struct io * io_new(void) { struct io *io; _io_init(); if ((io = calloc(1, sizeof(*io))) == NULL) return NULL; io->sock = -1; io->timeout = -1; if (iobuf_init(&io->iobuf, 0, 0) == -1) { free(io); return NULL; } return io; } void io_free(struct io *io) { io_debug("io_clear(%p)\n", io); /* the current io is virtually dead */ if (io == current) current = NULL; #ifdef IO_TLS tls_free(io->tls); io->tls = NULL; #endif if (event_initialized(&io->ev)) event_del(&io->ev); if (io->sock != -1) { close(io->sock); io->sock = -1; } iobuf_clear(&io->iobuf); free(io); } void io_hold(struct io *io) { io_debug("io_enter(%p)\n", io); if (io->flags & IO_HELD) fatalx("io_hold: io is already held"); io->flags &= ~IO_RESET; io->flags |= IO_HELD; } void io_release(struct io *io) { if (!(io->flags & IO_HELD)) fatalx("io_release: io is not held"); io->flags &= ~IO_HELD; if (!(io->flags & IO_RESET)) io_reload(io); } void io_set_fd(struct io *io, int fd) { io->sock = fd; if (fd != -1) io_reload(io); } void io_set_callback(struct io *io, void(*cb)(struct io *, int, void *), void *arg) { io->cb = cb; io->arg = arg; } void io_set_timeout(struct io *io, int msec) { io_debug("io_set_timeout(%p, %d)\n", io, msec); io->timeout = msec; } void io_set_lowat(struct io *io, size_t lowat) { io_debug("io_set_lowat(%p, %zu)\n", io, lowat); io->lowat = lowat; } void io_pause(struct io *io, int dir) { io_debug("io_pause(%p, %x)\n", io, dir); io->flags |= dir & (IO_PAUSE_IN | IO_PAUSE_OUT); io_reload(io); } void io_resume(struct io *io, int dir) { io_debug("io_resume(%p, %x)\n", io, dir); io->flags &= ~(dir & (IO_PAUSE_IN | IO_PAUSE_OUT)); io_reload(io); } void io_set_read(struct io *io) { int mode; io_debug("io_set_read(%p)\n", io); mode = io->flags & IO_RW; if (!(mode == 0 || mode == IO_WRITE)) fatalx("io_set_read: full-duplex or reading"); io->flags &= ~IO_RW; io->flags |= IO_READ; io_reload(io); } void io_set_write(struct io *io) { int mode; io_debug("io_set_write(%p)\n", io); mode = io->flags & IO_RW; if (!(mode == 0 || mode == IO_READ)) fatalx("io_set_write: full-duplex or writing"); io->flags &= ~IO_RW; io->flags |= IO_WRITE; io_reload(io); } const char * io_error(struct io *io) { return io->error; } struct tls * io_tls(struct io *io) { return io->tls; } int io_fileno(struct io *io) { return io->sock; } int io_paused(struct io *io, int what) { return (io->flags & (IO_PAUSE_IN | IO_PAUSE_OUT)) == what; } /* * Buffered output functions */ int io_write(struct io *io, const void *buf, size_t len) { int r; r = iobuf_queue(&io->iobuf, buf, len); io_reload(io); return r; } int io_writev(struct io *io, const struct iovec *iov, int iovcount) { int r; r = iobuf_queuev(&io->iobuf, iov, iovcount); io_reload(io); return r; } int io_print(struct io *io, const char *s) { return io_write(io, s, strlen(s)); } int io_printf(struct io *io, const char *fmt, ...) { va_list ap; int r; va_start(ap, fmt); r = io_vprintf(io, fmt, ap); va_end(ap); return r; } int io_vprintf(struct io *io, const char *fmt, va_list ap) { char *buf; int len; len = vasprintf(&buf, fmt, ap); if (len == -1) return -1; len = io_write(io, buf, len); free(buf); return len; } size_t io_queued(struct io *io) { return iobuf_queued(&io->iobuf); } /* * Buffered input functions */ void * io_data(struct io *io) { return iobuf_data(&io->iobuf); } size_t io_datalen(struct io *io) { return iobuf_len(&io->iobuf); } char * io_getline(struct io *io, size_t *sz) { return iobuf_getline(&io->iobuf, sz); } void io_drop(struct io *io, size_t sz) { return iobuf_drop(&io->iobuf, sz); } #define IO_READING(io) (((io)->flags & IO_RW) != IO_WRITE) #define IO_WRITING(io) (((io)->flags & IO_RW) != IO_READ) /* * Setup the necessary events as required by the current io state, * honouring duplex mode and i/o pauses. */ void io_reload(struct io *io) { short events; /* io will be reloaded at release time */ if (io->flags & IO_HELD) return; iobuf_normalize(&io->iobuf); #ifdef IO_TLS if (io->tls) { io_reload_tls(io); return; } #endif io_debug("io_reload(%p)\n", io); events = 0; if (IO_READING(io) && !(io->flags & IO_PAUSE_IN)) events = EV_READ; if (IO_WRITING(io) && !(io->flags & IO_PAUSE_OUT) && io_queued(io)) events |= EV_WRITE; io_reset(io, events, io_dispatch); } /* Set the requested event. */ void io_reset(struct io *io, short events, void (*dispatch)(int, short, void*)) { struct timeval tv, *ptv; io_debug("io_reset(%p, %s, %p) -> %s\n", io, io_evstr(events), dispatch, io_strio(io)); /* * Indicate that the event has already been reset so that reload * is not called on frame_leave. */ io->flags |= IO_RESET; if (event_initialized(&io->ev)) event_del(&io->ev); /* * The io is paused by the user, so we don't want the timeout to be * effective. */ if (events == 0) return; event_set(&io->ev, io->sock, events, dispatch, io); if (io->timeout >= 0) { tv.tv_sec = io->timeout / 1000; tv.tv_usec = (io->timeout % 1000) * 1000; ptv = &tv; } else ptv = NULL; event_add(&io->ev, ptv); } size_t io_pending(struct io *io) { return iobuf_len(&io->iobuf); } const char* io_strflags(int flags) { static char buf[64]; buf[0] = '\0'; switch (flags & IO_RW) { case 0: (void)strlcat(buf, "rw", sizeof buf); break; case IO_READ: (void)strlcat(buf, "R", sizeof buf); break; case IO_WRITE: (void)strlcat(buf, "W", sizeof buf); break; case IO_RW: (void)strlcat(buf, "RW", sizeof buf); break; } if (flags & IO_PAUSE_IN) (void)strlcat(buf, ",F_PI", sizeof buf); if (flags & IO_PAUSE_OUT) (void)strlcat(buf, ",F_PO", sizeof buf); return buf; } const char* io_evstr(short ev) { static char buf[64]; char buf2[16]; int n; n = 0; buf[0] = '\0'; if (ev == 0) { (void)strlcat(buf, "", sizeof(buf)); return buf; } if (ev & EV_TIMEOUT) { (void)strlcat(buf, "EV_TIMEOUT", sizeof(buf)); ev &= ~EV_TIMEOUT; n++; } if (ev & EV_READ) { if (n) (void)strlcat(buf, "|", sizeof(buf)); (void)strlcat(buf, "EV_READ", sizeof(buf)); ev &= ~EV_READ; n++; } if (ev & EV_WRITE) { if (n) (void)strlcat(buf, "|", sizeof(buf)); (void)strlcat(buf, "EV_WRITE", sizeof(buf)); ev &= ~EV_WRITE; n++; } if (ev & EV_SIGNAL) { if (n) (void)strlcat(buf, "|", sizeof(buf)); (void)strlcat(buf, "EV_SIGNAL", sizeof(buf)); ev &= ~EV_SIGNAL; n++; } if (ev) { if (n) (void)strlcat(buf, "|", sizeof(buf)); (void)strlcat(buf, "EV_?=0x", sizeof(buf)); (void)snprintf(buf2, sizeof(buf2), "%hx", ev); (void)strlcat(buf, buf2, sizeof(buf)); } return buf; } void io_dispatch(int fd, short ev, void *humppa) { struct io *io = humppa; size_t w; ssize_t n; int saved_errno; io_frame_enter("io_dispatch", io, ev); if (ev == EV_TIMEOUT) { io_callback(io, IO_TIMEOUT); goto leave; } if (ev & EV_WRITE && (w = io_queued(io))) { if ((n = iobuf_write(&io->iobuf, io->sock)) < 0) { if (n == IOBUF_WANT_WRITE) /* kqueue bug? */ goto read; if (n == IOBUF_CLOSED) io_callback(io, IO_DISCONNECTED); else { saved_errno = errno; io->error = strerror(errno); errno = saved_errno; io_callback(io, IO_ERROR); } goto leave; } if (w > io->lowat && w - n <= io->lowat) io_callback(io, IO_LOWAT); } read: if (ev & EV_READ) { iobuf_normalize(&io->iobuf); if ((n = iobuf_read(&io->iobuf, io->sock)) < 0) { if (n == IOBUF_CLOSED) io_callback(io, IO_DISCONNECTED); else { saved_errno = errno; io->error = strerror(errno); errno = saved_errno; io_callback(io, IO_ERROR); } goto leave; } if (n) io_callback(io, IO_DATAIN); } leave: io_frame_leave(io); } void io_callback(struct io *io, int evt) { io->cb(io, evt, io->arg); } int io_connect(struct io *io, const struct sockaddr *sa, const struct sockaddr *bsa) { int sock, errno_save; if ((sock = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) goto fail; io_set_nonblocking(sock); io_set_nolinger(sock); if (bsa && bind(sock, bsa, SA_LEN(bsa)) == -1) goto fail; if (connect(sock, sa, SA_LEN(sa)) == -1) if (errno != EINPROGRESS) goto fail; io->sock = sock; io_reset(io, EV_WRITE, io_dispatch_connect); return (sock); fail: if (sock != -1) { errno_save = errno; close(sock); errno = errno_save; io->error = strerror(errno); } return (-1); } void io_dispatch_connect(int fd, short ev, void *humppa) { struct io *io = humppa; int r, e; socklen_t sl; io_frame_enter("io_dispatch_connect", io, ev); if (ev == EV_TIMEOUT) { close(fd); io->sock = -1; io_callback(io, IO_TIMEOUT); } else { sl = sizeof(e); r = getsockopt(fd, SOL_SOCKET, SO_ERROR, &e, &sl); if (r == -1) { log_warn("io_dispatch_connect: getsockopt"); e = errno; } if (e) { close(fd); io->sock = -1; io->error = strerror(e); io_callback(io, e == ETIMEDOUT ? IO_TIMEOUT : IO_ERROR); } else { io->state = IO_STATE_UP; io_callback(io, IO_CONNECTED); } } io_frame_leave(io); } #ifdef IO_TLS int io_connect_tls(struct io *io, struct tls *tls, const char *hostname) { int mode; mode = io->flags & IO_RW; if (mode != IO_WRITE) fatalx("io_connect_tls: expect IO_WRITE mode"); if (io->tls) fatalx("io_connect_tls: TLS already started"); if (tls_connect_socket(tls, io->sock, hostname) == -1) { io->error = tls_error(tls); return (-1); } io->tls = tls; io->state = IO_STATE_CONNECT_TLS; io_reset(io, EV_READ|EV_WRITE, io_dispatch_handshake_tls); return (0); } int io_accept_tls(struct io *io, struct tls *tls) { int mode; mode = io->flags & IO_RW; if (mode != IO_READ) fatalx("io_accept_tls: expect IO_READ mode"); if (io->tls) fatalx("io_accept_tls: TLS already started"); if (tls_accept_socket(tls, &io->tls, io->sock) == -1) { io->error = tls_error(tls); return (-1); } io->state = IO_STATE_ACCEPT_TLS; io_reset(io, EV_READ|EV_WRITE, io_dispatch_handshake_tls); return (0); } void io_dispatch_handshake_tls(int fd, short event, void *humppa) { struct io *io = humppa; int ret; io_frame_enter("io_dispatch_handshake_tls", io, event); if (event == EV_TIMEOUT) { io_callback(io, IO_TIMEOUT); goto leave; } if ((ret = tls_handshake(io->tls)) == 0) { io->state = IO_STATE_UP; io_callback(io, IO_TLSREADY); goto leave; } if (ret == TLS_WANT_POLLIN) io_reset(io, EV_READ, io_dispatch_handshake_tls); else if (ret == TLS_WANT_POLLOUT) io_reset(io, EV_WRITE, io_dispatch_handshake_tls); else { io->error = tls_error(io->tls); io_callback(io, IO_ERROR); } leave: io_frame_leave(io); return; } void io_dispatch_read_tls(int fd, short event, void *humppa) { struct io *io = humppa; int n; io_frame_enter("io_dispatch_read_tls", io, event); if (event == EV_TIMEOUT) { io_callback(io, IO_TIMEOUT); goto leave; } again: iobuf_normalize(&io->iobuf); switch ((n = iobuf_read_tls(&io->iobuf, io->tls))) { case IOBUF_WANT_READ: io_reset(io, EV_READ, io_dispatch_read_tls); break; case IOBUF_WANT_WRITE: io_reset(io, EV_WRITE, io_dispatch_read_tls); break; case IOBUF_CLOSED: io_callback(io, IO_DISCONNECTED); break; case IOBUF_ERROR: io->error = tls_error(io->tls); io_callback(io, IO_ERROR); break; default: io_debug("io_dispatch_read_tls(...) -> r=%d\n", n); io_callback(io, IO_DATAIN); if (current == io && IO_READING(io)) goto again; } leave: io_frame_leave(io); } void io_dispatch_write_tls(int fd, short event, void *humppa) { struct io *io = humppa; int n; size_t w2, w; io_frame_enter("io_dispatch_write_tls", io, event); if (event == EV_TIMEOUT) { io_callback(io, IO_TIMEOUT); goto leave; } w = io_queued(io); switch ((n = iobuf_write_tls(&io->iobuf, io->tls))) { case IOBUF_WANT_READ: io_reset(io, EV_READ, io_dispatch_write_tls); break; case IOBUF_WANT_WRITE: io_reset(io, EV_WRITE, io_dispatch_write_tls); break; case IOBUF_CLOSED: io_callback(io, IO_DISCONNECTED); break; case IOBUF_ERROR: io->error = tls_error(io->tls); io_callback(io, IO_ERROR); break; default: io_debug("io_dispatch_write_tls(...) -> w=%d\n", n); w2 = io_queued(io); if (w > io->lowat && w2 <= io->lowat) io_callback(io, IO_LOWAT); break; } leave: io_frame_leave(io); } void io_reload_tls(struct io *io) { if (io->state != IO_STATE_UP) fatalx("io_reload_tls: bad state"); if (IO_READING(io) && !(io->flags & IO_PAUSE_IN)) { io_reset(io, EV_READ, io_dispatch_read_tls); return; } if (IO_WRITING(io) && !(io->flags & IO_PAUSE_OUT) && io_queued(io)) { io_reset(io, EV_WRITE, io_dispatch_write_tls); return; } /* paused */ } #endif /* IO_TLS */ opensmtpd-7.7.0p0/usr.sbin/smtpd/parse.y0000644000175000001440000023421214665027174013671 /* $OpenBSD: parse.y,v 1.299 2024/02/19 21:00:19 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2002, 2003, 2004 Henning Brauer * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Daniel Hartmeier. All rights reserved. * Copyright (c) 2001 Theo de Raadt. All rights reserved. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ %{ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #include "smtpd.h" #include "ssl.h" #include "log.h" TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files); static struct file { TAILQ_ENTRY(file) entry; FILE *stream; char *name; size_t ungetpos; size_t ungetsize; u_char *ungetbuf; int eof_reached; int lineno; int errors; } *file, *topfile; struct file *pushfile(const char *, int); int popfile(void); int check_file_secrecy(int, const char *); int yyparse(void); int yylex(void); int kw_cmp(const void *, const void *); int lookup(char *); int igetc(void); int lgetc(int); void lungetc(int); int findeol(void); int yyerror(const char *, ...) __attribute__((__format__ (printf, 1, 2))) __attribute__((__nonnull__ (1))); TAILQ_HEAD(symhead, sym) symhead = TAILQ_HEAD_INITIALIZER(symhead); struct sym { TAILQ_ENTRY(sym) entry; int used; int persist; char *nam; char *val; }; int symset(const char *, const char *, int); char *symget(const char *); struct smtpd *conf = NULL; static int errors = 0; struct table *table = NULL; struct mta_limits *limits; static struct pki *pki; static struct ca *sca; struct dispatcher *dsp; struct rule *rule; struct filter_proc *processor; struct filter_config *filter_config; static uint32_t last_dynchain_id = 1; enum listen_options { LO_FAMILY = 0x000001, LO_PORT = 0x000002, LO_SSL = 0x000004, LO_FILTER = 0x000008, LO_PKI = 0x000010, LO_AUTH = 0x000020, LO_TAG = 0x000040, LO_HOSTNAME = 0x000080, LO_HOSTNAMES = 0x000100, LO_MASKSOURCE = 0x000200, LO_NODSN = 0x000400, LO_SENDERS = 0x000800, LO_RECEIVEDAUTH = 0x001000, LO_MASQUERADE = 0x002000, LO_CA = 0x004000, LO_PROXY = 0x008000, }; #define PKI_MAX 32 static struct listen_opts { char *ifx; int family; in_port_t port; uint16_t ssl; char *filtername; char *pki[PKI_MAX]; int pkicount; char *tls_ciphers; char *tls_protocols; char *ca; uint16_t auth; struct table *authtable; char *tag; char *hostname; struct table *hostnametable; struct table *sendertable; uint16_t flags; uint32_t options; } listen_opts; static void create_sock_listener(struct listen_opts *); static void create_if_listener(struct listen_opts *); static void config_listener(struct listener *, struct listen_opts *); static int host_v4(struct listen_opts *); static int host_v6(struct listen_opts *); static int host_dns(struct listen_opts *); static int interface(struct listen_opts *); int delaytonum(char *); int is_if_in_group(const char *, const char *); static int config_lo_mask_source(struct listen_opts *); typedef struct { union { int64_t number; struct table *table; char *string; struct host *host; struct mailaddr *maddr; } v; int lineno; } YYSTYPE; %} %token ACTION ADMD ALIAS ANY ARROW AUTH AUTH_OPTIONAL %token BACKUP BOUNCE BYPASS %token CA CERT CHAIN CHROOT CIPHERS COMMIT COMPRESSION CONNECT %token DATA DATA_LINE DHE DISCONNECT DOMAIN %token EHLO ENABLE ENCRYPTION ERROR EXPAND_ONLY %token FCRDNS FILTER FOR FORWARD_ONLY FROM %token GROUP %token HELO HELO_SRC HOST HOSTNAME HOSTNAMES %token INCLUDE INET4 INET6 %token JUNK %token KEY %token LIMIT LISTEN LMTP LOCAL %token MAIL_FROM MAILDIR MASK_SRC MASQUERADE MATCH MAX_MESSAGE_SIZE MAX_DEFERRED MBOX MDA MTA MX %token NO_DSN NO_VERIFY NOOP %token ON %token PHASE PKI PORT PROC PROC_EXEC PROTOCOLS PROXY_V2 %token QUEUE QUIT %token RCPT_TO RDNS RECIPIENT RECEIVEDAUTH REGEX RELAY REJECT REPORT REWRITE RSET %token SCHEDULER SENDER SENDERS SMTP SMTP_IN SMTP_OUT SMTPS SOCKET SRC SRS SUB_ADDR_DELIM %token TABLE TAG TAGGED TLS TLS_REQUIRE TTL %token USER USERBASE %token VERIFY VIRTUAL %token WARN_INTERVAL WRAPPER %token STRING %token NUMBER %type table %type size negation %type tables tablenew tableref %% grammar : /* empty */ | grammar '\n' | grammar include '\n' | grammar varset '\n' | grammar bounce '\n' | grammar admd '\n' | grammar ca '\n' | grammar mda '\n' | grammar mta '\n' | grammar pki '\n' | grammar proc '\n' | grammar queue '\n' | grammar scheduler '\n' | grammar smtp '\n' | grammar srs '\n' | grammar listen '\n' | grammar table '\n' | grammar dispatcher '\n' | grammar match '\n' | grammar filter '\n' | grammar error '\n' { file->errors++; } ; include : INCLUDE STRING { struct file *nfile; if ((nfile = pushfile($2, 0)) == NULL) { yyerror("failed to include file %s", $2); free($2); YYERROR; } free($2); file = nfile; lungetc('\n'); } ; varset : STRING '=' STRING { char *s = $1; while (*s++) { if (isspace((unsigned char)*s)) { yyerror("macro name cannot contain " "whitespace"); free($1); free($3); YYERROR; } } if (symset($1, $3, 0) == -1) fatal("cannot store variable"); free($1); free($3); } ; comma : ',' optnl | nl | /* empty */ ; optnl : '\n' optnl | ; nl : '\n' optnl ; negation : '!' { $$ = 1; } | /* empty */ { $$ = 0; } ; assign : '=' | ARROW; keyval : STRING assign STRING { table_add(table, $1, $3); free($1); free($3); } ; keyval_list : keyval optnl | keyval comma keyval_list ; stringel : STRING { table_add(table, $1, NULL); free($1); } ; string_list : stringel optnl | stringel comma string_list ; tableval_list : string_list { } | keyval_list { } ; bounce: BOUNCE WARN_INTERVAL { memset(conf->sc_bounce_warn, 0, sizeof conf->sc_bounce_warn); } bouncedelays ; admd: ADMD STRING { size_t i; for (i = 0; $2[i] != '\0'; i++) { if (!isprint($2[i])) { yyerror("not a valid admd"); free($2); YYERROR; } } conf->sc_admd = $2; }; ca: CA STRING { char buf[HOST_NAME_MAX+1]; /* if not catchall, check that it is a valid domain */ if (strcmp($2, "*") != 0) { if (!res_hnok($2)) { yyerror("not a valid domain name: %s", $2); free($2); YYERROR; } } xlowercase(buf, $2, sizeof(buf)); free($2); sca = dict_get(conf->sc_ca_dict, buf); if (sca == NULL) { sca = xcalloc(1, sizeof *sca); (void)strlcpy(sca->ca_name, buf, sizeof(sca->ca_name)); dict_set(conf->sc_ca_dict, sca->ca_name, sca); } } ca_params ; ca_params_opt: CERT STRING { sca->ca_cert_file = $2; } ; ca_params: ca_params_opt ; mda: MDA LIMIT limits_mda | MDA WRAPPER STRING STRING { if (dict_get(conf->sc_mda_wrappers, $3)) { yyerror("mda wrapper already declared with that name: %s", $3); YYERROR; } dict_set(conf->sc_mda_wrappers, $3, $4); } ; mta: MTA MAX_DEFERRED NUMBER { conf->sc_mta_max_deferred = $3; } | MTA LIMIT FOR DOMAIN STRING { struct mta_limits *d; limits = dict_get(conf->sc_limits_dict, $5); if (limits == NULL) { limits = xcalloc(1, sizeof(*limits)); dict_xset(conf->sc_limits_dict, $5, limits); d = dict_xget(conf->sc_limits_dict, "default"); memmove(limits, d, sizeof(*limits)); } free($5); } limits_mta | MTA LIMIT { limits = dict_get(conf->sc_limits_dict, "default"); } limits_mta ; pki: PKI STRING { char buf[HOST_NAME_MAX+1]; /* if not catchall, check that it is a valid domain */ if (strcmp($2, "*") != 0) { if (!res_hnok($2)) { yyerror("not a valid domain name: %s", $2); free($2); YYERROR; } } xlowercase(buf, $2, sizeof(buf)); free($2); pki = dict_get(conf->sc_pki_dict, buf); if (pki == NULL) { pki = xcalloc(1, sizeof *pki); (void)strlcpy(pki->pki_name, buf, sizeof(pki->pki_name)); dict_set(conf->sc_pki_dict, pki->pki_name, pki); } } pki_params ; pki_params_opt: CERT STRING { pki->pki_cert_file = $2; } | KEY STRING { pki->pki_key_file = $2; } | DHE STRING { if (strcasecmp($2, "none") == 0) pki->pki_dhe = 0; else if (strcasecmp($2, "auto") == 0) pki->pki_dhe = 1; else if (strcasecmp($2, "legacy") == 0) pki->pki_dhe = 2; else { yyerror("invalid DHE keyword: %s", $2); free($2); YYERROR; } free($2); } ; pki_params: pki_params_opt pki_params | /* empty */ ; proc: PROC STRING STRING { if (dict_get(conf->sc_filter_processes_dict, $2)) { yyerror("processor already exists with that name: %s", $2); free($2); free($3); YYERROR; } processor = xcalloc(1, sizeof *processor); processor->command = $3; } proc_params { dict_set(conf->sc_filter_processes_dict, $2, processor); processor = NULL; } ; proc_params_opt: USER STRING { if (processor->user) { yyerror("user already specified for this processor"); free($2); YYERROR; } processor->user = $2; } | GROUP STRING { if (processor->group) { yyerror("group already specified for this processor"); free($2); YYERROR; } processor->group = $2; } | CHROOT STRING { if (processor->chroot) { yyerror("chroot already specified for this processor"); free($2); YYERROR; } processor->chroot = $2; } ; proc_params: proc_params_opt proc_params | /* empty */ ; queue: QUEUE COMPRESSION { conf->sc_queue_flags |= QUEUE_COMPRESSION; } | QUEUE ENCRYPTION { conf->sc_queue_flags |= QUEUE_ENCRYPTION; } | QUEUE ENCRYPTION STRING { if (strcasecmp($3, "stdin") == 0 || strcasecmp($3, "-") == 0) { conf->sc_queue_key = "stdin"; free($3); } else conf->sc_queue_key = $3; conf->sc_queue_flags |= QUEUE_ENCRYPTION; } | QUEUE TTL STRING { conf->sc_ttl = delaytonum($3); if (conf->sc_ttl == -1) { yyerror("invalid ttl delay: %s", $3); free($3); YYERROR; } free($3); } ; scheduler: SCHEDULER LIMIT limits_scheduler ; smtp: SMTP LIMIT limits_smtp | SMTP CIPHERS STRING { conf->sc_tls_ciphers = $3; } | SMTP MAX_MESSAGE_SIZE size { conf->sc_maxsize = $3; } | SMTP SUB_ADDR_DELIM STRING { if (strlen($3) != 1) { yyerror("subaddressing-delimiter must be one character"); free($3); YYERROR; } if (isspace((unsigned char)*$3) || !isprint((unsigned char)*$3) || *$3 == '@') { yyerror("sub-addr-delim uses invalid character"); free($3); YYERROR; } conf->sc_subaddressing_delim = $3; } ; srs: SRS KEY STRING { conf->sc_srs_key = $3; } | SRS KEY BACKUP STRING { conf->sc_srs_key_backup = $4; } | SRS TTL STRING { conf->sc_srs_ttl = delaytonum($3); if (conf->sc_srs_ttl == -1) { yyerror("ttl delay \"%s\" is invalid", $3); free($3); YYERROR; } conf->sc_srs_ttl /= 86400; if (conf->sc_srs_ttl == 0) { yyerror("ttl delay \"%s\" is too short", $3); free($3); YYERROR; } free($3); } ; dispatcher_local_option: USER STRING { if (dsp->u.local.is_mbox) { yyerror("user may not be specified for this dispatcher"); YYERROR; } if (dsp->u.local.forward_only) { yyerror("user may not be specified for forward-only"); YYERROR; } if (dsp->u.local.expand_only) { yyerror("user may not be specified for expand-only"); YYERROR; } if (dsp->u.local.user) { yyerror("user already specified for this dispatcher"); YYERROR; } dsp->u.local.user = $2; } | ALIAS tables { struct table *t = $2; if (dsp->u.local.table_alias) { yyerror("alias mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.local.table_virtual) { yyerror("virtual mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("table \"%s\" may not be used for alias lookups", t->t_name); YYERROR; } dsp->u.local.table_alias = strdup(t->t_name); } | VIRTUAL tables { struct table *t = $2; if (dsp->u.local.table_virtual) { yyerror("virtual mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.local.table_alias) { yyerror("alias mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("table \"%s\" may not be used for virtual lookups", t->t_name); YYERROR; } dsp->u.local.table_virtual = strdup(t->t_name); } | USERBASE tables { struct table *t = $2; if (dsp->u.local.table_userbase) { yyerror("userbase mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_USERINFO)) { yyerror("table \"%s\" may not be used for userbase lookups", t->t_name); YYERROR; } dsp->u.local.table_userbase = strdup(t->t_name); } | WRAPPER STRING { if (! dict_get(conf->sc_mda_wrappers, $2)) { yyerror("no mda wrapper with that name: %s", $2); YYERROR; } dsp->u.local.mda_wrapper = $2; } ; dispatcher_local_options: dispatcher_local_option dispatcher_local_options | /* empty */ ; dispatcher_local: MBOX { dsp->u.local.is_mbox = 1; } dispatcher_local_options | MAILDIR { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir"); } dispatcher_local_options | MAILDIR JUNK { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j"); } dispatcher_local_options | MAILDIR STRING { if (strncmp($2, "~/", 2) == 0) asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir \"%%{user.directory}/%s\"", $2+2); else asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir \"%s\"", $2); } dispatcher_local_options | MAILDIR STRING JUNK { if (strncmp($2, "~/", 2) == 0) asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j \"%%{user.directory}/%s\"", $2+2); else asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.maildir -j \"%s\"", $2); } dispatcher_local_options | LMTP STRING { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.lmtp -d %s -u", $2); } dispatcher_local_options | LMTP STRING RCPT_TO { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.lmtp -d %s -r", $2); } dispatcher_local_options | MDA STRING { asprintf(&dsp->u.local.command, PATH_LIBEXEC"/mail.mda \"%s\"", $2); } dispatcher_local_options | FORWARD_ONLY { dsp->u.local.forward_only = 1; } dispatcher_local_options | EXPAND_ONLY { dsp->u.local.expand_only = 1; } dispatcher_local_options ; dispatcher_remote_option: HELO STRING { if (dsp->u.remote.helo) { yyerror("helo already specified for this dispatcher"); YYERROR; } dsp->u.remote.helo = $2; } | HELO_SRC tables { struct table *t = $2; if (dsp->u.remote.helo_source) { yyerror("helo-source mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("table \"%s\" may not be used for helo-source lookups", t->t_name); YYERROR; } dsp->u.remote.helo_source = strdup(t->t_name); } | PKI STRING { if (dsp->u.remote.pki) { yyerror("pki already specified for this dispatcher"); YYERROR; } dsp->u.remote.pki = $2; } | CA STRING { if (dsp->u.remote.ca) { yyerror("ca already specified for this dispatcher"); YYERROR; } dsp->u.remote.ca = $2; } | CIPHERS STRING { if (dsp->u.remote.tls_ciphers) { yyerror("ciphers already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_ciphers = $2; } | PROTOCOLS STRING { if (dsp->u.remote.tls_protocols) { yyerror("protocols already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_protocols = $2; } | SRC tables { struct table *t = $2; if (dsp->u.remote.source) { yyerror("source mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_SOURCE)) { yyerror("table \"%s\" may not be used for source lookups", t->t_name); YYERROR; } dsp->u.remote.source = strdup(t->t_name); } | MAIL_FROM STRING { if (dsp->u.remote.mail_from) { yyerror("mail-from already specified for this dispatcher"); YYERROR; } dsp->u.remote.mail_from = $2; } | BACKUP MX STRING { if (dsp->u.remote.backup) { yyerror("backup already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.smarthost) { yyerror("backup and host are mutually exclusive"); YYERROR; } dsp->u.remote.backup = 1; dsp->u.remote.backupmx = $3; } | BACKUP { if (dsp->u.remote.backup) { yyerror("backup already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.smarthost) { yyerror("backup and host are mutually exclusive"); YYERROR; } dsp->u.remote.backup = 1; } | HOST tables { struct table *t = $2; if (dsp->u.remote.smarthost) { yyerror("host mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.backup) { yyerror("backup and host are mutually exclusive"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_RELAYHOST)) { yyerror("table \"%s\" may not be used for host lookups", t->t_name); YYERROR; } dsp->u.remote.smarthost = strdup(t->t_name); } | DOMAIN tables { struct table *t = $2; if (dsp->u.remote.smarthost) { yyerror("host mapping already specified for this dispatcher"); YYERROR; } if (dsp->u.remote.backup) { yyerror("backup and domain are mutually exclusive"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_RELAYHOST)) { yyerror("table \"%s\" may not be used for host lookups", t->t_name); YYERROR; } dsp->u.remote.smarthost = strdup(t->t_name); dsp->u.remote.smarthost_domain = 1; } | TLS { if (dsp->u.remote.tls_required == 1) { yyerror("tls already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_required = 1; dsp->u.remote.tls_verify = 1; } | TLS NO_VERIFY { if (dsp->u.remote.tls_required == 1) { yyerror("tls already specified for this dispatcher"); YYERROR; } dsp->u.remote.tls_required = 1; } | AUTH tables { struct table *t = $2; if (dsp->u.remote.smarthost == NULL) { yyerror("auth may not be specified without host on a dispatcher"); YYERROR; } if (dsp->u.remote.auth) { yyerror("auth mapping already specified for this dispatcher"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_HASH, K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } dsp->u.remote.auth = strdup(t->t_name); } | FILTER STRING { struct filter_config *fc; if (dsp->u.remote.filtername) { yyerror("filter already specified for this dispatcher"); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, $2)) == NULL) { yyerror("no filter exist with that name: %s", $2); free($2); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_OUT; dsp->u.remote.filtername = $2; } | FILTER { char buffer[128]; char *filtername; if (dsp->u.remote.filtername) { yyerror("filter already specified for this dispatcher"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_OUT; dict_init(&filter_config->chain_procs); dsp->u.remote.filtername = filtername; } '{' optnl filter_list '}' { dict_set(conf->sc_filters_dict, dsp->u.remote.filtername, filter_config); filter_config = NULL; } | SRS { if (conf->sc_srs_key == NULL) { yyerror("an srs key is required for srs to be specified in an action"); YYERROR; } if (dsp->u.remote.srs == 1) { yyerror("srs already specified for this dispatcher"); YYERROR; } dsp->u.remote.srs = 1; } ; dispatcher_remote_options: dispatcher_remote_option dispatcher_remote_options | /* empty */ ; dispatcher_remote : RELAY dispatcher_remote_options ; dispatcher_type: dispatcher_local { dsp->type = DISPATCHER_LOCAL; } | dispatcher_remote { dsp->type = DISPATCHER_REMOTE; } ; dispatcher_option: TTL STRING { if (dsp->ttl) { yyerror("ttl already specified for this dispatcher"); YYERROR; } dsp->ttl = delaytonum($2); if (dsp->ttl == -1) { yyerror("ttl delay \"%s\" is invalid", $2); free($2); YYERROR; } free($2); } ; dispatcher_options: dispatcher_option dispatcher_options | /* empty */ ; dispatcher: ACTION STRING { if (dict_get(conf->sc_dispatchers, $2)) { yyerror("dispatcher already declared with that name: %s", $2); YYERROR; } dsp = xcalloc(1, sizeof *dsp); } dispatcher_type dispatcher_options { if (dsp->type == DISPATCHER_LOCAL) if (dsp->u.local.table_userbase == NULL) dsp->u.local.table_userbase = ""; dict_set(conf->sc_dispatchers, $2, dsp); dsp = NULL; } ; match_option: negation TAG tables { struct table *t = $3; if (rule->flag_tag) { yyerror("tag already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_STRING)) { yyerror("table \"%s\" may not be used for tag lookups", t->t_name); YYERROR; } rule->flag_tag = $1 ? -1 : 1; rule->table_tag = strdup(t->t_name); } | negation TAG REGEX tables { struct table *t = $4; if (rule->flag_tag) { yyerror("tag already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for tag lookups", t->t_name); YYERROR; } rule->flag_tag = $1 ? -1 : 1; rule->flag_tag_regex = 1; rule->table_tag = strdup(t->t_name); } | negation HELO tables { struct table *t = $3; if (rule->flag_smtp_helo) { yyerror("helo already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for helo lookups", t->t_name); YYERROR; } rule->flag_smtp_helo = $1 ? -1 : 1; rule->table_smtp_helo = strdup(t->t_name); } | negation HELO REGEX tables { struct table *t = $4; if (rule->flag_smtp_helo) { yyerror("helo already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for helo lookups", t->t_name); YYERROR; } rule->flag_smtp_helo = $1 ? -1 : 1; rule->flag_smtp_helo_regex = 1; rule->table_smtp_helo = strdup(t->t_name); } | negation TLS { if (rule->flag_smtp_starttls) { yyerror("tls already specified for this rule"); YYERROR; } rule->flag_smtp_starttls = $1 ? -1 : 1; } | negation AUTH { if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } rule->flag_smtp_auth = $1 ? -1 : 1; } | negation AUTH tables { struct table *t = $3; if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_STRING|K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } rule->flag_smtp_auth = $1 ? -1 : 1; rule->table_smtp_auth = strdup(t->t_name); } | negation AUTH REGEX tables { struct table *t = $4; if (rule->flag_smtp_auth) { yyerror("auth already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for auth lookups", t->t_name); YYERROR; } rule->flag_smtp_auth = $1 ? -1 : 1; rule->flag_smtp_auth_regex = 1; rule->table_smtp_auth = strdup(t->t_name); } | negation MAIL_FROM tables { struct table *t = $3; if (rule->flag_smtp_mail_from) { yyerror("mail-from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for mail-from lookups", t->t_name); YYERROR; } rule->flag_smtp_mail_from = $1 ? -1 : 1; rule->table_smtp_mail_from = strdup(t->t_name); } | negation MAIL_FROM REGEX tables { struct table *t = $4; if (rule->flag_smtp_mail_from) { yyerror("mail-from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for mail-from lookups", t->t_name); YYERROR; } rule->flag_smtp_mail_from = $1 ? -1 : 1; rule->flag_smtp_mail_from_regex = 1; rule->table_smtp_mail_from = strdup(t->t_name); } | negation RCPT_TO tables { struct table *t = $3; if (rule->flag_smtp_rcpt_to) { yyerror("rcpt-to already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for rcpt-to lookups", t->t_name); YYERROR; } rule->flag_smtp_rcpt_to = $1 ? -1 : 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } | negation RCPT_TO REGEX tables { struct table *t = $4; if (rule->flag_smtp_rcpt_to) { yyerror("rcpt-to already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for rcpt-to lookups", t->t_name); YYERROR; } rule->flag_smtp_rcpt_to = $1 ? -1 : 1; rule->flag_smtp_rcpt_to_regex = 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } | negation FROM SOCKET { if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->flag_from_socket = 1; } | negation FROM LOCAL { struct table *t = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->table_from = strdup(t->t_name); } | negation FROM ANY { struct table *t = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->table_from = strdup(t->t_name); } | negation FROM SRC tables { struct table *t = $4; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_NETADDR)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->table_from = strdup(t->t_name); } | negation FROM SRC REGEX tables { struct table *t = $5; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->flag_from_regex = 1; rule->table_from = strdup(t->t_name); } | negation FROM RDNS { if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->flag_from_rdns = 1; } | negation FROM RDNS tables { struct table *t = $4; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for rdns lookups", t->t_name); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->flag_from_rdns = 1; rule->table_from = strdup(t->t_name); } | negation FROM RDNS REGEX tables { struct table *t = $5; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for rdns lookups", t->t_name); YYERROR; } rule->flag_from = $1 ? -1 : 1; rule->flag_from_regex = 1; rule->flag_from_rdns = 1; rule->table_from = strdup(t->t_name); } | negation FROM AUTH { struct table *anyhost = table_find(conf, ""); if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = $1 ? -1 : 1; } | negation FROM AUTH tables { struct table *anyhost = table_find(conf, ""); struct table *t = $4; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_STRING|K_CREDENTIALS)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = $1 ? -1 : 1; rule->table_smtp_auth = strdup(t->t_name); } | negation FROM AUTH REGEX tables { struct table *anyhost = table_find(conf, ""); struct table *t = $5; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_auth = $1 ? -1 : 1; rule->flag_smtp_auth_regex = 1; rule->table_smtp_auth = strdup(t->t_name); } | negation FROM MAIL_FROM tables { struct table *anyhost = table_find(conf, ""); struct table *t = $4; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_mail_from = $1 ? -1 : 1; rule->table_smtp_mail_from = strdup(t->t_name); } | negation FROM MAIL_FROM REGEX tables { struct table *anyhost = table_find(conf, ""); struct table *t = $5; if (rule->flag_from) { yyerror("from already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for from lookups", t->t_name); YYERROR; } rule->flag_from = 1; rule->table_from = strdup(anyhost->t_name); rule->flag_smtp_mail_from = $1 ? -1 : 1; rule->flag_smtp_mail_from_regex = 1; rule->table_smtp_mail_from = strdup(t->t_name); } | negation FOR LOCAL { struct table *t = table_find(conf, ""); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } rule->flag_for = $1 ? -1 : 1; rule->table_for = strdup(t->t_name); } | negation FOR ANY { struct table *t = table_find(conf, ""); if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } rule->flag_for = $1 ? -1 : 1; rule->table_for = strdup(t->t_name); } | negation FOR DOMAIN tables { struct table *t = $4; if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("table \"%s\" may not be used for 'for' lookups", t->t_name); YYERROR; } rule->flag_for = $1 ? -1 : 1; rule->table_for = strdup(t->t_name); } | negation FOR DOMAIN REGEX tables { struct table *t = $5; if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for 'for' lookups", t->t_name); YYERROR; } rule->flag_for = $1 ? -1 : 1; rule->flag_for_regex = 1; rule->table_for = strdup(t->t_name); } | negation FOR RCPT_TO tables { struct table *anyhost = table_find(conf, ""); struct table *t = $4; if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST|T_HASH, K_MAILADDR)) { yyerror("table \"%s\" may not be used for for lookups", t->t_name); YYERROR; } rule->flag_for = 1; rule->table_for = strdup(anyhost->t_name); rule->flag_smtp_rcpt_to = $1 ? -1 : 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } | negation FOR RCPT_TO REGEX tables { struct table *anyhost = table_find(conf, ""); struct table *t = $5; if (rule->flag_for) { yyerror("for already specified for this rule"); YYERROR; } if (!table_check_use(t, T_DYNAMIC|T_LIST, K_REGEX)) { yyerror("table \"%s\" may not be used for for lookups", t->t_name); YYERROR; } rule->flag_for = 1; rule->table_for = strdup(anyhost->t_name); rule->flag_smtp_rcpt_to = $1 ? -1 : 1; rule->flag_smtp_rcpt_to_regex = 1; rule->table_smtp_rcpt_to = strdup(t->t_name); } ; match_options: match_option match_options | /* empty */ ; match_dispatcher: STRING { if (dict_get(conf->sc_dispatchers, $1) == NULL) { yyerror("no such dispatcher: %s", $1); YYERROR; } rule->dispatcher = $1; } ; action: REJECT { rule->reject = 1; } | ACTION match_dispatcher ; match: MATCH { rule = xcalloc(1, sizeof *rule); } match_options action { if (!rule->flag_from) { rule->table_from = strdup(""); rule->flag_from = 1; } if (!rule->flag_for) { rule->table_for = strdup(""); rule->flag_for = 1; } TAILQ_INSERT_TAIL(conf->sc_rules, rule, r_entry); rule = NULL; } ; filter_action_builtin: filter_action_builtin_nojunk | JUNK { filter_config->junk = 1; } | BYPASS { filter_config->bypass = 1; } ; filter_action_builtin_nojunk: REJECT STRING { filter_config->reject = $2; } | DISCONNECT STRING { filter_config->disconnect = $2; } | REWRITE STRING { filter_config->rewrite = $2; } | REPORT STRING { filter_config->report = $2; } ; filter_phase_check_fcrdns: negation FCRDNS { filter_config->not_fcrdns = $1 ? -1 : 1; filter_config->fcrdns = 1; } ; filter_phase_check_rdns: negation RDNS { filter_config->not_rdns = $1 ? -1 : 1; filter_config->rdns = 1; } ; filter_phase_check_rdns_table: negation RDNS tables { filter_config->not_rdns_table = $1 ? -1 : 1; filter_config->rdns_table = $3; } ; filter_phase_check_rdns_regex: negation RDNS REGEX tables { filter_config->not_rdns_regex = $1 ? -1 : 1; filter_config->rdns_regex = $4; } ; filter_phase_check_src_table: negation SRC tables { filter_config->not_src_table = $1 ? -1 : 1; filter_config->src_table = $3; } ; filter_phase_check_src_regex: negation SRC REGEX tables { filter_config->not_src_regex = $1 ? -1 : 1; filter_config->src_regex = $4; } ; filter_phase_check_helo_table: negation HELO tables { filter_config->not_helo_table = $1 ? -1 : 1; filter_config->helo_table = $3; } ; filter_phase_check_helo_regex: negation HELO REGEX tables { filter_config->not_helo_regex = $1 ? -1 : 1; filter_config->helo_regex = $4; } ; filter_phase_check_auth: negation AUTH { filter_config->not_auth = $1 ? -1 : 1; filter_config->auth = 1; } ; filter_phase_check_auth_table: negation AUTH tables { filter_config->not_auth_table = $1 ? -1 : 1; filter_config->auth_table = $3; } ; filter_phase_check_auth_regex: negation AUTH REGEX tables { filter_config->not_auth_regex = $1 ? -1 : 1; filter_config->auth_regex = $4; } ; filter_phase_check_mail_from_table: negation MAIL_FROM tables { filter_config->not_mail_from_table = $1 ? -1 : 1; filter_config->mail_from_table = $3; } ; filter_phase_check_mail_from_regex: negation MAIL_FROM REGEX tables { filter_config->not_mail_from_regex = $1 ? -1 : 1; filter_config->mail_from_regex = $4; } ; filter_phase_check_rcpt_to_table: negation RCPT_TO tables { filter_config->not_rcpt_to_table = $1 ? -1 : 1; filter_config->rcpt_to_table = $3; } ; filter_phase_check_rcpt_to_regex: negation RCPT_TO REGEX tables { filter_config->not_rcpt_to_regex = $1 ? -1 : 1; filter_config->rcpt_to_regex = $4; } ; filter_phase_global_options: filter_phase_check_fcrdns | filter_phase_check_rdns | filter_phase_check_rdns_regex | filter_phase_check_rdns_table | filter_phase_check_src_regex | filter_phase_check_src_table; filter_phase_connect_options: filter_phase_global_options; filter_phase_helo_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_global_options; filter_phase_auth_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_check_auth | filter_phase_check_auth_table | filter_phase_check_auth_regex | filter_phase_global_options; filter_phase_mail_from_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_check_auth | filter_phase_check_auth_table | filter_phase_check_auth_regex | filter_phase_check_mail_from_table | filter_phase_check_mail_from_regex | filter_phase_global_options; filter_phase_rcpt_to_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_check_auth | filter_phase_check_auth_table | filter_phase_check_auth_regex | filter_phase_check_mail_from_table | filter_phase_check_mail_from_regex | filter_phase_check_rcpt_to_table | filter_phase_check_rcpt_to_regex | filter_phase_global_options; filter_phase_data_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_check_auth | filter_phase_check_auth_table | filter_phase_check_auth_regex | filter_phase_check_mail_from_table | filter_phase_check_mail_from_regex | filter_phase_global_options; /* filter_phase_quit_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_global_options; filter_phase_rset_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_global_options; filter_phase_noop_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_global_options; */ filter_phase_commit_options: filter_phase_check_helo_table | filter_phase_check_helo_regex | filter_phase_check_auth | filter_phase_check_auth_table | filter_phase_check_auth_regex | filter_phase_check_mail_from_table | filter_phase_check_mail_from_regex | filter_phase_global_options; filter_phase_connect: CONNECT { filter_config->phase = FILTER_CONNECT; } MATCH filter_phase_connect_options filter_action_builtin ; filter_phase_helo: HELO { filter_config->phase = FILTER_HELO; } MATCH filter_phase_helo_options filter_action_builtin ; filter_phase_ehlo: EHLO { filter_config->phase = FILTER_EHLO; } MATCH filter_phase_helo_options filter_action_builtin ; filter_phase_auth: AUTH { } MATCH filter_phase_auth_options filter_action_builtin ; filter_phase_mail_from: MAIL_FROM { filter_config->phase = FILTER_MAIL_FROM; } MATCH filter_phase_mail_from_options filter_action_builtin ; filter_phase_rcpt_to: RCPT_TO { filter_config->phase = FILTER_RCPT_TO; } MATCH filter_phase_rcpt_to_options filter_action_builtin ; filter_phase_data: DATA { filter_config->phase = FILTER_DATA; } MATCH filter_phase_data_options filter_action_builtin ; /* filter_phase_data_line: DATA_LINE { filter_config->phase = FILTER_DATA_LINE; } MATCH filter_action_builtin ; filter_phase_quit: QUIT { filter_config->phase = FILTER_QUIT; } filter_phase_quit_options filter_action_builtin ; filter_phase_rset: RSET { filter_config->phase = FILTER_RSET; } MATCH filter_phase_rset_options filter_action_builtin ; filter_phase_noop: NOOP { filter_config->phase = FILTER_NOOP; } MATCH filter_phase_noop_options filter_action_builtin ; */ filter_phase_commit: COMMIT { filter_config->phase = FILTER_COMMIT; } MATCH filter_phase_commit_options filter_action_builtin_nojunk ; filter_phase: filter_phase_connect | filter_phase_helo | filter_phase_ehlo | filter_phase_auth | filter_phase_mail_from | filter_phase_rcpt_to | filter_phase_data /*| filter_phase_data_line*/ /*| filter_phase_quit*/ /*| filter_phase_noop*/ /*| filter_phase_rset*/ | filter_phase_commit ; filterel: STRING { struct filter_config *fr; size_t i; if ((fr = dict_get(conf->sc_filters_dict, $1)) == NULL) { yyerror("no filter exist with that name: %s", $1); free($1); YYERROR; } if (fr->filter_type == FILTER_TYPE_CHAIN) { yyerror("no filter chain allowed within a filter chain: %s", $1); free($1); YYERROR; } for (i = 0; i < filter_config->chain_size; i++) { if (strcmp(filter_config->chain[i], $1) == 0) { yyerror("no filter allowed twice within a filter chain: %s", $1); free($1); YYERROR; } } if (fr->proc) { if (dict_get(&filter_config->chain_procs, fr->proc)) { yyerror("no proc allowed twice within a filter chain: %s", fr->proc); free($1); YYERROR; } dict_set(&filter_config->chain_procs, fr->proc, NULL); } fr->filter_subsystem |= filter_config->filter_subsystem; filter_config->chain_size += 1; filter_config->chain = reallocarray(filter_config->chain, filter_config->chain_size, sizeof(char *)); if (filter_config->chain == NULL) fatal("reallocarray"); filter_config->chain[filter_config->chain_size - 1] = $1; } ; filter_list: filterel optnl | filterel comma filter_list ; filter: FILTER STRING PROC STRING { if (dict_get(conf->sc_filters_dict, $2)) { yyerror("filter already exists with that name: %s", $2); free($2); free($4); YYERROR; } if (dict_get(conf->sc_filter_processes_dict, $4) == NULL) { yyerror("no processor exist with that name: %s", $4); free($4); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_PROC; filter_config->name = $2; filter_config->proc = $4; dict_set(conf->sc_filters_dict, $2, filter_config); filter_config = NULL; } | FILTER STRING PROC_EXEC STRING { if (dict_get(conf->sc_filters_dict, $2)) { yyerror("filter already exists with that name: %s", $2); free($2); free($4); YYERROR; } processor = xcalloc(1, sizeof *processor); processor->command = $4; filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_PROC; filter_config->name = $2; filter_config->proc = xstrdup($2); dict_set(conf->sc_filters_dict, $2, filter_config); } proc_params { dict_set(conf->sc_filter_processes_dict, filter_config->proc, processor); processor = NULL; filter_config = NULL; } | FILTER STRING PHASE { if (dict_get(conf->sc_filters_dict, $2)) { yyerror("filter already exists with that name: %s", $2); free($2); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->name = $2; filter_config->filter_type = FILTER_TYPE_BUILTIN; dict_set(conf->sc_filters_dict, $2, filter_config); } filter_phase { filter_config = NULL; } | FILTER STRING CHAIN { if (dict_get(conf->sc_filters_dict, $2)) { yyerror("filter already exists with that name: %s", $2); free($2); YYERROR; } filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; dict_init(&filter_config->chain_procs); } '{' optnl filter_list '}' { dict_set(conf->sc_filters_dict, $2, filter_config); filter_config = NULL; } ; size : NUMBER { if ($1 < 0) { yyerror("invalid size: %" PRId64, $1); YYERROR; } $$ = $1; } | STRING { long long result; if (scan_scaled($1, &result) == -1 || result < 0) { yyerror("invalid size: %s", $1); free($1); YYERROR; } free($1); $$ = result; } ; bouncedelay : STRING { time_t d; int i; d = delaytonum($1); if (d < 0) { yyerror("invalid bounce delay: %s", $1); free($1); YYERROR; } free($1); for (i = 0; i < MAX_BOUNCE_WARN; i++) { if (conf->sc_bounce_warn[i] != 0) continue; conf->sc_bounce_warn[i] = d; break; } } ; bouncedelays : bouncedelays ',' bouncedelay | bouncedelay ; opt_limit_mda : STRING NUMBER { if (!strcmp($1, "max-session")) { conf->sc_mda_max_session = $2; } else if (!strcmp($1, "max-session-per-user")) { conf->sc_mda_max_user_session = $2; } else if (!strcmp($1, "task-lowat")) { conf->sc_mda_task_lowat = $2; } else if (!strcmp($1, "task-hiwat")) { conf->sc_mda_task_hiwat = $2; } else if (!strcmp($1, "task-release")) { conf->sc_mda_task_release = $2; } else { yyerror("invalid scheduler limit keyword: %s", $1); free($1); YYERROR; } free($1); } ; limits_smtp : opt_limit_smtp limits_smtp | /* empty */ ; opt_limit_smtp : STRING NUMBER { if (!strcmp($1, "max-rcpt")) { conf->sc_session_max_rcpt = $2; } else if (!strcmp($1, "max-mails")) { conf->sc_session_max_mails = $2; } else { yyerror("invalid session limit keyword: %s", $1); free($1); YYERROR; } free($1); } ; limits_mda : opt_limit_mda limits_mda | /* empty */ ; opt_limit_mta : INET4 { limits->family = AF_INET; } | INET6 { limits->family = AF_INET6; } | STRING NUMBER { if (!limit_mta_set(limits, $1, $2)) { yyerror("invalid mta limit keyword: %s", $1); free($1); YYERROR; } free($1); } ; limits_mta : opt_limit_mta limits_mta | /* empty */ ; opt_limit_scheduler : STRING NUMBER { if (!strcmp($1, "max-inflight")) { conf->sc_scheduler_max_inflight = $2; } else if (!strcmp($1, "max-evp-batch-size")) { conf->sc_scheduler_max_evp_batch_size = $2; } else if (!strcmp($1, "max-msg-batch-size")) { conf->sc_scheduler_max_msg_batch_size = $2; } else if (!strcmp($1, "max-schedule")) { conf->sc_scheduler_max_schedule = $2; } else { yyerror("invalid scheduler limit keyword: %s", $1); free($1); YYERROR; } free($1); } ; limits_scheduler: opt_limit_scheduler limits_scheduler | /* empty */ ; opt_sock_listen : FILTER STRING { struct filter_config *fc; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); free($2); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, $2)) == NULL) { yyerror("no filter exist with that name: %s", $2); free($2); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; listen_opts.options |= LO_FILTER; listen_opts.filtername = $2; } | FILTER { char buffer[128]; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); listen_opts.options |= LO_FILTER; listen_opts.filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; dict_init(&filter_config->chain_procs); } '{' optnl filter_list '}' { dict_set(conf->sc_filters_dict, listen_opts.filtername, filter_config); filter_config = NULL; } | MASK_SRC { if (config_lo_mask_source(&listen_opts)) { YYERROR; } } | NO_DSN { if (listen_opts.options & LO_NODSN) { yyerror("no-dsn already specified"); YYERROR; } listen_opts.options |= LO_NODSN; listen_opts.flags &= ~F_EXT_DSN; } | TAG STRING { if (listen_opts.options & LO_TAG) { yyerror("tag already specified"); YYERROR; } listen_opts.options |= LO_TAG; if (strlen($2) >= SMTPD_TAG_SIZE) { yyerror("tag name too long"); free($2); YYERROR; } listen_opts.tag = $2; } ; opt_if_listen : INET4 { if (listen_opts.options & LO_FAMILY) { yyerror("address family already specified"); YYERROR; } listen_opts.options |= LO_FAMILY; listen_opts.family = AF_INET; } | INET6 { if (listen_opts.options & LO_FAMILY) { yyerror("address family already specified"); YYERROR; } listen_opts.options |= LO_FAMILY; listen_opts.family = AF_INET6; } | PORT STRING { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname($2, "tcp"); if (servent == NULL) { yyerror("invalid port: %s", $2); free($2); YYERROR; } free($2); listen_opts.port = ntohs(servent->s_port); } | PORT SMTP { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname("smtp", "tcp"); if (servent == NULL) { yyerror("invalid port: smtp"); YYERROR; } listen_opts.port = ntohs(servent->s_port); } | PORT SMTPS { struct servent *servent; if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; servent = getservbyname("smtps", "tcp"); if (servent == NULL) { yyerror("invalid port: smtps"); YYERROR; } listen_opts.port = ntohs(servent->s_port); } | PORT NUMBER { if (listen_opts.options & LO_PORT) { yyerror("port already specified"); YYERROR; } listen_opts.options |= LO_PORT; if ($2 <= 0 || $2 > (int)USHRT_MAX) { yyerror("invalid port: %" PRId64, $2); YYERROR; } listen_opts.port = $2; } | FILTER STRING { struct filter_config *fc; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } if ((fc = dict_get(conf->sc_filters_dict, $2)) == NULL) { yyerror("no filter exist with that name: %s", $2); free($2); YYERROR; } fc->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; listen_opts.options |= LO_FILTER; listen_opts.filtername = $2; } | FILTER { char buffer[128]; if (listen_opts.options & LO_FILTER) { yyerror("filter already specified"); YYERROR; } do { (void)snprintf(buffer, sizeof buffer, "", last_dynchain_id++); } while (dict_check(conf->sc_filters_dict, buffer)); listen_opts.options |= LO_FILTER; listen_opts.filtername = xstrdup(buffer); filter_config = xcalloc(1, sizeof *filter_config); filter_config->filter_type = FILTER_TYPE_CHAIN; filter_config->filter_subsystem |= FILTER_SUBSYSTEM_SMTP_IN; dict_init(&filter_config->chain_procs); } '{' optnl filter_list '}' { dict_set(conf->sc_filters_dict, listen_opts.filtername, filter_config); filter_config = NULL; } | SMTPS { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_SMTPS; } | SMTPS VERIFY { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_SMTPS|F_TLS_VERIFY; } | TLS { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS; } | TLS_REQUIRE { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS|F_STARTTLS_REQUIRE; } | TLS_REQUIRE VERIFY { if (listen_opts.options & LO_SSL) { yyerror("TLS mode already specified"); YYERROR; } listen_opts.options |= LO_SSL; listen_opts.ssl = F_STARTTLS|F_STARTTLS_REQUIRE|F_TLS_VERIFY; } | CIPHERS STRING { if (listen_opts.tls_ciphers) { yyerror("ciphers already specified"); YYERROR; } listen_opts.tls_ciphers = $2; } | PROTOCOLS STRING { if (listen_opts.tls_protocols) { yyerror("protocols already specified"); YYERROR; } listen_opts.tls_protocols = $2; } | PKI STRING { if (listen_opts.pkicount == PKI_MAX) { yyerror("too many pki specified"); YYERROR; } listen_opts.pki[listen_opts.pkicount++] = $2; } | CA STRING { if (listen_opts.options & LO_CA) { yyerror("ca already specified"); YYERROR; } listen_opts.options |= LO_CA; listen_opts.ca = $2; } | AUTH { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.auth = F_AUTH|F_AUTH_REQUIRE; } | AUTH_OPTIONAL { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.auth = F_AUTH; } | AUTH tables { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.authtable = $2; listen_opts.auth = F_AUTH|F_AUTH_REQUIRE; } | AUTH_OPTIONAL tables { if (listen_opts.options & LO_AUTH) { yyerror("auth already specified"); YYERROR; } listen_opts.options |= LO_AUTH; listen_opts.authtable = $2; listen_opts.auth = F_AUTH; } | TAG STRING { if (listen_opts.options & LO_TAG) { yyerror("tag already specified"); YYERROR; } listen_opts.options |= LO_TAG; if (strlen($2) >= SMTPD_TAG_SIZE) { yyerror("tag name too long"); free($2); YYERROR; } listen_opts.tag = $2; } | HOSTNAME STRING { if (listen_opts.options & LO_HOSTNAME) { yyerror("hostname already specified"); YYERROR; } listen_opts.options |= LO_HOSTNAME; listen_opts.hostname = $2; } | HOSTNAMES tables { struct table *t = $2; if (listen_opts.options & LO_HOSTNAMES) { yyerror("hostnames already specified"); YYERROR; } listen_opts.options |= LO_HOSTNAMES; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("invalid use of table \"%s\" as " "HOSTNAMES parameter", t->t_name); YYERROR; } listen_opts.hostnametable = t; } | MASK_SRC { if (config_lo_mask_source(&listen_opts)) { YYERROR; } } | RECEIVEDAUTH { if (listen_opts.options & LO_RECEIVEDAUTH) { yyerror("received-auth already specified"); YYERROR; } listen_opts.options |= LO_RECEIVEDAUTH; listen_opts.flags |= F_RECEIVEDAUTH; } | NO_DSN { if (listen_opts.options & LO_NODSN) { yyerror("no-dsn already specified"); YYERROR; } listen_opts.options |= LO_NODSN; listen_opts.flags &= ~F_EXT_DSN; } | PROXY_V2 { if (listen_opts.options & LO_PROXY) { yyerror("proxy-v2 already specified"); YYERROR; } listen_opts.options |= LO_PROXY; listen_opts.flags |= F_PROXY; } | SENDERS tables { struct table *t = $2; if (listen_opts.options & LO_SENDERS) { yyerror("senders already specified"); YYERROR; } listen_opts.options |= LO_SENDERS; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; } listen_opts.sendertable = t; } | SENDERS tables MASQUERADE { struct table *t = $2; if (listen_opts.options & LO_SENDERS) { yyerror("senders already specified"); YYERROR; } listen_opts.options |= LO_SENDERS|LO_MASQUERADE; if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; } listen_opts.sendertable = t; } ; listener_type : socket_listener | if_listener ; socket_listener : SOCKET sock_listen { if (conf->sc_sock_listener) { yyerror("socket listener already configured"); YYERROR; } create_sock_listener(&listen_opts); } ; if_listener : STRING if_listen { listen_opts.ifx = $1; create_if_listener(&listen_opts); } ; sock_listen : opt_sock_listen sock_listen | /* empty */ ; if_listen : opt_if_listen if_listen | /* empty */ ; listen : LISTEN { memset(&listen_opts, 0, sizeof listen_opts); listen_opts.family = AF_UNSPEC; listen_opts.flags |= F_EXT_DSN; } ON listener_type { free(listen_opts.tls_protocols); free(listen_opts.tls_ciphers); memset(&listen_opts, 0, sizeof listen_opts); } ; table : TABLE STRING STRING { char *p, *backend, *config; p = $3; if (*p == '/') { backend = "static"; config = $3; } else { backend = $3; config = NULL; for (p = $3; *p && *p != ':'; p++) ; if (*p == ':') { *p = '\0'; backend = $3; config = p+1; } } if (config != NULL && *config != '/') { yyerror("invalid backend parameter for table: %s", $2); free($2); free($3); YYERROR; } table = table_create(conf, backend, $2, config); if (!table_config(table)) { yyerror("invalid configuration file %s for table %s", config, table->t_name); free($2); free($3); YYERROR; } table = NULL; free($2); free($3); } | TABLE STRING { table = table_create(conf, "static", $2, NULL); free($2); } '{' optnl tableval_list '}' { table = NULL; } ; tablenew : STRING { struct table *t; t = table_create(conf, "static", NULL, NULL); table_add(t, $1, NULL); free($1); $$ = t; } | '{' optnl { table = table_create(conf, "static", NULL, NULL); } tableval_list '}' { $$ = table; table = NULL; } ; tableref : '<' STRING '>' { struct table *t; if ((t = table_find(conf, $2)) == NULL) { yyerror("no such table: %s", $2); free($2); YYERROR; } free($2); $$ = t; } ; tables : tablenew { $$ = $1; } | tableref { $$ = $1; } ; %% struct keywords { const char *k_name; int k_val; }; int yyerror(const char *fmt, ...) { va_list ap; char *msg; file->errors++; va_start(ap, fmt); if (vasprintf(&msg, fmt, ap) == -1) fatalx("yyerror vasprintf"); va_end(ap); logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg); free(msg); return (0); } int kw_cmp(const void *k, const void *e) { return (strcmp(k, ((const struct keywords *)e)->k_name)); } int lookup(char *s) { /* this has to be sorted always */ static const struct keywords keywords[] = { { "action", ACTION }, { "admd", ADMD }, { "alias", ALIAS }, { "any", ANY }, { "auth", AUTH }, { "auth-optional", AUTH_OPTIONAL }, { "backup", BACKUP }, { "bounce", BOUNCE }, { "bypass", BYPASS }, { "ca", CA }, { "cert", CERT }, { "chain", CHAIN }, { "chroot", CHROOT }, { "ciphers", CIPHERS }, { "commit", COMMIT }, { "compression", COMPRESSION }, { "connect", CONNECT }, { "data", DATA }, { "data-line", DATA_LINE }, { "dhe", DHE }, { "disconnect", DISCONNECT }, { "domain", DOMAIN }, { "ehlo", EHLO }, { "encryption", ENCRYPTION }, { "expand-only", EXPAND_ONLY }, { "fcrdns", FCRDNS }, { "filter", FILTER }, { "for", FOR }, { "forward-only", FORWARD_ONLY }, { "from", FROM }, { "group", GROUP }, { "helo", HELO }, { "helo-src", HELO_SRC }, { "host", HOST }, { "hostname", HOSTNAME }, { "hostnames", HOSTNAMES }, { "include", INCLUDE }, { "inet4", INET4 }, { "inet6", INET6 }, { "junk", JUNK }, { "key", KEY }, { "limit", LIMIT }, { "listen", LISTEN }, { "lmtp", LMTP }, { "local", LOCAL }, { "mail-from", MAIL_FROM }, { "maildir", MAILDIR }, { "mask-src", MASK_SRC }, { "masquerade", MASQUERADE }, { "match", MATCH }, { "max-deferred", MAX_DEFERRED }, { "max-message-size", MAX_MESSAGE_SIZE }, { "mbox", MBOX }, { "mda", MDA }, { "mta", MTA }, { "mx", MX }, { "no-dsn", NO_DSN }, { "no-verify", NO_VERIFY }, { "noop", NOOP }, { "on", ON }, { "phase", PHASE }, { "pki", PKI }, { "port", PORT }, { "proc", PROC }, { "proc-exec", PROC_EXEC }, { "protocols", PROTOCOLS }, { "proxy-v2", PROXY_V2 }, { "queue", QUEUE }, { "quit", QUIT }, { "rcpt-to", RCPT_TO }, { "rdns", RDNS }, { "received-auth", RECEIVEDAUTH }, { "recipient", RECIPIENT }, { "regex", REGEX }, { "reject", REJECT }, { "relay", RELAY }, { "report", REPORT }, { "rewrite", REWRITE }, { "rset", RSET }, { "scheduler", SCHEDULER }, { "senders", SENDERS }, { "smtp", SMTP }, { "smtp-in", SMTP_IN }, { "smtp-out", SMTP_OUT }, { "smtps", SMTPS }, { "socket", SOCKET }, { "src", SRC }, { "srs", SRS }, { "sub-addr-delim", SUB_ADDR_DELIM }, { "table", TABLE }, { "tag", TAG }, { "tagged", TAGGED }, { "tls", TLS }, { "tls-require", TLS_REQUIRE }, { "ttl", TTL }, { "user", USER }, { "userbase", USERBASE }, { "verify", VERIFY }, { "virtual", VIRTUAL }, { "warn-interval", WARN_INTERVAL }, { "wrapper", WRAPPER }, }; const struct keywords *p; p = bsearch(s, keywords, sizeof(keywords)/sizeof(keywords[0]), sizeof(keywords[0]), kw_cmp); if (p) return (p->k_val); else return (STRING); } #define START_EXPAND 1 #define DONE_EXPAND 2 static int expanding; int igetc(void) { int c; while (1) { if (file->ungetpos > 0) c = file->ungetbuf[--file->ungetpos]; else c = getc(file->stream); if (c == START_EXPAND) expanding = 1; else if (c == DONE_EXPAND) expanding = 0; else break; } return (c); } int lgetc(int quotec) { int c, next; if (quotec) { if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing " "quoted string"); if (file == topfile || popfile() == EOF) return (EOF); return (quotec); } return (c); } while ((c = igetc()) == '\\') { next = igetc(); if (next != '\n') { c = next; break; } yylval.lineno = file->lineno; file->lineno++; } if (c == EOF) { /* * Fake EOL when hit EOF for the first time. This gets line * count right if last line in included file is syntactically * invalid and has no newline. */ if (file->eof_reached == 0) { file->eof_reached = 1; return ('\n'); } while (c == EOF) { if (file == topfile || popfile() == EOF) return (EOF); c = igetc(); } } return (c); } void lungetc(int c) { if (c == EOF) return; if (file->ungetpos >= file->ungetsize) { void *p = reallocarray(file->ungetbuf, file->ungetsize, 2); if (p == NULL) fatal("%s", __func__); file->ungetbuf = p; file->ungetsize *= 2; } file->ungetbuf[file->ungetpos++] = c; } int findeol(void) { int c; /* skip to either EOF or the first real EOL */ while (1) { c = lgetc(0); if (c == '\n') { file->lineno++; break; } if (c == EOF) break; } return (ERROR); } int yylex(void) { char buf[8096]; char *p, *val; int quotec, next, c; int token; top: p = buf; while ((c = lgetc(0)) == ' ' || c == '\t') ; /* nothing */ yylval.lineno = file->lineno; if (c == '#') while ((c = lgetc(0)) != '\n' && c != EOF) ; /* nothing */ if (c == '$' && !expanding) { while (1) { if ((c = lgetc(0)) == EOF) return (0); if (p + 1 >= buf + sizeof(buf) - 1) { yyerror("string too long"); return (findeol()); } if (isalnum(c) || c == '_') { *p++ = c; continue; } *p = '\0'; lungetc(c); break; } val = symget(buf); if (val == NULL) { yyerror("macro '%s' not defined", buf); return (findeol()); } p = val + strlen(val) - 1; lungetc(DONE_EXPAND); while (p >= val) { lungetc((unsigned char)*p); p--; } lungetc(START_EXPAND); goto top; } switch (c) { case '\'': case '"': quotec = c; while (1) { if ((c = lgetc(quotec)) == EOF) return (0); if (c == '\n') { file->lineno++; continue; } else if (c == '\\') { if ((next = lgetc(quotec)) == EOF) return (0); if (next == quotec || next == ' ' || next == '\t') c = next; else if (next == '\n') { file->lineno++; continue; } else lungetc(next); } else if (c == quotec) { *p = '\0'; break; } else if (c == '\0') { yyerror("syntax error"); return (findeol()); } if (p + 1 >= buf + sizeof(buf) - 1) { yyerror("string too long"); return (findeol()); } *p++ = c; } yylval.v.string = strdup(buf); if (yylval.v.string == NULL) fatal("%s", __func__); return (STRING); } #define allowed_to_end_number(x) \ (isspace(x) || x == ')' || x ==',' || x == '/' || x == '}' || x == '=') if (c == '-' || isdigit(c)) { do { *p++ = c; if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } } while ((c = lgetc(0)) != EOF && isdigit(c)); lungetc(c); if (p == buf + 1 && buf[0] == '-') goto nodigits; if (c == EOF || allowed_to_end_number(c)) { const char *errstr = NULL; *p = '\0'; yylval.v.number = strtonum(buf, LLONG_MIN, LLONG_MAX, &errstr); if (errstr) { yyerror("\"%s\" invalid number: %s", buf, errstr); return (findeol()); } return (NUMBER); } else { nodigits: while (p > buf + 1) lungetc((unsigned char)*--p); c = (unsigned char)*--p; if (c == '-') return (c); } } if (c == '=') { if ((c = lgetc(0)) != EOF && c == '>') return (ARROW); lungetc(c); c = '='; } #define allowed_in_string(x) \ (isalnum(x) || (ispunct(x) && x != '(' && x != ')' && \ x != '{' && x != '}' && x != '<' && x != '>' && \ x != '!' && x != '=' && x != '#' && \ x != ',')) if (isalnum(c) || c == ':' || c == '_') { do { *p++ = c; if ((size_t)(p-buf) >= sizeof(buf)) { yyerror("string too long"); return (findeol()); } } while ((c = lgetc(0)) != EOF && (allowed_in_string(c))); lungetc(c); *p = '\0'; if ((token = lookup(buf)) == STRING) if ((yylval.v.string = strdup(buf)) == NULL) fatal("%s", __func__); return (token); } if (c == '\n') { yylval.lineno = file->lineno; file->lineno++; } if (c == EOF) return (0); return (c); } int check_file_secrecy(int fd, const char *fname) { struct stat st; if (fstat(fd, &st)) { log_warn("warn: cannot stat %s", fname); return (-1); } if (st.st_uid != 0 && st.st_uid != getuid()) { log_warnx("warn: %s: owner not root or current user", fname); return (-1); } if (st.st_mode & (S_IWGRP | S_IXGRP | S_IRWXO)) { log_warnx("warn: %s: group/world readable/writeable", fname); return (-1); } return (0); } struct file * pushfile(const char *name, int secret) { struct file *nfile; if ((nfile = calloc(1, sizeof(struct file))) == NULL) { log_warn("%s", __func__); return (NULL); } if ((nfile->name = strdup(name)) == NULL) { log_warn("%s", __func__); free(nfile); return (NULL); } if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { log_warn("%s: %s", __func__, nfile->name); free(nfile->name); free(nfile); return (NULL); } else if (secret && check_file_secrecy(fileno(nfile->stream), nfile->name)) { fclose(nfile->stream); free(nfile->name); free(nfile); return (NULL); } nfile->lineno = TAILQ_EMPTY(&files) ? 1 : 0; nfile->ungetsize = 16; nfile->ungetbuf = malloc(nfile->ungetsize); if (nfile->ungetbuf == NULL) { log_warn("%s", __func__); fclose(nfile->stream); free(nfile->name); free(nfile); return (NULL); } TAILQ_INSERT_TAIL(&files, nfile, entry); return (nfile); } int popfile(void) { struct file *prev; if ((prev = TAILQ_PREV(file, files, entry)) != NULL) prev->errors += file->errors; TAILQ_REMOVE(&files, file, entry); fclose(file->stream); free(file->name); free(file->ungetbuf); free(file); file = prev; return (file ? 0 : EOF); } int parse_config(struct smtpd *x_conf, const char *filename, int opts) { struct sym *sym, *next; conf = x_conf; errors = 0; if ((file = pushfile(filename, 0)) == NULL) { purge_config(PURGE_EVERYTHING); return (-1); } topfile = file; /* * parse configuration */ setservent(1); yyparse(); errors = file->errors; popfile(); endservent(); /* If the socket listener was not configured, create a default one. */ if (!conf->sc_sock_listener) { memset(&listen_opts, 0, sizeof listen_opts); listen_opts.family = AF_UNSPEC; listen_opts.flags |= F_EXT_DSN; create_sock_listener(&listen_opts); } /* Free macros and check which have not been used. */ TAILQ_FOREACH_SAFE(sym, &symhead, entry, next) { if ((conf->sc_opts & SMTPD_OPT_VERBOSE) && !sym->used) fprintf(stderr, "warning: macro '%s' not " "used\n", sym->nam); if (!sym->persist) { free(sym->nam); free(sym->val); TAILQ_REMOVE(&symhead, sym, entry); free(sym); } } if (TAILQ_EMPTY(conf->sc_rules)) { log_warnx("warn: no rules, nothing to do"); errors++; } if (errors) { purge_config(PURGE_EVERYTHING); return (-1); } return (0); } int symset(const char *nam, const char *val, int persist) { struct sym *sym; TAILQ_FOREACH(sym, &symhead, entry) { if (strcmp(nam, sym->nam) == 0) break; } if (sym != NULL) { if (sym->persist == 1) return (0); else { free(sym->nam); free(sym->val); TAILQ_REMOVE(&symhead, sym, entry); free(sym); } } if ((sym = calloc(1, sizeof(*sym))) == NULL) return (-1); sym->nam = strdup(nam); if (sym->nam == NULL) { free(sym); return (-1); } sym->val = strdup(val); if (sym->val == NULL) { free(sym->nam); free(sym); return (-1); } sym->used = 0; sym->persist = persist; TAILQ_INSERT_TAIL(&symhead, sym, entry); return (0); } int cmdline_symset(char *s) { char *sym, *val; int ret; if ((val = strrchr(s, '=')) == NULL) return (-1); sym = strndup(s, val - s); if (sym == NULL) fatalx("%s: strndup", __func__); ret = symset(sym, val + 1, 1); free(sym); return (ret); } char * symget(const char *nam) { struct sym *sym; TAILQ_FOREACH(sym, &symhead, entry) { if (strcmp(nam, sym->nam) == 0) { sym->used = 1; return (sym->val); } } return (NULL); } static void create_sock_listener(struct listen_opts *lo) { struct listener *l = xcalloc(1, sizeof(*l)); lo->hostname = conf->sc_hostname; l->ss.ss_family = AF_LOCAL; #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN l->ss.ss_len = sizeof(struct sockaddr *); #endif l->local = 1; conf->sc_sock_listener = l; config_listener(l, lo); } static void create_if_listener(struct listen_opts *lo) { uint16_t flags; if (lo->port != 0 && lo->ssl == F_SSL) fatalx("invalid listen option: tls/smtps on same port"); if (lo->auth != 0 && !lo->ssl) fatalx("invalid listen option: auth requires tls/smtps"); if (lo->pkicount && !lo->ssl) fatalx("invalid listen option: pki requires tls/smtps"); if (lo->pkicount == 0 && lo->ssl) fatalx("invalid listen option: pki required for tls/smtps"); flags = lo->flags; if (lo->port) { lo->flags = lo->ssl|lo->auth|flags; lo->port = htons(lo->port); } else { if (lo->ssl & F_SMTPS) { lo->port = htons(465); lo->flags = F_SMTPS|lo->auth|flags; } if (!lo->ssl || (lo->ssl & F_STARTTLS)) { lo->port = htons(25); lo->flags = lo->auth|flags; if (lo->ssl & F_STARTTLS) lo->flags |= F_STARTTLS; } } if (interface(lo)) return; if (host_v4(lo)) return; if (host_v6(lo)) return; if (host_dns(lo)) return; fatalx("invalid virtual ip or interface: %s", lo->ifx); } static void config_listener(struct listener *h, struct listen_opts *lo) { int i; h->fd = -1; h->port = lo->port; h->flags = lo->flags; if (lo->hostname == NULL) lo->hostname = conf->sc_hostname; if (lo->options & LO_FILTER) { h->flags |= F_FILTERED; (void)strlcpy(h->filter_name, lo->filtername, sizeof(h->filter_name)); } if (lo->authtable != NULL) (void)strlcpy(h->authtable, lo->authtable->t_name, sizeof(h->authtable)); h->pkicount = lo->pkicount; if (h->pkicount) { h->pki = calloc(h->pkicount, sizeof(*h->pki)); if (h->pki == NULL) fatal("calloc"); } for (i = 0; i < lo->pkicount; i++) { h->pki[i] = dict_get(conf->sc_pki_dict, lo->pki[i]); if (h->pki[i] == NULL) { log_warnx("pki name not found: %s", lo->pki[i]); fatalx(NULL); } } if (lo->tls_ciphers != NULL && (h->tls_ciphers = strdup(lo->tls_ciphers)) == NULL) { fatal("strdup"); } if (lo->tls_protocols != NULL && (h->tls_protocols = strdup(lo->tls_protocols)) == NULL) { fatal("strdup"); } if (lo->ca != NULL) { if (!lowercase(h->ca_name, lo->ca, sizeof(h->ca_name))) { log_warnx("ca name too long: %s", lo->ca); fatalx(NULL); } if (dict_get(conf->sc_ca_dict, h->ca_name) == NULL) { log_warnx("ca name not found: %s", lo->ca); fatalx(NULL); } } if (lo->tag != NULL) (void)strlcpy(h->tag, lo->tag, sizeof(h->tag)); (void)strlcpy(h->hostname, lo->hostname, sizeof(h->hostname)); if (lo->hostnametable) (void)strlcpy(h->hostnametable, lo->hostnametable->t_name, sizeof(h->hostnametable)); if (lo->sendertable) { (void)strlcpy(h->sendertable, lo->sendertable->t_name, sizeof(h->sendertable)); if (lo->options & LO_MASQUERADE) h->flags |= F_MASQUERADE; } if (lo->ssl & F_TLS_VERIFY) h->flags |= F_TLS_VERIFY; if (lo->ssl & F_STARTTLS_REQUIRE) h->flags |= F_STARTTLS_REQUIRE; if (h != conf->sc_sock_listener) TAILQ_INSERT_TAIL(conf->sc_listeners, h, entry); } static int host_v4(struct listen_opts *lo) { struct in_addr ina; struct sockaddr_in *sain; struct listener *h; if (lo->family != AF_UNSPEC && lo->family != AF_INET) return (0); memset(&ina, 0, sizeof(ina)); if (inet_pton(AF_INET, lo->ifx, &ina) != 1) return (0); h = xcalloc(1, sizeof(*h)); sain = (struct sockaddr_in *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_family = AF_INET; sain->sin_addr.s_addr = ina.s_addr; sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; config_listener(h, lo); return (1); } static int host_v6(struct listen_opts *lo) { struct in6_addr ina6; struct sockaddr_in6 *sin6; struct listener *h; if (lo->family != AF_UNSPEC && lo->family != AF_INET6) return (0); memset(&ina6, 0, sizeof(ina6)); if (inet_pton(AF_INET6, lo->ifx, &ina6) != 1) return (0); h = xcalloc(1, sizeof(*h)); sin6 = (struct sockaddr_in6 *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_family = AF_INET6; sin6->sin6_port = lo->port; memcpy(&sin6->sin6_addr, &ina6, sizeof(ina6)); if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; config_listener(h, lo); return (1); } static int host_dns(struct listen_opts *lo) { struct addrinfo hints, *res0, *res; int error, cnt = 0; struct sockaddr_in *sain; struct sockaddr_in6 *sin6; struct listener *h; memset(&hints, 0, sizeof(hints)); hints.ai_family = lo->family; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_ADDRCONFIG; error = getaddrinfo(lo->ifx, NULL, &hints, &res0); if (error == EAI_AGAIN || error == EAI_NODATA || error == EAI_NONAME) return (0); if (error) { log_warnx("warn: host_dns: could not parse \"%s\": %s", lo->ifx, gai_strerror(error)); return (-1); } for (res = res0; res; res = res->ai_next) { if (res->ai_family != AF_INET && res->ai_family != AF_INET6) continue; h = xcalloc(1, sizeof(*h)); h->ss.ss_family = res->ai_family; if (res->ai_family == AF_INET) { sain = (struct sockaddr_in *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_addr.s_addr = ((struct sockaddr_in *) res->ai_addr)->sin_addr.s_addr; sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; } else { sin6 = (struct sockaddr_in6 *)&h->ss; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif memcpy(&sin6->sin6_addr, &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr, sizeof(struct in6_addr)); sin6->sin6_port = lo->port; if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; } config_listener(h, lo); cnt++; } freeaddrinfo(res0); return (cnt); } static int interface(struct listen_opts *lo) { struct ifaddrs *ifap, *p; struct sockaddr_in *sain; struct sockaddr_in6 *sin6; struct listener *h; int ret = 0; if (getifaddrs(&ifap) == -1) fatal("getifaddrs"); for (p = ifap; p != NULL; p = p->ifa_next) { if (p->ifa_addr == NULL) continue; if (strcmp(p->ifa_name, lo->ifx) != 0 && !is_if_in_group(p->ifa_name, lo->ifx)) continue; if (lo->family != AF_UNSPEC && lo->family != p->ifa_addr->sa_family) continue; h = xcalloc(1, sizeof(*h)); switch (p->ifa_addr->sa_family) { case AF_INET: sain = (struct sockaddr_in *)&h->ss; *sain = *(struct sockaddr_in *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif sain->sin_port = lo->port; if (sain->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) h->local = 1; break; case AF_INET6: sin6 = (struct sockaddr_in6 *)&h->ss; *sin6 = *(struct sockaddr_in6 *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_port = lo->port; #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sin6->sin6_addr) || #ifdef USE_IPV6_ADDR_SCOPE_NODELOCAL IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) && #else IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr)) && #endif sin6->sin6_scope_id == 0) { sin6->sin6_scope_id = ntohs( *(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); sin6->sin6_addr.s6_addr[2] = 0; sin6->sin6_addr.s6_addr[3] = 0; } #endif if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) h->local = 1; break; default: free(h); continue; } config_listener(h, lo); ret = 1; } freeifaddrs(ifap); return ret; } int delaytonum(char *str) { unsigned int factor; size_t len; const char *errstr = NULL; int delay; /* we need at least 1 digit and 1 unit */ len = strlen(str); if (len < 2) goto bad; switch(str[len - 1]) { case 's': factor = 1; break; case 'm': factor = 60; break; case 'h': factor = 60 * 60; break; case 'd': factor = 24 * 60 * 60; break; default: goto bad; } str[len - 1] = '\0'; delay = strtonum(str, 1, INT_MAX / factor, &errstr); if (errstr) goto bad; return (delay * factor); bad: return (-1); } int is_if_in_group(const char *ifname, const char *groupname) { #ifdef HAVE_STRUCT_IFGROUPREQ unsigned int len; struct ifgroupreq ifgr; struct ifg_req *ifg; int s; int ret = 0; if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) fatal("socket"); memset(&ifgr, 0, sizeof(ifgr)); if (strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ) >= IFNAMSIZ) fatalx("interface name too large"); if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { if (errno == EINVAL || errno == ENOTTY) goto end; fatal("SIOCGIFGROUP"); } len = ifgr.ifgr_len; ifgr.ifgr_groups = xcalloc(len/sizeof(struct ifg_req), sizeof(struct ifg_req)); if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) fatal("SIOCGIFGROUP"); ifg = ifgr.ifgr_groups; for (; ifg && len >= sizeof(struct ifg_req); ifg++) { len -= sizeof(struct ifg_req); if (strcmp(ifg->ifgrq_group, groupname) == 0) { ret = 1; break; } } free(ifgr.ifgr_groups); end: close(s); return ret; #else return (0); #endif } static int config_lo_mask_source(struct listen_opts *lo) { if (lo->options & LO_MASKSOURCE) { yyerror("mask-source already specified"); return -1; } lo->options |= LO_MASKSOURCE; lo->flags |= F_MASK_SOURCE; return 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/iobuf.c0000644000175000001440000001645314610663500013627 /* $OpenBSD: iobuf.c,v 1.16 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #ifdef IO_TLS #include #endif #include #include "iobuf.h" #define IOBUF_MAX 65536 #define IOBUFQ_MIN 4096 struct ioqbuf *ioqbuf_alloc(struct iobuf *, size_t); void iobuf_drain(struct iobuf *, size_t); int iobuf_init(struct iobuf *io, size_t size, size_t max) { memset(io, 0, sizeof *io); if (max == 0) max = IOBUF_MAX; if (size == 0) size = max; if (size > max) return (-1); if ((io->buf = calloc(size, 1)) == NULL) return (-1); io->size = size; io->max = max; return (0); } void iobuf_clear(struct iobuf *io) { struct ioqbuf *q; free(io->buf); while ((q = io->outq)) { io->outq = q->next; free(q); } memset(io, 0, sizeof (*io)); } void iobuf_drain(struct iobuf *io, size_t n) { struct ioqbuf *q; size_t left = n; while ((q = io->outq) && left) { if ((q->wpos - q->rpos) > left) { q->rpos += left; left = 0; } else { left -= q->wpos - q->rpos; io->outq = q->next; free(q); } } io->queued -= (n - left); if (io->outq == NULL) io->outqlast = NULL; } int iobuf_extend(struct iobuf *io, size_t n) { char *t; if (n > io->max) return (-1); if (io->max - io->size < n) return (-1); t = recallocarray(io->buf, io->size, io->size + n, 1); if (t == NULL) return (-1); io->size += n; io->buf = t; return (0); } size_t iobuf_left(struct iobuf *io) { return io->size - io->wpos; } size_t iobuf_space(struct iobuf *io) { return io->size - (io->wpos - io->rpos); } size_t iobuf_len(struct iobuf *io) { return io->wpos - io->rpos; } char * iobuf_data(struct iobuf *io) { return io->buf + io->rpos; } void iobuf_drop(struct iobuf *io, size_t n) { if (n >= iobuf_len(io)) { io->rpos = io->wpos = 0; return; } io->rpos += n; } char * iobuf_getline(struct iobuf *iobuf, size_t *rlen) { char *buf; size_t len, i; buf = iobuf_data(iobuf); len = iobuf_len(iobuf); for (i = 0; i + 1 <= len; i++) if (buf[i] == '\n') { /* Note: the returned address points into the iobuf * buffer. We NUL-end it for convenience, and discard * the data from the iobuf, so that the caller doesn't * have to do it. The data remains "valid" as long * as the iobuf does not overwrite it, that is until * the next call to iobuf_normalize() or iobuf_extend(). */ iobuf_drop(iobuf, i + 1); buf[i] = '\0'; if (rlen) *rlen = i; return (buf); } return (NULL); } void iobuf_normalize(struct iobuf *io) { if (io->rpos == 0) return; if (io->rpos == io->wpos) { io->rpos = io->wpos = 0; return; } memmove(io->buf, io->buf + io->rpos, io->wpos - io->rpos); io->wpos -= io->rpos; io->rpos = 0; } ssize_t iobuf_read(struct iobuf *io, int fd) { ssize_t n; n = read(fd, io->buf + io->wpos, iobuf_left(io)); if (n == -1) { /* XXX is this really what we want? */ if (errno == EAGAIN || errno == EINTR) return (IOBUF_WANT_READ); return (IOBUF_ERROR); } if (n == 0) return (IOBUF_CLOSED); io->wpos += n; return (n); } struct ioqbuf * ioqbuf_alloc(struct iobuf *io, size_t len) { struct ioqbuf *q; if (len < IOBUFQ_MIN) len = IOBUFQ_MIN; if ((q = malloc(sizeof(*q) + len)) == NULL) return (NULL); q->rpos = 0; q->wpos = 0; q->size = len; q->next = NULL; q->buf = (char *)(q) + sizeof(*q); if (io->outqlast == NULL) io->outq = q; else io->outqlast->next = q; io->outqlast = q; return (q); } size_t iobuf_queued(struct iobuf *io) { return io->queued; } void * iobuf_reserve(struct iobuf *io, size_t len) { struct ioqbuf *q; void *r; if (len == 0) return (NULL); if (((q = io->outqlast) == NULL) || q->size - q->wpos <= len) { if ((q = ioqbuf_alloc(io, len)) == NULL) return (NULL); } r = q->buf + q->wpos; q->wpos += len; io->queued += len; return (r); } int iobuf_queue(struct iobuf *io, const void *data, size_t len) { void *buf; if (len == 0) return (0); if ((buf = iobuf_reserve(io, len)) == NULL) return (-1); memmove(buf, data, len); return (len); } int iobuf_queuev(struct iobuf *io, const struct iovec *iov, int iovcnt) { int i; size_t len = 0; char *buf; for (i = 0; i < iovcnt; i++) len += iov[i].iov_len; if ((buf = iobuf_reserve(io, len)) == NULL) return (-1); for (i = 0; i < iovcnt; i++) { if (iov[i].iov_len == 0) continue; memmove(buf, iov[i].iov_base, iov[i].iov_len); buf += iov[i].iov_len; } return (0); } int iobuf_fqueue(struct iobuf *io, const char *fmt, ...) { va_list ap; int len; va_start(ap, fmt); len = iobuf_vfqueue(io, fmt, ap); va_end(ap); return (len); } int iobuf_vfqueue(struct iobuf *io, const char *fmt, va_list ap) { char *buf; int len; len = vasprintf(&buf, fmt, ap); if (len == -1) return (-1); len = iobuf_queue(io, buf, len); free(buf); return (len); } ssize_t iobuf_write(struct iobuf *io, int fd) { struct iovec iov[IOV_MAX]; struct ioqbuf *q; int i; ssize_t n; i = 0; for (q = io->outq; q ; q = q->next) { if (i >= IOV_MAX) break; iov[i].iov_base = q->buf + q->rpos; iov[i].iov_len = q->wpos - q->rpos; i++; } n = writev(fd, iov, i); if (n == -1) { if (errno == EAGAIN || errno == EINTR) return (IOBUF_WANT_WRITE); if (errno == EPIPE) return (IOBUF_CLOSED); return (IOBUF_ERROR); } iobuf_drain(io, n); return (n); } int iobuf_flush(struct iobuf *io, int fd) { ssize_t s; while (io->queued) if ((s = iobuf_write(io, fd)) < 0) return (s); return (0); } #ifdef IO_TLS int iobuf_flush_tls(struct iobuf *io, struct tls *tls) { ssize_t s; while (io->queued) if ((s = iobuf_write_tls(io, tls)) < 0) return (s); return (0); } ssize_t iobuf_write_tls(struct iobuf *io, struct tls *tls) { struct ioqbuf *q; ssize_t n; q = io->outq; n = tls_write(tls, q->buf + q->rpos, q->wpos - q->rpos); if (n == TLS_WANT_POLLIN) return (IOBUF_WANT_READ); else if (n == TLS_WANT_POLLOUT) return (IOBUF_WANT_WRITE); else if (n == 0) return (IOBUF_CLOSED); else if (n == -1) return (IOBUF_ERROR); iobuf_drain(io, n); return (n); } ssize_t iobuf_read_tls(struct iobuf *io, struct tls *tls) { ssize_t n; n = tls_read(tls, io->buf + io->wpos, iobuf_left(io)); if (n == TLS_WANT_POLLIN) return (IOBUF_WANT_READ); else if (n == TLS_WANT_POLLOUT) return (IOBUF_WANT_WRITE); else if (n == 0) return (IOBUF_CLOSED); else if (n == -1) return (IOBUF_ERROR); io->wpos += n; return (n); } #endif /* IO_TLS */ opensmtpd-7.7.0p0/usr.sbin/smtpd/scheduler_ramqueue.c0000644000175000001440000006731414674615567016433 /* $OpenBSD: scheduler_ramqueue.c,v 1.49 2024/09/03 18:27:04 op Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" TAILQ_HEAD(evplist, rq_envelope); struct rq_message { uint32_t msgid; struct tree envelopes; }; struct rq_envelope { TAILQ_ENTRY(rq_envelope) entry; SPLAY_ENTRY(rq_envelope) t_entry; uint64_t evpid; uint64_t holdq; enum delivery_type type; #define RQ_EVPSTATE_PENDING 0 #define RQ_EVPSTATE_SCHEDULED 1 #define RQ_EVPSTATE_INFLIGHT 2 #define RQ_EVPSTATE_HELD 3 uint8_t state; #define RQ_ENVELOPE_EXPIRED 0x01 #define RQ_ENVELOPE_REMOVED 0x02 #define RQ_ENVELOPE_SUSPEND 0x04 #define RQ_ENVELOPE_UPDATE 0x08 #define RQ_ENVELOPE_OVERFLOW 0x10 uint8_t flags; time_t ctime; time_t sched; time_t expire; struct rq_message *message; time_t t_inflight; time_t t_scheduled; }; struct rq_holdq { struct evplist q; size_t count; }; struct rq_queue { size_t evpcount; struct tree messages; SPLAY_HEAD(prioqtree, rq_envelope) q_priotree; struct evplist q_pending; struct evplist q_inflight; struct evplist q_mta; struct evplist q_mda; struct evplist q_bounce; struct evplist q_update; struct evplist q_expired; struct evplist q_removed; }; static int rq_envelope_cmp(struct rq_envelope *, struct rq_envelope *); SPLAY_PROTOTYPE(prioqtree, rq_envelope, t_entry, rq_envelope_cmp); static int scheduler_ram_init(const char *); static int scheduler_ram_insert(struct scheduler_info *); static size_t scheduler_ram_commit(uint32_t); static size_t scheduler_ram_rollback(uint32_t); static int scheduler_ram_update(struct scheduler_info *); static int scheduler_ram_delete(uint64_t); static int scheduler_ram_hold(uint64_t, uint64_t); static int scheduler_ram_release(int, uint64_t, int); static int scheduler_ram_batch(int, int *, size_t *, uint64_t *, int *); static size_t scheduler_ram_messages(uint32_t, uint32_t *, size_t); static size_t scheduler_ram_envelopes(uint64_t, struct evpstate *, size_t); static int scheduler_ram_schedule(uint64_t); static int scheduler_ram_remove(uint64_t); static int scheduler_ram_suspend(uint64_t); static int scheduler_ram_resume(uint64_t); static int scheduler_ram_query(uint64_t); static void sorted_insert(struct rq_queue *, struct rq_envelope *); static void rq_queue_init(struct rq_queue *); static void rq_queue_merge(struct rq_queue *, struct rq_queue *); static void rq_queue_dump(struct rq_queue *, const char *); static void rq_queue_schedule(struct rq_queue *rq); static struct evplist *rq_envelope_list(struct rq_queue *, struct rq_envelope *); static void rq_envelope_schedule(struct rq_queue *, struct rq_envelope *); static int rq_envelope_remove(struct rq_queue *, struct rq_envelope *); static int rq_envelope_suspend(struct rq_queue *, struct rq_envelope *); static int rq_envelope_resume(struct rq_queue *, struct rq_envelope *); static void rq_envelope_delete(struct rq_queue *, struct rq_envelope *); static const char *rq_envelope_to_text(struct rq_envelope *); struct scheduler_backend scheduler_backend_ramqueue = { scheduler_ram_init, scheduler_ram_insert, scheduler_ram_commit, scheduler_ram_rollback, scheduler_ram_update, scheduler_ram_delete, scheduler_ram_hold, scheduler_ram_release, scheduler_ram_batch, scheduler_ram_messages, scheduler_ram_envelopes, scheduler_ram_schedule, scheduler_ram_remove, scheduler_ram_suspend, scheduler_ram_resume, scheduler_ram_query, }; static struct rq_queue ramqueue; static struct tree updates; static struct tree holdqs[3]; /* delivery type */ static time_t currtime; #define BACKOFF_TRANSFER 400 #define BACKOFF_DELIVERY 10 #define BACKOFF_OVERFLOW 3 static time_t scheduler_backoff(time_t t0, time_t base, uint32_t step) { return (t0 + base * step * step); } static time_t scheduler_next(time_t t0, time_t base, uint32_t step) { time_t t; /* XXX be more efficient */ while ((t = scheduler_backoff(t0, base, step)) <= currtime) step++; return (t); } static int scheduler_ram_init(const char *arg) { rq_queue_init(&ramqueue); tree_init(&updates); tree_init(&holdqs[D_MDA]); tree_init(&holdqs[D_MTA]); tree_init(&holdqs[D_BOUNCE]); return (1); } static int scheduler_ram_insert(struct scheduler_info *si) { struct rq_queue *update; struct rq_message *message; struct rq_envelope *envelope; uint32_t msgid; currtime = time(NULL); msgid = evpid_to_msgid(si->evpid); /* find/prepare a ramqueue update */ if ((update = tree_get(&updates, msgid)) == NULL) { update = xcalloc(1, sizeof *update); stat_increment("scheduler.ramqueue.update", 1); rq_queue_init(update); tree_xset(&updates, msgid, update); } /* find/prepare the msgtree message in ramqueue update */ if ((message = tree_get(&update->messages, msgid)) == NULL) { message = xcalloc(1, sizeof *message); message->msgid = msgid; tree_init(&message->envelopes); tree_xset(&update->messages, msgid, message); stat_increment("scheduler.ramqueue.message", 1); } /* create envelope in ramqueue message */ envelope = xcalloc(1, sizeof *envelope); envelope->evpid = si->evpid; envelope->type = si->type; envelope->message = message; envelope->ctime = si->creation; envelope->expire = si->creation + si->ttl; envelope->sched = scheduler_backoff(si->creation, (si->type == D_MTA) ? BACKOFF_TRANSFER : BACKOFF_DELIVERY, si->retry); tree_xset(&message->envelopes, envelope->evpid, envelope); update->evpcount++; stat_increment("scheduler.ramqueue.envelope", 1); envelope->state = RQ_EVPSTATE_PENDING; TAILQ_INSERT_TAIL(&update->q_pending, envelope, entry); si->nexttry = envelope->sched; return (1); } static size_t scheduler_ram_commit(uint32_t msgid) { struct rq_queue *update; size_t r; currtime = time(NULL); update = tree_xpop(&updates, msgid); r = update->evpcount; if (tracing & TRACE_SCHEDULER) rq_queue_dump(update, "update to commit"); rq_queue_merge(&ramqueue, update); if (tracing & TRACE_SCHEDULER) rq_queue_dump(&ramqueue, "resulting queue"); rq_queue_schedule(&ramqueue); free(update); stat_decrement("scheduler.ramqueue.update", 1); return (r); } static size_t scheduler_ram_rollback(uint32_t msgid) { struct rq_queue *update; struct rq_envelope *evp; size_t r; currtime = time(NULL); if ((update = tree_pop(&updates, msgid)) == NULL) return (0); r = update->evpcount; while ((evp = TAILQ_FIRST(&update->q_pending))) { TAILQ_REMOVE(&update->q_pending, evp, entry); rq_envelope_delete(update, evp); } free(update); stat_decrement("scheduler.ramqueue.update", 1); return (r); } static int scheduler_ram_update(struct scheduler_info *si) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; currtime = time(NULL); msgid = evpid_to_msgid(si->evpid); msg = tree_xget(&ramqueue.messages, msgid); evp = tree_xget(&msg->envelopes, si->evpid); /* it *must* be in-flight */ if (evp->state != RQ_EVPSTATE_INFLIGHT) fatalx("evp:%016" PRIx64 " not in-flight", si->evpid); TAILQ_REMOVE(&ramqueue.q_inflight, evp, entry); /* * If the envelope was removed while inflight, schedule it for * removal immediately. */ if (evp->flags & RQ_ENVELOPE_REMOVED) { TAILQ_INSERT_TAIL(&ramqueue.q_removed, evp, entry); evp->state = RQ_EVPSTATE_SCHEDULED; evp->t_scheduled = currtime; return (1); } evp->sched = scheduler_next(evp->ctime, (si->type == D_MTA) ? BACKOFF_TRANSFER : BACKOFF_DELIVERY, si->retry); evp->state = RQ_EVPSTATE_PENDING; if (!(evp->flags & RQ_ENVELOPE_SUSPEND)) sorted_insert(&ramqueue, evp); si->nexttry = evp->sched; return (1); } static int scheduler_ram_delete(uint64_t evpid) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; currtime = time(NULL); msgid = evpid_to_msgid(evpid); msg = tree_xget(&ramqueue.messages, msgid); evp = tree_xget(&msg->envelopes, evpid); /* it *must* be in-flight */ if (evp->state != RQ_EVPSTATE_INFLIGHT) fatalx("evp:%016" PRIx64 " not in-flight", evpid); TAILQ_REMOVE(&ramqueue.q_inflight, evp, entry); rq_envelope_delete(&ramqueue, evp); return (1); } #define HOLDQ_MAXSIZE 1000 static int scheduler_ram_hold(uint64_t evpid, uint64_t holdq) { struct rq_holdq *hq; struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; currtime = time(NULL); msgid = evpid_to_msgid(evpid); msg = tree_xget(&ramqueue.messages, msgid); evp = tree_xget(&msg->envelopes, evpid); /* it *must* be in-flight */ if (evp->state != RQ_EVPSTATE_INFLIGHT) fatalx("evp:%016" PRIx64 " not in-flight", evpid); TAILQ_REMOVE(&ramqueue.q_inflight, evp, entry); /* If the envelope is suspended, just mark it as pending */ if (evp->flags & RQ_ENVELOPE_SUSPEND) { evp->state = RQ_EVPSTATE_PENDING; return (0); } hq = tree_get(&holdqs[evp->type], holdq); if (hq == NULL) { hq = xcalloc(1, sizeof(*hq)); TAILQ_INIT(&hq->q); tree_xset(&holdqs[evp->type], holdq, hq); stat_increment("scheduler.ramqueue.holdq", 1); } /* If the holdq is full, just "tempfail" the envelope */ if (hq->count >= HOLDQ_MAXSIZE) { evp->state = RQ_EVPSTATE_PENDING; evp->flags |= RQ_ENVELOPE_UPDATE; evp->flags |= RQ_ENVELOPE_OVERFLOW; sorted_insert(&ramqueue, evp); stat_increment("scheduler.ramqueue.hold-overflow", 1); return (0); } evp->state = RQ_EVPSTATE_HELD; evp->holdq = holdq; /* This is an optimization: upon release, the envelopes will be * inserted in the pending queue from the first element to the last. * Since elements already in the queue were received first, they * were scheduled first, so they will be reinserted before the * current element. */ TAILQ_INSERT_HEAD(&hq->q, evp, entry); hq->count += 1; stat_increment("scheduler.ramqueue.hold", 1); return (1); } static int scheduler_ram_release(int type, uint64_t holdq, int n) { struct rq_holdq *hq; struct rq_envelope *evp; int i, update; currtime = time(NULL); hq = tree_get(&holdqs[type], holdq); if (hq == NULL) return (0); if (n == -1) { n = 0; update = 1; } else update = 0; for (i = 0; n == 0 || i < n; i++) { evp = TAILQ_FIRST(&hq->q); if (evp == NULL) break; TAILQ_REMOVE(&hq->q, evp, entry); hq->count -= 1; evp->holdq = 0; /* When released, all envelopes are put in the pending queue * and will be rescheduled immediately. As an optimization, * we could just schedule them directly. */ evp->state = RQ_EVPSTATE_PENDING; if (update) evp->flags |= RQ_ENVELOPE_UPDATE; sorted_insert(&ramqueue, evp); } if (TAILQ_EMPTY(&hq->q)) { tree_xpop(&holdqs[type], holdq); free(hq); stat_decrement("scheduler.ramqueue.holdq", 1); } stat_decrement("scheduler.ramqueue.hold", i); return (i); } static int scheduler_ram_batch(int mask, int *delay, size_t *count, uint64_t *evpids, int *types) { struct rq_envelope *evp; size_t i, n; time_t t; currtime = time(NULL); rq_queue_schedule(&ramqueue); if (tracing & TRACE_SCHEDULER) rq_queue_dump(&ramqueue, "scheduler_ram_batch()"); i = 0; n = 0; for (;;) { if (mask & SCHED_REMOVE && (evp = TAILQ_FIRST(&ramqueue.q_removed))) { TAILQ_REMOVE(&ramqueue.q_removed, evp, entry); types[i] = SCHED_REMOVE; evpids[i] = evp->evpid; rq_envelope_delete(&ramqueue, evp); if (++i == *count) break; } if (mask & SCHED_EXPIRE && (evp = TAILQ_FIRST(&ramqueue.q_expired))) { TAILQ_REMOVE(&ramqueue.q_expired, evp, entry); types[i] = SCHED_EXPIRE; evpids[i] = evp->evpid; rq_envelope_delete(&ramqueue, evp); if (++i == *count) break; } if (mask & SCHED_UPDATE && (evp = TAILQ_FIRST(&ramqueue.q_update))) { TAILQ_REMOVE(&ramqueue.q_update, evp, entry); types[i] = SCHED_UPDATE; evpids[i] = evp->evpid; if (evp->flags & RQ_ENVELOPE_OVERFLOW) t = BACKOFF_OVERFLOW; else if (evp->type == D_MTA) t = BACKOFF_TRANSFER; else t = BACKOFF_DELIVERY; evp->sched = scheduler_next(evp->ctime, t, 0); evp->flags &= ~(RQ_ENVELOPE_UPDATE|RQ_ENVELOPE_OVERFLOW); evp->state = RQ_EVPSTATE_PENDING; if (!(evp->flags & RQ_ENVELOPE_SUSPEND)) sorted_insert(&ramqueue, evp); if (++i == *count) break; } if (mask & SCHED_BOUNCE && (evp = TAILQ_FIRST(&ramqueue.q_bounce))) { TAILQ_REMOVE(&ramqueue.q_bounce, evp, entry); types[i] = SCHED_BOUNCE; evpids[i] = evp->evpid; TAILQ_INSERT_TAIL(&ramqueue.q_inflight, evp, entry); evp->state = RQ_EVPSTATE_INFLIGHT; evp->t_inflight = currtime; if (++i == *count) break; } if (mask & SCHED_MDA && (evp = TAILQ_FIRST(&ramqueue.q_mda))) { TAILQ_REMOVE(&ramqueue.q_mda, evp, entry); types[i] = SCHED_MDA; evpids[i] = evp->evpid; TAILQ_INSERT_TAIL(&ramqueue.q_inflight, evp, entry); evp->state = RQ_EVPSTATE_INFLIGHT; evp->t_inflight = currtime; if (++i == *count) break; } if (mask & SCHED_MTA && (evp = TAILQ_FIRST(&ramqueue.q_mta))) { TAILQ_REMOVE(&ramqueue.q_mta, evp, entry); types[i] = SCHED_MTA; evpids[i] = evp->evpid; TAILQ_INSERT_TAIL(&ramqueue.q_inflight, evp, entry); evp->state = RQ_EVPSTATE_INFLIGHT; evp->t_inflight = currtime; if (++i == *count) break; } /* nothing seen this round */ if (i == n) break; n = i; } if (i) { *count = i; return (1); } if ((evp = TAILQ_FIRST(&ramqueue.q_pending))) { if (evp->sched < evp->expire) t = evp->sched; else t = evp->expire; *delay = (t < currtime) ? 0 : (t - currtime); } else *delay = -1; return (0); } static size_t scheduler_ram_messages(uint32_t from, uint32_t *dst, size_t size) { uint64_t id; size_t n; void *i; for (n = 0, i = NULL; n < size; n++) { if (tree_iterfrom(&ramqueue.messages, &i, from, &id, NULL) == 0) break; dst[n] = id; } return (n); } static size_t scheduler_ram_envelopes(uint64_t from, struct evpstate *dst, size_t size) { struct rq_message *msg; struct rq_envelope *evp; void *i; size_t n; if ((msg = tree_get(&ramqueue.messages, evpid_to_msgid(from))) == NULL) return (0); for (n = 0, i = NULL; n < size; ) { if (tree_iterfrom(&msg->envelopes, &i, from, NULL, (void**)&evp) == 0) break; if (evp->flags & (RQ_ENVELOPE_REMOVED | RQ_ENVELOPE_EXPIRED)) continue; dst[n].evpid = evp->evpid; dst[n].flags = 0; dst[n].retry = 0; dst[n].time = 0; if (evp->state == RQ_EVPSTATE_PENDING) { dst[n].time = evp->sched; dst[n].flags = EF_PENDING; } else if (evp->state == RQ_EVPSTATE_SCHEDULED) { dst[n].time = evp->t_scheduled; dst[n].flags = EF_PENDING; } else if (evp->state == RQ_EVPSTATE_INFLIGHT) { dst[n].time = evp->t_inflight; dst[n].flags = EF_INFLIGHT; } else if (evp->state == RQ_EVPSTATE_HELD) { /* same as scheduled */ dst[n].time = evp->t_scheduled; dst[n].flags = EF_PENDING; dst[n].flags |= EF_HOLD; } if (evp->flags & RQ_ENVELOPE_SUSPEND) dst[n].flags |= EF_SUSPEND; n++; } return (n); } static int scheduler_ram_schedule(uint64_t evpid) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; void *i; int r; currtime = time(NULL); if (evpid > 0xffffffff) { msgid = evpid_to_msgid(evpid); if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) return (0); if (evp->state == RQ_EVPSTATE_INFLIGHT) return (0); rq_envelope_schedule(&ramqueue, evp); return (1); } else { msgid = evpid; if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); i = NULL; r = 0; while (tree_iter(&msg->envelopes, &i, NULL, (void*)(&evp))) { if (evp->state == RQ_EVPSTATE_INFLIGHT) continue; rq_envelope_schedule(&ramqueue, evp); r++; } return (r); } } static int scheduler_ram_remove(uint64_t evpid) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; void *i; int r; currtime = time(NULL); if (evpid > 0xffffffff) { msgid = evpid_to_msgid(evpid); if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) return (0); if (rq_envelope_remove(&ramqueue, evp)) return (1); return (0); } else { msgid = evpid; if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); i = NULL; r = 0; while (tree_iter(&msg->envelopes, &i, NULL, (void*)(&evp))) if (rq_envelope_remove(&ramqueue, evp)) r++; return (r); } } static int scheduler_ram_suspend(uint64_t evpid) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; void *i; int r; currtime = time(NULL); if (evpid > 0xffffffff) { msgid = evpid_to_msgid(evpid); if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) return (0); if (rq_envelope_suspend(&ramqueue, evp)) return (1); return (0); } else { msgid = evpid; if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); i = NULL; r = 0; while (tree_iter(&msg->envelopes, &i, NULL, (void*)(&evp))) if (rq_envelope_suspend(&ramqueue, evp)) r++; return (r); } } static int scheduler_ram_resume(uint64_t evpid) { struct rq_message *msg; struct rq_envelope *evp; uint32_t msgid; void *i; int r; currtime = time(NULL); if (evpid > 0xffffffff) { msgid = evpid_to_msgid(evpid); if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); if ((evp = tree_get(&msg->envelopes, evpid)) == NULL) return (0); if (rq_envelope_resume(&ramqueue, evp)) return (1); return (0); } else { msgid = evpid; if ((msg = tree_get(&ramqueue.messages, msgid)) == NULL) return (0); i = NULL; r = 0; while (tree_iter(&msg->envelopes, &i, NULL, (void*)(&evp))) if (rq_envelope_resume(&ramqueue, evp)) r++; return (r); } } static int scheduler_ram_query(uint64_t evpid) { uint32_t msgid; if (evpid > 0xffffffff) msgid = evpid_to_msgid(evpid); else msgid = evpid; if (tree_get(&ramqueue.messages, msgid) == NULL) return (0); return (1); } static void sorted_insert(struct rq_queue *rq, struct rq_envelope *evp) { struct rq_envelope *evp2; SPLAY_INSERT(prioqtree, &rq->q_priotree, evp); evp2 = SPLAY_NEXT(prioqtree, &rq->q_priotree, evp); if (evp2) TAILQ_INSERT_BEFORE(evp2, evp, entry); else TAILQ_INSERT_TAIL(&rq->q_pending, evp, entry); } static void rq_queue_init(struct rq_queue *rq) { memset(rq, 0, sizeof *rq); tree_init(&rq->messages); TAILQ_INIT(&rq->q_pending); TAILQ_INIT(&rq->q_inflight); TAILQ_INIT(&rq->q_mta); TAILQ_INIT(&rq->q_mda); TAILQ_INIT(&rq->q_bounce); TAILQ_INIT(&rq->q_update); TAILQ_INIT(&rq->q_expired); TAILQ_INIT(&rq->q_removed); SPLAY_INIT(&rq->q_priotree); } static void rq_queue_merge(struct rq_queue *rq, struct rq_queue *update) { struct rq_message *message, *tomessage; struct rq_envelope *envelope; uint64_t id; void *i; while (tree_poproot(&update->messages, &id, (void*)&message)) { if ((tomessage = tree_get(&rq->messages, id)) == NULL) { /* message does not exist. reuse structure */ tree_xset(&rq->messages, id, message); continue; } /* need to re-link all envelopes before merging them */ i = NULL; while ((tree_iter(&message->envelopes, &i, &id, (void*)&envelope))) envelope->message = tomessage; tree_merge(&tomessage->envelopes, &message->envelopes); free(message); stat_decrement("scheduler.ramqueue.message", 1); } /* Sorted insert in the pending queue */ while ((envelope = TAILQ_FIRST(&update->q_pending))) { TAILQ_REMOVE(&update->q_pending, envelope, entry); sorted_insert(rq, envelope); } rq->evpcount += update->evpcount; } #define SCHEDULEMAX 1024 static void rq_queue_schedule(struct rq_queue *rq) { struct rq_envelope *evp; size_t n; n = 0; while ((evp = TAILQ_FIRST(&rq->q_pending))) { if (evp->sched > currtime && evp->expire > currtime) break; if (n == SCHEDULEMAX) break; if (evp->state != RQ_EVPSTATE_PENDING) fatalx("evp:%016" PRIx64 " flags=0x%x", evp->evpid, evp->flags); if (evp->expire <= currtime) { TAILQ_REMOVE(&rq->q_pending, evp, entry); SPLAY_REMOVE(prioqtree, &rq->q_priotree, evp); TAILQ_INSERT_TAIL(&rq->q_expired, evp, entry); evp->state = RQ_EVPSTATE_SCHEDULED; evp->flags |= RQ_ENVELOPE_EXPIRED; evp->t_scheduled = currtime; continue; } rq_envelope_schedule(rq, evp); n += 1; } } static struct evplist * rq_envelope_list(struct rq_queue *rq, struct rq_envelope *evp) { switch (evp->state) { case RQ_EVPSTATE_PENDING: return &rq->q_pending; case RQ_EVPSTATE_SCHEDULED: if (evp->flags & RQ_ENVELOPE_EXPIRED) return &rq->q_expired; if (evp->flags & RQ_ENVELOPE_REMOVED) return &rq->q_removed; if (evp->flags & RQ_ENVELOPE_UPDATE) return &rq->q_update; if (evp->type == D_MTA) return &rq->q_mta; if (evp->type == D_MDA) return &rq->q_mda; if (evp->type == D_BOUNCE) return &rq->q_bounce; fatalx("%016" PRIx64 " bad evp type %d", evp->evpid, evp->type); case RQ_EVPSTATE_INFLIGHT: return &rq->q_inflight; case RQ_EVPSTATE_HELD: return (NULL); } fatalx("%016" PRIx64 " bad state %d", evp->evpid, evp->state); return (NULL); } static void rq_envelope_schedule(struct rq_queue *rq, struct rq_envelope *evp) { struct rq_holdq *hq; struct evplist *q = NULL; switch (evp->type) { case D_MTA: q = &rq->q_mta; break; case D_MDA: q = &rq->q_mda; break; case D_BOUNCE: q = &rq->q_bounce; break; } if (evp->flags & RQ_ENVELOPE_UPDATE) q = &rq->q_update; if (evp->state == RQ_EVPSTATE_HELD) { hq = tree_xget(&holdqs[evp->type], evp->holdq); TAILQ_REMOVE(&hq->q, evp, entry); hq->count -= 1; if (TAILQ_EMPTY(&hq->q)) { tree_xpop(&holdqs[evp->type], evp->holdq); free(hq); } evp->holdq = 0; stat_decrement("scheduler.ramqueue.hold", 1); } else if (!(evp->flags & RQ_ENVELOPE_SUSPEND)) { TAILQ_REMOVE(&rq->q_pending, evp, entry); SPLAY_REMOVE(prioqtree, &rq->q_priotree, evp); } TAILQ_INSERT_TAIL(q, evp, entry); evp->state = RQ_EVPSTATE_SCHEDULED; evp->t_scheduled = currtime; } static int rq_envelope_remove(struct rq_queue *rq, struct rq_envelope *evp) { struct rq_holdq *hq; struct evplist *evl; if (evp->flags & (RQ_ENVELOPE_REMOVED | RQ_ENVELOPE_EXPIRED)) return (0); /* * If envelope is inflight, mark it envelope for removal. */ if (evp->state == RQ_EVPSTATE_INFLIGHT) { evp->flags |= RQ_ENVELOPE_REMOVED; return (1); } if (evp->state == RQ_EVPSTATE_HELD) { hq = tree_xget(&holdqs[evp->type], evp->holdq); TAILQ_REMOVE(&hq->q, evp, entry); hq->count -= 1; if (TAILQ_EMPTY(&hq->q)) { tree_xpop(&holdqs[evp->type], evp->holdq); free(hq); } evp->holdq = 0; stat_decrement("scheduler.ramqueue.hold", 1); } else if (!(evp->flags & RQ_ENVELOPE_SUSPEND)) { evl = rq_envelope_list(rq, evp); TAILQ_REMOVE(evl, evp, entry); if (evl == &rq->q_pending) SPLAY_REMOVE(prioqtree, &rq->q_priotree, evp); } TAILQ_INSERT_TAIL(&rq->q_removed, evp, entry); evp->state = RQ_EVPSTATE_SCHEDULED; evp->flags |= RQ_ENVELOPE_REMOVED; evp->t_scheduled = currtime; return (1); } static int rq_envelope_suspend(struct rq_queue *rq, struct rq_envelope *evp) { struct rq_holdq *hq; struct evplist *evl; if (evp->flags & RQ_ENVELOPE_SUSPEND) return (0); if (evp->state == RQ_EVPSTATE_HELD) { hq = tree_xget(&holdqs[evp->type], evp->holdq); TAILQ_REMOVE(&hq->q, evp, entry); hq->count -= 1; if (TAILQ_EMPTY(&hq->q)) { tree_xpop(&holdqs[evp->type], evp->holdq); free(hq); } evp->holdq = 0; evp->state = RQ_EVPSTATE_PENDING; stat_decrement("scheduler.ramqueue.hold", 1); } else if (evp->state != RQ_EVPSTATE_INFLIGHT) { evl = rq_envelope_list(rq, evp); TAILQ_REMOVE(evl, evp, entry); if (evl == &rq->q_pending) SPLAY_REMOVE(prioqtree, &rq->q_priotree, evp); } evp->flags |= RQ_ENVELOPE_SUSPEND; return (1); } static int rq_envelope_resume(struct rq_queue *rq, struct rq_envelope *evp) { struct evplist *evl; if (!(evp->flags & RQ_ENVELOPE_SUSPEND)) return (0); if (evp->state != RQ_EVPSTATE_INFLIGHT) { evl = rq_envelope_list(rq, evp); if (evl == &rq->q_pending) sorted_insert(rq, evp); else TAILQ_INSERT_TAIL(evl, evp, entry); } evp->flags &= ~RQ_ENVELOPE_SUSPEND; return (1); } static void rq_envelope_delete(struct rq_queue *rq, struct rq_envelope *evp) { tree_xpop(&evp->message->envelopes, evp->evpid); if (tree_empty(&evp->message->envelopes)) { tree_xpop(&rq->messages, evp->message->msgid); free(evp->message); stat_decrement("scheduler.ramqueue.message", 1); } free(evp); rq->evpcount--; stat_decrement("scheduler.ramqueue.envelope", 1); } static const char * rq_envelope_to_text(struct rq_envelope *e) { static char buf[256]; char t[64]; (void)snprintf(buf, sizeof buf, "evp:%016" PRIx64 " [", e->evpid); if (e->type == D_BOUNCE) (void)strlcat(buf, "bounce", sizeof buf); else if (e->type == D_MDA) (void)strlcat(buf, "mda", sizeof buf); else if (e->type == D_MTA) (void)strlcat(buf, "mta", sizeof buf); (void)snprintf(t, sizeof t, ",expire=%s", duration_to_text(e->expire - currtime)); (void)strlcat(buf, t, sizeof buf); switch (e->state) { case RQ_EVPSTATE_PENDING: (void)snprintf(t, sizeof t, ",pending=%s", duration_to_text(e->sched - currtime)); (void)strlcat(buf, t, sizeof buf); break; case RQ_EVPSTATE_SCHEDULED: (void)snprintf(t, sizeof t, ",scheduled=%s", duration_to_text(currtime - e->t_scheduled)); (void)strlcat(buf, t, sizeof buf); break; case RQ_EVPSTATE_INFLIGHT: (void)snprintf(t, sizeof t, ",inflight=%s", duration_to_text(currtime - e->t_inflight)); (void)strlcat(buf, t, sizeof buf); break; case RQ_EVPSTATE_HELD: (void)snprintf(t, sizeof t, ",held=%s", duration_to_text(currtime - e->t_inflight)); (void)strlcat(buf, t, sizeof buf); break; default: fatalx("%016" PRIx64 " bad state %d", e->evpid, e->state); } if (e->flags & RQ_ENVELOPE_REMOVED) (void)strlcat(buf, ",removed", sizeof buf); if (e->flags & RQ_ENVELOPE_EXPIRED) (void)strlcat(buf, ",expired", sizeof buf); if (e->flags & RQ_ENVELOPE_SUSPEND) (void)strlcat(buf, ",suspended", sizeof buf); (void)strlcat(buf, "]", sizeof buf); return (buf); } static void rq_queue_dump(struct rq_queue *rq, const char * name) { struct rq_message *message; struct rq_envelope *envelope; void *i, *j; uint64_t id; log_debug("debug: /--- ramqueue: %s", name); i = NULL; while ((tree_iter(&rq->messages, &i, &id, (void*)&message))) { log_debug("debug: | msg:%08" PRIx32, message->msgid); j = NULL; while ((tree_iter(&message->envelopes, &j, &id, (void*)&envelope))) log_debug("debug: | %s", rq_envelope_to_text(envelope)); } log_debug("debug: \\---"); } static int rq_envelope_cmp(struct rq_envelope *e1, struct rq_envelope *e2) { time_t ref1, ref2; ref1 = (e1->sched < e1->expire) ? e1->sched : e1->expire; ref2 = (e2->sched < e2->expire) ? e2->sched : e2->expire; if (ref1 != ref2) return (ref1 < ref2) ? -1 : 1; if (e1->evpid != e2->evpid) return (e1->evpid < e2->evpid) ? -1 : 1; return 0; } SPLAY_GENERATE(prioqtree, rq_envelope, t_entry, rq_envelope_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd-tables.70000644000175000001440000001551115007617542015046 .\" $OpenBSD: smtpd-tables.7,v 1.5 2025/04/08 17:35:01 op Exp $ .\" .\" Copyright (c) 2008 Janne Johansson .\" Copyright (c) 2009 Jacek Masiulaniec .\" Copyright (c) 2012 Gilles Chehade .\" Copyright (c) 2024 Omar Polo .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" .Dd $Mdocdate: April 8 2025 $ .Dt SMTPD-TABLES 7 .Os .Sh NAME .Nm smtpd-tables .Nd table API for the smtpd daemon .Sh DESCRIPTION The .Xr smtpd 8 daemon provides a Simple Mail Transfer Protocol (SMTPD) implementation, which allows ordinary machines to become Mail eXchangers (MX). Some features that are commonly used by MX, such as querying databases for user credentials, are outside of the scope of SMTP and too complex to fit in .Xr smtpd 8 . .Pp Because an MX may need to provide these features, .Xr smtpd 8 provides an API to implement .Xr table 5 backends with a simple text-based protocol. .Sh DESIGN .Nm are programs that run as unique standalone processes, they do not share .Xr smtpd 8 address space. They are executed by .Xr smtpd 8 at startup and expected to run in an infinite loop, reading events and queries from standard input and writing responses to standard output. They are not allowed to terminate. .Pp Because .Nm are standalone programs that communicate with .Xr smtpd 8 , they may run as different users than .Xr smtpd 8 and may be written in any language. .Nm must not use blocking I/O, they must support answering asynchronously to .Xr smtpd 8 . .Sh PROTOCOL The protocol consist of human-readable lines exchanged between .Nm and .Xr smtpd 8 . .Pp The protocol begins with a handshake. First, .Xr smtpd 8 provides .Nm with general configuration information in the form of key-value lines, terminated by .Ql config|ready . For example: .Bd -literal -offset indent config|smtpd-version|7.7.0 config|protocol|0.1 config|tablename|devs config|ready .Ed .Pp Then, .Nm register the supported services, terminating with .Ql register|ready . For example: .Bd -literal -offset indent register|alias register|credentials register|ready .Ed .Pp Finally, .Xr smtpd 8 can start querying the table. For example: .Bd -literal -offset indent table|0.1|1713795082.354255|devs|lookup|alias|b72508d|op .Ed .Pp The .Dq | character is used to separate the fields and may only appear verbatim in the last field of the payload, in which case it should be considered a regular character and not a separator. No other field may contain a .Dq | . .Pp Each request has a common set of fields, followed by some other fields that are operation-specific. The common format consists of a protocol prefix .Sq table , the protocol version, the timestamp and the table name. For example: .Bd -literal -offset indent table|0.1|1713795091.202157|devs .Ed .Pp The protocol is inherently asynchronous, so multiple request may be sent without waiting for the table to reply. All the replies have a common prefix, followed by the operation-specific response. The common format consist of a prefix with the operation name in followed by .Sq -result , and the unique ID of the request. For example: .Bd -literal -offset indent lookup-result|b72508d .Ed .Pp The list of operations, operation-specific parameters and responses are as follows: .Bl -tag -width Ds .It Cm update Ar id Ask the table to reload its configuration. The result is either .Sq ok on success or .Sq error and a message upon a failure to do so. .It Cm check Ar service id query Check whether .Ar query is present in the table. The result is .Sq found if found, .Sq not-found if not, or .Sq error and a message upon an error. .It Cm lookup Ar service id query Look up a value in the table for given the .Ar query . The result is .Sq found and the value if found, .Sq not-found if not found, or .Sq error and a message upon an error. .It Cm fetch Ar service id Fetch the next item from the table, eventually wrapping around. It is only supported for the .Ic source and .Ic relayhost services. The result is .Sq found and the value if found, .Sq not-found if the table is empty, or .Sq error and a message upon an error. .El .Pp Each service has a specific format for the result. The exact syntax for the values and eventually the keys are described in .Xr table 5 . The services and their result format are as follows: .Pp .Bl -tag -width mailaddrmap -compact .It Ic alias One or more aliases separated by a comma. .It Ic auth Only usable for check. Lookup key is username and cleartext password separated by .Sq \&: . .It Ic domain A domain name. .\" XXX are wildcards allowed? .It Ic credentials The user name, followed by .Sq \&: and the encrypted password as per .Xr smtpctl 8 .Cm encrypt subcommand. .It Ic netaddr IPv4 and IPv6 address or netmask. .It Ic userinfo The user id, followed by .Sq \&: then the group id, then .Sq \&: and finally the home directory. .It Ic source IPv4 and IPv6 address. .It Ic mailaddr An username, a domain or a full email address. .It Ic addrname Used to map IP addresses to hostnames. .\" .It Ic mailaddrmap .\" XXX missing K_RELAYHOST, K_STRING and K_REGEX .El .Sh EXAMPLES Assuming the table is called .Dq devs , here's an example of a failed .Cm update transaction: .Bd -literal -offset indent table|0.1|1713795097.394049|devs|update|478ff0d2 update-result|478ff0d2|error|failed to connect to the database .Ed .Pp A .Cm check request for the .Ic netaddr service for the 192.168.0.7 IPv4 address which is not in the table: .Bd -literal -offset indent table|0.1|1713795103.314423|devs|check|netaddr|e5862859|192.168.0.7 check-result|e5862859|not-found .Ed .Pp A successful .Cm lookup request for the .Ic userinfo service for the user .Sq op : .Bd -literal -offset indent table|0.1|1713795110.354921|devs|lookup|userinfo|f993c74|op lookup-result|f993c74|found|1000:1000:/home/op .Ed .Pp A series of .Cm fetch requests for the .Cm source service that wraps around: .Bd -literal -offset indent table|0.1|1713795116.227321|devs|fetch|source|189bd3ee lookup-result|189bd3ee|found|192.168.1.7 table|0.1|1713795120.162438|devs|fetch|source|9e4c56d4 lookup-result|9e4c56d4|found|10.0.0.8 table|0.1|1713795122.930928|devs|fetch|source|f2c8b906 lookup-result|f2c8b906|found|192.168.1.7 .Ed .Sh SEE ALSO .Xr smtpd 8 .Sh HISTORY .Nm first appeared in .Ox 7.6 . opensmtpd-7.7.0p0/usr.sbin/smtpd/rfc5322.c0000644000175000001440000001206314620126254013603 /* $OpenBSD: rfc5322.c,v 1.4 2023/12/05 13:38:25 op Exp $ */ /* * Copyright (c) 2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include "rfc5322.h" struct buf { char *buf; size_t bufsz; size_t buflen; size_t bufmax; }; static int buf_alloc(struct buf *, size_t); static int buf_grow(struct buf *, size_t); static int buf_cat(struct buf *, const char *); struct rfc5322_parser { const char *line; int state; /* last parser state */ int next; /* parser needs data */ int unfold; const char *currhdr; struct buf hdr; struct buf val; }; struct rfc5322_parser * rfc5322_parser_new(void) { struct rfc5322_parser *parser; parser = calloc(1, sizeof(*parser)); if (parser == NULL) return NULL; rfc5322_clear(parser); parser->hdr.bufmax = 1024; parser->val.bufmax = 65536; return parser; } void rfc5322_free(struct rfc5322_parser *parser) { free(parser->hdr.buf); free(parser->val.buf); free(parser); } void rfc5322_clear(struct rfc5322_parser *parser) { parser->line = NULL; parser->state = RFC5322_NONE; parser->next = 0; parser->hdr.buflen = 0; parser->val.buflen = 0; } int rfc5322_push(struct rfc5322_parser *parser, const char *line) { if (parser->line) { errno = EALREADY; return -1; } parser->line = line; parser->next = 0; return 0; } int rfc5322_unfold_header(struct rfc5322_parser *parser) { if (parser->unfold) { errno = EALREADY; return -1; } if (parser->currhdr == NULL) { errno = EOPNOTSUPP; return -1; } if (buf_cat(&parser->val, parser->currhdr) == -1) return -1; parser->currhdr = NULL; parser->unfold = 1; return 0; } static int _rfc5322_next(struct rfc5322_parser *parser, struct rfc5322_result *res) { size_t len; const char *pos, *line; line = parser->line; switch(parser->state) { case RFC5322_HEADER_START: case RFC5322_HEADER_CONT: res->hdr = parser->hdr.buf; if (line && (line[0] == ' ' || line[0] == '\t')) { parser->line = NULL; parser->next = 1; if (parser->unfold) { if (buf_cat(&parser->val, "\n") == -1 || buf_cat(&parser->val, line) == -1) return -1; } res->value = line; return RFC5322_HEADER_CONT; } if (parser->unfold) { parser->val.buflen = 0; parser->unfold = 0; res->value = parser->val.buf; } return RFC5322_HEADER_END; case RFC5322_NONE: case RFC5322_HEADER_END: if (line && line[0] != ' ' && line[0] != '\t' && (pos = strchr(line, ':'))) { len = pos - line; if (buf_grow(&parser->hdr, len + 1) == -1) return -1; (void)memcpy(parser->hdr.buf, line, len); parser->hdr.buf[len] = '\0'; parser->hdr.buflen = len + 1; parser->line = NULL; parser->next = 1; parser->currhdr = pos + 1; res->hdr = parser->hdr.buf; res->value = pos + 1; return RFC5322_HEADER_START; } return RFC5322_END_OF_HEADERS; case RFC5322_END_OF_HEADERS: if (line == NULL) return RFC5322_END_OF_MESSAGE; if (line[0] == '\0') { parser->line = NULL; parser->next = 1; res->value = line; return RFC5322_BODY_START; } errno = EINVAL; return -1; case RFC5322_BODY_START: case RFC5322_BODY: if (line == NULL) return RFC5322_END_OF_MESSAGE; parser->line = NULL; parser->next = 1; res->value = line; return RFC5322_BODY; case RFC5322_END_OF_MESSAGE: errno = ENOMSG; return -1; default: errno = EINVAL; return -1; } } int rfc5322_next(struct rfc5322_parser *parser, struct rfc5322_result *res) { memset(res, 0, sizeof(*res)); if (parser->next) return RFC5322_NONE; return (parser->state = _rfc5322_next(parser, res)); } static int buf_alloc(struct buf *b, size_t need) { char *buf; size_t alloc; if (b->buf && b->bufsz >= need) return 0; if (need >= b->bufmax) { errno = ERANGE; return -1; } #define N 256 alloc = N * (need / N) + ((need % N) ? N : 0); #undef N buf = reallocarray(b->buf, alloc, 1); if (buf == NULL) return -1; b->buf = buf; b->bufsz = alloc; return 0; } static int buf_grow(struct buf *b, size_t sz) { if (SIZE_T_MAX - b->buflen <= sz) { errno = ERANGE; return -1; } return buf_alloc(b, b->buflen + sz); } static int buf_cat(struct buf *b, const char *s) { size_t len = strlen(s); if (buf_grow(b, len + 1) == -1) return -1; (void)memmove(b->buf + b->buflen, s, len + 1); b->buflen += len; return 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.lmtp.c0000644000175000001440000001565515007616153014426 /* * Copyright (c) 2017 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include enum phase { PHASE_BANNER, PHASE_HELO, PHASE_MAILFROM, PHASE_RCPTTO, PHASE_DATA, PHASE_EOM, PHASE_QUIT }; struct session { const char *lhlo; const char *mailfrom; char *rcptto; char **rcpts; int n_rcpts; }; static int lmtp_connect(const char *); static void lmtp_engine(int, struct session *); static void stream_file(FILE *); int main(int argc, char *argv[]) { int ch; int conn; const char *destination = "localhost"; struct session session; if (! geteuid()) errx(EX_TEMPFAIL, "mail.lmtp: may not be executed as root"); session.lhlo = "localhost"; session.mailfrom = getenv("SENDER"); session.rcptto = NULL; while ((ch = getopt(argc, argv, "d:l:f:ru")) != -1) { switch (ch) { case 'd': destination = optarg; break; case 'l': session.lhlo = optarg; break; case 'f': session.mailfrom = optarg; break; case 'r': session.rcptto = getenv("RECIPIENT"); break; case 'u': session.rcptto = getenv("USER"); break; default: break; } } argc -= optind; argv += optind; if (session.mailfrom == NULL) errx(EX_TEMPFAIL, "sender must be specified with -f"); if (argc == 0 && session.rcptto == NULL) errx(EX_TEMPFAIL, "no recipient was specified"); if (session.rcptto) { session.rcpts = &session.rcptto; session.n_rcpts = 1; } else { session.rcpts = argv; session.n_rcpts = argc; } conn = lmtp_connect(destination); lmtp_engine(conn, &session); return (0); } static int lmtp_connect_inet(const char *destination) { struct addrinfo hints, *res, *res0; char *destcopy = NULL; const char *hostname = NULL; const char *servname = NULL; const char *cause = NULL; char *p; int n, s = -1, save_errno; if ((destcopy = strdup(destination)) == NULL) err(EX_TEMPFAIL, NULL); servname = "25"; hostname = destcopy; p = destcopy; if (*p == '[') { if ((p = strchr(destcopy, ']')) == NULL) errx(EX_TEMPFAIL, "inet: invalid address syntax"); /* remove [ and ] */ *p = '\0'; hostname++; if (strncasecmp(hostname, "IPv6:", 5) == 0) hostname += 5; /* extract port if any */ switch (*(p+1)) { case ':': servname = p+2; break; case '\0': break; default: errx(EX_TEMPFAIL, "inet: invalid address syntax"); } } else if ((p = strchr(destcopy, ':')) != NULL) { *p++ = '\0'; servname = p; } memset(&hints, 0, sizeof hints); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV; n = getaddrinfo(hostname, servname, &hints, &res0); if (n) errx(EX_TEMPFAIL, "inet: %s", gai_strerror(n)); for (res = res0; res; res = res->ai_next) { s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (s == -1) { cause = "socket"; continue; } if (connect(s, res->ai_addr, res->ai_addrlen) == -1) { cause = "connect"; save_errno = errno; close(s); errno = save_errno; s = -1; continue; } break; } freeaddrinfo(res0); if (s == -1) errx(EX_TEMPFAIL, "%s", cause); free(destcopy); return s; } static int lmtp_connect_unix(const char *destination) { struct sockaddr_un addr; int s; if (*destination != '/') errx(EX_TEMPFAIL, "unix: path must be absolute"); if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) err(EX_TEMPFAIL, NULL); memset(&addr, 0, sizeof addr); addr.sun_family = AF_UNIX; if (strlcpy(addr.sun_path, destination, sizeof addr.sun_path) >= sizeof addr.sun_path) errx(EX_TEMPFAIL, "unix: socket path is too long"); if (connect(s, (struct sockaddr *)&addr, sizeof addr) == -1) err(EX_TEMPFAIL, "connect"); return s; } static int lmtp_connect(const char *destination) { if (destination[0] == '/') return lmtp_connect_unix(destination); return lmtp_connect_inet(destination); } static void lmtp_engine(int fd_read, struct session *session) { int fd_write = 0; FILE *file_read = 0; FILE *file_write = 0; char *line = NULL; size_t linesize = 0; ssize_t linelen; enum phase phase = PHASE_BANNER; if ((fd_write = dup(fd_read)) == -1) err(EX_TEMPFAIL, "dup"); if ((file_read = fdopen(fd_read, "r")) == NULL) err(EX_TEMPFAIL, "fdopen"); if ((file_write = fdopen(fd_write, "w")) == NULL) err(EX_TEMPFAIL, "fdopen"); do { fflush(file_write); if ((linelen = getline(&line, &linesize, file_read)) == -1) { if (ferror(file_read)) err(EX_TEMPFAIL, "getline"); else errx(EX_TEMPFAIL, "unexpected EOF from LMTP server"); } line[strcspn(line, "\n")] = '\0'; line[strcspn(line, "\r")] = '\0'; if (linelen < 4 || !isdigit((unsigned char)line[0]) || !isdigit((unsigned char)line[1]) || !isdigit((unsigned char)line[2]) || (line[3] != ' ' && line[3] != '-')) errx(EX_TEMPFAIL, "LMTP server sent an invalid line"); if (line[0] != (phase == PHASE_DATA ? '3' : '2')) { int code = EX_TEMPFAIL; if (line[0] != '4') code = EX_UNAVAILABLE; errx(code, "LMTP server error: %s", line); } if (line[3] == '-') continue; switch (phase) { case PHASE_BANNER: fprintf(file_write, "LHLO %s\r\n", session->lhlo); phase++; break; case PHASE_HELO: fprintf(file_write, "MAIL FROM:<%s>\r\n", session->mailfrom); phase++; break; case PHASE_MAILFROM: fprintf(file_write, "RCPT TO:<%s>\r\n", session->rcpts[session->n_rcpts - 1]); if (session->n_rcpts - 1 == 0) { phase++; break; } session->n_rcpts--; break; case PHASE_RCPTTO: fprintf(file_write, "DATA\r\n"); phase++; break; case PHASE_DATA: stream_file(file_write); fprintf(file_write, ".\r\n"); phase++; break; case PHASE_EOM: fprintf(file_write, "QUIT\r\n"); phase++; break; case PHASE_QUIT: exit(0); } } while (1); } static void stream_file(FILE *conn) { char *line = NULL; size_t linesize = 0; while (getline(&line, &linesize, stdin) != -1) { line[strcspn(line, "\n")] = '\0'; if (line[0] == '.') fprintf(conn, "."); fprintf(conn, "%s\r\n", line); } free(line); if (ferror(stdin)) err(EX_TEMPFAIL, "getline"); } opensmtpd-7.7.0p0/usr.sbin/smtpd/scheduler.c0000644000175000001440000003703214610663500014475 /* $OpenBSD: scheduler.c,v 1.62 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008-2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include "smtpd.h" #include "log.h" static void scheduler_imsg(struct mproc *, struct imsg *); static void scheduler_shutdown(void); static void scheduler_reset_events(void); static void scheduler_timeout(int, short, void *); static struct scheduler_backend *backend = NULL; static struct event ev; static size_t ninflight = 0; static int *types; static uint64_t *evpids; static uint32_t *msgids; static struct evpstate *state; extern const char *backend_scheduler; void scheduler_imsg(struct mproc *p, struct imsg *imsg) { struct bounce_req_msg req; struct envelope evp; struct scheduler_info si; struct msg m; uint64_t evpid, id, holdq; uint32_t msgid; uint32_t inflight; size_t n, i; time_t timestamp; int v, r, type; if (imsg == NULL) scheduler_shutdown(); switch (imsg->hdr.type) { case IMSG_QUEUE_ENVELOPE_SUBMIT: m_msg(&m, imsg); m_get_envelope(&m, &evp); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: inserting evp:%016" PRIx64, evp.id); scheduler_info(&si, &evp); stat_increment("scheduler.envelope.incoming", 1); backend->insert(&si); return; case IMSG_QUEUE_MESSAGE_COMMIT: m_msg(&m, imsg); m_get_msgid(&m, &msgid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: committing msg:%08" PRIx32, msgid); n = backend->commit(msgid); stat_decrement("scheduler.envelope.incoming", n); stat_increment("scheduler.envelope", n); scheduler_reset_events(); return; case IMSG_QUEUE_DISCOVER_EVPID: m_msg(&m, imsg); m_get_envelope(&m, &evp); m_end(&m); r = backend->query(evp.id); if (r) { log_debug("debug: scheduler: evp:%016" PRIx64 " already scheduled", evp.id); return; } log_trace(TRACE_SCHEDULER, "scheduler: discovering evp:%016" PRIx64, evp.id); scheduler_info(&si, &evp); stat_increment("scheduler.envelope.incoming", 1); backend->insert(&si); return; case IMSG_QUEUE_DISCOVER_MSGID: m_msg(&m, imsg); m_get_msgid(&m, &msgid); m_end(&m); r = backend->query(msgid); if (r) { log_debug("debug: scheduler: msgid:%08" PRIx32 " already scheduled", msgid); return; } log_trace(TRACE_SCHEDULER, "scheduler: committing msg:%08" PRIx32, msgid); n = backend->commit(msgid); stat_decrement("scheduler.envelope.incoming", n); stat_increment("scheduler.envelope", n); scheduler_reset_events(); return; case IMSG_QUEUE_MESSAGE_ROLLBACK: m_msg(&m, imsg); m_get_msgid(&m, &msgid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: aborting msg:%08" PRIx32, msgid); n = backend->rollback(msgid); stat_decrement("scheduler.envelope.incoming", n); scheduler_reset_events(); return; case IMSG_QUEUE_ENVELOPE_REMOVE: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_get_u32(&m, &inflight); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: queue requested removal of evp:%016" PRIx64, evpid); stat_decrement("scheduler.envelope", 1); if (!inflight) backend->remove(evpid); else { backend->delete(evpid); ninflight -= 1; stat_decrement("scheduler.envelope.inflight", 1); } scheduler_reset_events(); return; case IMSG_QUEUE_ENVELOPE_ACK: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: queue ack removal of evp:%016" PRIx64, evpid); ninflight -= 1; stat_decrement("scheduler.envelope.inflight", 1); scheduler_reset_events(); return; case IMSG_QUEUE_DELIVERY_OK: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (ok)", evpid); backend->delete(evpid); ninflight -= 1; stat_increment("scheduler.delivery.ok", 1); stat_decrement("scheduler.envelope.inflight", 1); stat_decrement("scheduler.envelope", 1); scheduler_reset_events(); return; case IMSG_QUEUE_DELIVERY_TEMPFAIL: m_msg(&m, imsg); m_get_envelope(&m, &evp); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: updating evp:%016" PRIx64, evp.id); scheduler_info(&si, &evp); backend->update(&si); ninflight -= 1; stat_increment("scheduler.delivery.tempfail", 1); stat_decrement("scheduler.envelope.inflight", 1); for (i = 0; i < MAX_BOUNCE_WARN; i++) { if (env->sc_bounce_warn[i] == 0) break; timestamp = si.creation + env->sc_bounce_warn[i]; if (si.nexttry >= timestamp && si.lastbounce < timestamp) { req.evpid = evp.id; req.timestamp = timestamp; req.bounce.type = B_DELAYED; req.bounce.delay = env->sc_bounce_warn[i]; req.bounce.ttl = si.ttl; m_compose(p, IMSG_SCHED_ENVELOPE_BOUNCE, 0, 0, -1, &req, sizeof req); break; } } scheduler_reset_events(); return; case IMSG_QUEUE_DELIVERY_PERMFAIL: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (fail)", evpid); backend->delete(evpid); ninflight -= 1; stat_increment("scheduler.delivery.permfail", 1); stat_decrement("scheduler.envelope.inflight", 1); stat_decrement("scheduler.envelope", 1); scheduler_reset_events(); return; case IMSG_QUEUE_DELIVERY_LOOP: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: deleting evp:%016" PRIx64 " (loop)", evpid); backend->delete(evpid); ninflight -= 1; stat_increment("scheduler.delivery.loop", 1); stat_decrement("scheduler.envelope.inflight", 1); stat_decrement("scheduler.envelope", 1); scheduler_reset_events(); return; case IMSG_QUEUE_HOLDQ_HOLD: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_get_id(&m, &holdq); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: holding evp:%016" PRIx64 " on %016" PRIx64, evpid, holdq); backend->hold(evpid, holdq); ninflight -= 1; stat_decrement("scheduler.envelope.inflight", 1); scheduler_reset_events(); return; case IMSG_QUEUE_HOLDQ_RELEASE: m_msg(&m, imsg); m_get_int(&m, &type); m_get_id(&m, &holdq); m_get_int(&m, &r); m_end(&m); log_trace(TRACE_SCHEDULER, "scheduler: releasing %d on holdq (%d, %016" PRIx64 ")", r, type, holdq); backend->release(type, holdq, r); scheduler_reset_events(); return; case IMSG_CTL_PAUSE_MDA: log_trace(TRACE_SCHEDULER, "scheduler: pausing mda"); env->sc_flags |= SMTPD_MDA_PAUSED; return; case IMSG_CTL_RESUME_MDA: log_trace(TRACE_SCHEDULER, "scheduler: resuming mda"); env->sc_flags &= ~SMTPD_MDA_PAUSED; scheduler_reset_events(); return; case IMSG_CTL_PAUSE_MTA: log_trace(TRACE_SCHEDULER, "scheduler: pausing mta"); env->sc_flags |= SMTPD_MTA_PAUSED; return; case IMSG_CTL_RESUME_MTA: log_trace(TRACE_SCHEDULER, "scheduler: resuming mta"); env->sc_flags &= ~SMTPD_MTA_PAUSED; scheduler_reset_events(); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_setverbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; case IMSG_CTL_LIST_MESSAGES: msgid = *(uint32_t *)(imsg->data); n = backend->messages(msgid, msgids, env->sc_scheduler_max_msg_batch_size); m_compose(p, IMSG_CTL_LIST_MESSAGES, imsg->hdr.peerid, 0, -1, msgids, n * sizeof (*msgids)); return; case IMSG_CTL_LIST_ENVELOPES: id = *(uint64_t *)(imsg->data); n = backend->envelopes(id, state, env->sc_scheduler_max_evp_batch_size); for (i = 0; i < n; i++) { m_create(p_queue, IMSG_CTL_LIST_ENVELOPES, imsg->hdr.peerid, 0, -1); m_add_evpid(p_queue, state[i].evpid); m_add_int(p_queue, state[i].flags); m_add_time(p_queue, state[i].time); m_close(p_queue); } m_compose(p_queue, IMSG_CTL_LIST_ENVELOPES, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_SCHEDULE: id = *(uint64_t *)(imsg->data); if (id <= 0xffffffffL) log_debug("debug: scheduler: " "scheduling msg:%08" PRIx64, id); else log_debug("debug: scheduler: " "scheduling evp:%016" PRIx64, id); r = backend->schedule(id); scheduler_reset_events(); m_compose(p, r ? IMSG_CTL_OK : IMSG_CTL_FAIL, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_QUEUE_ENVELOPE_SCHEDULE: id = *(uint64_t *)(imsg->data); backend->schedule(id); scheduler_reset_events(); return; case IMSG_CTL_REMOVE: id = *(uint64_t *)(imsg->data); if (id <= 0xffffffffL) log_debug("debug: scheduler: " "removing msg:%08" PRIx64, id); else log_debug("debug: scheduler: " "removing evp:%016" PRIx64, id); r = backend->remove(id); scheduler_reset_events(); m_compose(p, r ? IMSG_CTL_OK : IMSG_CTL_FAIL, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_PAUSE_EVP: id = *(uint64_t *)(imsg->data); if (id <= 0xffffffffL) log_debug("debug: scheduler: " "suspending msg:%08" PRIx64, id); else log_debug("debug: scheduler: " "suspending evp:%016" PRIx64, id); r = backend->suspend(id); scheduler_reset_events(); m_compose(p, r ? IMSG_CTL_OK : IMSG_CTL_FAIL, imsg->hdr.peerid, 0, -1, NULL, 0); return; case IMSG_CTL_RESUME_EVP: id = *(uint64_t *)(imsg->data); if (id <= 0xffffffffL) log_debug("debug: scheduler: " "resuming msg:%08" PRIx64, id); else log_debug("debug: scheduler: " "resuming evp:%016" PRIx64, id); r = backend->resume(id); scheduler_reset_events(); m_compose(p, r ? IMSG_CTL_OK : IMSG_CTL_FAIL, imsg->hdr.peerid, 0, -1, NULL, 0); return; } fatalx("scheduler_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } static void scheduler_shutdown(void) { log_debug("debug: scheduler agent exiting"); _exit(0); } static void scheduler_reset_events(void) { struct timeval tv; evtimer_del(&ev); tv.tv_sec = 0; tv.tv_usec = 0; evtimer_add(&ev, &tv); } int scheduler(void) { struct passwd *pw; backend = scheduler_backend_lookup(backend_scheduler); if (backend == NULL) fatalx("cannot find scheduler backend \"%s\"", backend_scheduler); purge_config(PURGE_EVERYTHING & ~PURGE_DISPATCHERS); if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); config_process(PROC_SCHEDULER); backend->init(backend_scheduler); if (chroot(PATH_CHROOT) == -1) fatal("scheduler: chroot"); if (chdir("/") == -1) fatal("scheduler: chdir(\"/\")"); if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("scheduler: cannot drop privileges"); evpids = xcalloc(env->sc_scheduler_max_schedule, sizeof *evpids); types = xcalloc(env->sc_scheduler_max_schedule, sizeof *types); msgids = xcalloc(env->sc_scheduler_max_msg_batch_size, sizeof *msgids); state = xcalloc(env->sc_scheduler_max_evp_batch_size, sizeof *state); imsg_callback = scheduler_imsg; event_init(); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); config_peer(PROC_CONTROL); config_peer(PROC_QUEUE); evtimer_set(&ev, scheduler_timeout, NULL); scheduler_reset_events(); #if HAVE_PLEDGE if (pledge("stdio", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } static void scheduler_timeout(int fd, short event, void *p) { struct timeval tv; size_t i; size_t d_inflight; size_t d_envelope; size_t d_removed; size_t d_expired; size_t d_updated; size_t count; int mask, r, delay; tv.tv_sec = 0; tv.tv_usec = 0; mask = SCHED_UPDATE; if (ninflight < env->sc_scheduler_max_inflight) { mask |= SCHED_EXPIRE | SCHED_REMOVE | SCHED_BOUNCE; if (!(env->sc_flags & SMTPD_MDA_PAUSED)) mask |= SCHED_MDA; if (!(env->sc_flags & SMTPD_MTA_PAUSED)) mask |= SCHED_MTA; } count = env->sc_scheduler_max_schedule; log_trace(TRACE_SCHEDULER, "scheduler: getting batch: mask=0x%x, count=%zu", mask, count); r = backend->batch(mask, &delay, &count, evpids, types); log_trace(TRACE_SCHEDULER, "scheduler: got r=%i, delay=%i, count=%zu", r, delay, count); if (r < 0) fatalx("scheduler: error in batch handler"); if (r == 0) { if (delay < -1) fatalx("scheduler: invalid delay %d", delay); if (delay == -1) { log_trace(TRACE_SCHEDULER, "scheduler: sleeping"); return; } tv.tv_sec = delay; tv.tv_usec = 0; log_trace(TRACE_SCHEDULER, "scheduler: waiting for %s", duration_to_text(tv.tv_sec)); evtimer_add(&ev, &tv); return; } d_inflight = 0; d_envelope = 0; d_removed = 0; d_expired = 0; d_updated = 0; for (i = 0; i < count; i++) { switch(types[i]) { case SCHED_REMOVE: log_debug("debug: scheduler: evp:%016" PRIx64 " removed", evpids[i]); m_create(p_queue, IMSG_SCHED_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_queue, evpids[i]); m_close(p_queue); d_envelope += 1; d_removed += 1; d_inflight += 1; break; case SCHED_EXPIRE: log_debug("debug: scheduler: evp:%016" PRIx64 " expired", evpids[i]); m_create(p_queue, IMSG_SCHED_ENVELOPE_EXPIRE, 0, 0, -1); m_add_evpid(p_queue, evpids[i]); m_close(p_queue); d_envelope += 1; d_expired += 1; d_inflight += 1; break; case SCHED_UPDATE: log_debug("debug: scheduler: evp:%016" PRIx64 " scheduled (update)", evpids[i]); d_updated += 1; break; case SCHED_BOUNCE: log_debug("debug: scheduler: evp:%016" PRIx64 " scheduled (bounce)", evpids[i]); m_create(p_queue, IMSG_SCHED_ENVELOPE_INJECT, 0, 0, -1); m_add_evpid(p_queue, evpids[i]); m_close(p_queue); d_inflight += 1; break; case SCHED_MDA: log_debug("debug: scheduler: evp:%016" PRIx64 " scheduled (mda)", evpids[i]); m_create(p_queue, IMSG_SCHED_ENVELOPE_DELIVER, 0, 0, -1); m_add_evpid(p_queue, evpids[i]); m_close(p_queue); d_inflight += 1; break; case SCHED_MTA: log_debug("debug: scheduler: evp:%016" PRIx64 " scheduled (mta)", evpids[i]); m_create(p_queue, IMSG_SCHED_ENVELOPE_TRANSFER, 0, 0, -1); m_add_evpid(p_queue, evpids[i]); m_close(p_queue); d_inflight += 1; break; } } stat_decrement("scheduler.envelope", d_envelope); stat_increment("scheduler.envelope.inflight", d_inflight); stat_increment("scheduler.envelope.expired", d_expired); stat_increment("scheduler.envelope.removed", d_removed); stat_increment("scheduler.envelope.updated", d_updated); ninflight += d_inflight; tv.tv_sec = 0; tv.tv_usec = 0; evtimer_add(&ev, &tv); } opensmtpd-7.7.0p0/usr.sbin/smtpd/mda_mbox.c0000644000175000001440000000436614610663500014311 /* $OpenBSD: mda_mbox.c,v 1.3 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2018 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include "smtpd.h" void mda_mbox(struct deliver *deliver) { int ret; char sender[LINE_MAX]; char *envp[] = { "HOME=/", "PATH=" _PATH_DEFPATH, "LOGNAME=root", "USER=root", NULL, }; if (deliver->sender.user[0] == '\0' && deliver->sender.domain[0] == '\0') ret = snprintf(sender, sizeof sender, "MAILER-DAEMON"); else ret = snprintf(sender, sizeof sender, "%s@%s", deliver->sender.user, deliver->sender.domain); if (ret < 0 || (size_t)ret >= sizeof sender) errx(EX_TEMPFAIL, "sender address too long"); execle(PATH_MAILLOCAL, PATH_MAILLOCAL, "-f", sender, deliver->userinfo.username, (char *)NULL, envp); perror("execl"); _exit(EX_TEMPFAIL); } void mda_mbox_init(struct deliver *deliver) { int fd; int ret; char buffer[LINE_MAX]; ret = snprintf(buffer, sizeof buffer, "%s/%s", _PATH_MAILDIR, deliver->userinfo.username); if (ret < 0 || (size_t)ret >= sizeof buffer) errx(EX_TEMPFAIL, "mailbox pathname too long"); if ((fd = open(buffer, O_CREAT|O_EXCL, 0)) == -1) { if (errno == EEXIST) return; err(EX_TEMPFAIL, "open"); } if (fchown(fd, deliver->userinfo.uid, deliver->userinfo.gid) == -1) err(EX_TEMPFAIL, "fchown"); if (fchmod(fd, S_IRUSR|S_IWUSR) == -1) err(EX_TEMPFAIL, "fchown"); } opensmtpd-7.7.0p0/usr.sbin/smtpd/mta_session.c0000644000175000001440000013034114674615567015064 /* $OpenBSD: mta_session.c,v 1.152 2024/09/03 18:27:04 op Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #define MAX_TRYBEFOREDISABLE 10 #define MTA_HIWAT 65535 enum mta_state { MTA_INIT, MTA_BANNER, MTA_EHLO, MTA_HELO, MTA_LHLO, MTA_STARTTLS, MTA_AUTH, MTA_AUTH_PLAIN, MTA_AUTH_LOGIN, MTA_AUTH_LOGIN_USER, MTA_AUTH_LOGIN_PASS, MTA_READY, MTA_MAIL, MTA_RCPT, MTA_DATA, MTA_BODY, MTA_EOM, MTA_LMTP_EOM, MTA_RSET, MTA_QUIT, }; #define MTA_FORCE_ANYSSL 0x0001 #define MTA_FORCE_SMTPS 0x0002 #define MTA_FORCE_TLS 0x0004 #define MTA_FORCE_PLAIN 0x0008 #define MTA_WANT_SECURE 0x0010 #define MTA_DOWNGRADE_PLAIN 0x0080 #define MTA_TLS 0x0100 #define MTA_TLS_VERIFIED 0x0200 #define MTA_FREE 0x0400 #define MTA_LMTP 0x0800 #define MTA_WAIT 0x1000 #define MTA_HANGON 0x2000 #define MTA_RECONN 0x4000 #define MTA_EXT_STARTTLS 0x01 #define MTA_EXT_PIPELINING 0x02 #define MTA_EXT_AUTH 0x04 #define MTA_EXT_AUTH_PLAIN 0x08 #define MTA_EXT_AUTH_LOGIN 0x10 #define MTA_EXT_SIZE 0x20 struct mta_session { uint64_t id; struct mta_relay *relay; struct mta_route *route; char *helo; char *mxname; char *username; int flags; int attempt; int use_smtps; int use_starttls; int use_smtp_tls; int ready; struct event ev; struct io *io; int ext; size_t ext_size; size_t msgtried; size_t msgcount; size_t rcptcount; int hangon; enum mta_state state; struct mta_task *task; struct mta_envelope *currevp; FILE *datafp; size_t datalen; size_t failures; char replybuf[2048]; }; static void mta_session_init(void); static void mta_start(int fd, short ev, void *arg); static void mta_io(struct io *, int, void *); static void mta_free(struct mta_session *); static void mta_getnameinfo_cb(void *, int, const char *, const char *); static void mta_on_ptr(void *, void *, void *); static void mta_on_timeout(struct runq *, void *); static void mta_connect(struct mta_session *); static void mta_enter_state(struct mta_session *, int); static void mta_flush_task(struct mta_session *, int, const char *, size_t, int); static void mta_error(struct mta_session *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); static void mta_send(struct mta_session *, char *, ...) __attribute__((__format__ (printf, 2, 3))); static ssize_t mta_queue_data(struct mta_session *); static void mta_response(struct mta_session *, char *); static const char * mta_strstate(int); static void mta_tls_init(struct mta_session *); static void mta_tls_started(struct mta_session *); static struct mta_session *mta_tree_pop(struct tree *, uint64_t); static const char * dsn_strret(enum dsn_ret); static const char * dsn_strnotify(uint8_t); void mta_hoststat_update(const char *, const char *); void mta_hoststat_reschedule(const char *); void mta_hoststat_cache(const char *, uint64_t); void mta_hoststat_uncache(const char *, uint64_t); static void mta_filter_begin(struct mta_session *); static void mta_filter_end(struct mta_session *); static void mta_connected(struct mta_session *); static void mta_disconnected(struct mta_session *); static void mta_report_link_connect(struct mta_session *, const char *, int, const struct sockaddr_storage *, const struct sockaddr_storage *); static void mta_report_link_greeting(struct mta_session *, const char *); static void mta_report_link_identify(struct mta_session *, const char *, const char *); static void mta_report_link_tls(struct mta_session *, const char *); static void mta_report_link_disconnect(struct mta_session *); static void mta_report_link_auth(struct mta_session *, const char *, const char *); static void mta_report_tx_reset(struct mta_session *, uint32_t); static void mta_report_tx_begin(struct mta_session *, uint32_t); static void mta_report_tx_mail(struct mta_session *, uint32_t, const char *, int); static void mta_report_tx_rcpt(struct mta_session *, uint32_t, const char *, int); static void mta_report_tx_envelope(struct mta_session *, uint32_t, uint64_t); static void mta_report_tx_data(struct mta_session *, uint32_t, int); static void mta_report_tx_commit(struct mta_session *, uint32_t, size_t); static void mta_report_tx_rollback(struct mta_session *, uint32_t); static void mta_report_protocol_client(struct mta_session *, const char *); static void mta_report_protocol_server(struct mta_session *, const char *); #if 0 static void mta_report_filter_response(struct mta_session *, int, int, const char *); #endif static void mta_report_timeout(struct mta_session *); static struct tree wait_helo; static struct tree wait_ptr; static struct tree wait_fd; static struct tree wait_tls_init; static struct tree wait_tls_verify; static struct runq *hangon; #define SESSION_FILTERED(s) \ ((s)->relay->dispatcher->u.remote.filtername) static void mta_session_init(void) { static int init = 0; if (!init) { tree_init(&wait_helo); tree_init(&wait_ptr); tree_init(&wait_fd); tree_init(&wait_tls_init); tree_init(&wait_tls_verify); runq_init(&hangon, mta_on_timeout); init = 1; } } void mta_session(struct mta_relay *relay, struct mta_route *route, const char *mxname) { struct mta_session *s; struct timeval tv; mta_session_init(); s = xcalloc(1, sizeof *s); s->id = generate_uid(); s->relay = relay; s->route = route; s->mxname = xstrdup(mxname); mta_filter_begin(s); if (relay->flags & RELAY_LMTP) s->flags |= MTA_LMTP; switch (relay->tls) { case RELAY_TLS_SMTPS: s->flags |= MTA_FORCE_SMTPS; s->flags |= MTA_WANT_SECURE; break; case RELAY_TLS_STARTTLS: s->flags |= MTA_FORCE_TLS; s->flags |= MTA_WANT_SECURE; break; case RELAY_TLS_OPPORTUNISTIC: /* do not force anything, try tls then smtp */ break; case RELAY_TLS_NO: s->flags |= MTA_FORCE_PLAIN; break; default: fatalx("bad value for relay->tls: %d", relay->tls); } log_debug("debug: mta: %p: spawned for relay %s", s, mta_relay_to_text(relay)); stat_increment("mta.session", 1); if (route->dst->ptrname || route->dst->lastptrquery) { /* We want to delay the connection since to always notify * the relay asynchronously. */ tv.tv_sec = 0; tv.tv_usec = 0; evtimer_set(&s->ev, mta_start, s); evtimer_add(&s->ev, &tv); } else if (waitq_wait(&route->dst->ptrname, mta_on_ptr, s)) { resolver_getnameinfo(s->route->dst->sa, NI_NUMERICSERV, mta_getnameinfo_cb, s); } } void mta_session_imsg(struct mproc *p, struct imsg *imsg) { struct mta_session *s; struct msg m; uint64_t reqid; const char *name; int status, fd; struct stat sb; switch (imsg->hdr.type) { case IMSG_MTA_OPEN_MESSAGE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); fd = imsg_get_fd(imsg); s = mta_tree_pop(&wait_fd, reqid); if (s == NULL) { if (fd != -1) close(fd); return; } if (fd == -1) { log_debug("debug: mta: failed to obtain msg fd"); mta_flush_task(s, IMSG_MTA_DELIVERY_TEMPFAIL, "Could not get message fd", 0, 0); mta_enter_state(s, MTA_READY); return; } if ((s->ext & MTA_EXT_SIZE) && s->ext_size != 0) { if (fstat(fd, &sb) == -1) { log_debug("debug: mta: failed to stat msg fd"); mta_flush_task(s, IMSG_MTA_DELIVERY_TEMPFAIL, "Could not stat message fd", 0, 0); mta_enter_state(s, MTA_READY); close(fd); return; } if (sb.st_size > (off_t)s->ext_size) { log_debug("debug: mta: message too large for peer"); mta_flush_task(s, IMSG_MTA_DELIVERY_PERMFAIL, "message too large for peer", 0, 0); mta_enter_state(s, MTA_READY); close(fd); return; } } s->datafp = fdopen(fd, "r"); if (s->datafp == NULL) fatal("mta: fdopen"); mta_enter_state(s, MTA_MAIL); return; case IMSG_MTA_LOOKUP_HELO: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &status); if (status == LKA_OK) m_get_string(&m, &name); m_end(&m); s = mta_tree_pop(&wait_helo, reqid); if (s == NULL) return; if (status == LKA_OK) { s->helo = xstrdup(name); mta_connect(s); } else { mta_source_error(s->relay, s->route, "Failed to retrieve helo string"); mta_free(s); } return; default: fatalx("mta_session_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } } static struct mta_session * mta_tree_pop(struct tree *wait, uint64_t reqid) { struct mta_session *s; s = tree_xpop(wait, reqid); if (s->flags & MTA_FREE) { log_debug("debug: mta: %p: zombie session", s); mta_free(s); return (NULL); } s->flags &= ~MTA_WAIT; return (s); } static void mta_free(struct mta_session *s) { struct mta_relay *relay; struct mta_route *route; log_debug("debug: mta: %p: session done", s); mta_disconnected(s); if (s->ready) s->relay->nconn_ready -= 1; if (s->flags & MTA_HANGON) { log_debug("debug: mta: %p: cancelling hangon timer", s); runq_cancel(hangon, s); } if (s->io) io_free(s->io); if (s->task) fatalx("current task should have been deleted already"); if (s->datafp) { fclose(s->datafp); s->datalen = 0; } free(s->helo); relay = s->relay; route = s->route; free(s->username); free(s->mxname); free(s); stat_decrement("mta.session", 1); mta_route_collect(relay, route); } static void mta_getnameinfo_cb(void *arg, int gaierrno, const char *host, const char *serv) { struct mta_session *s = arg; struct mta_host *h; h = s->route->dst; h->lastptrquery = time(NULL); if (host) h->ptrname = xstrdup(host); waitq_run(&h->ptrname, h->ptrname); } static void mta_on_timeout(struct runq *runq, void *arg) { struct mta_session *s = arg; log_debug("mta: timeout for session hangon"); s->flags &= ~MTA_HANGON; s->hangon++; mta_enter_state(s, MTA_READY); } static void mta_on_ptr(void *tag, void *arg, void *data) { struct mta_session *s = arg; mta_connect(s); } static void mta_start(int fd, short ev, void *arg) { struct mta_session *s = arg; mta_connect(s); } static void mta_connect(struct mta_session *s) { struct sockaddr_storage ss; struct sockaddr *sa; int portno; const char *schema; if (s->helo == NULL) { if (s->relay->helotable && s->route->src->sa) { m_create(p_lka, IMSG_MTA_LOOKUP_HELO, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->relay->helotable); m_add_sockaddr(p_lka, s->route->src->sa); m_close(p_lka); tree_xset(&wait_helo, s->id, s); s->flags |= MTA_WAIT; return; } else if (s->relay->heloname) s->helo = xstrdup(s->relay->heloname); else s->helo = xstrdup(env->sc_hostname); } if (s->io) { io_free(s->io); s->io = NULL; } s->use_smtps = s->use_starttls = s->use_smtp_tls = 0; switch (s->attempt) { case 0: if (s->flags & MTA_FORCE_SMTPS) s->use_smtps = 1; /* smtps */ else if (s->flags & (MTA_FORCE_TLS|MTA_FORCE_ANYSSL)) s->use_starttls = 1; /* tls, tls+smtps */ else if (!(s->flags & MTA_FORCE_PLAIN)) s->use_smtp_tls = 1; break; case 1: if (s->flags & MTA_FORCE_ANYSSL) { s->use_smtps = 1; /* tls+smtps */ break; } else if (s->flags & MTA_DOWNGRADE_PLAIN) { /* smtp, with tls failure */ break; } default: mta_free(s); return; } portno = s->use_smtps ? 465 : 25; /* Override with relay-specified port */ if (s->relay->port) portno = s->relay->port; memmove(&ss, s->route->dst->sa, SA_LEN(s->route->dst->sa)); sa = (struct sockaddr *)&ss; if (sa->sa_family == AF_INET) ((struct sockaddr_in *)sa)->sin_port = htons(portno); else if (sa->sa_family == AF_INET6) ((struct sockaddr_in6 *)sa)->sin6_port = htons(portno); s->attempt += 1; if (s->use_smtp_tls) schema = "smtp://"; else if (s->use_starttls) schema = "smtp+tls://"; else if (s->use_smtps) schema = "smtps://"; else if (s->flags & MTA_LMTP) schema = "lmtp://"; else schema = "smtp+notls://"; log_info("%016"PRIx64" mta " "connecting address=%s%s:%d host=%s", s->id, schema, sa_to_text(s->route->dst->sa), portno, s->route->dst->ptrname); mta_enter_state(s, MTA_INIT); s->io = io_new(); io_set_callback(s->io, mta_io, s); io_set_timeout(s->io, 300000); if (io_connect(s->io, sa, s->route->src->sa) == -1) { /* * This error is most likely a "no route", * so there is no need to try again. */ log_debug("debug: mta: io_connect failed: %s", io_error(s->io)); if (errno == EADDRNOTAVAIL) mta_source_error(s->relay, s->route, io_error(s->io)); else mta_error(s, "Connection failed: %s", io_error(s->io)); mta_free(s); } } static void mta_enter_state(struct mta_session *s, int newstate) { struct mta_envelope *e; size_t envid_sz; int oldstate; ssize_t q; char ibuf[LINE_MAX]; char obuf[LINE_MAX]; int offset; const char *srs_sender; again: oldstate = s->state; log_trace(TRACE_MTA, "mta: %p: %s -> %s", s, mta_strstate(oldstate), mta_strstate(newstate)); s->state = newstate; memset(s->replybuf, 0, sizeof s->replybuf); /* don't try this at home! */ #define mta_enter_state(_s, _st) do { newstate = _st; goto again; } while (0) switch (s->state) { case MTA_INIT: case MTA_BANNER: break; case MTA_EHLO: s->ext = 0; mta_send(s, "EHLO %s", s->helo); mta_report_link_identify(s, "EHLO", s->helo); break; case MTA_HELO: s->ext = 0; mta_send(s, "HELO %s", s->helo); mta_report_link_identify(s, "HELO", s->helo); break; case MTA_LHLO: s->ext = 0; mta_send(s, "LHLO %s", s->helo); mta_report_link_identify(s, "LHLO", s->helo); break; case MTA_STARTTLS: if (s->flags & MTA_DOWNGRADE_PLAIN) mta_enter_state(s, MTA_AUTH); if (s->flags & MTA_TLS) /* already started */ mta_enter_state(s, MTA_AUTH); else if ((s->ext & MTA_EXT_STARTTLS) == 0) { if (s->flags & MTA_FORCE_TLS || s->flags & MTA_WANT_SECURE) { mta_error(s, "TLS required but not supported by remote host"); s->flags |= MTA_RECONN; } else /* server doesn't support starttls, do not use it */ mta_enter_state(s, MTA_AUTH); } else mta_send(s, "STARTTLS"); break; case MTA_AUTH: if (s->relay->secret && s->flags & MTA_TLS) { if (s->ext & MTA_EXT_AUTH) { if (s->ext & MTA_EXT_AUTH_PLAIN) { mta_enter_state(s, MTA_AUTH_PLAIN); break; } if (s->ext & MTA_EXT_AUTH_LOGIN) { mta_enter_state(s, MTA_AUTH_LOGIN); break; } log_debug("debug: mta: %p: no supported AUTH method on session", s); mta_error(s, "no supported AUTH method"); } else { log_debug("debug: mta: %p: AUTH not advertised on session", s); mta_error(s, "AUTH not advertised"); } } else if (s->relay->secret) { log_debug("debug: mta: %p: not using AUTH on non-TLS " "session", s); mta_error(s, "Refuse to AUTH over insecure channel"); mta_connect(s); } else { mta_enter_state(s, MTA_READY); } break; case MTA_AUTH_PLAIN: memset(ibuf, 0, sizeof ibuf); if (base64_decode(s->relay->secret, (unsigned char *)ibuf, sizeof(ibuf)-1) == -1) { log_debug("debug: mta: %p: credentials too large on session", s); mta_error(s, "Credentials too large"); break; } s->username = xstrdup(ibuf+1); mta_send(s, "AUTH PLAIN %s", s->relay->secret); break; case MTA_AUTH_LOGIN: mta_send(s, "AUTH LOGIN"); break; case MTA_AUTH_LOGIN_USER: memset(ibuf, 0, sizeof ibuf); if (base64_decode(s->relay->secret, (unsigned char *)ibuf, sizeof(ibuf)-1) == -1) { log_debug("debug: mta: %p: credentials too large on session", s); mta_error(s, "Credentials too large"); break; } s->username = xstrdup(ibuf+1); memset(obuf, 0, sizeof obuf); base64_encode((unsigned char *)ibuf + 1, strlen(ibuf + 1), obuf, sizeof obuf); mta_send(s, "%s", obuf); memset(ibuf, 0, sizeof ibuf); memset(obuf, 0, sizeof obuf); break; case MTA_AUTH_LOGIN_PASS: memset(ibuf, 0, sizeof ibuf); if (base64_decode(s->relay->secret, (unsigned char *)ibuf, sizeof(ibuf)-1) == -1) { log_debug("debug: mta: %p: credentials too large on session", s); mta_error(s, "Credentials too large"); break; } offset = strlen(ibuf+1)+2; memset(obuf, 0, sizeof obuf); base64_encode((unsigned char *)ibuf + offset, strlen(ibuf + offset), obuf, sizeof obuf); mta_send(s, "%s", obuf); memset(ibuf, 0, sizeof ibuf); memset(obuf, 0, sizeof obuf); break; case MTA_READY: /* Ready to send a new mail */ if (s->ready == 0) { s->ready = 1; s->relay->nconn_ready += 1; mta_route_ok(s->relay, s->route); } if (s->msgtried >= MAX_TRYBEFOREDISABLE) { log_info("%016"PRIx64" mta host-rejects-all-mails", s->id); mta_route_down(s->relay, s->route); mta_enter_state(s, MTA_QUIT); break; } if (s->msgcount >= s->relay->limits->max_mail_per_session) { log_debug("debug: mta: " "%p: cannot send more message to relay %s", s, mta_relay_to_text(s->relay)); mta_enter_state(s, MTA_QUIT); break; } /* * When downgrading from opportunistic TLS, clear flag and * possibly reuse the same task (forbidden in other cases). */ if (s->flags & MTA_DOWNGRADE_PLAIN) s->flags &= ~MTA_DOWNGRADE_PLAIN; else if (s->task) fatalx("task should be NULL at this point"); if (s->task == NULL) s->task = mta_route_next_task(s->relay, s->route); if (s->task == NULL) { log_debug("debug: mta: %p: no task for relay %s", s, mta_relay_to_text(s->relay)); if (s->relay->nconn > 1 || s->hangon >= s->relay->limits->sessdelay_keepalive) { mta_enter_state(s, MTA_QUIT); break; } log_debug("mta: debug: last connection: hanging on for %llds", (long long)(s->relay->limits->sessdelay_keepalive - s->hangon)); s->flags |= MTA_HANGON; runq_schedule(hangon, 1, s); break; } log_debug("debug: mta: %p: handling next task for relay %s", s, mta_relay_to_text(s->relay)); stat_increment("mta.task.running", 1); m_create(p_queue, IMSG_MTA_OPEN_MESSAGE, 0, 0, -1); m_add_id(p_queue, s->id); m_add_msgid(p_queue, s->task->msgid); m_close(p_queue); tree_xset(&wait_fd, s->id, s); s->flags |= MTA_WAIT; break; case MTA_MAIL: s->currevp = TAILQ_FIRST(&s->task->envelopes); e = s->currevp; s->hangon = 0; s->msgtried++; envid_sz = strlen(e->dsn_envid); /* SRS-encode if requested for the relay action, AND we're not * bouncing, AND we have an RCPT which means we are forwarded, * AND the RCPT has a '@' just for sanity check (will always). */ if (env->sc_srs_key != NULL && s->relay->srs && strchr(s->task->sender, '@') && e->rcpt && strchr(e->rcpt, '@')) { /* encode and replace task sender with new SRS-sender */ srs_sender = srs_encode(s->task->sender, strchr(e->rcpt, '@') + 1); if (srs_sender) { free(s->task->sender); s->task->sender = xstrdup(srs_sender); } } if (s->ext & MTA_EXT_DSN) { mta_send(s, "MAIL FROM:<%s>%s%s%s%s", s->task->sender, e->dsn_ret ? " RET=" : "", e->dsn_ret ? dsn_strret(e->dsn_ret) : "", envid_sz ? " ENVID=" : "", envid_sz ? e->dsn_envid : ""); } else mta_send(s, "MAIL FROM:<%s>", s->task->sender); break; case MTA_RCPT: if (s->currevp == NULL) s->currevp = TAILQ_FIRST(&s->task->envelopes); e = s->currevp; if (s->ext & MTA_EXT_DSN) { mta_send(s, "RCPT TO:<%s>%s%s%s%s", e->dest, e->dsn_notify ? " NOTIFY=" : "", e->dsn_notify ? dsn_strnotify(e->dsn_notify) : "", e->dsn_orcpt ? " ORCPT=" : "", e->dsn_orcpt ? e->dsn_orcpt : ""); } else mta_send(s, "RCPT TO:<%s>", e->dest); mta_report_tx_envelope(s, s->task->msgid, e->id); s->rcptcount++; break; case MTA_DATA: fseek(s->datafp, 0, SEEK_SET); mta_send(s, "DATA"); break; case MTA_BODY: if (s->datafp == NULL) { log_trace(TRACE_MTA, "mta: %p: end-of-file", s); mta_enter_state(s, MTA_EOM); break; } if ((q = mta_queue_data(s)) == -1) { s->flags |= MTA_FREE; break; } if (q == 0) { mta_enter_state(s, MTA_BODY); break; } log_trace(TRACE_MTA, "mta: %p: >>> [...%zd bytes...]", s, q); break; case MTA_EOM: mta_send(s, "."); break; case MTA_LMTP_EOM: /* LMTP reports status of each delivery, so enable read */ io_set_read(s->io); break; case MTA_RSET: if (s->datafp) { fclose(s->datafp); s->datafp = NULL; s->datalen = 0; } mta_send(s, "RSET"); break; case MTA_QUIT: mta_send(s, "QUIT"); break; default: fatalx("mta_enter_state: unknown state"); } #undef mta_enter_state } /* * Handle a response to an SMTP command */ static void mta_response(struct mta_session *s, char *line) { struct mta_envelope *e; struct sockaddr_storage ss; struct sockaddr *sa; const char *domain; char *pbuf; socklen_t sa_len; char buf[LINE_MAX]; int delivery; switch (s->state) { case MTA_BANNER: if (line[0] != '2') { mta_error(s, "BANNER rejected: %s", line); s->flags |= MTA_FREE; return; } pbuf = ""; if (strlen(line) > 4) { (void)strlcpy(buf, line + 4, sizeof buf); if ((pbuf = strchr(buf, ' '))) *pbuf = '\0'; pbuf = valid_domainpart(buf) ? buf : ""; } mta_report_link_greeting(s, pbuf); if (s->flags & MTA_LMTP) mta_enter_state(s, MTA_LHLO); else mta_enter_state(s, MTA_EHLO); break; case MTA_EHLO: if (line[0] != '2') { /* rejected at ehlo state */ if ((s->relay->flags & RELAY_AUTH) || (s->flags & MTA_WANT_SECURE)) { mta_error(s, "EHLO rejected: %s", line); s->flags |= MTA_FREE; return; } mta_enter_state(s, MTA_HELO); return; } if (!(s->flags & MTA_FORCE_PLAIN)) mta_enter_state(s, MTA_STARTTLS); else mta_enter_state(s, MTA_READY); break; case MTA_HELO: if (line[0] != '2') { mta_error(s, "HELO rejected: %s", line); s->flags |= MTA_FREE; return; } mta_enter_state(s, MTA_READY); break; case MTA_LHLO: if (line[0] != '2') { mta_error(s, "LHLO rejected: %s", line); s->flags |= MTA_FREE; return; } mta_enter_state(s, MTA_READY); break; case MTA_STARTTLS: if (line[0] != '2') { if (!(s->flags & MTA_WANT_SECURE)) { mta_enter_state(s, MTA_AUTH); return; } /* XXX mark that the MX doesn't support STARTTLS */ mta_error(s, "STARTTLS rejected: %s", line); s->flags |= MTA_FREE; return; } mta_tls_init(s); break; case MTA_AUTH_PLAIN: if (line[0] != '2') { mta_error(s, "AUTH rejected: %s", line); mta_report_link_auth(s, s->username, "fail"); s->flags |= MTA_FREE; return; } mta_report_link_auth(s, s->username, "pass"); mta_enter_state(s, MTA_READY); break; case MTA_AUTH_LOGIN: if (strncmp(line, "334 ", 4) != 0) { mta_error(s, "AUTH rejected: %s", line); mta_report_link_auth(s, s->username, "fail"); s->flags |= MTA_FREE; return; } mta_enter_state(s, MTA_AUTH_LOGIN_USER); break; case MTA_AUTH_LOGIN_USER: if (strncmp(line, "334 ", 4) != 0) { mta_error(s, "AUTH rejected: %s", line); mta_report_link_auth(s, s->username, "fail"); s->flags |= MTA_FREE; return; } mta_enter_state(s, MTA_AUTH_LOGIN_PASS); break; case MTA_AUTH_LOGIN_PASS: if (line[0] != '2') { mta_error(s, "AUTH rejected: %s", line); mta_report_link_auth(s, s->username, "fail"); s->flags |= MTA_FREE; return; } mta_report_link_auth(s, s->username, "pass"); mta_enter_state(s, MTA_READY); break; case MTA_MAIL: if (line[0] != '2') { if (line[0] == '5') delivery = IMSG_MTA_DELIVERY_PERMFAIL; else delivery = IMSG_MTA_DELIVERY_TEMPFAIL; mta_flush_task(s, delivery, line, 0, 0); mta_enter_state(s, MTA_RSET); return; } mta_report_tx_begin(s, s->task->msgid); mta_report_tx_mail(s, s->task->msgid, s->task->sender, 1); mta_enter_state(s, MTA_RCPT); break; case MTA_RCPT: e = s->currevp; /* remove envelope from hosttat cache if there */ if ((domain = strchr(e->dest, '@')) != NULL) { domain++; mta_hoststat_uncache(domain, e->id); } s->currevp = TAILQ_NEXT(s->currevp, entry); if (line[0] == '2') { s->failures = 0; /* * this host is up, reschedule envelopes that * were cached for reschedule. */ if (domain) mta_hoststat_reschedule(domain); } else { mta_report_tx_rollback(s, s->task->msgid); mta_report_tx_reset(s, s->task->msgid); if (line[0] == '5') delivery = IMSG_MTA_DELIVERY_PERMFAIL; else delivery = IMSG_MTA_DELIVERY_TEMPFAIL; s->failures++; /* remove failed envelope from task list */ TAILQ_REMOVE(&s->task->envelopes, e, entry); stat_decrement("mta.envelope", 1); /* log right away */ (void)snprintf(buf, sizeof(buf), "%s", mta_host_to_text(s->route->dst)); e->session = s->id; /* XXX */ /* * getsockname() can only fail with ENOBUFS here * best effort, don't log source ... */ sa_len = sizeof(ss); sa = (struct sockaddr *)&ss; if (getsockname(io_fileno(s->io), sa, &sa_len) == -1) mta_delivery_log(e, NULL, buf, delivery, line); else mta_delivery_log(e, sa_to_text(sa), buf, delivery, line); if (domain) mta_hoststat_update(domain, e->status); mta_delivery_notify(e); if (s->relay->limits->max_failures_per_session && s->failures == s->relay->limits->max_failures_per_session) { mta_flush_task(s, IMSG_MTA_DELIVERY_TEMPFAIL, "Too many consecutive errors, closing connection", 0, 1); mta_enter_state(s, MTA_QUIT); break; } /* * if no more envelopes, flush failed queue */ if (TAILQ_EMPTY(&s->task->envelopes)) { mta_flush_task(s, IMSG_MTA_DELIVERY_OK, "No envelope", 0, 0); mta_enter_state(s, MTA_RSET); break; } } switch (line[0]) { case '2': mta_report_tx_rcpt(s, s->task->msgid, e->dest, 1); break; case '4': mta_report_tx_rcpt(s, s->task->msgid, e->dest, -1); break; case '5': mta_report_tx_rcpt(s, s->task->msgid, e->dest, 0); break; } if (s->currevp == NULL) mta_enter_state(s, MTA_DATA); else mta_enter_state(s, MTA_RCPT); break; case MTA_DATA: if (line[0] == '2' || line[0] == '3') { mta_report_tx_data(s, s->task->msgid, 1); mta_enter_state(s, MTA_BODY); break; } if (line[0] == '5') delivery = IMSG_MTA_DELIVERY_PERMFAIL; else delivery = IMSG_MTA_DELIVERY_TEMPFAIL; mta_report_tx_data(s, s->task->msgid, delivery == IMSG_MTA_DELIVERY_TEMPFAIL ? -1 : 0); mta_report_tx_rollback(s, s->task->msgid); mta_report_tx_reset(s, s->task->msgid); mta_flush_task(s, delivery, line, 0, 0); mta_enter_state(s, MTA_RSET); break; case MTA_LMTP_EOM: case MTA_EOM: if (line[0] == '2') { delivery = IMSG_MTA_DELIVERY_OK; s->msgtried = 0; s->msgcount++; } else if (line[0] == '5') delivery = IMSG_MTA_DELIVERY_PERMFAIL; else delivery = IMSG_MTA_DELIVERY_TEMPFAIL; if (delivery != IMSG_MTA_DELIVERY_OK) { mta_report_tx_rollback(s, s->task->msgid); mta_report_tx_reset(s, s->task->msgid); } else { mta_report_tx_commit(s, s->task->msgid, s->datalen); mta_report_tx_reset(s, s->task->msgid); } mta_flush_task(s, delivery, line, (s->flags & MTA_LMTP) ? 1 : 0, 0); if (s->task) { s->rcptcount--; mta_enter_state(s, MTA_LMTP_EOM); } else { s->rcptcount = 0; if (s->relay->limits->sessdelay_transaction) { log_debug("debug: mta: waiting for %llds before next transaction", (long long)s->relay->limits->sessdelay_transaction); s->hangon = s->relay->limits->sessdelay_transaction -1; s->flags |= MTA_HANGON; runq_schedule(hangon, s->relay->limits->sessdelay_transaction, s); } else mta_enter_state(s, MTA_READY); } break; case MTA_RSET: s->rcptcount = 0; if (s->task) { mta_report_tx_rollback(s, s->task->msgid); mta_report_tx_reset(s, s->task->msgid); } if (s->relay->limits->sessdelay_transaction) { log_debug("debug: mta: waiting for %llds after reset", (long long)s->relay->limits->sessdelay_transaction); s->hangon = s->relay->limits->sessdelay_transaction -1; s->flags |= MTA_HANGON; runq_schedule(hangon, s->relay->limits->sessdelay_transaction, s); } else mta_enter_state(s, MTA_READY); break; default: fatalx("mta_response() bad state"); } } static void mta_io(struct io *io, int evt, void *arg) { struct mta_session *s = arg; char *line, *msg, *p; size_t len; const char *error; int cont; log_trace(TRACE_IO, "mta: %p: %s %s", s, io_strevent(evt), io_strio(io)); switch (evt) { case IO_CONNECTED: mta_connected(s); if (s->use_smtps) { io_set_write(io); mta_tls_init(s); if (s->flags & MTA_FREE) mta_free(s); } else { mta_enter_state(s, MTA_BANNER); io_set_read(io); } break; case IO_TLSREADY: log_info("%016"PRIx64" mta tls ciphers=%s", s->id, tls_to_text(io_tls(s->io))); s->flags |= MTA_TLS; if (s->relay->dispatcher->u.remote.tls_verify) s->flags |= MTA_TLS_VERIFIED; mta_tls_started(s); mta_report_link_tls(s, tls_to_text(io_tls(s->io))); break; case IO_DATAIN: nextline: line = io_getline(s->io, &len); if (line == NULL) { if (io_datalen(s->io) >= LINE_MAX) { mta_error(s, "Input too long"); mta_free(s); } return; } /* Strip trailing '\r' */ if (len && line[len - 1] == '\r') line[--len] = '\0'; log_trace(TRACE_MTA, "mta: %p: <<< %s", s, line); mta_report_protocol_server(s, line); if ((error = parse_smtp_response(line, len, &msg, &cont))) { mta_error(s, "Bad response: %s", error); mta_free(s); return; } /* read extensions */ if (s->state == MTA_EHLO) { if (strcmp(msg, "STARTTLS") == 0) s->ext |= MTA_EXT_STARTTLS; else if (strncmp(msg, "AUTH ", 5) == 0) { s->ext |= MTA_EXT_AUTH; if ((p = strstr(msg, " PLAIN")) && (*(p+6) == '\0' || *(p+6) == ' ')) s->ext |= MTA_EXT_AUTH_PLAIN; if ((p = strstr(msg, " LOGIN")) && (*(p+6) == '\0' || *(p+6) == ' ')) s->ext |= MTA_EXT_AUTH_LOGIN; } else if (strcmp(msg, "PIPELINING") == 0) s->ext |= MTA_EXT_PIPELINING; else if (strcmp(msg, "DSN") == 0) s->ext |= MTA_EXT_DSN; else if (strncmp(msg, "SIZE ", 5) == 0) { s->ext_size = strtonum(msg+5, 0, UINT32_MAX, &error); if (error == NULL) s->ext |= MTA_EXT_SIZE; } } /* continuation reply, we parse out the repeating statuses and ESC */ if (cont) { if (s->replybuf[0] == '\0') (void)strlcat(s->replybuf, line, sizeof s->replybuf); else if (len > 4) { p = line + 4; if (isdigit((unsigned char)p[0]) && p[1] == '.' && isdigit((unsigned char)p[2]) && p[3] == '.' && isdigit((unsigned char)p[4]) && isspace((unsigned char)p[5])) p += 5; (void)strlcat(s->replybuf, p, sizeof s->replybuf); } goto nextline; } /* last line of a reply, check if we're on a continuation to parse out status and ESC. * if we overflow reply buffer or are not on continuation, log entire last line. */ if (s->replybuf[0] == '\0') (void)strlcat(s->replybuf, line, sizeof s->replybuf); else if (len > 4) { p = line + 4; if (isdigit((unsigned char)p[0]) && p[1] == '.' && isdigit((unsigned char)p[2]) && p[3] == '.' && isdigit((unsigned char)p[4]) && isspace((unsigned char)p[5])) p += 5; if (strlcat(s->replybuf, p, sizeof s->replybuf) >= sizeof s->replybuf) (void)strlcpy(s->replybuf, line, sizeof s->replybuf); } if (s->state == MTA_QUIT) { log_info("%016"PRIx64" mta disconnected reason=quit messages=%zu", s->id, s->msgcount); mta_free(s); return; } io_set_write(io); mta_response(s, s->replybuf); if (s->flags & MTA_FREE) { mta_free(s); return; } if (s->flags & MTA_RECONN) { s->flags &= ~MTA_RECONN; mta_connect(s); return; } if (io_datalen(s->io)) { log_debug("debug: mta: remaining data in input buffer"); mta_error(s, "Remote host sent too much data"); if (s->flags & MTA_WAIT) s->flags |= MTA_FREE; else mta_free(s); } break; case IO_LOWAT: if (s->state == MTA_BODY) { mta_enter_state(s, MTA_BODY); if (s->flags & MTA_FREE) { mta_free(s); return; } } if (io_queued(s->io) == 0) io_set_read(io); break; case IO_TIMEOUT: log_debug("debug: mta: %p: connection timeout", s); mta_error(s, "Connection timeout"); mta_report_timeout(s); if (!s->ready) mta_connect(s); else mta_free(s); break; case IO_ERROR: log_debug("debug: mta: %p: IO error: %s", s, io_error(io)); if (s->state == MTA_STARTTLS && s->use_smtp_tls) { /* error in non-strict SSL negotiation, downgrade to plain */ log_info("smtp-out: Error on session %016"PRIx64 ": opportunistic TLS failed, " "downgrading to plain", s->id); s->flags &= ~MTA_TLS; s->flags |= MTA_DOWNGRADE_PLAIN; mta_connect(s); break; } mta_error(s, "IO Error: %s", io_error(io)); mta_free(s); break; case IO_DISCONNECTED: log_debug("debug: mta: %p: disconnected in state %s", s, mta_strstate(s->state)); mta_error(s, "Connection closed unexpectedly"); if (!s->ready) mta_connect(s); else mta_free(s); break; default: fatalx("mta_io() bad event"); } } static void mta_send(struct mta_session *s, char *fmt, ...) { va_list ap; char *p; int len; va_start(ap, fmt); if ((len = vasprintf(&p, fmt, ap)) == -1) fatal("mta: vasprintf"); va_end(ap); log_trace(TRACE_MTA, "mta: %p: >>> %s", s, p); if (strncasecmp(p, "AUTH PLAIN ", 11) == 0) mta_report_protocol_client(s, "AUTH PLAIN ********"); else if (s->state == MTA_AUTH_LOGIN_USER || s->state == MTA_AUTH_LOGIN_PASS) mta_report_protocol_client(s, "********"); else mta_report_protocol_client(s, p); io_xprintf(s->io, "%s\r\n", p); free(p); } /* * Queue some data into the input buffer */ static ssize_t mta_queue_data(struct mta_session *s) { char *ln = NULL; size_t sz = 0, q; ssize_t len; q = io_queued(s->io); while (io_queued(s->io) < MTA_HIWAT) { if ((len = getline(&ln, &sz, s->datafp)) == -1) break; if (ln[len - 1] == '\n') ln[len - 1] = '\0'; s->datalen += io_xprintf(s->io, "%s%s\r\n", *ln == '.' ? "." : "", ln); } free(ln); if (ferror(s->datafp)) { mta_flush_task(s, IMSG_MTA_DELIVERY_TEMPFAIL, "Error reading content file", 0, 0); return (-1); } if (feof(s->datafp)) { fclose(s->datafp); s->datafp = NULL; } return (io_queued(s->io) - q); } static void mta_flush_task(struct mta_session *s, int delivery, const char *error, size_t count, int cache) { struct mta_envelope *e; char relay[LINE_MAX]; size_t n; struct sockaddr_storage ss; struct sockaddr *sa; socklen_t sa_len; const char *domain; (void)snprintf(relay, sizeof relay, "%s", mta_host_to_text(s->route->dst)); n = 0; while ((e = TAILQ_FIRST(&s->task->envelopes))) { if (count && n == count) { stat_decrement("mta.envelope", n); return; } TAILQ_REMOVE(&s->task->envelopes, e, entry); /* we're about to log, associate session to envelope */ e->session = s->id; e->ext = s->ext; /* XXX */ /* * getsockname() can only fail with ENOBUFS here * best effort, don't log source ... */ sa = (struct sockaddr *)&ss; sa_len = sizeof(ss); if (getsockname(io_fileno(s->io), sa, &sa_len) == -1) mta_delivery_log(e, NULL, relay, delivery, error); else mta_delivery_log(e, sa_to_text(sa), relay, delivery, error); mta_delivery_notify(e); domain = strchr(e->dest, '@'); if (domain) { domain++; mta_hoststat_update(domain, error); if (cache) mta_hoststat_cache(domain, e->id); } n++; } free(s->task->sender); free(s->task); s->task = NULL; if (s->datafp) { fclose(s->datafp); s->datafp = NULL; } stat_decrement("mta.envelope", n); stat_decrement("mta.task.running", 1); stat_decrement("mta.task", 1); } static void mta_error(struct mta_session *s, const char *fmt, ...) { va_list ap; char *error; int len; va_start(ap, fmt); if ((len = vasprintf(&error, fmt, ap)) == -1) fatal("mta: vasprintf"); va_end(ap); if (s->msgcount) log_info("smtp-out: Error on session %016"PRIx64 " after %zu message%s sent: %s", s->id, s->msgcount, (s->msgcount > 1) ? "s" : "", error); else log_info("%016"PRIx64" mta error reason=%s", s->id, error); /* * If not connected yet, and the error is not local, just ignore it * and try to reconnect. */ if (s->state == MTA_INIT && (errno == ETIMEDOUT || errno == ECONNREFUSED)) { log_debug("debug: mta: not reporting route error yet"); free(error); return; } mta_route_error(s->relay, s->route); if (s->task) mta_flush_task(s, IMSG_MTA_DELIVERY_TEMPFAIL, error, 0, 0); free(error); } static void mta_tls_init(struct mta_session *s) { struct dispatcher_remote *remote; struct tls *tls; if ((tls = tls_client()) == NULL) { log_info("%016"PRIx64" mta closing reason=tls-failure", s->id); s->flags |= MTA_FREE; return; } remote = &s->relay->dispatcher->u.remote; if ((s->flags & MTA_WANT_SECURE) && !remote->tls_required) { /* If TLS not explicitly configured, use implicit config. */ remote->tls_required = 1; remote->tls_verify = 1; tls_config_verify(remote->tls_config); } if (tls_configure(tls, remote->tls_config) == -1) { log_info("%016"PRIx64" mta closing reason=tls-failure", s->id); tls_free(tls); s->flags |= MTA_FREE; return; } if (io_connect_tls(s->io, tls, s->mxname) == -1) { log_info("%016"PRIx64" mta closing reason=tls-connect-failed", s->id); tls_free(tls); s->flags |= MTA_FREE; } } static void mta_tls_started(struct mta_session *s) { if (tls_peer_cert_provided(io_tls(s->io))) { log_info("%016"PRIx64" mta " "cert-check result=\"%s\" fingerprint=\"%s\"", s->id, (s->flags & MTA_TLS_VERIFIED) ? "valid" : "unverified", tls_peer_cert_hash(io_tls(s->io))); } else { log_info("%016"PRIx64" smtp " "cert-check result=\"no certificate presented\"", s->id); } if (s->use_smtps) { mta_enter_state(s, MTA_BANNER); io_set_read(s->io); } else mta_enter_state(s, MTA_EHLO); } static const char * dsn_strret(enum dsn_ret ret) { if (ret == DSN_RETHDRS) return "HDRS"; else if (ret == DSN_RETFULL) return "FULL"; else { log_debug("mta: invalid ret %d", ret); return "???"; } } static const char * dsn_strnotify(uint8_t arg) { static char buf[32]; size_t sz; buf[0] = '\0'; if (arg & DSN_SUCCESS) (void)strlcat(buf, "SUCCESS,", sizeof(buf)); if (arg & DSN_FAILURE) (void)strlcat(buf, "FAILURE,", sizeof(buf)); if (arg & DSN_DELAY) (void)strlcat(buf, "DELAY,", sizeof(buf)); if (arg & DSN_NEVER) (void)strlcat(buf, "NEVER,", sizeof(buf)); /* trim trailing comma */ sz = strlen(buf); if (sz) buf[sz - 1] = '\0'; return (buf); } #define CASE(x) case x : return #x static const char * mta_strstate(int state) { switch (state) { CASE(MTA_INIT); CASE(MTA_BANNER); CASE(MTA_EHLO); CASE(MTA_HELO); CASE(MTA_STARTTLS); CASE(MTA_AUTH); CASE(MTA_AUTH_PLAIN); CASE(MTA_AUTH_LOGIN); CASE(MTA_AUTH_LOGIN_USER); CASE(MTA_AUTH_LOGIN_PASS); CASE(MTA_READY); CASE(MTA_MAIL); CASE(MTA_RCPT); CASE(MTA_DATA); CASE(MTA_BODY); CASE(MTA_EOM); CASE(MTA_LMTP_EOM); CASE(MTA_RSET); CASE(MTA_QUIT); default: return "MTA_???"; } } static void mta_filter_begin(struct mta_session *s) { if (!SESSION_FILTERED(s)) return; m_create(p_lka, IMSG_FILTER_SMTP_BEGIN, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->relay->dispatcher->u.remote.filtername); m_close(p_lka); } static void mta_filter_end(struct mta_session *s) { if (!SESSION_FILTERED(s)) return; m_create(p_lka, IMSG_FILTER_SMTP_END, 0, 0, -1); m_add_id(p_lka, s->id); m_close(p_lka); } static void mta_connected(struct mta_session *s) { struct sockaddr_storage sa_src; struct sockaddr_storage sa_dest; int sa_len; log_info("%016"PRIx64" mta connected", s->id); sa_len = sizeof sa_src; if (getsockname(io_fileno(s->io), (struct sockaddr *)&sa_src, &sa_len) == -1) bzero(&sa_src, sizeof sa_src); sa_len = sizeof sa_dest; if (getpeername(io_fileno(s->io), (struct sockaddr *)&sa_dest, &sa_len) == -1) bzero(&sa_dest, sizeof sa_dest); mta_report_link_connect(s, s->route->dst->ptrname, 1, &sa_src, &sa_dest); } static void mta_disconnected(struct mta_session *s) { mta_report_link_disconnect(s); mta_filter_end(s); } static void mta_report_link_connect(struct mta_session *s, const char *rdns, int fcrdns, const struct sockaddr_storage *ss_src, const struct sockaddr_storage *ss_dest) { if (! SESSION_FILTERED(s)) return; report_smtp_link_connect("smtp-out", s->id, rdns, fcrdns, ss_src, ss_dest); } static void mta_report_link_greeting(struct mta_session *s, const char *domain) { if (! SESSION_FILTERED(s)) return; report_smtp_link_greeting("smtp-out", s->id, domain); } static void mta_report_link_identify(struct mta_session *s, const char *method, const char *identity) { if (! SESSION_FILTERED(s)) return; report_smtp_link_identify("smtp-out", s->id, method, identity); } static void mta_report_link_tls(struct mta_session *s, const char *ssl) { if (! SESSION_FILTERED(s)) return; report_smtp_link_tls("smtp-out", s->id, ssl); } static void mta_report_link_disconnect(struct mta_session *s) { if (! SESSION_FILTERED(s)) return; report_smtp_link_disconnect("smtp-out", s->id); } static void mta_report_link_auth(struct mta_session *s, const char *user, const char *result) { if (! SESSION_FILTERED(s)) return; report_smtp_link_auth("smtp-out", s->id, user, result); } static void mta_report_tx_reset(struct mta_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_reset("smtp-out", s->id, msgid); } static void mta_report_tx_begin(struct mta_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_begin("smtp-out", s->id, msgid); } static void mta_report_tx_mail(struct mta_session *s, uint32_t msgid, const char *address, int ok) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_mail("smtp-out", s->id, msgid, address, ok); } static void mta_report_tx_rcpt(struct mta_session *s, uint32_t msgid, const char *address, int ok) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_rcpt("smtp-out", s->id, msgid, address, ok); } static void mta_report_tx_envelope(struct mta_session *s, uint32_t msgid, uint64_t evpid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_envelope("smtp-out", s->id, msgid, evpid); } static void mta_report_tx_data(struct mta_session *s, uint32_t msgid, int ok) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_data("smtp-out", s->id, msgid, ok); } static void mta_report_tx_commit(struct mta_session *s, uint32_t msgid, size_t msgsz) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_commit("smtp-out", s->id, msgid, msgsz); } static void mta_report_tx_rollback(struct mta_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_rollback("smtp-out", s->id, msgid); } static void mta_report_protocol_client(struct mta_session *s, const char *command) { if (! SESSION_FILTERED(s)) return; report_smtp_protocol_client("smtp-out", s->id, command); } static void mta_report_protocol_server(struct mta_session *s, const char *response) { if (! SESSION_FILTERED(s)) return; report_smtp_protocol_server("smtp-out", s->id, response); } #if 0 static void mta_report_filter_response(struct mta_session *s, int phase, int response, const char *param) { if (! SESSION_FILTERED(s)) return; report_smtp_filter_response("smtp-out", s->id, phase, response, param); } #endif static void mta_report_timeout(struct mta_session *s) { if (! SESSION_FILTERED(s)) return; report_smtp_timeout("smtp-out", s->id); } opensmtpd-7.7.0p0/usr.sbin/smtpd/makemap.80000644000175000001440000001224014610663500014051 .\" $OpenBSD: makemap.8,v 1.31 2021/02/13 07:37:13 jmc Exp $ .\" .\" Copyright (c) 2009 Jacek Masiulaniec .\" Copyright (c) 2008-2009 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 13 2021 $ .Dt MAKEMAP 8 .Os .Sh NAME .Nm makemap .Nd create database maps for smtpd .Sh SYNOPSIS .Nm makemap .Op Fl U .Op Fl d Ar dbtype .Op Fl o Ar dbfile .Op Fl t Ar type .Ar file .Sh DESCRIPTION Maps provide a generic interface for associating a textual key to a value. Such associations may be accessed through a plaintext file, database, or DNS. The format of these file types is described below. .Nm itself creates the database maps used by keyed map lookups specified in .Xr smtpd.conf 5 . .Pp .Nm reads input from .Ar file and writes data to a file which is named by adding a .Dq .db suffix to .Ar file . The current line can be extended over multiple lines using a backslash .Pq Sq \e . Comments can be put anywhere in the file using a hash mark .Pq Sq # , and extend to the end of the current line. Care should be taken when commenting out multi-line text: the comment is effective until the end of the entire block. In all cases, .Nm reads lines consisting of words separated by whitespace. The first word of a line is the database key; the remainder represents the mapped value. The database key and value may optionally be separated by the colon character. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d Ar dbtype Specify the format of the database. Available formats are .Ar hash and .Ar btree . The default value is .Ar hash . .It Fl o Ar dbfile Write the generated database to .Ar dbfile . .It Fl t Ar type Specify the format of the resulting map file. The default map format is suitable for storing simple, unstructured, key-to-value string associations. However, if the mapped value has special meaning, as in the case of a virtual domains file, a suitable .Ar type must be provided. The available output types are: .Bl -tag -width "aliases" .It Cm aliases The mapped value is a comma-separated list of mail destinations. This format can be used for building user aliases and user mappings for virtual domain files. .It Cm set There is no mapped value \(en a map of this type will only allow for the lookup of keys. This format can be used for building primary domain maps. .El .It Fl U Instead of generating a database map from text input, dump the contents of a database map as text with the key and value separated with a tab. .El .Sh PRIMARY DOMAINS Primary domains can be kept in tables. To create a primary domain table, add each primary domain on a single line by itself. .Pp In addition to adding an entry to the primary domain map, one must add a filter rule that accepts mail for the domain map, for example: .Bd -literal -offset indent table domains db:/etc/mail/domains.db action "local" mbox match for domain action "local" .Ed .Sh VIRTUAL DOMAINS Virtual domains may also be kept in tables. To create a virtual domain table, add each virtual domain on a single line by itself. .Pp Virtual domains expect a mapping of virtual users to real users in order to determine if a recipient is accepted or not. The mapping format is an extension to .Xr aliases 5 , which allows the use of .Dq user@domain.tld to accept user only on the specified domain, .Dq user to accept the user for any of the virtual domains, .Dq @domain.tld to provide a catch-all for the specified domain and .Dq @ to provide a global catch-all for all domains. .Xr smtpd 8 will perform the lookups in that specific order. .Pp To create a single virtual address, add .Dq user@example.com user to the users map. To handle all mail destined to any user at example.com, add .Dq @example.com user to the virtual map. .Pp In addition to adding an entry to the virtual map, one must add a filter rule that accepts mail for virtual domains, for example: .Bd -literal -offset indent table vdomains db:/etc/mail/vdomains.db table vusers db:/etc/mail/users.db action "local" mbox virtual match for domain action "local" match for domain "example.org" action "local" .Ed .Sh FILES .Bl -tag -width "/etc/mail/aliasesXXX" -compact .It Pa /etc/mail/aliases List of user mail aliases. .It Pa /etc/mail/secrets List of remote host credentials. .El .Sh EXIT STATUS .Ex -std makemap .Sh SEE ALSO .Xr aliases 5 , .Xr smtpd.conf 5 , .Xr table 5 , .Xr newaliases 8 , .Xr smtpd 8 .Sh HISTORY The .Nm command first appeared in .Ox 4.6 as a replacement for the equivalent command shipped with sendmail. opensmtpd-7.7.0p0/usr.sbin/smtpd/queue.c0000644000175000001440000004554014610663500013646 /* $OpenBSD: queue.c,v 1.196 2024/01/20 09:01:03 claudio Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" static void queue_imsg(struct mproc *, struct imsg *); static void queue_timeout(int, short, void *); static void queue_bounce(struct envelope *, struct delivery_bounce *); static void queue_shutdown(void); static void queue_log(const struct envelope *, const char *, const char *); static void queue_msgid_walk(int, short, void *); static void queue_imsg(struct mproc *p, struct imsg *imsg) { struct delivery_bounce bounce; struct msg_walkinfo *wi; struct timeval tv; struct bounce_req_msg *req_bounce; struct envelope evp; struct msg m; const char *reason; uint64_t reqid, evpid, holdq; uint32_t msgid; time_t nexttry; size_t n_evp; int fd, mta_ext, ret, v, flags, code; if (imsg == NULL) queue_shutdown(); memset(&bounce, 0, sizeof(struct delivery_bounce)); switch (imsg->hdr.type) { case IMSG_SMTP_MESSAGE_CREATE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); ret = queue_message_create(&msgid); m_create(p, IMSG_SMTP_MESSAGE_CREATE, 0, 0, -1); m_add_id(p, reqid); if (ret == 0) m_add_int(p, 0); else { m_add_int(p, 1); m_add_msgid(p, msgid); } m_close(p); return; case IMSG_SMTP_MESSAGE_ROLLBACK: m_msg(&m, imsg); m_get_msgid(&m, &msgid); m_end(&m); queue_message_delete(msgid); m_create(p_scheduler, IMSG_QUEUE_MESSAGE_ROLLBACK, 0, 0, -1); m_add_msgid(p_scheduler, msgid); m_close(p_scheduler); return; case IMSG_SMTP_MESSAGE_COMMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_msgid(&m, &msgid); m_end(&m); ret = queue_message_commit(msgid); m_create(p, IMSG_SMTP_MESSAGE_COMMIT, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, (ret == 0) ? 0 : 1); m_close(p); if (ret) { m_create(p_scheduler, IMSG_QUEUE_MESSAGE_COMMIT, 0, 0, -1); m_add_msgid(p_scheduler, msgid); m_close(p_scheduler); } return; case IMSG_SMTP_MESSAGE_OPEN: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_msgid(&m, &msgid); m_end(&m); fd = queue_message_fd_rw(msgid); m_create(p, IMSG_SMTP_MESSAGE_OPEN, 0, 0, fd); m_add_id(p, reqid); m_add_int(p, (fd == -1) ? 0 : 1); m_close(p); return; case IMSG_QUEUE_SMTP_SESSION: bounce_fd(imsg_get_fd(imsg)); return; case IMSG_LKA_ENVELOPE_SUBMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_envelope(&m, &evp); m_end(&m); if (evp.id == 0) log_warnx("warn: imsg_queue_submit_envelope: evpid=0"); if (evpid_to_msgid(evp.id) == 0) log_warnx("warn: imsg_queue_submit_envelope: msgid=0, " "evpid=%016"PRIx64, evp.id); ret = queue_envelope_create(&evp); m_create(p_dispatcher, IMSG_QUEUE_ENVELOPE_SUBMIT, 0, 0, -1); m_add_id(p_dispatcher, reqid); if (ret == 0) m_add_int(p_dispatcher, 0); else { m_add_int(p_dispatcher, 1); m_add_evpid(p_dispatcher, evp.id); } m_close(p_dispatcher); if (ret) { m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_SUBMIT, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); } return; case IMSG_LKA_ENVELOPE_COMMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_end(&m); m_create(p_dispatcher, IMSG_QUEUE_ENVELOPE_COMMIT, 0, 0, -1); m_add_id(p_dispatcher, reqid); m_add_int(p_dispatcher, 1); m_close(p_dispatcher); return; case IMSG_SCHED_ENVELOPE_REMOVE: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_ACK, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_close(p_scheduler); /* already removed by scheduler */ if (queue_envelope_load(evpid, &evp) == 0) return; queue_log(&evp, "Remove", "Removed by administrator"); queue_envelope_delete(evpid); return; case IMSG_SCHED_ENVELOPE_EXPIRE: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_ACK, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_close(p_scheduler); /* already removed by scheduler*/ if (queue_envelope_load(evpid, &evp) == 0) return; bounce.type = B_FAILED; envelope_set_errormsg(&evp, "Envelope expired"); envelope_set_esc_class(&evp, ESC_STATUS_PERMFAIL); envelope_set_esc_code(&evp, ESC_DELIVERY_TIME_EXPIRED); queue_bounce(&evp, &bounce); queue_log(&evp, "Expire", "Envelope expired"); queue_envelope_delete(evpid); return; case IMSG_SCHED_ENVELOPE_BOUNCE: CHECK_IMSG_DATA_SIZE(imsg, sizeof *req_bounce); req_bounce = imsg->data; evpid = req_bounce->evpid; if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: bounce: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 0); /* not in-flight */ m_close(p_scheduler); return; } queue_bounce(&evp, &req_bounce->bounce); evp.lastbounce = req_bounce->timestamp; if (!queue_envelope_update(&evp)) log_warnx("warn: could not update envelope %016"PRIx64, evpid); return; case IMSG_SCHED_ENVELOPE_DELIVER: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: deliver: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 1); /* in-flight */ m_close(p_scheduler); return; } evp.lasttry = time(NULL); m_create(p_dispatcher, IMSG_QUEUE_DELIVER, 0, 0, -1); m_add_envelope(p_dispatcher, &evp); m_close(p_dispatcher); return; case IMSG_SCHED_ENVELOPE_INJECT: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); bounce_add(evpid); return; case IMSG_SCHED_ENVELOPE_TRANSFER: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 1); /* in-flight */ m_close(p_scheduler); return; } evp.lasttry = time(NULL); m_create(p_dispatcher, IMSG_QUEUE_TRANSFER, 0, 0, -1); m_add_envelope(p_dispatcher, &evp); m_close(p_dispatcher); return; case IMSG_CTL_LIST_ENVELOPES: if (imsg->hdr.len == sizeof imsg->hdr) { m_forward(p_control, imsg); return; } m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_get_int(&m, &flags); m_get_time(&m, &nexttry); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) return; /* Envelope is gone, drop it */ /* * XXX consistency: The envelope might already be on * its way back to the scheduler. We need to detect * this properly and report that state. */ if (flags & EF_INFLIGHT) { /* * Not exactly correct but pretty close: The * value is not recorded on the envelope unless * a tempfail occurs. */ evp.lasttry = nexttry; } m_create(p_control, IMSG_CTL_LIST_ENVELOPES, imsg->hdr.peerid, 0, -1); m_add_int(p_control, flags); m_add_time(p_control, nexttry); m_add_envelope(p_control, &evp); m_close(p_control); return; case IMSG_MDA_OPEN_MESSAGE: case IMSG_MTA_OPEN_MESSAGE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_msgid(&m, &msgid); m_end(&m); fd = queue_message_fd_r(msgid); m_create(p, imsg->hdr.type, 0, 0, fd); m_add_id(p, reqid); m_close(p); return; case IMSG_MDA_DELIVERY_OK: case IMSG_MTA_DELIVERY_OK: m_msg(&m, imsg); m_get_evpid(&m, &evpid); if (imsg->hdr.type == IMSG_MTA_DELIVERY_OK) m_get_int(&m, &mta_ext); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warn("queue: dsn: failed to load envelope"); return; } if (evp.dsn_notify & DSN_SUCCESS) { bounce.type = B_DELIVERED; bounce.dsn_ret = evp.dsn_ret; envelope_set_esc_class(&evp, ESC_STATUS_OK); if (imsg->hdr.type == IMSG_MDA_DELIVERY_OK) queue_bounce(&evp, &bounce); else if (imsg->hdr.type == IMSG_MTA_DELIVERY_OK && (mta_ext & MTA_EXT_DSN) == 0) { bounce.mta_without_dsn = 1; queue_bounce(&evp, &bounce); } } queue_envelope_delete(evpid); m_create(p_scheduler, IMSG_QUEUE_DELIVERY_OK, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_close(p_scheduler); return; case IMSG_MDA_DELIVERY_TEMPFAIL: case IMSG_MTA_DELIVERY_TEMPFAIL: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_get_string(&m, &reason); m_get_int(&m, &code); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: tempfail: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 1); /* in-flight */ m_close(p_scheduler); return; } envelope_set_errormsg(&evp, "%s", reason); envelope_set_esc_class(&evp, ESC_STATUS_TEMPFAIL); envelope_set_esc_code(&evp, code); evp.retry++; if (!queue_envelope_update(&evp)) log_warnx("warn: could not update envelope %016"PRIx64, evpid); m_create(p_scheduler, IMSG_QUEUE_DELIVERY_TEMPFAIL, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); return; case IMSG_MDA_DELIVERY_PERMFAIL: case IMSG_MTA_DELIVERY_PERMFAIL: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_get_string(&m, &reason); m_get_int(&m, &code); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: permfail: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 1); /* in-flight */ m_close(p_scheduler); return; } bounce.type = B_FAILED; envelope_set_errormsg(&evp, "%s", reason); envelope_set_esc_class(&evp, ESC_STATUS_PERMFAIL); envelope_set_esc_code(&evp, code); queue_bounce(&evp, &bounce); queue_envelope_delete(evpid); m_create(p_scheduler, IMSG_QUEUE_DELIVERY_PERMFAIL, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_close(p_scheduler); return; case IMSG_MDA_DELIVERY_LOOP: case IMSG_MTA_DELIVERY_LOOP: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: loop: failed to load envelope"); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_REMOVE, 0, 0, -1); m_add_evpid(p_scheduler, evpid); m_add_u32(p_scheduler, 1); /* in-flight */ m_close(p_scheduler); return; } envelope_set_errormsg(&evp, "%s", "Loop detected"); envelope_set_esc_class(&evp, ESC_STATUS_TEMPFAIL); envelope_set_esc_code(&evp, ESC_ROUTING_LOOP_DETECTED); bounce.type = B_FAILED; queue_bounce(&evp, &bounce); queue_envelope_delete(evp.id); m_create(p_scheduler, IMSG_QUEUE_DELIVERY_LOOP, 0, 0, -1); m_add_evpid(p_scheduler, evp.id); m_close(p_scheduler); return; case IMSG_MTA_DELIVERY_HOLD: case IMSG_MDA_DELIVERY_HOLD: imsg->hdr.type = IMSG_QUEUE_HOLDQ_HOLD; m_forward(p_scheduler, imsg); return; case IMSG_MTA_SCHEDULE: imsg->hdr.type = IMSG_QUEUE_ENVELOPE_SCHEDULE; m_forward(p_scheduler, imsg); return; case IMSG_MTA_HOLDQ_RELEASE: case IMSG_MDA_HOLDQ_RELEASE: m_msg(&m, imsg); m_get_id(&m, &holdq); m_get_int(&m, &v); m_end(&m); m_create(p_scheduler, IMSG_QUEUE_HOLDQ_RELEASE, 0, 0, -1); if (imsg->hdr.type == IMSG_MTA_HOLDQ_RELEASE) m_add_int(p_scheduler, D_MTA); else m_add_int(p_scheduler, D_MDA); m_add_id(p_scheduler, holdq); m_add_int(p_scheduler, v); m_close(p_scheduler); return; case IMSG_CTL_PAUSE_MDA: case IMSG_CTL_PAUSE_MTA: case IMSG_CTL_RESUME_MDA: case IMSG_CTL_RESUME_MTA: m_forward(p_scheduler, imsg); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_trace_verbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; case IMSG_CTL_DISCOVER_EVPID: m_msg(&m, imsg); m_get_evpid(&m, &evpid); m_end(&m); if (queue_envelope_load(evpid, &evp) == 0) { log_warnx("queue: discover: failed to load " "envelope %016" PRIx64, evpid); n_evp = 0; m_compose(p_control, imsg->hdr.type, imsg->hdr.peerid, 0, -1, &n_evp, sizeof n_evp); return; } m_create(p_scheduler, IMSG_QUEUE_DISCOVER_EVPID, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); m_create(p_scheduler, IMSG_QUEUE_DISCOVER_MSGID, 0, 0, -1); m_add_msgid(p_scheduler, evpid_to_msgid(evpid)); m_close(p_scheduler); n_evp = 1; m_compose(p_control, imsg->hdr.type, imsg->hdr.peerid, 0, -1, &n_evp, sizeof n_evp); return; case IMSG_CTL_DISCOVER_MSGID: m_msg(&m, imsg); m_get_msgid(&m, &msgid); m_end(&m); /* handle concurrent walk requests */ wi = xcalloc(1, sizeof *wi); wi->msgid = msgid; wi->peerid = imsg->hdr.peerid; evtimer_set(&wi->ev, queue_msgid_walk, wi); tv.tv_sec = 0; tv.tv_usec = 10; evtimer_add(&wi->ev, &tv); return; } fatalx("queue_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } static void queue_msgid_walk(int fd, short event, void *arg) { struct envelope evp; struct timeval tv; struct msg_walkinfo *wi = arg; int r; r = queue_message_walk(&evp, wi->msgid, &wi->done, &wi->data); if (r == -1) { if (wi->n_evp) { m_create(p_scheduler, IMSG_QUEUE_DISCOVER_MSGID, 0, 0, -1); m_add_msgid(p_scheduler, wi->msgid); m_close(p_scheduler); } m_compose(p_control, IMSG_CTL_DISCOVER_MSGID, wi->peerid, 0, -1, &wi->n_evp, sizeof wi->n_evp); evtimer_del(&wi->ev); free(wi); return; } if (r) { m_create(p_scheduler, IMSG_QUEUE_DISCOVER_EVPID, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); wi->n_evp += 1; } tv.tv_sec = 0; tv.tv_usec = 10; evtimer_set(&wi->ev, queue_msgid_walk, wi); evtimer_add(&wi->ev, &tv); } static void queue_bounce(struct envelope *e, struct delivery_bounce *d) { struct envelope b; b = *e; b.type = D_BOUNCE; b.agent.bounce = *d; b.retry = 0; b.lasttry = 0; b.creation = time(NULL); b.ttl = 3600 * 24 * 7; if (e->dsn_notify & DSN_NEVER) return; if (b.id == 0) log_warnx("warn: queue_bounce: evpid=0"); if (evpid_to_msgid(b.id) == 0) log_warnx("warn: queue_bounce: msgid=0, evpid=%016"PRIx64, b.id); if (e->type == D_BOUNCE) { log_warnx("warn: queue: double bounce!"); } else if (e->sender.user[0] == '\0') { log_warnx("warn: queue: no return path!"); } else if (!queue_envelope_create(&b)) { log_warnx("warn: queue: cannot bounce!"); } else { log_debug("debug: queue: bouncing evp:%016" PRIx64 " as evp:%016" PRIx64, e->id, b.id); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_SUBMIT, 0, 0, -1); m_add_envelope(p_scheduler, &b); m_close(p_scheduler); m_create(p_scheduler, IMSG_QUEUE_MESSAGE_COMMIT, 0, 0, -1); m_add_msgid(p_scheduler, evpid_to_msgid(b.id)); m_close(p_scheduler); stat_increment("queue.bounce", 1); } } static void queue_shutdown(void) { log_debug("debug: queue agent exiting"); queue_close(); _exit(0); } int queue(void) { struct passwd *pw; struct timeval tv; struct event ev_qload; purge_config(PURGE_EVERYTHING & ~PURGE_DISPATCHERS); if ((pw = getpwnam(SMTPD_QUEUE_USER)) == NULL) if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); env->sc_queue_flags |= QUEUE_EVPCACHE; env->sc_queue_evpcache_size = 1024; if (chroot(PATH_SPOOL) == -1) fatal("queue: chroot"); if (chdir("/") == -1) fatal("queue: chdir(\"/\")"); config_process(PROC_QUEUE); if (env->sc_queue_flags & QUEUE_COMPRESSION) log_info("queue: queue compression enabled"); if (env->sc_queue_key) { if (!crypto_setup(env->sc_queue_key, strlen(env->sc_queue_key))) fatalx("crypto_setup: invalid key for queue encryption"); log_info("queue: queue encryption enabled"); } if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("queue: cannot drop privileges"); imsg_callback = queue_imsg; event_init(); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); config_peer(PROC_PARENT); config_peer(PROC_CONTROL); config_peer(PROC_LKA); config_peer(PROC_SCHEDULER); config_peer(PROC_DISPATCHER); /* setup queue loading task */ evtimer_set(&ev_qload, queue_timeout, &ev_qload); tv.tv_sec = 0; tv.tv_usec = 10; evtimer_add(&ev_qload, &tv); #if HAVE_PLEDGE if (pledge("stdio rpath wpath cpath flock recvfd sendfd", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } static void queue_timeout(int fd, short event, void *p) { static uint32_t msgid = 0; struct envelope evp; struct event *ev = p; struct timeval tv; int r; r = queue_envelope_walk(&evp); if (r == -1) { if (msgid) { m_create(p_scheduler, IMSG_QUEUE_MESSAGE_COMMIT, 0, 0, -1); m_add_msgid(p_scheduler, msgid); m_close(p_scheduler); } log_debug("debug: queue: done loading queue into scheduler"); return; } if (r) { if (msgid && evpid_to_msgid(evp.id) != msgid) { m_create(p_scheduler, IMSG_QUEUE_MESSAGE_COMMIT, 0, 0, -1); m_add_msgid(p_scheduler, msgid); m_close(p_scheduler); } msgid = evpid_to_msgid(evp.id); m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_SUBMIT, 0, 0, -1); m_add_envelope(p_scheduler, &evp); m_close(p_scheduler); } tv.tv_sec = 0; tv.tv_usec = 10; evtimer_add(ev, &tv); } static void queue_log(const struct envelope *e, const char *prefix, const char *status) { char rcpt[LINE_MAX]; (void)strlcpy(rcpt, "-", sizeof rcpt); if (strcmp(e->rcpt.user, e->dest.user) || strcmp(e->rcpt.domain, e->dest.domain)) (void)snprintf(rcpt, sizeof rcpt, "%s@%s", e->rcpt.user, e->rcpt.domain); log_info("%s: %s for %016" PRIx64 ": from=<%s@%s>, to=<%s@%s>, " "rcpt=<%s>, delay=%s, stat=%s", e->type == D_MDA ? "delivery" : "relay", prefix, e->id, e->sender.user, e->sender.domain, e->dest.user, e->dest.domain, rcpt, duration_to_text(time(NULL) - e->creation), status); } opensmtpd-7.7.0p0/usr.sbin/smtpd/to.c0000644000175000001440000004557714610663500013156 /* $OpenBSD: to.c,v 1.50 2023/05/31 16:51:46 op Exp $ */ /* * Copyright (c) 2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #if IO_TLS #include #endif #include "smtpd.h" #include "log.h" static int alias_is_filter(struct expandnode *, const char *, size_t); static int alias_is_username(struct expandnode *, const char *, size_t); static int alias_is_address(struct expandnode *, const char *, size_t); static int alias_is_filename(struct expandnode *, const char *, size_t); static int alias_is_include(struct expandnode *, const char *, size_t); static int alias_is_error(struct expandnode *, const char *, size_t); static int broken_inet_net_pton_ipv6(const char *, void *, size_t); const char * sockaddr_to_text(const struct sockaddr *sa) { static char buf[NI_MAXHOST]; if (getnameinfo(sa, SA_LEN(sa), buf, sizeof(buf), NULL, 0, NI_NUMERICHOST)) return ("(unknown)"); else return (buf); } int text_to_mailaddr(struct mailaddr *maddr, const char *email) { char *username; char *hostname; char buffer[LINE_MAX]; if (strlcpy(buffer, email, sizeof buffer) >= sizeof buffer) return 0; memset(maddr, 0, sizeof *maddr); username = buffer; hostname = strrchr(username, '@'); if (hostname == NULL) { if (strlcpy(maddr->user, username, sizeof maddr->user) >= sizeof maddr->user) return 0; } else if (username == hostname) { *hostname++ = '\0'; if (strlcpy(maddr->domain, hostname, sizeof maddr->domain) >= sizeof maddr->domain) return 0; } else { *hostname++ = '\0'; if (strlcpy(maddr->user, username, sizeof maddr->user) >= sizeof maddr->user) return 0; if (strlcpy(maddr->domain, hostname, sizeof maddr->domain) >= sizeof maddr->domain) return 0; } return 1; } const char * mailaddr_to_text(const struct mailaddr *maddr) { static char buffer[LINE_MAX]; (void)strlcpy(buffer, maddr->user, sizeof buffer); (void)strlcat(buffer, "@", sizeof buffer); if (strlcat(buffer, maddr->domain, sizeof buffer) >= sizeof buffer) return NULL; return buffer; } const char * sa_to_text(const struct sockaddr *sa) { static char buf[NI_MAXHOST + 5]; char *p; buf[0] = '\0'; p = buf; if (sa->sa_family == AF_LOCAL) (void)strlcpy(buf, "local", sizeof buf); else if (sa->sa_family == AF_INET) { in_addr_t addr; addr = ((const struct sockaddr_in *)sa)->sin_addr.s_addr; addr = ntohl(addr); (void)bsnprintf(p, NI_MAXHOST, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff); } else if (sa->sa_family == AF_INET6) { (void)bsnprintf(p, NI_MAXHOST, "[%s]", sockaddr_to_text(sa)); } return (buf); } const char * ss_to_text(const struct sockaddr_storage *ss) { return (sa_to_text((const struct sockaddr*)ss)); } const char * time_to_text(time_t when) { struct tm *lt; static char buf[40]; const char *day[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; const char *month[] = {"Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec"}; const char *tz; long offset; lt = localtime(&when); if (lt == NULL || when == 0) fatalx("time_to_text: localtime"); #if HAVE_STRUCT_TM_TM_GMTOFF offset = lt->tm_gmtoff; tz = lt->tm_zone; #elif defined HAVE_DECL_ALTZONE && defined HAVE_DECL_TIMEZONE offset = lt->tm_isdst > 0 ? altzone : timezone; tz = lt->tm_isdst > 0 ? tzname[1] : tzname[0]; #endif /* We do not use strftime because it is subject to locale substitution*/ if (!bsnprintf(buf, sizeof(buf), "%s, %d %s %d %02d:%02d:%02d %c%02d%02d (%s)", day[lt->tm_wday], lt->tm_mday, month[lt->tm_mon], lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec, offset >= 0 ? '+' : '-', abs((int)offset / 3600), abs((int)offset % 3600) / 60, tz)) fatalx("time_to_text: bsnprintf"); return buf; } const char * duration_to_text(time_t t) { static char dst[64]; char buf[64]; int h, m, s; long long d; if (t == 0) { (void)strlcpy(dst, "0s", sizeof dst); return (dst); } dst[0] = '\0'; if (t < 0) { (void)strlcpy(dst, "-", sizeof dst); t = -t; } s = t % 60; t /= 60; m = t % 60; t /= 60; h = t % 24; d = t / 24; if (d) { (void)snprintf(buf, sizeof buf, "%lldd", d); (void)strlcat(dst, buf, sizeof dst); } if (h) { (void)snprintf(buf, sizeof buf, "%dh", h); (void)strlcat(dst, buf, sizeof dst); } if (m) { (void)snprintf(buf, sizeof buf, "%dm", m); (void)strlcat(dst, buf, sizeof dst); } if (s) { (void)snprintf(buf, sizeof buf, "%ds", s); (void)strlcat(dst, buf, sizeof dst); } return (dst); } int text_to_netaddr(struct netaddr *netaddr, const char *s) { struct sockaddr_storage ss; struct sockaddr_in ssin; struct sockaddr_in6 ssin6; int bits; char buf[NI_MAXHOST]; size_t len; memset(&ssin, 0, sizeof(struct sockaddr_in)); memset(&ssin6, 0, sizeof(struct sockaddr_in6)); if (strncasecmp("IPv6:", s, 5) == 0) s += 5; bits = inet_net_pton(AF_INET, s, &ssin.sin_addr, sizeof(struct in_addr)); if (bits != -1) { ssin.sin_family = AF_INET; memcpy(&ss, &ssin, sizeof(ssin)); #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN ss.ss_len = sizeof(struct sockaddr_in); #endif } else { if (s[0] != '[') { if ((len = strlcpy(buf, s, sizeof buf)) >= sizeof buf) return 0; } else { s++; if (strncasecmp("IPv6:", s, 5) == 0) s += 5; if ((len = strlcpy(buf, s, sizeof buf)) >= sizeof buf) return 0; if (buf[len-1] != ']') return 0; buf[len-1] = 0; } bits = inet_net_pton(AF_INET6, buf, &ssin6.sin6_addr, sizeof(struct in6_addr)); if (bits == -1) { if (errno != EAFNOSUPPORT) return 0; bits = broken_inet_net_pton_ipv6(buf, &ssin6.sin6_addr, sizeof(struct in6_addr)); if (bits == -1) return 0; } ssin6.sin6_family = AF_INET6; memcpy(&ss, &ssin6, sizeof(ssin6)); #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN ss.ss_len = sizeof(struct sockaddr_in6); #endif } netaddr->ss = ss; netaddr->bits = bits; return 1; } int text_to_relayhost(struct relayhost *relay, const char *s) { static const struct schema { const char *name; int tls; uint16_t flags; uint16_t port; } schemas [] = { /* * new schemas should be *appended* otherwise the default * schema index needs to be updated later in this function. */ { "smtp://", RELAY_TLS_OPPORTUNISTIC, 0, 25 }, { "smtp+tls://", RELAY_TLS_STARTTLS, 0, 25 }, { "smtp+notls://", RELAY_TLS_NO, 0, 25 }, /* need to specify an explicit port for LMTP */ { "lmtp://", RELAY_TLS_NO, RELAY_LMTP, 0 }, { "smtps://", RELAY_TLS_SMTPS, 0, 465 } }; const char *errstr = NULL; char *p, *q; char buffer[1024]; char *beg, *end; size_t i; size_t len; memset(buffer, 0, sizeof buffer); if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer) return 0; for (i = 0; i < nitems(schemas); ++i) if (strncasecmp(schemas[i].name, s, strlen(schemas[i].name)) == 0) break; if (i == nitems(schemas)) { /* there is a schema, but it's not recognized */ if (strstr(buffer, "://")) return 0; /* no schema, default to smtp:// */ i = 0; p = buffer; } else p = buffer + strlen(schemas[i].name); relay->tls = schemas[i].tls; relay->flags = schemas[i].flags; relay->port = schemas[i].port; /* first, we extract the label if any */ if ((q = strchr(p, '@')) != NULL) { *q = 0; if (strlcpy(relay->authlabel, p, sizeof (relay->authlabel)) >= sizeof (relay->authlabel)) return 0; p = q + 1; } /* then, we extract the mail exchanger */ beg = end = p; if (*beg == '[') { if ((end = strchr(beg, ']')) == NULL) return 0; /* skip ']', it has to be included in the relay hostname */ ++end; len = end - beg; } else { for (end = beg; *end; ++end) if (!isalnum((unsigned char)*end) && *end != '_' && *end != '.' && *end != '-') break; len = end - beg; } if (len >= sizeof relay->hostname) return 0; for (i = 0; i < len; ++i) relay->hostname[i] = beg[i]; relay->hostname[i] = 0; /* finally, we extract the port */ p = beg + len; if (*p == ':') { relay->port = strtonum(p+1, 1, IPPORT_HILASTAUTO, &errstr); if (errstr) return 0; } if (!valid_domainpart(relay->hostname)) return 0; if ((relay->flags & RELAY_LMTP) && (relay->port == 0)) return 0; if (relay->authlabel[0]) { /* disallow auth on non-tls scheme. */ if (relay->tls != RELAY_TLS_STARTTLS && relay->tls != RELAY_TLS_SMTPS) return 0; relay->flags |= RELAY_AUTH; } return 1; } uint64_t text_to_evpid(const char *s) { uint64_t ulval; char *ep; errno = 0; ulval = strtoull(s, &ep, 16); if (s[0] == '\0' || *ep != '\0') return 0; if (errno == ERANGE && ulval == ULLONG_MAX) return 0; if (ulval == 0) return 0; return (ulval); } uint32_t text_to_msgid(const char *s) { uint64_t ulval; char *ep; errno = 0; ulval = strtoull(s, &ep, 16); if (s[0] == '\0' || *ep != '\0') return 0; if (errno == ERANGE && ulval == ULLONG_MAX) return 0; if (ulval == 0) return 0; if (ulval > 0xffffffff) return 0; return (ulval & 0xffffffff); } const char * rule_to_text(struct rule *r) { static char buf[4096]; memset(buf, 0, sizeof buf); (void)strlcpy(buf, "match", sizeof buf); if (r->flag_tag) { if (r->flag_tag < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " tag ", sizeof buf); (void)strlcat(buf, r->table_tag, sizeof buf); } if (r->flag_from) { if (r->flag_from < 0) (void)strlcat(buf, " !", sizeof buf); if (r->flag_from_socket) (void)strlcat(buf, " from socket", sizeof buf); else if (r->flag_from_rdns) { (void)strlcat(buf, " from rdns", sizeof buf); if (r->table_from) { (void)strlcat(buf, " ", sizeof buf); (void)strlcat(buf, r->table_from, sizeof buf); } } else if (strcmp(r->table_from, "") == 0) (void)strlcat(buf, " from any", sizeof buf); else if (strcmp(r->table_from, "") == 0) (void)strlcat(buf, " from local", sizeof buf); else { (void)strlcat(buf, " from src ", sizeof buf); (void)strlcat(buf, r->table_from, sizeof buf); } } if (r->flag_for) { if (r->flag_for < 0) (void)strlcat(buf, " !", sizeof buf); if (strcmp(r->table_for, "") == 0) (void)strlcat(buf, " for any", sizeof buf); else if (strcmp(r->table_for, "") == 0) (void)strlcat(buf, " for local", sizeof buf); else { (void)strlcat(buf, " for domain ", sizeof buf); (void)strlcat(buf, r->table_for, sizeof buf); } } if (r->flag_smtp_helo) { if (r->flag_smtp_helo < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " helo ", sizeof buf); (void)strlcat(buf, r->table_smtp_helo, sizeof buf); } if (r->flag_smtp_auth) { if (r->flag_smtp_auth < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " auth", sizeof buf); if (r->table_smtp_auth) { (void)strlcat(buf, " ", sizeof buf); (void)strlcat(buf, r->table_smtp_auth, sizeof buf); } } if (r->flag_smtp_starttls) { if (r->flag_smtp_starttls < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " tls", sizeof buf); } if (r->flag_smtp_mail_from) { if (r->flag_smtp_mail_from < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " mail-from ", sizeof buf); (void)strlcat(buf, r->table_smtp_mail_from, sizeof buf); } if (r->flag_smtp_rcpt_to) { if (r->flag_smtp_rcpt_to < 0) (void)strlcat(buf, " !", sizeof buf); (void)strlcat(buf, " rcpt-to ", sizeof buf); (void)strlcat(buf, r->table_smtp_rcpt_to, sizeof buf); } (void)strlcat(buf, " action ", sizeof buf); if (r->reject) (void)strlcat(buf, "reject", sizeof buf); else (void)strlcat(buf, r->dispatcher, sizeof buf); return buf; } int text_to_userinfo(struct userinfo *userinfo, const char *s) { char buf[PATH_MAX]; char *p; const char *errstr; memset(buf, 0, sizeof buf); p = buf; while (*s && *s != ':') *p++ = *s++; if (*s++ != ':') goto error; if (strlcpy(userinfo->username, buf, sizeof userinfo->username) >= sizeof userinfo->username) goto error; memset(buf, 0, sizeof buf); p = buf; while (*s && *s != ':') *p++ = *s++; if (*s++ != ':') goto error; userinfo->uid = strtonum(buf, 0, UID_MAX, &errstr); if (errstr) goto error; memset(buf, 0, sizeof buf); p = buf; while (*s && *s != ':') *p++ = *s++; if (*s++ != ':') goto error; userinfo->gid = strtonum(buf, 0, GID_MAX, &errstr); if (errstr) goto error; if (strlcpy(userinfo->directory, s, sizeof userinfo->directory) >= sizeof userinfo->directory) goto error; return 1; error: return 0; } int text_to_credentials(struct credentials *creds, const char *s) { char *p; char buffer[LINE_MAX]; size_t offset; p = strchr(s, ':'); if (p == NULL) { creds->username[0] = '\0'; if (strlcpy(creds->password, s, sizeof creds->password) >= sizeof creds->password) return 0; return 1; } offset = p - s; memset(buffer, 0, sizeof buffer); if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer) return 0; p = buffer + offset; *p = '\0'; if (strlcpy(creds->username, buffer, sizeof creds->username) >= sizeof creds->username) return 0; if (strlcpy(creds->password, p+1, sizeof creds->password) >= sizeof creds->password) return 0; return 1; } int text_to_expandnode(struct expandnode *expandnode, const char *s) { size_t l; l = strlen(s); if (alias_is_error(expandnode, s, l) || alias_is_include(expandnode, s, l) || alias_is_filter(expandnode, s, l) || alias_is_filename(expandnode, s, l) || alias_is_address(expandnode, s, l) || alias_is_username(expandnode, s, l)) return (1); return (0); } const char * expandnode_to_text(struct expandnode *expandnode) { switch (expandnode->type) { case EXPAND_FILTER: case EXPAND_FILENAME: case EXPAND_INCLUDE: case EXPAND_ERROR: case EXPAND_USERNAME: return expandnode->u.user; case EXPAND_ADDRESS: return mailaddr_to_text(&expandnode->u.mailaddr); case EXPAND_INVALID: break; } return NULL; } /******/ static int alias_is_filter(struct expandnode *alias, const char *line, size_t len) { int v = 0; if (*line == '"') v = 1; if (*(line+v) == '|') { if (strlcpy(alias->u.buffer, line + v + 1, sizeof(alias->u.buffer)) >= sizeof(alias->u.buffer)) return 0; if (v) { v = strlen(alias->u.buffer); if (v == 0) return (0); if (alias->u.buffer[v-1] != '"') return (0); alias->u.buffer[v-1] = '\0'; } alias->type = EXPAND_FILTER; return (1); } return (0); } static int alias_is_username(struct expandnode *alias, const char *line, size_t len) { memset(alias, 0, sizeof *alias); if (strlcpy(alias->u.user, line, sizeof(alias->u.user)) >= sizeof(alias->u.user)) return 0; while (*line) { if (!isalnum((unsigned char)*line) && *line != '_' && *line != '.' && *line != '-' && *line != '+') return 0; ++line; } alias->type = EXPAND_USERNAME; return 1; } static int alias_is_address(struct expandnode *alias, const char *line, size_t len) { char *domain; memset(alias, 0, sizeof *alias); if (len < 3) /* x@y */ return 0; domain = strchr(line, '@'); if (domain == NULL) return 0; /* @ cannot start or end an address */ if (domain == line || domain == line + len - 1) return 0; /* scan pre @ for disallowed chars */ *domain++ = '\0'; (void)strlcpy(alias->u.mailaddr.user, line, sizeof(alias->u.mailaddr.user)); (void)strlcpy(alias->u.mailaddr.domain, domain, sizeof(alias->u.mailaddr.domain)); while (*line) { char allowedset[] = "!#$%*/?|^{}`~&'+-=_."; if (!isalnum((unsigned char)*line) && strchr(allowedset, *line) == NULL) return 0; ++line; } while (*domain) { char allowedset[] = "-."; if (!isalnum((unsigned char)*domain) && strchr(allowedset, *domain) == NULL) return 0; ++domain; } alias->type = EXPAND_ADDRESS; return 1; } static int alias_is_filename(struct expandnode *alias, const char *line, size_t len) { memset(alias, 0, sizeof *alias); if (*line != '/') return 0; if (strlcpy(alias->u.buffer, line, sizeof(alias->u.buffer)) >= sizeof(alias->u.buffer)) return 0; alias->type = EXPAND_FILENAME; return 1; } static int alias_is_include(struct expandnode *alias, const char *line, size_t len) { size_t skip; memset(alias, 0, sizeof *alias); if (strncasecmp(":include:", line, 9) == 0) skip = 9; else if (strncasecmp("include:", line, 8) == 0) skip = 8; else return 0; if (!alias_is_filename(alias, line + skip, len - skip)) return 0; alias->type = EXPAND_INCLUDE; return 1; } static int alias_is_error(struct expandnode *alias, const char *line, size_t len) { size_t skip; memset(alias, 0, sizeof *alias); if (strncasecmp(":error:", line, 7) == 0) skip = 7; else if (strncasecmp("error:", line, 6) == 0) skip = 6; else return 0; if (strlcpy(alias->u.buffer, line + skip, sizeof(alias->u.buffer)) >= sizeof(alias->u.buffer)) return 0; if (strlen(alias->u.buffer) < 5) return 0; /* [45][0-9]{2} [a-zA-Z0-9].* */ if (alias->u.buffer[3] != ' ' || !isalnum((unsigned char)alias->u.buffer[4]) || (alias->u.buffer[0] != '4' && alias->u.buffer[0] != '5') || !isdigit((unsigned char)alias->u.buffer[1]) || !isdigit((unsigned char)alias->u.buffer[2])) return 0; alias->type = EXPAND_ERROR; return 1; } #if IO_TLS const char * tls_to_text(struct tls *tls) { static char buf[256]; (void)snprintf(buf, sizeof buf, "%s:%s:%d", tls_conn_version(tls), tls_conn_cipher(tls), tls_conn_cipher_strength(tls)); return (buf); } #endif static int broken_inet_net_pton_ipv6(const char *src, void *dst, size_t size) { int ret; int bits; char buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255:255:255:255/128")]; char *sep; const char *errstr; if (strlcpy(buf, src, sizeof buf) >= sizeof buf) { errno = EMSGSIZE; return (-1); } sep = strchr(buf, '/'); if (sep != NULL) *sep++ = '\0'; ret = inet_pton(AF_INET6, buf, dst); if (ret != 1) return (-1); if (sep == NULL) return 128; bits = strtonum(sep, 0, 128, &errstr); if (errstr) return (-1); return bits; } opensmtpd-7.7.0p0/usr.sbin/smtpd/spfwalk.c0000644000175000001440000002042614610663500014165 /* * Copyright (c) 2017 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #ifdef HAVE_ARPA_NAMESER_COMPAT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd-defines.h" #include "smtpd-api.h" #include "unpack_dns.h" #include "parser.h" struct target { void (*dispatch)(struct dns_rr *, struct target *); int cidr4; int cidr6; }; int spfwalk(int, struct parameter *); static void dispatch_txt(struct dns_rr *, struct target *); static void dispatch_mx(struct dns_rr *, struct target *); static void dispatch_a(struct dns_rr *, struct target *); static void dispatch_aaaa(struct dns_rr *, struct target *); static void lookup_record(int, char *, struct target *); static void dispatch_record(struct asr_result *, void *); static ssize_t parse_txt(const char *, size_t, char *, size_t); static int parse_target(char *, struct target *); void *xmalloc(size_t size); int ip_v4 = 0; int ip_v6 = 0; int ip_both = 1; struct dict seen; int spfwalk(int argc, struct parameter *argv) { struct target tgt; const char *ip_family = NULL; char *line = NULL; size_t linesize = 0; ssize_t linelen; if (argv) ip_family = argv[0].u.u_str; if (ip_family) { if (strcmp(ip_family, "-4") == 0) { ip_both = 0; ip_v4 = 1; } else if (strcmp(ip_family, "-6") == 0) { ip_both = 0; ip_v6 = 1; } else errx(1, "invalid ip_family"); } dict_init(&seen); event_init(); tgt.cidr4 = tgt.cidr6 = -1; tgt.dispatch = dispatch_txt; while ((linelen = getline(&line, &linesize, stdin)) != -1) { while (linelen-- > 0 && isspace((unsigned char)line[linelen])) line[linelen] = '\0'; if (linelen > 0) lookup_record(T_TXT, line, &tgt); } free(line); #if HAVE_PLEDGE if (pledge("dns stdio", NULL) == -1) err(1, "pledge"); #endif event_dispatch(); return 0; } void lookup_record(int type, char *record, struct target *tgt) { struct asr_query *as; struct target *ntgt; size_t i; if (strchr(record, '%') != NULL) { for (i = 0; record[i] != '\0'; i++) { if (!isprint(record[i])) record[i] = '?'; } warnx("%s: %s contains macros and can't be resolved", __func__, record); return; } as = res_query_async(record, C_IN, type, NULL); if (as == NULL) err(1, "res_query_async"); ntgt = xmalloc(sizeof(*ntgt)); *ntgt = *tgt; event_asr_run(as, dispatch_record, (void *)ntgt); } void dispatch_record(struct asr_result *ar, void *arg) { struct target *tgt = arg; struct unpack pack; struct dns_header h; struct dns_query q; struct dns_rr rr; /* best effort */ if (ar->ar_h_errno && ar->ar_h_errno != NO_DATA) goto end; unpack_init(&pack, ar->ar_data, ar->ar_datalen); unpack_header(&pack, &h); unpack_query(&pack, &q); for (; h.ancount; h.ancount--) { unpack_rr(&pack, &rr); /**/ tgt->dispatch(&rr, tgt); } end: free(tgt); } void dispatch_txt(struct dns_rr *rr, struct target *tgt) { char buf[4096]; char *argv[512]; char buf2[512]; struct target ltgt; struct in6_addr ina; char **ap = argv; char *in = buf; char *record, *end; ssize_t n; if (rr->rr_type != T_TXT) return; n = parse_txt(rr->rr.other.rdata, rr->rr.other.rdlen, buf, sizeof(buf)); if (n == -1 || n == sizeof(buf)) return; buf[n] = '\0'; if (strncasecmp("v=spf1 ", buf, 7)) return; while ((*ap = strsep(&in, " ")) != NULL) { if (strcasecmp(*ap, "v=spf1") == 0) continue; end = *ap + strlen(*ap)-1; if (*end == '.') *end = '\0'; if (dict_set(&seen, *ap, &seen)) continue; if (**ap == '-' || **ap == '~') continue; if (**ap == '+' || **ap == '?') (*ap)++; ltgt.cidr4 = ltgt.cidr6 = -1; if (strncasecmp("ip4:", *ap, 4) == 0) { if ((ip_v4 == 1 || ip_both == 1) && inet_net_pton(AF_INET, *(ap) + 4, &ina, sizeof(ina)) != -1) printf("%s\n", *(ap) + 4); continue; } if (strncasecmp("ip6:", *ap, 4) == 0) { if ((ip_v6 == 1 || ip_both == 1) && inet_net_pton(AF_INET6, *(ap) + 4, &ina, sizeof(ina)) != -1) printf("%s\n", *(ap) + 4); continue; } if (strcasecmp("a", *ap) == 0) { print_dname(rr->rr_dname, buf2, sizeof(buf2)); buf2[strlen(buf2) - 1] = '\0'; ltgt.dispatch = dispatch_a; lookup_record(T_A, buf2, <gt); ltgt.dispatch = dispatch_aaaa; lookup_record(T_AAAA, buf2, <gt); continue; } if (strncasecmp("a:", *ap, 2) == 0) { record = *(ap) + 2; if (parse_target(record, <gt) < 0) continue; ltgt.dispatch = dispatch_a; lookup_record(T_A, record, <gt); ltgt.dispatch = dispatch_aaaa; lookup_record(T_AAAA, record, <gt); continue; } if (strncasecmp("exists:", *ap, 7) == 0) { ltgt.dispatch = dispatch_a; lookup_record(T_A, *(ap) + 7, <gt); continue; } if (strncasecmp("include:", *ap, 8) == 0) { ltgt.dispatch = dispatch_txt; lookup_record(T_TXT, *(ap) + 8, <gt); continue; } if (strncasecmp("redirect=", *ap, 9) == 0) { ltgt.dispatch = dispatch_txt; lookup_record(T_TXT, *(ap) + 9, <gt); continue; } if (strcasecmp("mx", *ap) == 0) { print_dname(rr->rr_dname, buf2, sizeof(buf2)); buf2[strlen(buf2) - 1] = '\0'; ltgt.dispatch = dispatch_mx; lookup_record(T_MX, buf2, <gt); continue; } if (strncasecmp("mx:", *ap, 3) == 0) { record = *(ap) + 3; if (parse_target(record, <gt) < 0) continue; ltgt.dispatch = dispatch_mx; lookup_record(T_MX, record, <gt); continue; } } *ap = NULL; } void dispatch_mx(struct dns_rr *rr, struct target *tgt) { char buf[512]; struct target ltgt; if (rr->rr_type != T_MX) return; print_dname(rr->rr.mx.exchange, buf, sizeof(buf)); buf[strlen(buf) - 1] = '\0'; if (buf[strlen(buf) - 1] == '.') buf[strlen(buf) - 1] = '\0'; ltgt = *tgt; ltgt.dispatch = dispatch_a; lookup_record(T_A, buf, <gt); ltgt.dispatch = dispatch_aaaa; lookup_record(T_AAAA, buf, <gt); } void dispatch_a(struct dns_rr *rr, struct target *tgt) { char buffer[512]; const char *ptr; if (rr->rr_type != T_A) return; if ((ptr = inet_ntop(AF_INET, &rr->rr.in_a.addr, buffer, sizeof buffer))) { if (tgt->cidr4 >= 0) printf("%s/%d\n", ptr, tgt->cidr4); else printf("%s\n", ptr); } } void dispatch_aaaa(struct dns_rr *rr, struct target *tgt) { char buffer[512]; const char *ptr; if (rr->rr_type != T_AAAA) return; if ((ptr = inet_ntop(AF_INET6, &rr->rr.in_aaaa.addr6, buffer, sizeof buffer))) { if (tgt->cidr6 >= 0) printf("%s/%d\n", ptr, tgt->cidr6); else printf("%s\n", ptr); } } ssize_t parse_txt(const char *rdata, size_t rdatalen, char *dst, size_t dstsz) { size_t len; ssize_t r = 0; while (rdatalen) { len = *(const unsigned char *)rdata; if (len >= rdatalen) { errno = EINVAL; return -1; } rdata++; rdatalen--; if (len == 0) continue; if (len >= dstsz) { errno = EOVERFLOW; return -1; } memmove(dst, rdata, len); dst += len; dstsz -= len; rdata += len; rdatalen -= len; r += len; } return r; } int parse_target(char *record, struct target *tgt) { const char *err; char *m4, *m6; m4 = record; strsep(&m4, "/"); if (m4 == NULL) return 0; m6 = m4; strsep(&m6, "/"); if (*m4) { tgt->cidr4 = strtonum(m4, 0, 32, &err); if (err) return tgt->cidr4 = -1; } if (m6 == NULL) return 0; tgt->cidr6 = strtonum(m6, 0, 128, &err); if (err) return tgt->cidr6 = -1; return 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/scheduler_backend.c0000644000175000001440000000423514610663500016143 /* $OpenBSD: scheduler_backend.c,v 1.18 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" extern struct scheduler_backend scheduler_backend_null; extern struct scheduler_backend scheduler_backend_proc; extern struct scheduler_backend scheduler_backend_ramqueue; struct scheduler_backend * scheduler_backend_lookup(const char *name) { if (!strcmp(name, "null")) return &scheduler_backend_null; if (!strcmp(name, "ramqueue")) return &scheduler_backend_ramqueue; return &scheduler_backend_proc; } void scheduler_info(struct scheduler_info *sched, struct envelope *evp) { struct dispatcher *disp; disp = evp->type == D_BOUNCE ? env->sc_dispatcher_bounce : dict_xget(env->sc_dispatchers, evp->dispatcher); switch (disp->type) { case DISPATCHER_LOCAL: sched->type = D_MDA; break; case DISPATCHER_REMOTE: sched->type = D_MTA; break; case DISPATCHER_BOUNCE: sched->type = D_BOUNCE; break; } sched->ttl = disp->ttl ? disp->ttl : env->sc_ttl; sched->evpid = evp->id; sched->creation = evp->creation; sched->retry = evp->retry; sched->lasttry = evp->lasttry; sched->lastbounce = evp->lastbounce; sched->nexttry = 0; } opensmtpd-7.7.0p0/usr.sbin/smtpd/mda_unpriv.c0000644000175000001440000000660414620126254014665 /* $OpenBSD: mda_unpriv.c,v 1.9 2024/03/15 21:52:20 op Exp $ */ /* * Copyright (c) 2018 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include "smtpd.h" void mda_unpriv(struct dispatcher *dsp, struct deliver *deliver, const char *pw_name, const char *pw_dir) { int idx; char *mda_environ[12]; char mda_exec[LINE_MAX]; char mda_wrapper[LINE_MAX]; const char *mda_command; const char *mda_command_wrap; if (deliver->mda_exec[0]) mda_command = deliver->mda_exec; else mda_command = dsp->u.local.command; if (strlcpy(mda_exec, mda_command, sizeof (mda_exec)) >= sizeof (mda_exec)) errx(1, "mda command line too long"); if (mda_expand_format(mda_exec, sizeof mda_exec, deliver, &deliver->userinfo, NULL) == -1) errx(1, "mda command line could not be expanded"); mda_command = mda_exec; /* setup environment similar to other MTA */ idx = 0; xasprintf(&mda_environ[idx++], "PATH=%s", _PATH_DEFPATH); xasprintf(&mda_environ[idx++], "DOMAIN=%s", deliver->rcpt.domain); xasprintf(&mda_environ[idx++], "HOME=%s", pw_dir); xasprintf(&mda_environ[idx++], "ORIGINAL_RECIPIENT=%s@%s", deliver->rcpt.user, deliver->rcpt.domain); xasprintf(&mda_environ[idx++], "RECIPIENT=%s@%s", deliver->dest.user, deliver->dest.domain); xasprintf(&mda_environ[idx++], "SHELL=/bin/sh"); xasprintf(&mda_environ[idx++], "LOCAL=%s", deliver->rcpt.user); xasprintf(&mda_environ[idx++], "LOGNAME=%s", deliver->userinfo.username); xasprintf(&mda_environ[idx++], "USER=%s", deliver->userinfo.username); if (deliver->sender.user[0]) xasprintf(&mda_environ[idx++], "SENDER=%s@%s", deliver->sender.user, deliver->sender.domain); else xasprintf(&mda_environ[idx++], "SENDER="); if (deliver->mda_subaddress[0]) xasprintf(&mda_environ[idx++], "EXTENSION=%s", deliver->mda_subaddress); mda_environ[idx++] = (char *)NULL; if (dsp->u.local.mda_wrapper) { mda_command_wrap = dict_get(env->sc_mda_wrappers, dsp->u.local.mda_wrapper); if (mda_command_wrap == NULL) errx(1, "could not find wrapper %s", dsp->u.local.mda_wrapper); if (strlcpy(mda_wrapper, mda_command_wrap, sizeof (mda_wrapper)) >= sizeof (mda_wrapper)) errx(1, "mda command line too long"); if (mda_expand_format(mda_wrapper, sizeof mda_wrapper, deliver, &deliver->userinfo, mda_command) == -1) errx(1, "mda command line could not be expanded"); mda_command = mda_wrapper; } execle("/bin/sh", "/bin/sh", "-c", mda_command, (char *)NULL, mda_environ); perror("execle"); _exit(1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/iobuf.h0000644000175000001440000000433614610663500013631 /* $OpenBSD: iobuf.h,v 1.7 2021/07/28 19:39:50 benno Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct ioqbuf { struct ioqbuf *next; char *buf; size_t size; size_t wpos; size_t rpos; }; struct iobuf { char *buf; size_t max; size_t size; size_t wpos; size_t rpos; size_t queued; struct ioqbuf *outq; struct ioqbuf *outqlast; }; struct tls; #define IOBUF_WANT_READ -1 #define IOBUF_WANT_WRITE -2 #define IOBUF_CLOSED -3 #define IOBUF_ERROR -4 int iobuf_init(struct iobuf *, size_t, size_t); void iobuf_clear(struct iobuf *); int iobuf_extend(struct iobuf *, size_t); void iobuf_normalize(struct iobuf *); void iobuf_drop(struct iobuf *, size_t); size_t iobuf_space(struct iobuf *); size_t iobuf_len(struct iobuf *); size_t iobuf_left(struct iobuf *); char *iobuf_data(struct iobuf *); char *iobuf_getline(struct iobuf *, size_t *); ssize_t iobuf_read(struct iobuf *, int); ssize_t iobuf_read_tls(struct iobuf *, struct tls *); size_t iobuf_queued(struct iobuf *); void* iobuf_reserve(struct iobuf *, size_t); int iobuf_queue(struct iobuf *, const void*, size_t); int iobuf_queuev(struct iobuf *, const struct iovec *, int); int iobuf_fqueue(struct iobuf *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); int iobuf_vfqueue(struct iobuf *, const char *, va_list); int iobuf_flush(struct iobuf *, int); int iobuf_flush_tls(struct iobuf *, struct tls *); ssize_t iobuf_write(struct iobuf *, int); ssize_t iobuf_write_tls(struct iobuf *, struct tls *); opensmtpd-7.7.0p0/usr.sbin/smtpd/unpack_dns.c0000644000175000001440000001415114610663500014641 /* $OpenBSD: unpack_dns.c,v 1.3 2022/01/20 14:18:10 naddy Exp $ */ /* * Copyright (c) 2011-2014 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #ifdef HAVE_ARPA_NAMESER_COMPAT_H #include #endif #include #include #include "unpack_dns.h" static int unpack_data(struct unpack *, void *, size_t); static int unpack_u16(struct unpack *, uint16_t *); static int unpack_u32(struct unpack *, uint32_t *); static int unpack_inaddr(struct unpack *, struct in_addr *); static int unpack_in6addr(struct unpack *, struct in6_addr *); static int unpack_dname(struct unpack *, char *, size_t); void unpack_init(struct unpack *unpack, const char *buf, size_t len) { unpack->buf = buf; unpack->len = len; unpack->offset = 0; unpack->err = NULL; } int unpack_header(struct unpack *p, struct dns_header *h) { if (unpack_data(p, h, HFIXEDSZ) == -1) return (-1); h->flags = ntohs(h->flags); h->qdcount = ntohs(h->qdcount); h->ancount = ntohs(h->ancount); h->nscount = ntohs(h->nscount); h->arcount = ntohs(h->arcount); return (0); } int unpack_query(struct unpack *p, struct dns_query *q) { unpack_dname(p, q->q_dname, sizeof(q->q_dname)); unpack_u16(p, &q->q_type); unpack_u16(p, &q->q_class); return (p->err) ? (-1) : (0); } int unpack_rr(struct unpack *p, struct dns_rr *rr) { uint16_t rdlen; size_t save_offset; unpack_dname(p, rr->rr_dname, sizeof(rr->rr_dname)); unpack_u16(p, &rr->rr_type); unpack_u16(p, &rr->rr_class); unpack_u32(p, &rr->rr_ttl); unpack_u16(p, &rdlen); if (p->err) return (-1); if (p->len - p->offset < rdlen) { p->err = "too short"; return (-1); } save_offset = p->offset; switch (rr->rr_type) { case T_CNAME: unpack_dname(p, rr->rr.cname.cname, sizeof(rr->rr.cname.cname)); break; case T_MX: unpack_u16(p, &rr->rr.mx.preference); unpack_dname(p, rr->rr.mx.exchange, sizeof(rr->rr.mx.exchange)); break; case T_NS: unpack_dname(p, rr->rr.ns.nsname, sizeof(rr->rr.ns.nsname)); break; case T_PTR: unpack_dname(p, rr->rr.ptr.ptrname, sizeof(rr->rr.ptr.ptrname)); break; case T_SOA: unpack_dname(p, rr->rr.soa.mname, sizeof(rr->rr.soa.mname)); unpack_dname(p, rr->rr.soa.rname, sizeof(rr->rr.soa.rname)); unpack_u32(p, &rr->rr.soa.serial); unpack_u32(p, &rr->rr.soa.refresh); unpack_u32(p, &rr->rr.soa.retry); unpack_u32(p, &rr->rr.soa.expire); unpack_u32(p, &rr->rr.soa.minimum); break; case T_A: if (rr->rr_class != C_IN) goto other; unpack_inaddr(p, &rr->rr.in_a.addr); break; case T_AAAA: if (rr->rr_class != C_IN) goto other; unpack_in6addr(p, &rr->rr.in_aaaa.addr6); break; default: other: rr->rr.other.rdata = p->buf + p->offset; rr->rr.other.rdlen = rdlen; p->offset += rdlen; } if (p->err) return (-1); /* make sure that the advertised rdlen is really ok */ if (p->offset - save_offset != rdlen) p->err = "bad dlen"; return (p->err) ? (-1) : (0); } ssize_t dname_expand(const unsigned char *data, size_t len, size_t offset, size_t *newoffset, char *dst, size_t max) { size_t n, count, end, ptr, start; ssize_t res; if (offset >= len) return (-1); res = 0; end = start = offset; for (; (n = data[offset]); ) { if ((n & 0xc0) == 0xc0) { if (offset + 2 > len) return (-1); ptr = 256 * (n & ~0xc0) + data[offset + 1]; if (ptr >= start) return (-1); if (end < offset + 2) end = offset + 2; offset = start = ptr; continue; } if (offset + n + 1 > len) return (-1); /* copy n + at offset+1 */ if (dst != NULL && max != 0) { count = (max < n + 1) ? (max) : (n + 1); memmove(dst, data + offset, count); dst += count; max -= count; } res += n + 1; offset += n + 1; if (end < offset) end = offset; } if (end < offset + 1) end = offset + 1; if (dst != NULL && max != 0) dst[0] = 0; if (newoffset) *newoffset = end; return (res + 1); } char * print_dname(const char *_dname, char *buf, size_t max) { const unsigned char *dname = _dname; char *res; size_t left, count; if (_dname[0] == 0) { (void)strlcpy(buf, ".", max); return buf; } res = buf; left = max - 1; while (dname[0] && left) { count = (dname[0] < (left - 1)) ? dname[0] : (left - 1); memmove(buf, dname + 1, count); dname += dname[0] + 1; left -= count; buf += count; if (left) { left -= 1; *buf++ = '.'; } } buf[0] = 0; return (res); } static int unpack_data(struct unpack *p, void *data, size_t len) { if (p->err) return (-1); if (p->len - p->offset < len) { p->err = "too short"; return (-1); } memmove(data, p->buf + p->offset, len); p->offset += len; return (0); } static int unpack_u16(struct unpack *p, uint16_t *u16) { if (unpack_data(p, u16, 2) == -1) return (-1); *u16 = ntohs(*u16); return (0); } static int unpack_u32(struct unpack *p, uint32_t *u32) { if (unpack_data(p, u32, 4) == -1) return (-1); *u32 = ntohl(*u32); return (0); } static int unpack_inaddr(struct unpack *p, struct in_addr *a) { return (unpack_data(p, a, 4)); } static int unpack_in6addr(struct unpack *p, struct in6_addr *a6) { return (unpack_data(p, a6, 16)); } static int unpack_dname(struct unpack *p, char *dst, size_t max) { ssize_t e; if (p->err) return (-1); e = dname_expand(p->buf, p->len, p->offset, &p->offset, dst, max); if (e == -1) { p->err = "bad domain name"; return (-1); } if (e < 0 || e > MAXDNAME) { p->err = "domain name too long"; return (-1); } return (0); } opensmtpd-7.7.0p0/usr.sbin/smtpd/sendmail.80000644000175000001440000000441314610663500014235 .\" $OpenBSD: sendmail.8,v 1.4 2015/10/23 15:48:16 jung Exp $ .\" .\" Copyright (C) 2013 Ryan Kavanagh .\" All rights reserved. .\" .\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .Dd $Mdocdate: October 23 2015 $ .Dt SENDMAIL 8 .Os .Sh NAME .Nm sendmail .Nd a mail enqueuer for .Xr smtpd 8 .Sh SYNOPSIS .Nm .Op Fl tv .Op Fl F Ar name .Op Fl f Ar from .Ar to ... .Sh DESCRIPTION The .Nm utility is a local enqueuer for the .Xr smtpd 8 daemon, compatible with .Xr mailwrapper 8 . The message is read on standard input (stdin) until .Nm encounters an end-of-file. The .Nm enqueuer is not intended to be used directly to send mail, but rather via a frontend known as a mail user agent. .Pp Unless the optional .Fl t flag is specified, one or more recipients must be specified on the command line. .Pp The options are as follows: .Bl -tag -width Ds .It Fl F Ar name Set the sender's full name. .It Fl f Ar from Set the sender's address. .It Fl t Read the message's To:, Cc:, and Bcc: fields for recipients. The Bcc: field will be deleted before sending. .It Fl v Enable verbose output. .El .Pp To maintain compatibility with Sendmail, Inc.'s implementation of .Nm , various other flags are accepted, but have no effect. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO .Xr smtpctl 8 , .Xr smtpd 8 .Sh AUTHORS .Sy OpenSMTPD is primarily developed by Gilles Chehade, Eric Faurot, and Charles Longeau, with contributions from various .Ox hackers. It is distributed under the ISC license. .Pp This manpage was written by .An Ryan Kavanagh .Aq Mt rak@debian.org for the Debian project and is distributed under the ISC license. opensmtpd-7.7.0p0/usr.sbin/smtpd/limit.c0000644000175000001440000000707114610663500013635 /* $OpenBSD: limit.c,v 1.7 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" void limit_mta_set_defaults(struct mta_limits *limits) { limits->maxconn_per_host = 10; limits->maxconn_per_route = 5; limits->maxconn_per_source = 100; limits->maxconn_per_connector = 20; limits->maxconn_per_relay = 100; limits->maxconn_per_domain = 100; limits->conndelay_host = 0; limits->conndelay_route = 5; limits->conndelay_source = 0; limits->conndelay_connector = 0; limits->conndelay_relay = 2; limits->conndelay_domain = 0; limits->discdelay_route = 3; limits->max_mail_per_session = 100; limits->sessdelay_transaction = 0; limits->sessdelay_keepalive = 10; limits->max_failures_per_session = 25; limits->family = AF_UNSPEC; limits->task_hiwat = 50; limits->task_lowat = 30; limits->task_release = 10; } int limit_mta_set(struct mta_limits *limits, const char *key, int64_t value) { if (!strcmp(key, "max-conn-per-host")) limits->maxconn_per_host = value; else if (!strcmp(key, "max-conn-per-route")) limits->maxconn_per_route = value; else if (!strcmp(key, "max-conn-per-source")) limits->maxconn_per_source = value; else if (!strcmp(key, "max-conn-per-connector")) limits->maxconn_per_connector = value; else if (!strcmp(key, "max-conn-per-relay")) limits->maxconn_per_relay = value; else if (!strcmp(key, "max-conn-per-domain")) limits->maxconn_per_domain = value; else if (!strcmp(key, "conn-delay-host")) limits->conndelay_host = value; else if (!strcmp(key, "conn-delay-route")) limits->conndelay_route = value; else if (!strcmp(key, "conn-delay-source")) limits->conndelay_source = value; else if (!strcmp(key, "conn-delay-connector")) limits->conndelay_connector = value; else if (!strcmp(key, "conn-delay-relay")) limits->conndelay_relay = value; else if (!strcmp(key, "conn-delay-domain")) limits->conndelay_domain = value; else if (!strcmp(key, "reconn-delay-route")) limits->discdelay_route = value; else if (!strcmp(key, "session-mail-max")) limits->max_mail_per_session = value; else if (!strcmp(key, "session-transaction-delay")) limits->sessdelay_transaction = value; else if (!strcmp(key, "session-keepalive")) limits->sessdelay_keepalive = value; else if (!strcmp(key, "max-failures-per-session")) limits->max_failures_per_session = value; else if (!strcmp(key, "task-hiwat")) limits->task_hiwat = value; else if (!strcmp(key, "task-lowat")) limits->task_lowat = value; else if (!strcmp(key, "task-release")) limits->task_release = value; else return (0); return (1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd-filters.70000644000175000001440000004317715007617542015255 .\" $OpenBSD: smtpd-filters.7,v 1.15 2025/04/08 17:35:01 op Exp $ .\" .\" Copyright (c) 2008 Janne Johansson .\" Copyright (c) 2009 Jacek Masiulaniec .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" .Dd $Mdocdate: April 8 2025 $ .Dt SMTPD-FILTERS 7 .Os .Sh NAME .Nm smtpd-filters .Nd filtering API for the smtpd daemon .Sh DESCRIPTION The .Xr smtpd 8 daemon provides a Simple Mail Transfer Protocol (SMTP) implementation, which allows ordinary machines to become Mail eXchangers (MX). Some features that are commonly used by MX, such as delivery reporting or spam filtering, are outside the scope of SMTP and too complex to fit in .Xr smtpd 8 . .Pp Because an MX may need to provide these features, .Xr smtpd 8 provides an API to extend its behavior through .Nm . .Pp At runtime, .Xr smtpd 8 can report events to .Nm , querying what it should answer to these events. This allows the decision logic to rely on third-party programs. .Sh DESIGN .Nm are programs that run as unique standalone processes, they do not share .Xr smtpd 8 memory space. They are executed by .Xr smtpd 8 at startup and expected to run in an infinite loop, reading events and filtering requests from .Xr stdin 4 , writing responses to .Xr stdout 4 and logging to .Xr stderr 4 . They are not allowed to terminate. .Pp Because .Nm are standalone programs that communicate with .Xr smtpd 8 through .Xr fd 4 , they may run as different users than .Xr smtpd 8 and may be written in any language. .Nm must not use blocking I/O, they must support answering asynchronously to .Xr smtpd 8 . .Sh REPORT AND FILTER The API relies on two streams, report and filter. .Pp The report stream is a one-way stream which allows .Xr smtpd 8 to inform .Nm in real-time about events. Report events do not expect an answer from .Nm ; they are just meant to provide information. A filter should be able to replicate the .Xr smtpd 8 state for a session by gathering information coming from report events. No decision is ever taken by the report stream. .Pp The filter stream is a two-way stream which allows .Xr smtpd 8 to query .Nm about what it should do with a session at a given phase. Filter requests expect an answer from .Nm ; .Xr smtpd 8 will not let the session move forward until then. A decision must always be taken by the filter stream. .Pp It is sometimes possible to rely on filter requests to gather information, but because a response is expected by .Xr smtpd 8 , this is more costly than using report events. The correct pattern for writing filters is to use report events to create a local state for a session, then use filter requests to take decisions based on this state. The only case when using filter requests instead of report events is correct is when a decision is required for the filter request and there is no need for more information than that of the event itself. .Sh PROTOCOL The protocol consists of human-readable lines exchanged between .Nm and .Xr smtpd 8 , through .Xr fd 4 . .Pp The protocol begins with a handshake. First, .Xr smtpd 8 provides .Nm with general configuration information in the form of key-value lines: .Bd -literal -offset indent config|smtpd-version|7.7.0 config|protocol|0.7 config|smtp-session-timeout|300 config|subsystem|smtp-in config|ready .Ed .Pp Then, .Nm register the stream, subsystem and event they want to handle: .Bd -literal -offset indent register|report|smtp-in|link-connect register|ready .Ed .Pp Finally, .Xr smtpd 8 emits report events and filter requests, expecting .Nm to respond or not depending on the stream: .Bd -literal -offset indent report|0.7|1576146008.006099|smtp-in|link-connect|7641df9771b4ed00|mail.openbsd.org|pass|199.185.178.25:33174|45.77.67.80:25 report|0.7|1576147242.200225|smtp-in|link-connect|7641dfb3798eb5bf|mail.openbsd.org|pass|199.185.178.25:31205|45.77.67.80:25 report|0.7|1576148447.982572|smtp-in|link-connect|7641dfc063102cbd|mail.openbsd.org|pass|199.185.178.25:24786|45.77.67.80:25 .Ed .Pp The character .Dq | may only appear in the last field of a payload, in which case it should be considered a regular character and not a separator. No other field may contain a .Dq | . .Pp The list of subsystems and events, as well as the format of requests and responses, are documented in the sections below. .Sh CONFIGURATION During the initial handshake, .Xr smtpd 8 emits a series of configuration keys and values. The list is meant to be ignored by .Nm that do not require it and consumed gracefully by filters that do. .Pp There are currently three keys: .Bd -literal -offset indent config|smtpd-version|7.7.0 config|protocol|0.7 config|smtp-session-timeout|300 config|subsystem|smtp-in .Ed .Pp When .Xr smtpd 8 has sent all configuration keys, it emits the following line: .Bd -literal -offset indent config|ready .Ed .Sh REPORT EVENTS There is currently only one subsystem supported in the API: smtp-in. .Pp Each report event is generated by .Xr smtpd 8 as a single line similar to the one below: .Bd -literal -offset indent report|0.7|1576146008.006099|smtp-in|link-connect|7641df9771b4ed00|mail.openbsd.org|pass|199.185.178.25:33174|45.77.67.80:25 .Ed .Pp The format consists of a protocol prefix containing the stream, the protocol version, the timestamp, the subsystem, the event and the unique session identifier, separated by .Dq | : .Bd -literal -offset indent report|0.7|1576146008.006099|smtp-in|link-connect|7641df9771b4ed00 .Ed .Pp It is followed by a suffix containing the event-specific parameters, also separated by .Dq | : .Bd -literal -offset indent mail.openbsd.org|pass|199.185.178.25:33174|45.77.67.80:25 .Ed .Pp The list of events and event-specific parameters for smtp-in are as follows: .Bl -tag -width Ds .It Ic link-connect : Ar rdns fcrdns src dest This event is generated upon connection. .Pp .Ar rdns contains the reverse DNS hostname for the remote end or an empty string if none. .Pp .Ar fcrdns contains the string .Dq pass or .Dq fail depending on if the remote end validates FCrDNS. .Pp .Ar src contains either the IP address and port of the source address, in the format .Dq address:port , or the path to a UNIX socket in the format .Dq unix:/path . .Pp .Ar dest holds either the IP address and port of the destination address, in the format .Dq address:port , or the path to a UNIX socket in the format .Dq unix:/path . .It Ic link-greeting : Ar hostname This event is generated upon display of the server banner. .Pp .Ar hostname contains the hostname displayed in the banner. .It Ic link-identify : Ar method identity This event is generated upon .Dq HELO or .Dq EHLO command from the client. .Pp .Ar method contains the string .Dq HELO or .Dq EHLO indicating the method used by the client. .Pp .Ar identity contains the identity provided by the client. .It Ic link-tls : Ar tls-string This event is generated upon successful negotiation of TLS. .Pp .Ar tls-string contains a colon-separated list of TLS properties including the TLS version, the cipher suite used by the session and the cipher strength in bits. .It Ic link-disconnect This event is generated upon disconnection of the client. .It Ic link-auth : Ar result username This event is generated upon an authentication attempt by the client. .Pp .Ar result contains the string .Dq pass , .Dq fail or .Dq error depending on the result of the authentication attempt. .Pp .Ar username contains the username used for the authentication attempt. .It Ic tx-reset : Op message-id This event is generated when a transaction is reset. .Pp If reset took place during a transaction, .Ar message-id contains the identifier of the transaction being reset. .It Ic tx-begin : Ar message-id This event is generated when a transaction is initiated. .Pp .Ar message-id contains the identifier for the transaction. .It Ic tx-mail : Ar message-id Ar result address This event is generated when client emits .Dq MAIL FROM . .Pp .Ar message-id contains the identifier for the transaction. .Pp .Ar result contains .Dq ok if the sender was accepted, .Dq permfail if it was rejected or .Dq tempfail if it was rejected for a transient error. .Pp .Ar address contains the e-mail address of the sender. The address is normalized and sanitized, the characters .Dq < and .Dq > are removed, along with any parameters to .Dq MAIL FROM . .It Ic tx-rcpt : Ar message-id Ar result address This event is generated when client emits .Dq RCPT TO . .Pp .Ar message-id contains the identifier for the transaction. .Pp .Ar result contains .Dq ok if the recipient was accepted, .Dq permfail if it was rejected or .Dq tempfail if it was rejected for a transient error. .Pp .Ar address contains the e-mail address of the recipient. The address is normalized and sanitized, the characters .Dq < and .Dq > are removed, along with any parameters to .Dq RCPT TO . .It Ic tx-envelope : Ar message-id Ar envelope-id This event is generated when an envelope is accepted. .Pp .Ar envelope-id contains the unique identifier for the envelope. .It Ic tx-data : Ar message-id Ar result This event is generated when client has emitted .Dq DATA . .Pp .Ar message-id contains the unique identifier for the transaction. .Pp .Ar result contains .Dq ok if server accepted the message for processing, .Dq permfail if it has not been accepted and .Dq tempfail if a transient error prevented message processing. .It Ic tx-commit : Ar message-id Ar message-size This event is generated when a transaction has been accepted by the server. .Pp .Ar message-id contains the unique identifier for the SMTP transaction. .Pp .Ar message-size contains the size of the message submitted in the .Dq DATA phase of the SMTP transaction. .It Ic tx-rollback : Ar message-id This event is generated when a transaction has been rejected by the server. .Pp .Ar message-id contains the unique identifier for the SMTP transaction. .It Ic protocol-client : Ar command This event is generated for every command submitted by the client. It contains the raw command as received by the server. .Pp .Ar command contains the command emitted by the client to the server. .It Ic protocol-server : Ar response This event is generated for every response emitted by the server. It contains the raw response as emitted by the server. .Pp .Ar response contains the response emitted by the server to the client. .It Ic filter-report : Ar filter-kind Ar name message This event is generated when a filter emits a report. .Pp .Ar filter-kind may be either .Dq builtin or .Dq proc depending on if the filter is an .Xr smtpd 8 builtin filter or a proc filter implementing the API. .Pp .Ar name is the name of the filter that generated the report. .Pp .Ar message is a filter-specific message. .It Ic filter-response : Ar phase response Op param This event is generated when a filter responds to a filtering request. .Pp .Ar phase contains the phase name for the request. The phases are documented in the next section. .Pp .Ar response contains the response of the filter to the request, it is either one of .Dq proceed , .Dq report , .Dq reject , .Dq disconnect , .Dq junk or .Dq rewrite . .Pp If specified, .Ar param is the parameter to the response. .It Ic timeout This event is generated when a timeout happens for a session. .El .Sh FILTER REQUESTS There is currently only one subsystem supported in the API: smtp-in. .Pp Filter requests allow .Xr smtpd 8 to query .Nm about what to do with a session at a particular phase. In addition, they allow .Nm to alter the content of a message by adding, modifying, or suppressing lines of input in a way that is similar to what program like .Xr sed 1 or .Xr grep 1 would do. .Pp Each filter request is generated by .Xr smtpd 8 as a single line similar to the one below. Fields are separated by the .Dq | character. .Bd -literal -offset indent filter|0.7|1576146008.006099|smtp-in|connect|7641df9771b4ed00|1ef1c203cc576e5d|mail.openbsd.org|199.185.178.25 .Ed .Pp The format consists of a protocol prefix containing the stream, the protocol version, the timestamp, the subsystem, the filtering phase, the unique session identifier and an opaque token that the filter should provide in its response: .Bd -literal -offset indent filter|0.7|1576146008.006099|smtp-in|connect|7641df9771b4ed00|1ef1c203cc576e5d .Ed .Pp It is followed by a suffix containing the phase-specific parameters of the filter request, also separated by .Dq | : .Bd -literal -offset indent mail.openbsd.org|199.185.178.25 .Ed .Pp Unlike with report events, .Xr smtpd 8 expects answers from filter requests and will not allow a session to move forward until the filter has instructed .Xr smtpd 8 how to treat it. .Pp For all phases except .Dq data-line , responses must follow the same construct: a message of type .Dq filter-result , followed by the unique session id, the opaque token, a decision and optional decision-specific parameters: .Bd -literal -offset indent filter-result|7641df9771b4ed00|1ef1c203cc576e5d|proceed filter-result|7641df9771b4ed00|1ef1c203cc576e5d|reject|550 nope .Ed .Pp The possible decisions for a .Dq filter-result message are documented below. .Pp For the .Dq data-line phase, .Nm are fed a stream of lines corresponding to the message to filter, terminated by a single dot: .Bd -literal -offset indent filter|0.7|1576146008.006099|smtp-in|data-line|7641df9771b4ed00|1ef1c203cc576e5d|line 1 filter|0.7|1576146008.006103|smtp-in|data-line|7641df9771b4ed00|1ef1c203cc576e5d|line 2 filter|0.7|1576146008.006105|smtp-in|data-line|7641df9771b4ed00|1ef1c203cc576e5d|. .Ed .Pp They are expected to return an output stream similarly terminated by a single dot. A filter may add to, suppress, modify or echo back the lines it receives. Ultimately, .Xr smtpd 8 assumes that the message consists of the output from .Nm . .Pp Note that filters may be chained, and the lines that are input into a subsequent filter are the lines that are output from a previous filter. .Pp The response to .Dq data-line requests use their own construct. A .Dq filter-dataline prefix, followed by the unique session identifier, the opaque token and the output line as follows: .Bd -literal -offset indent filter-dataline|7641df9771b4ed00|1ef1c203cc576e5d|line 1 filter-dataline|7641df9771b4ed00|1ef1c203cc576e5d|line 2 filter-dataline|7641df9771b4ed00|1ef1c203cc576e5d|. .Ed .Pp The list of events and event-specific parameters for smtp-in are as follows: .Bl -tag -width Ds .It Ic connect : Ar rdns src This request is emitted after connection, before the banner is displayed. .Pp .Ar src contains either the IP address of the source (a.b.c.d for IPv4 or [x:x:x:x:x:x:x:x] IPv6) or .Dq local (for UNIX sockets). .It Ic helo : Ar identity This request is emitted after the client has emitted .Dq HELO . .It Ic ehlo : Ar identity This request is emitted after the client has emitted .Dq EHLO . .It Ic starttls : Ar tls-string This request is emitted after the client has requested .Dq STARTTLS . .It Ic auth : Ar auth This request is emitted after the client has requested .Dq AUTH . .It Ic mail-from : Ar address This request is emitted after the client has requested .Dq MAIL FROM . .It Ic rcpt-to : Ar address This request is emitted after the client has requested .Dq RCPT TO . .It Ic data This request is emitted after the client has requested .Dq DATA . .It Ic data-line : Ar line This request is emitted for each line of input in the .Dq DATA phase. The lines are raw dot-escaped SMTP DATA input, terminated with a single dot. .It Ic commit This request is emitted after the final single dot is received. .El .Pp For every filtering phase, excepted .Dq data-line , the following decisions may be taken by a filter: .Bl -tag -width Ds .It Ic proceed No action is taken, session or transaction may be passed to the next filter. .It Ic junk The session or transaction is marked as spam. .Xr smtpd 8 will prepend an .Dq X-Spam header to the message. .It Ic reject Ar error The command is rejected with the message .Ar error . The message must be a valid SMTP message including status code, 5xx or 4xx. .Pp Messages starting with a 5xx status result in a permanent failure, those starting with a 4xx status result in a temporary failure. .Pp Messages starting with a 421 status will result in a client disconnect. .It Ic disconnect Ar error The client is disconnected with the message .Ar error . The message must be a valid SMTP message including status code, 5xx or 4xx. .Pp Messages starting with a 5xx status result in a permanent failure, those starting with a 4xx status result in a temporary failure. .It Ic rewrite Ar parameter The command parameter is rewritten. .Pp This decision allows a filter to perform a rewrite of client-submitted commands before they are processed by the SMTP engine. .Ar parameter is expected to be a valid SMTP parameter for the command. .It Ic report Ar parameter Generates a report with .Ar parameter for this filter. .El .\".Sh EXAMPLES .\"This example filter written in .\".Xr sh 1 .\"will echo back... .\".Bd -literal -offset indent .\"XXX .\".Ed .\".Pp .\"This example filter will filter... .\".Bd -literal -offset indent .\"XXX .\".Ed .\".Pp .\"Note that libraries may provide a simpler interface to .\".Nm .\"that does not require implementing the protocol itself. .\".Ed .Sh SEE ALSO .Xr smtpd 8 .Sh HISTORY .Nm first appeared in .Ox 6.6 . opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd.c0000644000175000001440000015127215007615267013661 /* $OpenBSD: smtpd.c,v 1.354 2024/11/21 13:22:21 claudio Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2009 Jacek Masiulaniec * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include /* Needed for flock */ #include #include #include #include #include #include #ifdef BSD_AUTH #include #endif #ifdef USE_PAM #if defined(HAVE_SECURITY_PAM_APPL_H) #include #elif defined (HAVE_PAM_PAM_APPL_H) #include #endif #endif #ifdef HAVE_CRYPT_H #include /* needed for crypt() */ #endif #include #include /* needed for err and errx */ #include #include #include /* needed for setgroups */ #include #include #include #include #ifdef HAVE_LOGIN_CAP_H #include #endif #include #include #include #include #ifdef HAVE_SHADOW_H #include /* needed for getspnam() */ #endif #include #include #include #include #include #include #include #include #ifdef HAVE_UTIL_H #include #endif #include #include #include #include "smtpd.h" #include "log.h" #include "ssl.h" extern char *__progname; #define SMTPD_MAXARG 32 static void parent_imsg(struct mproc *, struct imsg *); static void usage(void); static int smtpd(void); static void parent_shutdown(void); static void parent_send_config(int, short, void *); static void parent_send_config_lka(void); static void parent_send_config_dispatcher(void); static void parent_send_config_ca(void); static void parent_sig_handler(int, short, void *); static void forkmda(struct mproc *, uint64_t, struct deliver *); static int parent_forward_open(char *, char *, uid_t, gid_t); static struct child *child_add(pid_t, int, const char *); static struct mproc *start_child(int, char **, char *); static struct mproc *setup_peer(enum smtp_proc_type, pid_t, int); static void setup_peers(struct mproc *, struct mproc *); static void setup_done(struct mproc *); static void setup_proc(void); static struct mproc *setup_peer(enum smtp_proc_type, pid_t, int); static int imsg_wait(struct imsgbuf *, struct imsg *, int); static void offline_scan(int, short, void *); static int offline_add(char *, uid_t, gid_t); static void offline_done(void); static int offline_enqueue(char *, uid_t, gid_t); static void purge_task(void); static int parent_auth_user(const char *, const char *); static void load_pki_tree(void); static void load_pki_keys(void); static void fork_filter_processes(void); static void fork_filter_process(const char *, const char *, const char *, const char *, const char *, uint32_t); enum child_type { CHILD_DAEMON, CHILD_MDA, CHILD_PROCESSOR, CHILD_ENQUEUE_OFFLINE, }; struct child { pid_t pid; enum child_type type; const char *title; int mda_out; uint64_t mda_id; char *path; char *cause; }; struct offline { TAILQ_ENTRY(offline) entry; uid_t uid; gid_t gid; char *path; }; #define OFFLINE_READMAX 20 #define OFFLINE_QUEUEMAX 5 static size_t offline_running = 0; TAILQ_HEAD(, offline) offline_q; static struct event config_ev; static struct event offline_ev; static struct timeval offline_timeout; static pid_t purge_pid = -1; extern char **environ; void (*imsg_callback)(struct mproc *, struct imsg *); enum smtp_proc_type smtpd_process; struct smtpd *env = NULL; struct mproc *p_control = NULL; struct mproc *p_lka = NULL; struct mproc *p_parent = NULL; struct mproc *p_queue = NULL; struct mproc *p_scheduler = NULL; struct mproc *p_dispatcher = NULL; struct mproc *p_ca = NULL; const char *backend_queue = "fs"; const char *backend_scheduler = "ramqueue"; const char *backend_stat = "ram"; int profiling = 0; int debug = 0; int foreground = 0; int control_socket = -1; struct tree children; /* Saved arguments to main(). */ char **saved_argv; int saved_argc; static void parent_imsg(struct mproc *p, struct imsg *imsg) { struct forward_req *fwreq; struct filter_proc *processor; struct deliver deliver; struct child *c; struct msg m; const void *data; const char *username, *password, *cause, *procname; uint64_t reqid; size_t sz; void *i; int fd, n, v, ret; if (imsg == NULL) fatalx("process %s socket closed", p->name); switch (imsg->hdr.type) { case IMSG_LKA_OPEN_FORWARD: CHECK_IMSG_DATA_SIZE(imsg, sizeof *fwreq); fwreq = imsg->data; fd = parent_forward_open(fwreq->user, fwreq->directory, fwreq->uid, fwreq->gid); fwreq->status = 0; if (fd == -1 && errno != ENOENT) { if (errno == EAGAIN) fwreq->status = -1; } else fwreq->status = 1; m_compose(p, IMSG_LKA_OPEN_FORWARD, 0, 0, fd, fwreq, sizeof *fwreq); return; case IMSG_LKA_AUTHENTICATE: /* * If we reached here, it means we want root to lookup * system user. */ m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &username); m_get_string(&m, &password); m_end(&m); ret = parent_auth_user(username, password); m_create(p, IMSG_LKA_AUTHENTICATE, 0, 0, -1); m_add_id(p, reqid); m_add_int(p, ret); m_close(p); return; case IMSG_MDA_FORK: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_data(&m, &data, &sz); m_end(&m); if (sz != sizeof(deliver)) fatalx("expected deliver"); memmove(&deliver, data, sz); forkmda(p, reqid, &deliver); return; case IMSG_MDA_KILL: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_string(&m, &cause); m_end(&m); i = NULL; while ((n = tree_iter(&children, &i, NULL, (void**)&c))) if (c->type == CHILD_MDA && c->mda_id == reqid && c->cause == NULL) break; if (!n) { log_debug("debug: smtpd: " "kill request: proc not found"); return; } c->cause = xstrdup(cause); log_debug("debug: smtpd: kill requested for %u: %s", c->pid, c->cause); kill(c->pid, SIGTERM); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_trace_verbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; case IMSG_LKA_PROCESSOR_ERRFD: m_msg(&m, imsg); m_get_string(&m, &procname); m_end(&m); processor = dict_xget(env->sc_filter_processes_dict, procname); m_create(p_lka, IMSG_LKA_PROCESSOR_ERRFD, 0, 0, processor->errfd); m_add_string(p_lka, procname); m_close(p_lka); return; } fatalx("parent_imsg: unexpected %s imsg from %s", imsg_to_str(imsg->hdr.type), proc_title(p->proc)); } static void usage(void) { extern char *__progname; fprintf(stderr, "usage: %s [-dFhnv] [-D macro=value] " "[-f file] [-P system] [-T trace]\n", __progname); exit(1); } static void parent_shutdown(void) { pid_t pid; mproc_clear(p_ca); mproc_clear(p_dispatcher); mproc_clear(p_control); mproc_clear(p_lka); mproc_clear(p_scheduler); mproc_clear(p_queue); do { pid = waitpid(WAIT_MYPGRP, NULL, 0); } while (pid != -1 || (pid == -1 && errno == EINTR)); unlink(SMTPD_SOCKET); log_info("Exiting"); exit(0); } static void parent_send_config(int fd, short event, void *p) { parent_send_config_lka(); parent_send_config_dispatcher(); parent_send_config_ca(); purge_config(PURGE_PKI); } static void parent_send_config_dispatcher(void) { log_debug("debug: parent_send_config: configuring dispatcher process"); m_compose(p_dispatcher, IMSG_CONF_START, 0, 0, -1, NULL, 0); m_compose(p_dispatcher, IMSG_CONF_END, 0, 0, -1, NULL, 0); } void parent_send_config_lka(void) { log_debug("debug: parent_send_config_ruleset: reloading"); m_compose(p_lka, IMSG_CONF_START, 0, 0, -1, NULL, 0); m_compose(p_lka, IMSG_CONF_END, 0, 0, -1, NULL, 0); } static void parent_send_config_ca(void) { log_debug("debug: parent_send_config: configuring ca process"); m_compose(p_ca, IMSG_CONF_START, 0, 0, -1, NULL, 0); m_compose(p_ca, IMSG_CONF_END, 0, 0, -1, NULL, 0); } static void parent_sig_handler(int sig, short event, void *p) { struct child *child; int status, fail; pid_t pid; char *cause; switch (sig) { case SIGTERM: case SIGINT: log_debug("debug: got signal %d", sig); parent_shutdown(); /* NOT REACHED */ case SIGCHLD: do { int len; enum mda_resp_status mda_status; int mda_sysexit; pid = waitpid(-1, &status, WNOHANG); if (pid <= 0) continue; fail = 0; if (WIFSIGNALED(status)) { fail = 1; len = asprintf(&cause, "terminated; signal %d", WTERMSIG(status)); mda_status = MDA_TEMPFAIL; mda_sysexit = 0; } else if (WIFEXITED(status)) { if (WEXITSTATUS(status) != 0) { fail = 1; len = asprintf(&cause, "exited abnormally"); mda_sysexit = WEXITSTATUS(status); if (mda_sysexit == EX_OSERR || mda_sysexit == EX_TEMPFAIL) mda_status = MDA_TEMPFAIL; else mda_status = MDA_PERMFAIL; } else { len = asprintf(&cause, "exited okay"); mda_status = MDA_OK; mda_sysexit = 0; } } else /* WIFSTOPPED or WIFCONTINUED */ continue; if (len == -1) fatal("asprintf"); if (pid == purge_pid) purge_pid = -1; child = tree_pop(&children, pid); if (child == NULL) goto skip; switch (child->type) { case CHILD_PROCESSOR: if (fail) { log_warnx("warn: lost processor: %s %s", child->title, cause); parent_shutdown(); } break; case CHILD_DAEMON: if (fail) log_warnx("warn: lost child: %s %s", child->title, cause); break; case CHILD_MDA: if (WIFSIGNALED(status) && WTERMSIG(status) == SIGALRM) { char *tmp; if (asprintf(&tmp, "terminated; timeout") != -1) { free(cause); cause = tmp; } } else if (child->cause && WIFSIGNALED(status) && WTERMSIG(status) == SIGTERM) { free(cause); cause = child->cause; child->cause = NULL; } free(child->cause); log_debug("debug: smtpd: mda process done " "for session %016"PRIx64 ": %s", child->mda_id, cause); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, child->mda_out); m_add_id(p_dispatcher, child->mda_id); m_add_int(p_dispatcher, mda_status); m_add_int(p_dispatcher, mda_sysexit); m_add_string(p_dispatcher, cause); m_close(p_dispatcher); break; case CHILD_ENQUEUE_OFFLINE: if (fail) log_warnx("warn: smtpd: " "couldn't enqueue offline " "message %s; smtpctl %s", child->path, cause); else unlink(child->path); free(child->path); offline_done(); break; default: fatalx("smtpd: unexpected child type"); } free(child); skip: free(cause); } while (pid > 0 || (pid == -1 && errno == EINTR)); break; default: fatalx("smtpd: unexpected signal"); } } int main(int argc, char *argv[]) { int c, i; int opts, flags; const char *conffile = CONF_FILE; int save_argc = argc; char **save_argv = argv; char *rexec = NULL; struct smtpd *conf; #ifndef HAVE___PROGNAME __progname = get_progname(argv[0]); #endif __progname = xstrdup(__progname); /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ saved_argc = argc; saved_argv = xcalloc(argc + 1, sizeof(*saved_argv)); for (i = 0; i < argc; i++) saved_argv[i] = xstrdup(argv[i]); saved_argv[i] = NULL; #ifndef HAVE_SETPROCTITLE /* Prepare for later setproctitle emulation */ compat_init_setproctitle(argc, argv); argv = saved_argv; #endif /* this is to work around GNU getopt + portable setproctitle() fuckery */ save_argc = saved_argc; save_argv = saved_argv; if ((conf = config_default()) == NULL) err(1, NULL); env = conf; flags = 0; opts = 0; debug = 0; tracing = 0; log_init(1, LOG_MAIL); if ((conf = config_default()) == NULL) fatal("config_default"); env = conf; TAILQ_INIT(&offline_q); while ((c = getopt(argc, argv, "B:dD:hnP:f:FT:vx:")) != -1) { switch (c) { case 'B': if (strstr(optarg, "queue=") == optarg) backend_queue = strchr(optarg, '=') + 1; else if (strstr(optarg, "scheduler=") == optarg) backend_scheduler = strchr(optarg, '=') + 1; else if (strstr(optarg, "stat=") == optarg) backend_stat = strchr(optarg, '=') + 1; else log_warnx("warn: " "invalid backend specifier %s", optarg); break; case 'd': foreground = 1; foreground_log = 1; break; case 'D': if (cmdline_symset(optarg) < 0) log_warnx("warn: " "could not parse macro definition %s", optarg); break; case 'h': log_info("version: " SMTPD_NAME " " SMTPD_VERSION); usage(); break; case 'n': debug = 2; opts |= SMTPD_OPT_NOACTION; break; case 'f': conffile = optarg; break; case 'F': foreground = 1; break; case 'T': if (!strcmp(optarg, "imsg")) tracing |= TRACE_IMSG; else if (!strcmp(optarg, "io")) tracing |= TRACE_IO; else if (!strcmp(optarg, "smtp")) tracing |= TRACE_SMTP; else if (!strcmp(optarg, "filters")) tracing |= TRACE_FILTERS; else if (!strcmp(optarg, "mta") || !strcmp(optarg, "transfer")) tracing |= TRACE_MTA; else if (!strcmp(optarg, "bounce") || !strcmp(optarg, "bounces")) tracing |= TRACE_BOUNCE; else if (!strcmp(optarg, "scheduler")) tracing |= TRACE_SCHEDULER; else if (!strcmp(optarg, "lookup")) tracing |= TRACE_LOOKUP; else if (!strcmp(optarg, "stat") || !strcmp(optarg, "stats")) tracing |= TRACE_STAT; else if (!strcmp(optarg, "rules")) tracing |= TRACE_RULES; else if (!strcmp(optarg, "mproc")) tracing |= TRACE_MPROC; else if (!strcmp(optarg, "expand")) tracing |= TRACE_EXPAND; else if (!strcmp(optarg, "table") || !strcmp(optarg, "tables")) tracing |= TRACE_TABLES; else if (!strcmp(optarg, "queue")) tracing |= TRACE_QUEUE; else if (!strcmp(optarg, "all")) tracing |= ~TRACE_DEBUG; else if (!strcmp(optarg, "profstat")) profiling |= PROFILE_TOSTAT; else if (!strcmp(optarg, "profile-imsg")) profiling |= PROFILE_IMSG; else if (!strcmp(optarg, "profile-queue")) profiling |= PROFILE_QUEUE; else log_warnx("warn: unknown trace flag \"%s\"", optarg); break; case 'P': if (!strcmp(optarg, "smtp")) flags |= SMTPD_SMTP_PAUSED; else if (!strcmp(optarg, "mta")) flags |= SMTPD_MTA_PAUSED; else if (!strcmp(optarg, "mda")) flags |= SMTPD_MDA_PAUSED; break; case 'v': tracing |= TRACE_DEBUG; break; case 'x': rexec = optarg; break; default: usage(); } } argv += optind; argc -= optind; if (argc || *argv) usage(); env->sc_opts |= opts; if (parse_config(conf, conffile, opts)) exit(1); if (RAND_status() != 1) errx(1, "PRNG is not seeded"); if (strlcpy(env->sc_conffile, conffile, PATH_MAX) >= PATH_MAX) fatalx("config file exceeds PATH_MAX"); if (env->sc_opts & SMTPD_OPT_NOACTION) { if (env->sc_queue_key && crypto_setup(env->sc_queue_key, strlen(env->sc_queue_key)) == 0) { fatalx("crypto_setup:" "invalid key for queue encryption"); } load_pki_tree(); load_pki_keys(); fprintf(stderr, "configuration OK\n"); exit(0); } env->sc_flags |= flags; /* check for root privileges */ if (geteuid()) fatalx("need root privileges"); log_init(foreground_log, LOG_MAIL); log_trace_verbose(tracing); load_pki_tree(); load_pki_keys(); log_debug("debug: using \"%s\" queue backend", backend_queue); log_debug("debug: using \"%s\" scheduler backend", backend_scheduler); log_debug("debug: using \"%s\" stat backend", backend_stat); if (env->sc_hostname[0] == '\0') fatalx("machine does not have a hostname set"); env->sc_uptime = time(NULL); if (rexec == NULL) { smtpd_process = PROC_PARENT; if (env->sc_queue_flags & QUEUE_ENCRYPTION) { if (env->sc_queue_key == NULL) { char *password; password = getpass("queue key: "); if (password == NULL) fatal("getpass"); env->sc_queue_key = strdup(password); explicit_bzero(password, strlen(password)); if (env->sc_queue_key == NULL) fatal("strdup"); } else { char *buf = NULL; size_t sz = 0; ssize_t len; if (strcasecmp(env->sc_queue_key, "stdin") == 0) { if ((len = getline(&buf, &sz, stdin)) == -1) fatal("getline"); if (buf[len - 1] == '\n') buf[len - 1] = '\0'; env->sc_queue_key = buf; } } } log_info("info: %s %s starting", SMTPD_NAME, SMTPD_VERSION); if (!foreground) if (daemon(0, 0) == -1) fatal("failed to daemonize"); /* setup all processes */ p_ca = start_child(save_argc, save_argv, "ca"); p_ca->proc = PROC_CA; p_control = start_child(save_argc, save_argv, "control"); p_control->proc = PROC_CONTROL; p_lka = start_child(save_argc, save_argv, "lka"); p_lka->proc = PROC_LKA; p_dispatcher = start_child(save_argc, save_argv, "dispatcher"); p_dispatcher->proc = PROC_DISPATCHER; p_queue = start_child(save_argc, save_argv, "queue"); p_queue->proc = PROC_QUEUE; p_scheduler = start_child(save_argc, save_argv, "scheduler"); p_scheduler->proc = PROC_SCHEDULER; setup_peers(p_control, p_ca); setup_peers(p_control, p_lka); setup_peers(p_control, p_dispatcher); setup_peers(p_control, p_queue); setup_peers(p_control, p_scheduler); setup_peers(p_dispatcher, p_ca); setup_peers(p_dispatcher, p_lka); setup_peers(p_dispatcher, p_queue); setup_peers(p_queue, p_lka); setup_peers(p_queue, p_scheduler); if (env->sc_queue_key) { if (imsg_compose(&p_queue->imsgbuf, IMSG_SETUP_KEY, 0, 0, -1, env->sc_queue_key, strlen(env->sc_queue_key) + 1) == -1) fatal("imsg_compose"); if (imsgbuf_flush(&p_queue->imsgbuf) == -1) fatal("imsgbuf_flush"); } setup_done(p_ca); setup_done(p_control); setup_done(p_lka); setup_done(p_dispatcher); setup_done(p_queue); setup_done(p_scheduler); log_debug("smtpd: setup done"); return smtpd(); } if (!strcmp(rexec, "ca")) { smtpd_process = PROC_CA; setup_proc(); return ca(); } else if (!strcmp(rexec, "control")) { smtpd_process = PROC_CONTROL; setup_proc(); /* the control socket ensures that only one smtpd instance is running */ control_socket = control_create_socket(); env->sc_stat = stat_backend_lookup(backend_stat); if (env->sc_stat == NULL) fatalx("could not find stat backend \"%s\"", backend_stat); return control(); } else if (!strcmp(rexec, "lka")) { smtpd_process = PROC_LKA; setup_proc(); return lka(); } else if (!strcmp(rexec, "dispatcher")) { smtpd_process = PROC_DISPATCHER; setup_proc(); return dispatcher(); } else if (!strcmp(rexec, "queue")) { smtpd_process = PROC_QUEUE; setup_proc(); if (env->sc_queue_flags & QUEUE_COMPRESSION) env->sc_comp = compress_backend_lookup("gzip"); if (!queue_init(backend_queue, 1)) fatalx("could not initialize queue backend"); return queue(); } else if (!strcmp(rexec, "scheduler")) { smtpd_process = PROC_SCHEDULER; setup_proc(); for (i = 0; i < MAX_BOUNCE_WARN; i++) { if (env->sc_bounce_warn[i] == 0) break; log_debug("debug: bounce warning after %s", duration_to_text(env->sc_bounce_warn[i])); } return scheduler(); } fatalx("bad rexec: %s", rexec); return (1); } static struct mproc * start_child(int save_argc, char **save_argv, char *rexec) { struct mproc *p; char *argv[SMTPD_MAXARG]; int sp[2], argc = 0; pid_t pid; if (save_argc >= SMTPD_MAXARG - 2) fatalx("too many arguments"); if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) fatal("socketpair"); io_set_nonblocking(sp[0]); io_set_nonblocking(sp[1]); switch (pid = fork()) { case -1: fatal("%s: fork", save_argv[0]); case 0: break; default: close(sp[0]); p = calloc(1, sizeof(*p)); if (p == NULL) fatal("calloc"); if((p->name = strdup(rexec)) == NULL) fatal("strdup"); mproc_init(p, sp[1]); p->pid = pid; p->handler = parent_imsg; return p; } if (sp[0] != 3) { if (dup2(sp[0], 3) == -1) fatal("%s: dup2", rexec); } else if (fcntl(sp[0], F_SETFD, 0) == -1) fatal("%s: fcntl", rexec); xclosefrom(4); for (argc = 0; argc < save_argc; argc++) argv[argc] = save_argv[argc]; argv[argc++] = "-x"; argv[argc++] = rexec; argv[argc++] = NULL; execvp(argv[0], argv); fatal("%s: execvp", rexec); } static void setup_peers(struct mproc *a, struct mproc *b) { int sp[2]; if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) fatal("socketpair"); io_set_nonblocking(sp[0]); io_set_nonblocking(sp[1]); if (imsg_compose(&a->imsgbuf, IMSG_SETUP_PEER, b->proc, b->pid, sp[0], NULL, 0) == -1) fatal("imsg_compose"); if (imsgbuf_flush(&a->imsgbuf) == -1) fatal("imsgbuf_flush"); if (imsg_compose(&b->imsgbuf, IMSG_SETUP_PEER, a->proc, a->pid, sp[1], NULL, 0) == -1) fatal("imsg_compose"); if (imsgbuf_flush(&b->imsgbuf) == -1) fatal("imsgbuf_flush"); } static void setup_done(struct mproc *p) { struct imsg imsg; if (imsg_compose(&p->imsgbuf, IMSG_SETUP_DONE, 0, 0, -1, NULL, 0) == -1) fatal("imsg_compose"); if (imsgbuf_flush(&p->imsgbuf) == -1) fatal("imsgbuf_flush"); if (imsg_wait(&p->imsgbuf, &imsg, 10000) == -1) fatal("imsg_wait"); if (imsg.hdr.type != IMSG_SETUP_DONE) fatalx("expect IMSG_SETUP_DONE"); log_debug("setup_done: %s[%d] done", p->name, p->pid); imsg_free(&imsg); } static void setup_proc(void) { struct imsgbuf *ibuf; struct imsg imsg; int setup = 1; log_procinit(proc_title(smtpd_process)); p_parent = calloc(1, sizeof(*p_parent)); if (p_parent == NULL) fatal("calloc"); if((p_parent->name = strdup("parent")) == NULL) fatal("strdup"); p_parent->proc = PROC_PARENT; p_parent->handler = imsg_dispatch; mproc_init(p_parent, 3); ibuf = &p_parent->imsgbuf; while (setup) { if (imsg_wait(ibuf, &imsg, 10000) == -1) fatal("imsg_wait"); switch (imsg.hdr.type) { case IMSG_SETUP_KEY: env->sc_queue_key = strdup(imsg.data); break; case IMSG_SETUP_PEER: setup_peer(imsg.hdr.peerid, imsg.hdr.pid, imsg_get_fd(&imsg)); break; case IMSG_SETUP_DONE: setup = 0; break; default: fatal("bad imsg %d", imsg.hdr.type); } imsg_free(&imsg); } if (imsg_compose(ibuf, IMSG_SETUP_DONE, 0, 0, -1, NULL, 0) == -1) fatal("imsg_compose"); if (imsgbuf_flush(ibuf) == -1) fatal("imsgbuf_flush"); log_debug("setup_proc: %s done", proc_title(smtpd_process)); } static struct mproc * setup_peer(enum smtp_proc_type proc, pid_t pid, int sock) { struct mproc *p, **pp; log_debug("setup_peer: %s -> %s[%u] fd=%d", proc_title(smtpd_process), proc_title(proc), pid, sock); if (sock == -1) fatalx("peer socket not received"); switch (proc) { case PROC_LKA: pp = &p_lka; break; case PROC_QUEUE: pp = &p_queue; break; case PROC_CONTROL: pp = &p_control; break; case PROC_SCHEDULER: pp = &p_scheduler; break; case PROC_DISPATCHER: pp = &p_dispatcher; break; case PROC_CA: pp = &p_ca; break; default: fatalx("unknown peer"); } if (*pp) fatalx("peer already set"); p = calloc(1, sizeof(*p)); if (p == NULL) fatal("calloc"); if((p->name = strdup(proc_title(proc))) == NULL) fatal("strdup"); mproc_init(p, sock); p->pid = pid; p->proc = proc; p->handler = imsg_dispatch; *pp = p; return p; } static int imsg_wait(struct imsgbuf *ibuf, struct imsg *imsg, int timeout) { struct pollfd pfd[1]; ssize_t n; pfd[0].fd = ibuf->fd; pfd[0].events = POLLIN; while (1) { if ((n = imsg_get(ibuf, imsg)) == -1) return -1; if (n) return 1; n = poll(pfd, 1, timeout); if (n == -1) return -1; if (n == 0) { errno = ETIMEDOUT; return -1; } if (imsgbuf_read(ibuf) != 1) return -1; } } int smtpd(void) { struct event ev_sigint; struct event ev_sigterm; struct event ev_sigchld; struct event ev_sighup; struct timeval tv; imsg_callback = parent_imsg; tree_init(&children); child_add(p_queue->pid, CHILD_DAEMON, proc_title(PROC_QUEUE)); child_add(p_control->pid, CHILD_DAEMON, proc_title(PROC_CONTROL)); child_add(p_lka->pid, CHILD_DAEMON, proc_title(PROC_LKA)); child_add(p_scheduler->pid, CHILD_DAEMON, proc_title(PROC_SCHEDULER)); child_add(p_dispatcher->pid, CHILD_DAEMON, proc_title(PROC_DISPATCHER)); child_add(p_ca->pid, CHILD_DAEMON, proc_title(PROC_CA)); event_init(); signal_set(&ev_sigint, SIGINT, parent_sig_handler, NULL); signal_set(&ev_sigterm, SIGTERM, parent_sig_handler, NULL); signal_set(&ev_sigchld, SIGCHLD, parent_sig_handler, NULL); signal_set(&ev_sighup, SIGHUP, parent_sig_handler, NULL); signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); signal_add(&ev_sigchld, NULL); signal_add(&ev_sighup, NULL); signal(SIGPIPE, SIG_IGN); config_peer(PROC_CONTROL); config_peer(PROC_LKA); config_peer(PROC_QUEUE); config_peer(PROC_CA); config_peer(PROC_DISPATCHER); evtimer_set(&config_ev, parent_send_config, NULL); memset(&tv, 0, sizeof(tv)); evtimer_add(&config_ev, &tv); /* defer offline scanning for a second */ evtimer_set(&offline_ev, offline_scan, NULL); offline_timeout.tv_sec = 1; offline_timeout.tv_usec = 0; evtimer_add(&offline_ev, &offline_timeout); if (pidfile(NULL) < 0) err(1, "pidfile"); fork_filter_processes(); purge_task(); #if HAVE_PLEDGE if (pledge("stdio rpath wpath cpath fattr tmppath " "getpw sendfd proc exec id inet chown unix", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } static void load_pki_tree(void) { struct pki *pki; struct ca *sca; const char *k; void *iter_dict; log_debug("debug: init ssl-tree"); iter_dict = NULL; while (dict_iter(env->sc_pki_dict, &iter_dict, &k, (void **)&pki)) { log_debug("info: loading pki information for %s", k); if (pki->pki_cert_file == NULL) fatalx("load_pki_tree: missing certificate file"); if (pki->pki_key_file == NULL) fatalx("load_pki_tree: missing key file"); if (!ssl_load_certificate(pki, pki->pki_cert_file)) fatalx("load_pki_tree: failed to load certificate file"); } log_debug("debug: init ca-tree"); iter_dict = NULL; while (dict_iter(env->sc_ca_dict, &iter_dict, &k, (void **)&sca)) { log_debug("info: loading CA information for %s", k); if (!ssl_load_cafile(sca, sca->ca_cert_file)) fatalx("load_pki_tree: failed to load CA file"); } } void load_pki_keys(void) { struct pki *pki; const char *k; void *iter_dict; log_debug("debug: init ssl-tree"); iter_dict = NULL; while (dict_iter(env->sc_pki_dict, &iter_dict, &k, (void **)&pki)) { log_debug("info: loading pki keys for %s", k); if (!ssl_load_keyfile(pki, pki->pki_key_file, k)) fatalx("load_pki_keys: failed to load key file"); } } int fork_proc_backend(const char *key, const char *conf, const char *procname, int do_stdout) { pid_t pid; int sp[2]; char path[PATH_MAX]; char name[PATH_MAX]; char *arg; if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) { log_warnx("warn: %s-proc: conf too long", key); return (-1); } arg = strchr(name, ':'); if (arg) *arg++ = '\0'; if (snprintf(path, sizeof(path), PATH_LIBEXEC "/%s-%s", key, name) >= (ssize_t)sizeof(path)) { log_warn("warn: %s-proc: exec path too long", key); return (-1); } if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { log_warn("warn: %s-proc: socketpair", key); return (-1); } if ((pid = fork()) == -1) { log_warn("warn: %s-proc: fork", key); close(sp[0]); close(sp[1]); return (-1); } if (pid == 0) { /* child process */ dup2(sp[0], STDIN_FILENO); if (do_stdout) dup2(sp[0], STDOUT_FILENO); closefrom(STDERR_FILENO + 1); if (procname == NULL) procname = name; execl(path, procname, arg, (char *)NULL); fatal("execl: %s", path); } /* parent process */ close(sp[0]); return (sp[1]); } struct child * child_add(pid_t pid, int type, const char *title) { struct child *child; if ((child = calloc(1, sizeof(*child))) == NULL) fatal("smtpd: child_add: calloc"); child->pid = pid; child->type = type; child->title = title; tree_xset(&children, pid, child); return (child); } static void purge_task(void) { struct passwd *pw; DIR *d; int n; uid_t uid; gid_t gid; n = 0; if ((d = opendir(PATH_SPOOL PATH_PURGE))) { while (readdir(d) != NULL) n++; closedir(d); } else log_warn("warn: purge_task: opendir"); if (n > 2) { switch (purge_pid = fork()) { case -1: log_warn("warn: purge_task: fork"); break; case 0: if ((pw = getpwnam(SMTPD_QUEUE_USER)) == NULL) fatalx("unknown user " SMTPD_QUEUE_USER); if (chroot(PATH_SPOOL PATH_PURGE) == -1) fatal("smtpd: chroot"); if (chdir("/") == -1) fatal("smtpd: chdir"); uid = pw->pw_uid; gid = pw->pw_gid; if (setgroups(1, &gid) || setresgid(gid, gid, gid) || setresuid(uid, uid, uid)) fatal("smtpd: cannot drop privileges"); rmtree("/", 1); _exit(0); break; default: break; } } } static void fork_filter_processes(void) { const char *name; void *iter; const char *fn; struct filter_config *fc; struct filter_config *fcs; struct filter_proc *fp; size_t i; /* For each filter chain, assign the registered subsystem to subfilters */ iter = NULL; while (dict_iter(env->sc_filters_dict, &iter, (const char **)&fn, (void **)&fc)) { if (fc->chain) { for (i = 0; i < fc->chain_size; ++i) { fcs = dict_xget(env->sc_filters_dict, fc->chain[i]); fcs->filter_subsystem |= fc->filter_subsystem; } } } /* For each filter, assign the registered subsystem to underlying proc */ iter = NULL; while (dict_iter(env->sc_filters_dict, &iter, (const char **)&fn, (void **)&fc)) { if (fc->proc) { fp = dict_xget(env->sc_filter_processes_dict, fc->proc); fp->filter_subsystem |= fc->filter_subsystem; } } iter = NULL; while (dict_iter(env->sc_filter_processes_dict, &iter, &name, (void **)&fp)) fork_filter_process(name, fp->command, fp->user, fp->group, fp->chroot, fp->filter_subsystem); } static void fork_filter_process(const char *name, const char *command, const char *user, const char *group, const char *chroot_path, uint32_t subsystems) { pid_t pid; struct filter_proc *processor; char buf; int sp[2], errfd[2]; struct passwd *pw; struct group *gr; char exec[_POSIX_ARG_MAX]; int execr; if (user == NULL) user = SMTPD_USER; if ((pw = getpwnam(user)) == NULL) fatal("getpwnam"); if (group) { if ((gr = getgrnam(group)) == NULL) fatal("getgrnam"); } else { if ((gr = getgrgid(pw->pw_gid)) == NULL) fatal("getgrgid"); } if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) fatal("socketpair"); if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, errfd) == -1) fatal("socketpair"); if ((pid = fork()) == -1) fatal("fork"); /* parent passes the child fd over to lka */ if (pid > 0) { processor = dict_xget(env->sc_filter_processes_dict, name); processor->errfd = errfd[1]; child_add(pid, CHILD_PROCESSOR, name); close(sp[0]); close(errfd[0]); m_create(p_lka, IMSG_LKA_PROCESSOR_FORK, 0, 0, sp[1]); m_add_string(p_lka, name); m_add_u32(p_lka, (uint32_t)subsystems); m_close(p_lka); return; } close(sp[1]); close(errfd[1]); dup2(sp[0], STDIN_FILENO); dup2(sp[0], STDOUT_FILENO); dup2(errfd[0], STDERR_FILENO); if (chroot_path) { if (chroot(chroot_path) != 0 || chdir("/") != 0) fatal("chroot: %s", chroot_path); } if (setgroups(1, &gr->gr_gid) || setresgid(gr->gr_gid, gr->gr_gid, gr->gr_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("fork_filter_process: cannot drop privileges"); xclosefrom(STDERR_FILENO + 1); if (setsid() == -1) fatal("setsid"); if (signal(SIGPIPE, SIG_DFL) == SIG_ERR || signal(SIGINT, SIG_DFL) == SIG_ERR || signal(SIGTERM, SIG_DFL) == SIG_ERR || signal(SIGCHLD, SIG_DFL) == SIG_ERR || signal(SIGHUP, SIG_DFL) == SIG_ERR) fatal("signal"); if (command[0] == '/') execr = snprintf(exec, sizeof(exec), "exec %s", command); else execr = snprintf(exec, sizeof(exec), "exec %s/%s", PATH_LIBEXEC, command); if (execr >= (int) sizeof(exec)) fatalx("%s: exec path too long", name); /* * Wait for lka to acknowledge that it received the fd. * This prevents a race condition between the filter sending an error * message, and exiting and lka not being able to log it because of * SIGCHLD. * (Ab)use read to determine if the fd is installed; since stderr is * never going to be read from we can shutdown(2) the write-end in lka. */ if (read(STDERR_FILENO, &buf, 1) != 0) fatalx("lka didn't properly close write end of error socket"); if (system(exec) == -1) fatal("system"); /* there's no successful exit from a processor */ _exit(1); } static void forkmda(struct mproc *p, uint64_t id, struct deliver *deliver) { char ebuf[128], sfn[32]; struct dispatcher *dsp; struct child *child; pid_t pid; int allout, pipefd[2]; struct passwd *pw; const char *pw_name; uid_t pw_uid; gid_t pw_gid; const char *pw_dir; dsp = dict_xget(env->sc_dispatchers, deliver->dispatcher); if (dsp->type != DISPATCHER_LOCAL) fatalx("non-local dispatcher called from forkmda()"); log_debug("debug: smtpd: forking mda for session %016"PRIx64 ": %s as %s", id, deliver->userinfo.username, dsp->u.local.user ? dsp->u.local.user : deliver->userinfo.username); if (dsp->u.local.user) { if ((pw = getpwnam(dsp->u.local.user)) == NULL) { (void)snprintf(ebuf, sizeof ebuf, "delivery user '%s' does not exist", dsp->u.local.user); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, -1); m_add_id(p_dispatcher, id); m_add_int(p_dispatcher, MDA_PERMFAIL); m_add_int(p_dispatcher, EX_NOUSER); m_add_string(p_dispatcher, ebuf); m_close(p_dispatcher); return; } pw_name = pw->pw_name; pw_uid = pw->pw_uid; pw_gid = pw->pw_gid; pw_dir = pw->pw_dir; } else { pw_name = deliver->userinfo.username; pw_uid = deliver->userinfo.uid; pw_gid = deliver->userinfo.gid; pw_dir = deliver->userinfo.directory; } if (pw_uid == 0 && (!dsp->u.local.is_mbox || deliver->mda_exec[0])) { (void)snprintf(ebuf, sizeof ebuf, "MDA not allowed to deliver to: %s", deliver->userinfo.username); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, -1); m_add_id(p_dispatcher, id); m_add_int(p_dispatcher, MDA_PERMFAIL); m_add_int(p_dispatcher, EX_NOPERM); m_add_string(p_dispatcher, ebuf); m_close(p_dispatcher); return; } if (dsp->u.local.is_mbox && dsp->u.local.command != NULL) fatalx("serious memory corruption in privileged process"); if (pipe(pipefd) == -1) { (void)snprintf(ebuf, sizeof ebuf, "pipe: %s", strerror(errno)); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, -1); m_add_id(p_dispatcher, id); m_add_int(p_dispatcher, MDA_TEMPFAIL); m_add_int(p_dispatcher, EX_OSERR); m_add_string(p_dispatcher, ebuf); m_close(p_dispatcher); return; } /* prepare file which captures stdout and stderr */ (void)strlcpy(sfn, "/tmp/smtpd.out.XXXXXXXXXXX", sizeof(sfn)); allout = mkstemp(sfn); if (allout == -1) { (void)snprintf(ebuf, sizeof ebuf, "mkstemp: %s", strerror(errno)); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, -1); m_add_id(p_dispatcher, id); m_add_int(p_dispatcher, MDA_TEMPFAIL); m_add_int(p_dispatcher, EX_OSERR); m_add_string(p_dispatcher, ebuf); m_close(p_dispatcher); close(pipefd[0]); close(pipefd[1]); return; } unlink(sfn); pid = fork(); if (pid == -1) { (void)snprintf(ebuf, sizeof ebuf, "fork: %s", strerror(errno)); m_create(p_dispatcher, IMSG_MDA_DONE, 0, 0, -1); m_add_id(p_dispatcher, id); m_add_int(p_dispatcher, MDA_TEMPFAIL); m_add_int(p_dispatcher, EX_OSERR); m_add_string(p_dispatcher, ebuf); m_close(p_dispatcher); close(pipefd[0]); close(pipefd[1]); close(allout); return; } /* parent passes the child fd over to mda */ if (pid > 0) { child = child_add(pid, CHILD_MDA, NULL); child->mda_out = allout; child->mda_id = id; close(pipefd[0]); m_create(p, IMSG_MDA_FORK, 0, 0, pipefd[1]); m_add_id(p, id); m_close(p); return; } /* mbox helper, create mailbox before privdrop if it doesn't exist */ if (dsp->u.local.is_mbox) mda_mbox_init(deliver); if (chdir(pw_dir) == -1 && chdir("/") == -1) fatal("chdir"); if (setgroups(1, &pw_gid) || setresgid(pw_gid, pw_gid, pw_gid) || setresuid(pw_uid, pw_uid, pw_uid)) fatal("forkmda: cannot drop privileges"); if (dup2(pipefd[0], STDIN_FILENO) == -1 || dup2(allout, STDOUT_FILENO) == -1 || dup2(allout, STDERR_FILENO) == -1) fatal("forkmda: dup2"); closefrom(STDERR_FILENO + 1); if (setsid() == -1) fatal("setsid"); if (signal(SIGPIPE, SIG_DFL) == SIG_ERR || signal(SIGINT, SIG_DFL) == SIG_ERR || signal(SIGTERM, SIG_DFL) == SIG_ERR || signal(SIGCHLD, SIG_DFL) == SIG_ERR || signal(SIGHUP, SIG_DFL) == SIG_ERR) fatal("signal"); /* avoid hangs by setting 5m timeout */ alarm(300); if (dsp->u.local.is_mbox && dsp->u.local.mda_wrapper == NULL && deliver->mda_exec[0] == '\0') mda_mbox(deliver); else mda_unpriv(dsp, deliver, pw_name, pw_dir); } static void offline_scan(int fd, short ev, void *arg) { char *path_argv[2]; FTS *fts = arg; FTSENT *e; int n = 0; path_argv[0] = PATH_SPOOL PATH_OFFLINE; path_argv[1] = NULL; if (fts == NULL) { log_debug("debug: smtpd: scanning offline queue..."); fts = fts_open(path_argv, FTS_PHYSICAL | FTS_NOCHDIR, NULL); if (fts == NULL) { log_warn("fts_open: %s", path_argv[0]); return; } } while ((e = fts_read(fts)) != NULL) { if (e->fts_info != FTS_F) continue; /* offline files must be at depth 1 */ if (e->fts_level != 1) continue; /* offline file group must match parent directory group */ if (e->fts_statp->st_gid != e->fts_parent->fts_statp->st_gid) continue; if (e->fts_statp->st_size == 0) { if (unlink(e->fts_accpath) == -1) log_warnx("warn: smtpd: could not unlink %s", e->fts_accpath); continue; } if (offline_add(e->fts_name, e->fts_statp->st_uid, e->fts_statp->st_gid)) { log_warnx("warn: smtpd: " "could not add offline message %s", e->fts_name); continue; } if ((n++) == OFFLINE_READMAX) { evtimer_set(&offline_ev, offline_scan, fts); offline_timeout.tv_sec = 0; offline_timeout.tv_usec = 100000; evtimer_add(&offline_ev, &offline_timeout); return; } } log_debug("debug: smtpd: offline scanning done"); fts_close(fts); } static int offline_enqueue(char *name, uid_t uid, gid_t gid) { char *path; struct stat sb; pid_t pid; struct child *child; struct passwd *pw; int pathlen; pathlen = asprintf(&path, "%s/%s", PATH_SPOOL PATH_OFFLINE, name); if (pathlen == -1) { log_warnx("warn: smtpd: asprintf"); return (-1); } if (pathlen >= PATH_MAX) { log_warnx("warn: smtpd: pathname exceeds PATH_MAX"); free(path); return (-1); } log_debug("debug: smtpd: enqueueing offline message %s", path); if ((pid = fork()) == -1) { log_warn("warn: smtpd: fork"); free(path); return (-1); } if (pid == 0) { char *envp[2], *p = NULL, *tmp; int fd; FILE *fp; size_t sz = 0; ssize_t len; arglist args; closefrom(STDERR_FILENO + 1); memset(&args, 0, sizeof(args)); if ((fd = open(path, O_RDONLY|O_NOFOLLOW|O_NONBLOCK)) == -1) { log_warn("warn: smtpd: open: %s", path); _exit(1); } if (fstat(fd, &sb) == -1) { log_warn("warn: smtpd: fstat: %s", path); _exit(1); } if (!S_ISREG(sb.st_mode)) { log_warnx("warn: smtpd: file %s (uid %d) not regular", path, sb.st_uid); _exit(1); } if (sb.st_nlink != 1) { log_warnx("warn: smtpd: file %s is hard-link", path); _exit(1); } if (sb.st_uid != uid) { log_warnx("warn: smtpd: file %s has bad uid %d", path, sb.st_uid); _exit(1); } if (sb.st_gid != gid) { log_warnx("warn: smtpd: file %s has bad gid %d", path, sb.st_gid); _exit(1); } pw = getpwuid(sb.st_uid); if (pw == NULL) { log_warnx("warn: smtpd: getpwuid for uid %d failed", sb.st_uid); _exit(1); } if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) _exit(1); if ((fp = fdopen(fd, "r")) == NULL) _exit(1); if (chdir(pw->pw_dir) == -1 && chdir("/") == -1) _exit(1); if (setsid() == -1 || signal(SIGPIPE, SIG_DFL) == SIG_ERR || dup2(fileno(fp), STDIN_FILENO) == -1) _exit(1); if ((len = getline(&p, &sz, fp)) == -1) _exit(1); if (p[len - 1] != '\n') _exit(1); p[len - 1] = '\0'; addargs(&args, "%s", "sendmail"); addargs(&args, "%s", "-S"); while ((tmp = strsep(&p, "|")) != NULL) addargs(&args, "%s", tmp); free(p); if (lseek(fileno(fp), len, SEEK_SET) == -1) _exit(1); envp[0] = "PATH=" _PATH_DEFPATH; envp[1] = (char *)NULL; environ = envp; execvp(PATH_SMTPCTL, args.list); _exit(1); } offline_running++; child = child_add(pid, CHILD_ENQUEUE_OFFLINE, NULL); child->path = path; return (0); } static int offline_add(char *path, uid_t uid, gid_t gid) { struct offline *q; if (offline_running < OFFLINE_QUEUEMAX) /* skip queue */ return offline_enqueue(path, uid, gid); q = malloc(sizeof(*q) + strlen(path) + 1); if (q == NULL) return (-1); q->uid = uid; q->gid = gid; q->path = (char *)q + sizeof(*q); memmove(q->path, path, strlen(path) + 1); TAILQ_INSERT_TAIL(&offline_q, q, entry); return (0); } static void offline_done(void) { struct offline *q; offline_running--; while (offline_running < OFFLINE_QUEUEMAX) { if ((q = TAILQ_FIRST(&offline_q)) == NULL) break; /* all done */ TAILQ_REMOVE(&offline_q, q, entry); offline_enqueue(q->path, q->uid, q->gid); free(q); } } static int parent_forward_open(char *username, char *directory, uid_t uid, gid_t gid) { char pathname[PATH_MAX]; int fd; struct stat sb; if (!bsnprintf(pathname, sizeof (pathname), "%s/.forward", directory)) { log_warnx("warn: smtpd: %s: pathname too large", pathname); return -1; } if (stat(directory, &sb) == -1) { log_warn("warn: smtpd: parent_forward_open: %s", directory); return -1; } if (sb.st_mode & S_ISVTX) { log_warnx("warn: smtpd: parent_forward_open: %s is sticky", directory); errno = EAGAIN; return -1; } do { fd = open(pathname, O_RDONLY|O_NOFOLLOW|O_NONBLOCK); } while (fd == -1 && errno == EINTR); if (fd == -1) { if (errno == ENOENT) return -1; if (errno == EMFILE || errno == ENFILE || errno == EIO) { errno = EAGAIN; return -1; } if (errno == ELOOP) log_warnx("warn: smtpd: parent_forward_open: %s: " "cannot follow symbolic links", pathname); else log_warn("warn: smtpd: parent_forward_open: %s", pathname); return -1; } if (!secure_file(fd, pathname, directory, uid, 1)) { log_warnx("warn: smtpd: %s: insecure file", pathname); close(fd); return -1; } return fd; } void imsg_dispatch(struct mproc *p, struct imsg *imsg) { struct timespec t0, t1, dt; int msg; if (imsg == NULL) { imsg_callback(p, imsg); return; } log_imsg(smtpd_process, p->proc, imsg); if (profiling & PROFILE_IMSG) clock_gettime(CLOCK_MONOTONIC, &t0); msg = imsg->hdr.type; imsg_callback(p, imsg); if (profiling & PROFILE_IMSG) { clock_gettime(CLOCK_MONOTONIC, &t1); timespecsub(&t1, &t0, &dt); log_debug("profile-imsg: %s %s %s %d %lld.%09ld", proc_name(smtpd_process), proc_name(p->proc), imsg_to_str(msg), (int)imsg->hdr.len, (long long)dt.tv_sec, dt.tv_nsec); if (profiling & PROFILE_TOSTAT) { char key[STAT_KEY_SIZE]; /* can't profstat control process yet */ if (smtpd_process == PROC_CONTROL) return; if (!bsnprintf(key, sizeof key, "profiling.imsg.%s.%s.%s", proc_name(smtpd_process), proc_name(p->proc), imsg_to_str(msg))) return; stat_set(key, stat_timespec(&dt)); } } } void log_imsg(int to, int from, struct imsg *imsg) { if (to == PROC_CONTROL && imsg->hdr.type == IMSG_STAT_SET) return; log_trace(TRACE_IMSG, "imsg: %s <- %s: %s (len=%zu)", proc_name(to), proc_name(from), imsg_to_str(imsg->hdr.type), imsg->hdr.len - IMSG_HEADER_SIZE); } const char * proc_title(enum smtp_proc_type proc) { switch (proc) { case PROC_PARENT: return "[priv]"; case PROC_LKA: return "lookup"; case PROC_QUEUE: return "queue"; case PROC_CONTROL: return "control"; case PROC_SCHEDULER: return "scheduler"; case PROC_DISPATCHER: return "dispatcher"; case PROC_CA: return "crypto"; case PROC_CLIENT: return "client"; case PROC_PROCESSOR: return "processor"; } return "unknown"; } const char * proc_name(enum smtp_proc_type proc) { switch (proc) { case PROC_PARENT: return "parent"; case PROC_LKA: return "lka"; case PROC_QUEUE: return "queue"; case PROC_CONTROL: return "control"; case PROC_SCHEDULER: return "scheduler"; case PROC_DISPATCHER: return "dispatcher"; case PROC_CA: return "ca"; case PROC_CLIENT: return "client-proc"; default: return "unknown"; } } #define CASE(x) case x : return #x const char * imsg_to_str(int type) { static char buf[32]; switch (type) { CASE(IMSG_NONE); CASE(IMSG_CTL_OK); CASE(IMSG_CTL_FAIL); CASE(IMSG_CTL_GET_DIGEST); CASE(IMSG_CTL_GET_STATS); CASE(IMSG_CTL_LIST_MESSAGES); CASE(IMSG_CTL_LIST_ENVELOPES); CASE(IMSG_CTL_MTA_SHOW_HOSTS); CASE(IMSG_CTL_MTA_SHOW_RELAYS); CASE(IMSG_CTL_MTA_SHOW_ROUTES); CASE(IMSG_CTL_MTA_SHOW_HOSTSTATS); CASE(IMSG_CTL_MTA_BLOCK); CASE(IMSG_CTL_MTA_UNBLOCK); CASE(IMSG_CTL_MTA_SHOW_BLOCK); CASE(IMSG_CTL_PAUSE_EVP); CASE(IMSG_CTL_PAUSE_MDA); CASE(IMSG_CTL_PAUSE_MTA); CASE(IMSG_CTL_PAUSE_SMTP); CASE(IMSG_CTL_PROFILE); CASE(IMSG_CTL_PROFILE_DISABLE); CASE(IMSG_CTL_PROFILE_ENABLE); CASE(IMSG_CTL_RESUME_EVP); CASE(IMSG_CTL_RESUME_MDA); CASE(IMSG_CTL_RESUME_MTA); CASE(IMSG_CTL_RESUME_SMTP); CASE(IMSG_CTL_RESUME_ROUTE); CASE(IMSG_CTL_REMOVE); CASE(IMSG_CTL_SCHEDULE); CASE(IMSG_CTL_SHOW_STATUS); CASE(IMSG_CTL_TRACE_DISABLE); CASE(IMSG_CTL_TRACE_ENABLE); CASE(IMSG_CTL_UPDATE_TABLE); CASE(IMSG_CTL_VERBOSE); CASE(IMSG_CTL_DISCOVER_EVPID); CASE(IMSG_CTL_DISCOVER_MSGID); CASE(IMSG_CTL_SMTP_SESSION); CASE(IMSG_GETADDRINFO); CASE(IMSG_GETADDRINFO_END); CASE(IMSG_GETNAMEINFO); CASE(IMSG_RES_QUERY); CASE(IMSG_SETUP_KEY); CASE(IMSG_SETUP_PEER); CASE(IMSG_SETUP_DONE); CASE(IMSG_CONF_START); CASE(IMSG_CONF_END); CASE(IMSG_STAT_INCREMENT); CASE(IMSG_STAT_DECREMENT); CASE(IMSG_STAT_SET); CASE(IMSG_LKA_AUTHENTICATE); CASE(IMSG_LKA_OPEN_FORWARD); CASE(IMSG_LKA_ENVELOPE_SUBMIT); CASE(IMSG_LKA_ENVELOPE_COMMIT); CASE(IMSG_QUEUE_DELIVER); CASE(IMSG_QUEUE_DELIVERY_OK); CASE(IMSG_QUEUE_DELIVERY_TEMPFAIL); CASE(IMSG_QUEUE_DELIVERY_PERMFAIL); CASE(IMSG_QUEUE_DELIVERY_LOOP); CASE(IMSG_QUEUE_DISCOVER_EVPID); CASE(IMSG_QUEUE_DISCOVER_MSGID); CASE(IMSG_QUEUE_ENVELOPE_ACK); CASE(IMSG_QUEUE_ENVELOPE_COMMIT); CASE(IMSG_QUEUE_ENVELOPE_REMOVE); CASE(IMSG_QUEUE_ENVELOPE_SCHEDULE); CASE(IMSG_QUEUE_ENVELOPE_SUBMIT); CASE(IMSG_QUEUE_HOLDQ_HOLD); CASE(IMSG_QUEUE_HOLDQ_RELEASE); CASE(IMSG_QUEUE_MESSAGE_COMMIT); CASE(IMSG_QUEUE_MESSAGE_ROLLBACK); CASE(IMSG_QUEUE_SMTP_SESSION); CASE(IMSG_QUEUE_TRANSFER); CASE(IMSG_MDA_DELIVERY_OK); CASE(IMSG_MDA_DELIVERY_TEMPFAIL); CASE(IMSG_MDA_DELIVERY_PERMFAIL); CASE(IMSG_MDA_DELIVERY_LOOP); CASE(IMSG_MDA_DELIVERY_HOLD); CASE(IMSG_MDA_DONE); CASE(IMSG_MDA_FORK); CASE(IMSG_MDA_HOLDQ_RELEASE); CASE(IMSG_MDA_LOOKUP_USERINFO); CASE(IMSG_MDA_KILL); CASE(IMSG_MDA_OPEN_MESSAGE); CASE(IMSG_MTA_DELIVERY_OK); CASE(IMSG_MTA_DELIVERY_TEMPFAIL); CASE(IMSG_MTA_DELIVERY_PERMFAIL); CASE(IMSG_MTA_DELIVERY_LOOP); CASE(IMSG_MTA_DELIVERY_HOLD); CASE(IMSG_MTA_DNS_HOST); CASE(IMSG_MTA_DNS_HOST_END); CASE(IMSG_MTA_DNS_MX); CASE(IMSG_MTA_DNS_MX_PREFERENCE); CASE(IMSG_MTA_HOLDQ_RELEASE); CASE(IMSG_MTA_LOOKUP_CREDENTIALS); CASE(IMSG_MTA_LOOKUP_SOURCE); CASE(IMSG_MTA_LOOKUP_HELO); CASE(IMSG_MTA_LOOKUP_SMARTHOST); CASE(IMSG_MTA_OPEN_MESSAGE); CASE(IMSG_MTA_SCHEDULE); CASE(IMSG_SCHED_ENVELOPE_BOUNCE); CASE(IMSG_SCHED_ENVELOPE_DELIVER); CASE(IMSG_SCHED_ENVELOPE_EXPIRE); CASE(IMSG_SCHED_ENVELOPE_INJECT); CASE(IMSG_SCHED_ENVELOPE_REMOVE); CASE(IMSG_SCHED_ENVELOPE_TRANSFER); CASE(IMSG_SMTP_AUTHENTICATE); CASE(IMSG_SMTP_MESSAGE_COMMIT); CASE(IMSG_SMTP_MESSAGE_CREATE); CASE(IMSG_SMTP_MESSAGE_ROLLBACK); CASE(IMSG_SMTP_MESSAGE_OPEN); CASE(IMSG_SMTP_CHECK_SENDER); CASE(IMSG_SMTP_EXPAND_RCPT); CASE(IMSG_SMTP_LOOKUP_HELO); CASE(IMSG_SMTP_REQ_CONNECT); CASE(IMSG_SMTP_REQ_HELO); CASE(IMSG_SMTP_REQ_MAIL); CASE(IMSG_SMTP_REQ_RCPT); CASE(IMSG_SMTP_REQ_DATA); CASE(IMSG_SMTP_REQ_EOM); CASE(IMSG_SMTP_EVENT_RSET); CASE(IMSG_SMTP_EVENT_COMMIT); CASE(IMSG_SMTP_EVENT_ROLLBACK); CASE(IMSG_SMTP_EVENT_DISCONNECT); CASE(IMSG_LKA_PROCESSOR_FORK); CASE(IMSG_LKA_PROCESSOR_ERRFD); CASE(IMSG_REPORT_SMTP_LINK_CONNECT); CASE(IMSG_REPORT_SMTP_LINK_DISCONNECT); CASE(IMSG_REPORT_SMTP_LINK_GREETING); CASE(IMSG_REPORT_SMTP_LINK_IDENTIFY); CASE(IMSG_REPORT_SMTP_LINK_TLS); CASE(IMSG_REPORT_SMTP_LINK_AUTH); CASE(IMSG_REPORT_SMTP_TX_RESET); CASE(IMSG_REPORT_SMTP_TX_BEGIN); CASE(IMSG_REPORT_SMTP_TX_MAIL); CASE(IMSG_REPORT_SMTP_TX_RCPT); CASE(IMSG_REPORT_SMTP_TX_ENVELOPE); CASE(IMSG_REPORT_SMTP_TX_DATA); CASE(IMSG_REPORT_SMTP_TX_COMMIT); CASE(IMSG_REPORT_SMTP_TX_ROLLBACK); CASE(IMSG_REPORT_SMTP_PROTOCOL_CLIENT); CASE(IMSG_REPORT_SMTP_PROTOCOL_SERVER); CASE(IMSG_REPORT_SMTP_FILTER_RESPONSE); CASE(IMSG_REPORT_SMTP_TIMEOUT); CASE(IMSG_FILTER_SMTP_BEGIN); CASE(IMSG_FILTER_SMTP_END); CASE(IMSG_FILTER_SMTP_PROTOCOL); CASE(IMSG_FILTER_SMTP_DATA_BEGIN); CASE(IMSG_FILTER_SMTP_DATA_END); CASE(IMSG_CA_RSA_PRIVENC); CASE(IMSG_CA_RSA_PRIVDEC); CASE(IMSG_CA_ECDSA_SIGN); default: (void)snprintf(buf, sizeof(buf), "IMSG_??? (%d)", type); return buf; } } #ifdef BSD_AUTH int parent_auth_bsd(const char *username, const char *password) { char user[LOGIN_NAME_MAX]; char pass[LINE_MAX]; int ret; (void)strlcpy(user, username, sizeof(user)); (void)strlcpy(pass, password, sizeof(pass)); ret = auth_userokay(user, NULL, "auth-smtp", pass); if (ret) return LKA_OK; return LKA_PERMFAIL; } #endif #ifdef USE_PAM int pam_conv_password(int num_msg, const struct pam_message **msg, struct pam_response **respp, void *password) { struct pam_response *response; if (num_msg != 1) return PAM_CONV_ERR; response = calloc(1, sizeof(struct pam_response)); if (response == NULL || (response->resp = strdup(password)) == NULL) { free(response); return PAM_BUF_ERR; } *respp = response; return PAM_SUCCESS; } int parent_auth_pam(const char *username, const char *password) { int rc; pam_handle_t *pamh = NULL; struct pam_conv conv = { pam_conv_password, (char *)password }; if ((rc = pam_start(USE_PAM_SERVICE, username, &conv, &pamh)) != PAM_SUCCESS) goto end; if ((rc = pam_authenticate(pamh, 0)) != PAM_SUCCESS) goto end; if ((rc = pam_acct_mgmt(pamh, 0)) != PAM_SUCCESS) goto end; end: pam_end(pamh, rc); switch (rc) { case PAM_SUCCESS: return LKA_OK; case PAM_SYSTEM_ERR: case PAM_ABORT: case PAM_AUTHINFO_UNAVAIL: return LKA_TEMPFAIL; default: return LKA_PERMFAIL; } } #endif #ifdef HAVE_GETSPNAM int parent_auth_getspnam(const char *username, const char *password) { struct spwd *pw; char *ep; errno = 0; do { pw = getspnam(username); } while (pw == NULL && errno == EINTR); if (pw == NULL) { if (errno) return LKA_TEMPFAIL; return LKA_PERMFAIL; } if ((ep = crypt(password, pw->sp_pwdp)) == NULL) return LKA_PERMFAIL; if (strcmp(pw->sp_pwdp, ep) == 0) return LKA_OK; return LKA_PERMFAIL; } #endif int parent_auth_pwd(const char *username, const char *password) { struct passwd *pw; char *ep; errno = 0; do { pw = getpwnam(username); } while (pw == NULL && errno == EINTR); if (pw == NULL) { if (errno) return LKA_TEMPFAIL; return LKA_PERMFAIL; } if ((ep = crypt(password, pw->pw_passwd)) == NULL) return LKA_PERMFAIL; if (strcmp(pw->pw_passwd, ep) == 0) return LKA_OK; return LKA_PERMFAIL; } int parent_auth_user(const char *username, const char *password) { #if defined(BSD_AUTH) return (parent_auth_bsd(username, password)); #elif defined(USE_PAM) return (parent_auth_pam(username, password)); #elif defined(HAVE_GETSPNAM) return (parent_auth_getspnam(username, password)); #else return (parent_auth_pwd(username, password)); #endif } opensmtpd-7.7.0p0/usr.sbin/smtpd/ssl.h0000644000175000001440000000262014610663500013320 /* $OpenBSD: ssl.h,v 1.27 2023/06/25 08:08:03 op Exp $ */ /* * Copyright (c) 2013 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ struct pki { char pki_name[HOST_NAME_MAX+1]; char *pki_cert_file; char *pki_cert; off_t pki_cert_len; char *pki_key_file; char *pki_key; off_t pki_key_len; int pki_dhe; }; struct ca { char ca_name[HOST_NAME_MAX+1]; char *ca_cert_file; char *ca_cert; off_t ca_cert_len; }; /* ssl.c */ void ssl_error(const char *); int ssl_load_certificate(struct pki *, const char *); int ssl_load_keyfile(struct pki *, const char *, const char *); int ssl_load_cafile(struct ca *, const char *); char *ssl_pubkey_hash(const char *, off_t); opensmtpd-7.7.0p0/usr.sbin/smtpd/smtp_client.c0000644000175000001440000005153014674615567015063 /* $OpenBSD: smtp_client.c,v 1.17 2022/12/28 21:30:18 jmc Exp $ */ /* * Copyright (c) 2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "log.h" #include "ioev.h" #include "smtp.h" #define TRACE_SMTPCLT 2 #define TRACE_IO 3 enum { STATE_INIT = 0, STATE_BANNER, STATE_EHLO, STATE_HELO, STATE_LHLO, STATE_STARTTLS, STATE_AUTH, STATE_AUTH_PLAIN, STATE_AUTH_LOGIN, STATE_AUTH_LOGIN_USER, STATE_AUTH_LOGIN_PASS, STATE_READY, STATE_MAIL, STATE_RCPT, STATE_DATA, STATE_BODY, STATE_EOM, STATE_RSET, STATE_QUIT, STATE_LAST }; #define base64_encode __b64_ntop #define base64_decode __b64_pton #define FLAG_TLS 0x01 #define FLAG_TLS_VERIFIED 0x02 #define SMTP_EXT_STARTTLS 0x01 #define SMTP_EXT_PIPELINING 0x02 #define SMTP_EXT_AUTH 0x04 #define SMTP_EXT_AUTH_PLAIN 0x08 #define SMTP_EXT_AUTH_LOGIN 0x10 #define SMTP_EXT_DSN 0x20 #define SMTP_EXT_SIZE 0x40 struct smtp_client { void *tag; struct smtp_params params; int state; int flags; int ext; size_t ext_size; struct io *io; char *reply; size_t replysz; struct smtp_mail *mail; int rcptidx; int rcptok; }; void log_trace_verbose(int); void log_trace(int, const char *, ...) __attribute__((format (printf, 2, 3))); static void smtp_client_io(struct io *, int, void *); static void smtp_client_free(struct smtp_client *); static void smtp_client_state(struct smtp_client *, int); static void smtp_client_abort(struct smtp_client *, int, const char *); static void smtp_client_cancel(struct smtp_client *, int, const char *); static void smtp_client_sendcmd(struct smtp_client *, char *, ...); static void smtp_client_sendbody(struct smtp_client *); static int smtp_client_readline(struct smtp_client *); static int smtp_client_replycat(struct smtp_client *, const char *); static void smtp_client_response(struct smtp_client *, const char *); static void smtp_client_mail_abort(struct smtp_client *); static void smtp_client_mail_status(struct smtp_client *, const char *); static void smtp_client_rcpt_status(struct smtp_client *, struct smtp_rcpt *, const char *); static const char *strstate[STATE_LAST] = { "INIT", "BANNER", "EHLO", "HELO", "LHLO", "STARTTLS", "AUTH", "AUTH_PLAIN", "AUTH_LOGIN", "AUTH_LOGIN_USER", "AUTH_LOGIN_PASS", "READY", "MAIL", "RCPT", "DATA", "BODY", "EOM", "RSET", "QUIT", }; struct smtp_client * smtp_connect(const struct smtp_params *params, void *tag) { struct smtp_client *proto; proto = calloc(1, sizeof *proto); if (proto == NULL) return NULL; memmove(&proto->params, params, sizeof(*params)); proto->tag = tag; proto->io = io_new(); if (proto->io == NULL) { free(proto); return NULL; } io_set_callback(proto->io, smtp_client_io, proto); io_set_timeout(proto->io, proto->params.timeout); if (io_connect(proto->io, proto->params.dst, proto->params.src) == -1) { smtp_client_abort(proto, FAIL_CONN, io_error(proto->io)); return NULL; } return proto; } void smtp_cert_verified(struct smtp_client *proto, int verified) { if (verified == CERT_OK) proto->flags |= FLAG_TLS_VERIFIED; else if (proto->params.tls_verify) { errno = EINVAL; /* EAUTH in base but it's not portable */ smtp_client_abort(proto, FAIL_CONN, "Invalid server certificate"); return; } io_resume(proto->io, IO_IN); if (proto->state == STATE_INIT) smtp_client_state(proto, STATE_BANNER); else { /* Clear extensions before re-issueing an EHLO command. */ proto->ext = 0; smtp_client_state(proto, STATE_EHLO); } } void smtp_set_tls(struct smtp_client *proto, void *ctx) { io_connect_tls(proto->io, ctx, proto->params.tls_servname); } void smtp_quit(struct smtp_client *proto) { if (proto->state != STATE_READY) fatalx("connection is not ready"); smtp_client_state(proto, STATE_QUIT); } void smtp_sendmail(struct smtp_client *proto, struct smtp_mail *mail) { if (proto->state != STATE_READY) fatalx("connection is not ready"); proto->mail = mail; smtp_client_state(proto, STATE_MAIL); } static void smtp_client_free(struct smtp_client *proto) { if (proto->mail) fatalx("current task should have been deleted already"); smtp_closed(proto->tag, proto); if (proto->io) io_free(proto->io); free(proto->reply); free(proto); } /* * End the session immediately. */ static void smtp_client_abort(struct smtp_client *proto, int err, const char *reason) { smtp_failed(proto->tag, proto, err, reason); if (proto->mail) smtp_client_mail_abort(proto); smtp_client_free(proto); } /* * Properly close the session. */ static void smtp_client_cancel(struct smtp_client *proto, int err, const char *reason) { if (proto->mail) fatal("not supposed to have a mail"); smtp_failed(proto->tag, proto, err, reason); smtp_client_state(proto, STATE_QUIT); } static void smtp_client_state(struct smtp_client *proto, int newstate) { struct smtp_rcpt *rcpt; char ibuf[LINE_MAX], obuf[LINE_MAX]; size_t n; int oldstate; if (proto->reply) proto->reply[0] = '\0'; again: oldstate = proto->state; proto->state = newstate; log_trace(TRACE_SMTPCLT, "%p: %s -> %s", proto, strstate[oldstate], strstate[newstate]); /* don't try this at home! */ #define smtp_client_state(_s, _st) do { newstate = _st; goto again; } while (0) switch (proto->state) { case STATE_BANNER: io_set_read(proto->io); break; case STATE_EHLO: smtp_client_sendcmd(proto, "EHLO %s", proto->params.helo); break; case STATE_HELO: smtp_client_sendcmd(proto, "HELO %s", proto->params.helo); break; case STATE_LHLO: smtp_client_sendcmd(proto, "LHLO %s", proto->params.helo); break; case STATE_STARTTLS: if (proto->params.tls_req == TLS_NO || proto->flags & FLAG_TLS) smtp_client_state(proto, STATE_AUTH); else if (proto->ext & SMTP_EXT_STARTTLS) smtp_client_sendcmd(proto, "STARTTLS"); else if (proto->params.tls_req == TLS_FORCE) smtp_client_cancel(proto, FAIL_IMPL, "TLS not supported by remote host"); else smtp_client_state(proto, STATE_AUTH); break; case STATE_AUTH: if (!proto->params.auth_user) smtp_client_state(proto, STATE_READY); else if ((proto->flags & FLAG_TLS) == 0) smtp_client_cancel(proto, FAIL_IMPL, "Authentication requires TLS"); else if ((proto->ext & SMTP_EXT_AUTH) == 0) smtp_client_cancel(proto, FAIL_IMPL, "AUTH not supported by remote host"); else if (proto->ext & SMTP_EXT_AUTH_PLAIN) smtp_client_state(proto, STATE_AUTH_PLAIN); else if (proto->ext & SMTP_EXT_AUTH_LOGIN) smtp_client_state(proto, STATE_AUTH_LOGIN); else smtp_client_cancel(proto, FAIL_IMPL, "No supported AUTH method"); break; case STATE_AUTH_PLAIN: (void)strlcpy(ibuf, "-", sizeof(ibuf)); (void)strlcat(ibuf, proto->params.auth_user, sizeof(ibuf)); if (strlcat(ibuf, ":", sizeof(ibuf)) >= sizeof(ibuf)) { errno = EMSGSIZE; smtp_client_cancel(proto, FAIL_INTERNAL, "credentials too large"); break; } n = strlcat(ibuf, proto->params.auth_pass, sizeof(ibuf)); if (n >= sizeof(ibuf)) { errno = EMSGSIZE; smtp_client_cancel(proto, FAIL_INTERNAL, "credentials too large"); break; } *strchr(ibuf, ':') = '\0'; ibuf[0] = '\0'; if (base64_encode(ibuf, n, obuf, sizeof(obuf)) == -1) { errno = EMSGSIZE; smtp_client_cancel(proto, FAIL_INTERNAL, "credentials too large"); break; } smtp_client_sendcmd(proto, "AUTH PLAIN %s", obuf); explicit_bzero(ibuf, sizeof ibuf); explicit_bzero(obuf, sizeof obuf); break; case STATE_AUTH_LOGIN: smtp_client_sendcmd(proto, "AUTH LOGIN"); break; case STATE_AUTH_LOGIN_USER: if (base64_encode(proto->params.auth_user, strlen(proto->params.auth_user), obuf, sizeof(obuf)) == -1) { errno = EMSGSIZE; smtp_client_cancel(proto, FAIL_INTERNAL, "credentials too large"); break; } smtp_client_sendcmd(proto, "%s", obuf); explicit_bzero(obuf, sizeof obuf); break; case STATE_AUTH_LOGIN_PASS: if (base64_encode(proto->params.auth_pass, strlen(proto->params.auth_pass), obuf, sizeof(obuf)) == -1) { errno = EMSGSIZE; smtp_client_cancel(proto, FAIL_INTERNAL, "credentials too large"); break; } smtp_client_sendcmd(proto, "%s", obuf); explicit_bzero(obuf, sizeof obuf); break; case STATE_READY: smtp_ready(proto->tag, proto); break; case STATE_MAIL: if (proto->ext & SMTP_EXT_DSN) smtp_client_sendcmd(proto, "MAIL FROM:<%s>%s%s%s%s", proto->mail->from, proto->mail->dsn_ret ? " RET=" : "", proto->mail->dsn_ret ? proto->mail->dsn_ret : "", proto->mail->dsn_envid ? " ENVID=" : "", proto->mail->dsn_envid ? proto->mail->dsn_envid : ""); else smtp_client_sendcmd(proto, "MAIL FROM:<%s>", proto->mail->from); break; case STATE_RCPT: if (proto->rcptidx == proto->mail->rcptcount) { smtp_client_state(proto, STATE_DATA); break; } rcpt = &proto->mail->rcpt[proto->rcptidx]; if (proto->ext & SMTP_EXT_DSN) smtp_client_sendcmd(proto, "RCPT TO:<%s>%s%s%s%s", rcpt->to, rcpt->dsn_notify ? " NOTIFY=" : "", rcpt->dsn_notify ? rcpt->dsn_notify : "", rcpt->dsn_orcpt ? " ORCPT=" : "", rcpt->dsn_orcpt ? rcpt->dsn_orcpt : ""); else smtp_client_sendcmd(proto, "RCPT TO:<%s>", rcpt->to); break; case STATE_DATA: if (proto->rcptok == 0) { smtp_client_mail_abort(proto); smtp_client_state(proto, STATE_RSET); } else smtp_client_sendcmd(proto, "DATA"); break; case STATE_BODY: fseek(proto->mail->fp, 0, SEEK_SET); smtp_client_sendbody(proto); break; case STATE_EOM: smtp_client_sendcmd(proto, "."); break; case STATE_RSET: smtp_client_sendcmd(proto, "RSET"); break; case STATE_QUIT: smtp_client_sendcmd(proto, "QUIT"); break; default: fatalx("%s: bad state %d", __func__, proto->state); } #undef smtp_client_state } /* * Handle a response to an SMTP command */ static void smtp_client_response(struct smtp_client *proto, const char *line) { struct smtp_rcpt *rcpt; int i, seen; switch (proto->state) { case STATE_BANNER: if (line[0] != '2') smtp_client_abort(proto, FAIL_RESP, line); else if (proto->params.lmtp) smtp_client_state(proto, STATE_LHLO); else smtp_client_state(proto, STATE_EHLO); break; case STATE_EHLO: if (line[0] != '2') { /* * Either rejected or not implemented. If we want to * use EHLO extensions, report an SMTP error. * Otherwise, fallback to using HELO. */ if ((proto->params.tls_req == TLS_FORCE) || (proto->params.auth_user)) smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_HELO); break; } smtp_client_state(proto, STATE_STARTTLS); break; case STATE_HELO: if (line[0] != '2') smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_READY); break; case STATE_LHLO: if (line[0] != '2') smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_READY); break; case STATE_STARTTLS: if (line[0] != '2') { if ((proto->params.tls_req == TLS_FORCE) || (proto->params.auth_user)) { smtp_client_cancel(proto, FAIL_RESP, line); break; } smtp_client_state(proto, STATE_AUTH); } else smtp_require_tls(proto->tag, proto); break; case STATE_AUTH_PLAIN: if (line[0] != '2') smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_READY); break; case STATE_AUTH_LOGIN: if (strncmp(line, "334 ", 4)) smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_AUTH_LOGIN_USER); break; case STATE_AUTH_LOGIN_USER: if (strncmp(line, "334 ", 4)) smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_AUTH_LOGIN_PASS); break; case STATE_AUTH_LOGIN_PASS: if (line[0] != '2') smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_READY); break; case STATE_MAIL: if (line[0] != '2') { smtp_client_mail_status(proto, line); smtp_client_state(proto, STATE_RSET); } else smtp_client_state(proto, STATE_RCPT); break; case STATE_RCPT: rcpt = &proto->mail->rcpt[proto->rcptidx++]; if (line[0] != '2') smtp_client_rcpt_status(proto, rcpt, line); else { proto->rcptok++; smtp_client_state(proto, STATE_RCPT); } break; case STATE_DATA: if (line[0] != '2' && line[0] != '3') { smtp_client_mail_status(proto, line); smtp_client_state(proto, STATE_RSET); } else smtp_client_state(proto, STATE_BODY); break; case STATE_EOM: if (proto->params.lmtp) { /* * LMTP reports a status of each accepted RCPT. * Report status for the first pending RCPT and read * more lines if another rcpt needs a status. */ for (i = 0, seen = 0; i < proto->mail->rcptcount; i++) { rcpt = &proto->mail->rcpt[i]; if (rcpt->done) continue; if (seen) { io_set_read(proto->io); return; } smtp_client_rcpt_status(proto, &proto->mail->rcpt[i], line); seen = 1; } } smtp_client_mail_status(proto, line); smtp_client_state(proto, STATE_READY); break; case STATE_RSET: if (line[0] != '2') smtp_client_cancel(proto, FAIL_RESP, line); else smtp_client_state(proto, STATE_READY); break; case STATE_QUIT: smtp_client_free(proto); break; default: fatalx("%s: bad state %d", __func__, proto->state); } } static void smtp_client_io(struct io *io, int evt, void *arg) { struct smtp_client *proto = arg; log_trace(TRACE_IO, "%p: %s %s", proto, io_strevent(evt), io_strio(io)); switch (evt) { case IO_CONNECTED: if (proto->params.tls_req == TLS_SMTPS) { io_set_write(io); smtp_require_tls(proto->tag, proto); } else smtp_client_state(proto, STATE_BANNER); break; case IO_TLSREADY: proto->flags |= FLAG_TLS; if (proto->state == STATE_INIT) smtp_client_state(proto, STATE_BANNER); else { /* Clear extensions before re-issueing an EHLO command. */ proto->ext = 0; smtp_client_state(proto, STATE_EHLO); } break; case IO_DATAIN: while (smtp_client_readline(proto)) ; break; case IO_LOWAT: if (proto->state == STATE_BODY) smtp_client_sendbody(proto); else io_set_read(io); break; case IO_TIMEOUT: errno = ETIMEDOUT; smtp_client_abort(proto, FAIL_CONN, "Connection timeout"); break; case IO_ERROR: smtp_client_abort(proto, FAIL_CONN, io_error(io)); break; case IO_DISCONNECTED: smtp_client_abort(proto, FAIL_CONN, io_error(io)); break; default: fatalx("%s: bad event %d", __func__, evt); } } /* * return 1 if a new line is expected. */ static int smtp_client_readline(struct smtp_client *proto) { const char *e; size_t len; char *line, *msg, *p; int cont; line = io_getline(proto->io, &len); if (line == NULL) { if (io_datalen(proto->io) >= proto->params.linemax) smtp_client_abort(proto, FAIL_PROTO, "Line too long"); return 0; } /* Strip trailing '\r' */ if (len && line[len - 1] == '\r') line[--len] = '\0'; log_trace(TRACE_SMTPCLT, "%p: <<< %s", proto, line); /* Validate SMTP */ if (len > 3) { msg = line + 4; cont = (line[3] == '-'); } else if (len == 3) { msg = line + 3; cont = 0; } else { smtp_client_abort(proto, FAIL_PROTO, "Response too short"); return 0; } /* Validate reply code. */ if (line[0] < '2' || line[0] > '5' || !isdigit((unsigned char)line[1]) || !isdigit((unsigned char)line[2])) { smtp_client_abort(proto, FAIL_PROTO, "Invalid reply code"); return 0; } /* Validate reply message. */ for (p = msg; *p; p++) if (!isprint((unsigned char)*p)) { smtp_client_abort(proto, FAIL_PROTO, "Non-printable characters in response"); return 0; } /* Read extensions. */ if (proto->state == STATE_EHLO) { if (strcmp(msg, "STARTTLS") == 0) proto->ext |= SMTP_EXT_STARTTLS; else if (strncmp(msg, "AUTH ", 5) == 0) { proto->ext |= SMTP_EXT_AUTH; if ((p = strstr(msg, " PLAIN")) && (*(p+6) == '\0' || *(p+6) == ' ')) proto->ext |= SMTP_EXT_AUTH_PLAIN; if ((p = strstr(msg, " LOGIN")) && (*(p+6) == '\0' || *(p+6) == ' ')) proto->ext |= SMTP_EXT_AUTH_LOGIN; } else if (strcmp(msg, "PIPELINING") == 0) proto->ext |= SMTP_EXT_PIPELINING; else if (strcmp(msg, "DSN") == 0) proto->ext |= SMTP_EXT_DSN; else if (strncmp(msg, "SIZE ", 5) == 0) { proto->ext_size = strtonum(msg + 5, 0, SIZE_T_MAX, &e); if (e == NULL) proto->ext |= SMTP_EXT_SIZE; } } if (smtp_client_replycat(proto, line) == -1) { smtp_client_abort(proto, FAIL_INTERNAL, NULL); return 0; } if (cont) return 1; if (io_datalen(proto->io)) { /* * There should be no pending data after a response is read, * except for the multiple status lines after a LMTP message. * It can also happen with pipelineing, but we don't do that * for now. */ if (!(proto->params.lmtp && proto->state == STATE_EOM)) { smtp_client_abort(proto, FAIL_PROTO, "Trailing data"); return 0; } } io_set_write(proto->io); smtp_client_response(proto, proto->reply); return 0; } /* * Concatenate the given response line. */ static int smtp_client_replycat(struct smtp_client *proto, const char *line) { size_t len; char *tmp; int first; if (proto->reply && proto->reply[0]) { /* * If the line is the continuation of an multi-line response, * skip the status and ESC parts. First, skip the status, then * skip the separator amd ESC if found. */ first = 0; line += 3; if (line[0]) { line += 1; if (isdigit((unsigned char)line[0]) && line[1] == '.' && isdigit((unsigned char)line[2]) && line[3] == '.' && isdigit((unsigned char)line[4]) && isspace((unsigned char)line[5])) line += 5; } } else first = 1; if (proto->reply) { len = strlcat(proto->reply, line, proto->replysz); if (len < proto->replysz) return 0; } else len = strlen(line); if (len > proto->params.ibufmax) { errno = EMSGSIZE; return -1; } /* Allocate by multiples of 2^8 */ len += (len % 256) ? (256 - (len % 256)) : 0; tmp = realloc(proto->reply, len); if (tmp == NULL) return -1; if (proto->reply == NULL) tmp[0] = '\0'; proto->reply = tmp; proto->replysz = len; (void)strlcat(proto->reply, line, proto->replysz); /* Replace the separator with a space for the first line. */ if (first && proto->reply[3]) proto->reply[3] = ' '; return 0; } static void smtp_client_sendbody(struct smtp_client *proto) { ssize_t len; size_t sz = 0, total, w; char *ln = NULL; int n; total = io_queued(proto->io); w = 0; while (total < proto->params.obufmax) { if ((len = getline(&ln, &sz, proto->mail->fp)) == -1) break; if (ln[len - 1] == '\n') ln[len - 1] = '\0'; n = io_printf(proto->io, "%s%s\r\n", *ln == '.'?".":"", ln); if (n == -1) { free(ln); smtp_client_abort(proto, FAIL_INTERNAL, NULL); return; } total += n; w += n; } free(ln); if (ferror(proto->mail->fp)) { smtp_client_abort(proto, FAIL_INTERNAL, "Cannot read message"); return; } log_trace(TRACE_SMTPCLT, "%p: >>> [...%zd bytes...]", proto, w); if (feof(proto->mail->fp)) smtp_client_state(proto, STATE_EOM); } static void smtp_client_sendcmd(struct smtp_client *proto, char *fmt, ...) { va_list ap; char *p; int len; va_start(ap, fmt); len = vasprintf(&p, fmt, ap); va_end(ap); if (len == -1) { smtp_client_abort(proto, FAIL_INTERNAL, NULL); return; } log_trace(TRACE_SMTPCLT, "mta: %p: >>> %s", proto, p); len = io_printf(proto->io, "%s\r\n", p); free(p); if (len == -1) smtp_client_abort(proto, FAIL_INTERNAL, NULL); } static void smtp_client_mail_status(struct smtp_client *proto, const char *status) { int i; for (i = 0; i < proto->mail->rcptcount; i++) smtp_client_rcpt_status(proto, &proto->mail->rcpt[i], status); smtp_done(proto->tag, proto, proto->mail); proto->mail = NULL; } static void smtp_client_mail_abort(struct smtp_client *proto) { smtp_done(proto->tag, proto, proto->mail); proto->mail = NULL; } static void smtp_client_rcpt_status(struct smtp_client *proto, struct smtp_rcpt *rcpt, const char *line) { struct smtp_status status; if (rcpt->done) return; rcpt->done = 1; status.rcpt = rcpt; status.cmd = strstate[proto->state]; status.status = line; smtp_status(proto->tag, proto, &status); } opensmtpd-7.7.0p0/usr.sbin/smtpd/unpack_dns.h0000644000175000001440000000434214610663500014647 /* $OpenBSD: unpack_dns.h,v 1.2 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2011-2014 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include struct unpack { const char *buf; size_t len; size_t offset; const char *err; }; struct dns_header { uint16_t id; uint16_t flags; uint16_t qdcount; uint16_t ancount; uint16_t nscount; uint16_t arcount; }; struct dns_query { char q_dname[MAXDNAME]; uint16_t q_type; uint16_t q_class; }; struct dns_rr { char rr_dname[MAXDNAME]; uint16_t rr_type; uint16_t rr_class; uint32_t rr_ttl; union { struct { char cname[MAXDNAME]; } cname; struct { uint16_t preference; char exchange[MAXDNAME]; } mx; struct { char nsname[MAXDNAME]; } ns; struct { char ptrname[MAXDNAME]; } ptr; struct { char mname[MAXDNAME]; char rname[MAXDNAME]; uint32_t serial; uint32_t refresh; uint32_t retry; uint32_t expire; uint32_t minimum; } soa; struct { struct in_addr addr; } in_a; struct { struct in6_addr addr6; } in_aaaa; struct { uint16_t rdlen; const void *rdata; } other; } rr; }; void unpack_init(struct unpack *, const char *, size_t); int unpack_header(struct unpack *, struct dns_header *); int unpack_rr(struct unpack *, struct dns_rr *); int unpack_query(struct unpack *, struct dns_query *); char *print_dname(const char *, char *, size_t); ssize_t dname_expand(const unsigned char *, size_t, size_t, size_t *, char *, size_t); opensmtpd-7.7.0p0/usr.sbin/smtpd/config.c0000644000175000001440000002230414620126254013761 /* $OpenBSD: config.c,v 1.58 2024/01/04 09:30:09 op Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include /* needed for setproctitle */ #include "smtpd.h" #include "log.h" #include "ssl.h" void set_local(struct smtpd *, const char *); void set_localaddrs(struct smtpd *, struct table *); struct smtpd * config_default(void) { struct smtpd *conf = NULL; struct mta_limits *limits = NULL; struct table *t = NULL; char hostname[HOST_NAME_MAX+1]; if (getmailname(hostname, sizeof hostname) == -1) return NULL; if ((conf = calloc(1, sizeof(*conf))) == NULL) return conf; (void)strlcpy(conf->sc_hostname, hostname, sizeof(conf->sc_hostname)); conf->sc_maxsize = DEFAULT_MAX_BODY_SIZE; conf->sc_subaddressing_delim = SUBADDRESSING_DELIMITER; conf->sc_ttl = SMTPD_QUEUE_EXPIRY; conf->sc_srs_ttl = SMTPD_QUEUE_EXPIRY / 86400; conf->sc_mta_max_deferred = 100; conf->sc_scheduler_max_inflight = 5000; conf->sc_scheduler_max_schedule = 10; conf->sc_scheduler_max_evp_batch_size = 256; conf->sc_scheduler_max_msg_batch_size = 1024; conf->sc_session_max_rcpt = 1000; conf->sc_session_max_mails = 100; conf->sc_mda_max_session = 50; conf->sc_mda_max_user_session = 7; conf->sc_mda_task_hiwat = 50; conf->sc_mda_task_lowat = 30; conf->sc_mda_task_release = 10; /* Report mails delayed for more than 4 hours */ conf->sc_bounce_warn[0] = 3600 * 4; conf->sc_tables_dict = calloc(1, sizeof(*conf->sc_tables_dict)); conf->sc_rules = calloc(1, sizeof(*conf->sc_rules)); conf->sc_dispatchers = calloc(1, sizeof(*conf->sc_dispatchers)); conf->sc_listeners = calloc(1, sizeof(*conf->sc_listeners)); conf->sc_ca_dict = calloc(1, sizeof(*conf->sc_ca_dict)); conf->sc_pki_dict = calloc(1, sizeof(*conf->sc_pki_dict)); conf->sc_ssl_dict = calloc(1, sizeof(*conf->sc_ssl_dict)); conf->sc_limits_dict = calloc(1, sizeof(*conf->sc_limits_dict)); conf->sc_mda_wrappers = calloc(1, sizeof(*conf->sc_mda_wrappers)); conf->sc_filter_processes_dict = calloc(1, sizeof(*conf->sc_filter_processes_dict)); conf->sc_dispatcher_bounce = calloc(1, sizeof(*conf->sc_dispatcher_bounce)); conf->sc_filters_dict = calloc(1, sizeof(*conf->sc_filters_dict)); limits = calloc(1, sizeof(*limits)); if (conf->sc_tables_dict == NULL || conf->sc_rules == NULL || conf->sc_dispatchers == NULL || conf->sc_listeners == NULL || conf->sc_ca_dict == NULL || conf->sc_pki_dict == NULL || conf->sc_ssl_dict == NULL || conf->sc_limits_dict == NULL || conf->sc_mda_wrappers == NULL || conf->sc_filter_processes_dict == NULL || conf->sc_dispatcher_bounce == NULL || conf->sc_filters_dict == NULL || limits == NULL) goto error; dict_init(conf->sc_dispatchers); dict_init(conf->sc_mda_wrappers); dict_init(conf->sc_ca_dict); dict_init(conf->sc_pki_dict); dict_init(conf->sc_ssl_dict); dict_init(conf->sc_tables_dict); dict_init(conf->sc_limits_dict); dict_init(conf->sc_filter_processes_dict); limit_mta_set_defaults(limits); dict_xset(conf->sc_limits_dict, "default", limits); TAILQ_INIT(conf->sc_listeners); TAILQ_INIT(conf->sc_rules); /* bounce dispatcher */ conf->sc_dispatcher_bounce->type = DISPATCHER_BOUNCE; /* * declare special "localhost", "anyhost" and "localnames" tables */ set_local(conf, conf->sc_hostname); t = table_create(conf, "static", "", NULL); table_add(t, "*", NULL); hostname[strcspn(hostname, ".")] = '\0'; if (strcmp(conf->sc_hostname, hostname) != 0) table_add(t, hostname, NULL); table_create(conf, "getpwnam", "", NULL); return conf; error: free(conf->sc_tables_dict); free(conf->sc_rules); free(conf->sc_dispatchers); free(conf->sc_listeners); free(conf->sc_ca_dict); free(conf->sc_pki_dict); free(conf->sc_ssl_dict); free(conf->sc_limits_dict); free(conf->sc_mda_wrappers); free(conf->sc_filter_processes_dict); free(conf->sc_dispatcher_bounce); free(conf->sc_filters_dict); free(limits); free(conf); return NULL; } void set_local(struct smtpd *conf, const char *hostname) { struct table *t; t = table_create(conf, "static", "", NULL); table_add(t, "localhost", NULL); table_add(t, hostname, NULL); set_localaddrs(conf, t); } void set_localaddrs(struct smtpd *conf, struct table *localnames) { struct ifaddrs *ifap, *p; struct sockaddr_storage ss; struct sockaddr_in *sain; struct sockaddr_in6 *sin6; struct table *t; t = table_create(conf, "static", "", NULL); table_add(t, "local", NULL); table_add(t, "0.0.0.0/0", NULL); table_add(t, "::/0", NULL); if (getifaddrs(&ifap) == -1) fatal("getifaddrs"); t = table_create(conf, "static", "", NULL); table_add(t, "local", NULL); for (p = ifap; p != NULL; p = p->ifa_next) { if (p->ifa_addr == NULL) continue; switch (p->ifa_addr->sa_family) { case AF_INET: sain = (struct sockaddr_in *)&ss; *sain = *(struct sockaddr_in *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sain->sin_len = sizeof(struct sockaddr_in); #endif table_add(t, ss_to_text(&ss), NULL); table_add(localnames, ss_to_text(&ss), NULL); break; case AF_INET6: sin6 = (struct sockaddr_in6 *)&ss; *sin6 = *(struct sockaddr_in6 *)p->ifa_addr; #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sin6->sin6_addr) || #ifdef USE_IPV6_ADDR_SCOPE_NODELOCAL IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) && #else IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr)) && #endif sin6->sin6_scope_id == 0) { sin6->sin6_scope_id = ntohs( *(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); sin6->sin6_addr.s6_addr[2] = 0; sin6->sin6_addr.s6_addr[3] = 0; } #endif table_add(t, ss_to_text(&ss), NULL); table_add(localnames, ss_to_text(&ss), NULL); break; } } freeifaddrs(ifap); } void purge_config(uint8_t what) { struct dispatcher *d; struct listener *l; struct table *t; struct rule *r; struct pki *p; const char *k; void *iter_dict; if (what & PURGE_LISTENERS) { while ((l = TAILQ_FIRST(env->sc_listeners)) != NULL) { TAILQ_REMOVE(env->sc_listeners, l, entry); free(l->tls_ciphers); free(l->tls_protocols); free(l->pki); free(l); } free(env->sc_listeners); env->sc_listeners = NULL; } if (what & PURGE_TABLES) { while (dict_root(env->sc_tables_dict, NULL, (void **)&t)) table_destroy(env, t); free(env->sc_tables_dict); env->sc_tables_dict = NULL; } if (what & PURGE_RULES) { while ((r = TAILQ_FIRST(env->sc_rules)) != NULL) { TAILQ_REMOVE(env->sc_rules, r, r_entry); free(r); } free(env->sc_rules); env->sc_rules = NULL; } if (what & PURGE_DISPATCHERS) { while (dict_poproot(env->sc_dispatchers, (void **)&d)) { free(d); } free(env->sc_dispatchers); env->sc_dispatchers = NULL; } if (what & PURGE_PKI) { while (dict_poproot(env->sc_pki_dict, (void **)&p)) { freezero(p->pki_cert, p->pki_cert_len); freezero(p->pki_key, p->pki_key_len); free(p); } free(env->sc_pki_dict); env->sc_pki_dict = NULL; } else if (what & PURGE_PKI_KEYS) { iter_dict = NULL; while (dict_iter(env->sc_pki_dict, &iter_dict, &k, (void **)&p)) { freezero(p->pki_cert, p->pki_cert_len); p->pki_cert = NULL; freezero(p->pki_key, p->pki_key_len); p->pki_key = NULL; } } } #ifndef CONFIG_MINIMUM void config_process(enum smtp_proc_type proc) { struct rlimit rl; smtpd_process = proc; setproctitle("%s", proc_title(proc)); if (getrlimit(RLIMIT_NOFILE, &rl) == -1) fatal("fdlimit: getrlimit"); rl.rlim_cur = rl.rlim_max; if (setrlimit(RLIMIT_NOFILE, &rl) == -1) if (errno != EINVAL) fatal("fdlimit: setrlimit"); } void config_peer(enum smtp_proc_type proc) { struct mproc *p; if (proc == smtpd_process) fatal("config_peers: cannot peer with oneself"); if (proc == PROC_CONTROL) p = p_control; else if (proc == PROC_LKA) p = p_lka; else if (proc == PROC_PARENT) p = p_parent; else if (proc == PROC_QUEUE) p = p_queue; else if (proc == PROC_SCHEDULER) p = p_scheduler; else if (proc == PROC_DISPATCHER) p = p_dispatcher; else if (proc == PROC_CA) p = p_ca; else fatalx("bad peer"); mproc_enable(p); } #else void config_process(enum smtp_proc_type proc) {} void config_peer(enum smtp_proc_type proc) {} #endif opensmtpd-7.7.0p0/usr.sbin/smtpd/smtp.10000644000175000001440000000741214610663500013417 .\" $OpenBSD: smtp.1,v 1.14 2021/05/23 16:12:56 eric Exp $ .\" .\" Copyright (c) 2018, Eric Faurot .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: May 23 2021 $ .Dt SMTP 1 .Os .Sh NAME .Nm smtp .Nd Simple Mail Transfer Protocol client .Sh SYNOPSIS .Nm .Op Fl Chnv .Op Fl a Ar authfile .Op Fl F Ar from .Op Fl H Ar helo .Op Fl s Ar server .Op Fl T Ar params .Op Ar recipient ... .Sh DESCRIPTION The .Nm utility is a Simple Mail Transfer Protocol .Pq SMTP client which can be used to run an SMTP transaction against an SMTP server. .Pp By default, .Nm reads the mail content from the standard input, establishes an SMTP session, and runs an SMTP transaction for all the specified recipients. The content is sent unaltered as mail data. .Pp The options are as follows: .Bl -tag -width Ds .It Fl a Ar authfile Perform a login before sending the message. The username and password are read from .Ar authfile and need to be on the first and second line respectively. This option requires a TLS or STARTTLS .Ar server . .It Fl C Do not require server certificate to be valid. This flag is deprecated. Use .Dq Fl T Cm noverify instead. .It Fl F Ar from Set the return-path (MAIL FROM) for the SMTP transaction. Default to the current username. .It Fl H Ar helo Define the hostname to advertise (HELO) when establishing the SMTP session. .It Fl h Display usage. .It Fl n Do not actually execute a transaction, just try to establish an SMTP session and quit. When this option is given, no message is read from the standard input. .It Fl s Ar server Specify the server to connect to and connection parameters. The format is .Sm off .Op Ar proto No :// Op Ar user : pass No @ .Ar host Op : Ar port . .Sm on The following protocols are available: .Pp .Bl -tag -width "smtp+notls" -compact .It smtp Normal SMTP session with opportunistic STARTTLS. .It smtp+tls Normal SMTP session with mandatory STARTTLS. .It smtp+notls Plain text SMTP session without TLS. .It lmtp LMTP session with opportunistic STARTTLS. .It lmtp+tls LMTP session with mandatory STARTTLS. .It lmtp+notls Plain text LMTP session without TLS. .It smtps SMTP session with forced TLS on connection. .El .Pp Defaults to .Dq smtp://localhost:25 . .It Fl T Ar params Set specific parameters for TLS sessions. The .Ar params string is a comma or space separated list of options. The available options are: .Bl -tag -width Ds .It Cm cafile Ns = Ns Ar filename Use .Ar filename as root certificates file instead of the system default. .It Cm ciphers Ns = Ns Ar value Specify the allowed ciphers. Refer to .Xr tls_config_set_ciphers 3 for .Ar value . .It Cm nosni Disable Server Name Indication (SNI). .It Cm noverify Do not require server certificate to be valid. .It Cm protocols Ns = Ns Ar value Specify the protocols to use. Refer to .Xr tls_config_parse_protocols 3 for .Ar value . .It Cm servername Ns = Ns Ar value Use .Ar value for Server Name Indication (SNI). Defaults to the specified server hostname. .El .It Fl v Be more verbose. This option can be specified multiple times. .El .Sh SEE ALSO .Xr smtpd 8 .Sh HISTORY The .Nm program first appeared in .Ox 6.4 . opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.mda.c0000644000175000001440000000321614610663500014176 /* * Copyright (c) 2017 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { int ch; int ret; if (! geteuid()) errx(1, "mail.mda: may not be executed as root"); while ((ch = getopt(argc, argv, "")) != -1) { switch (ch) { default: break; } } argc -= optind; argv += optind; if (argc == 0) errx(1, "mail.mda: command required"); if (argc > 1) errx(1, "mail.mda: only one command is supported"); /* could not obtain a shell or could not obtain wait status, * tempfail */ if ((ret = system(argv[0])) == -1) errx(EX_TEMPFAIL, "%s", strerror(errno)); /* not exited properly but we have no details, * tempfail */ if (! WIFEXITED(ret)) exit(EX_TEMPFAIL); exit(WEXITSTATUS(ret)); } opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.mboxfile.80000644000175000001440000000232314610663500015165 .\" $OpenBSD: mail.mboxfile.8,v 1.1 2018/07/25 10:19:28 gilles Exp $ .\" .\" Copyright (c) 2017 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: July 25 2018 $ .Dt MAIL.MDA 8 .Os .Sh NAME .Nm mail.mboxfile .Nd deliver mail to a file in mbox format .Sh SYNOPSIS .Nm mail.mboxfile .Ar file .Sh DESCRIPTION .Nm appends mail to a file in mbox format and acknowledges delivery success or failure with its exit status. .Sh EXIT STATUS .Ex -std mail.mboxfile .Sh SEE ALSO .Xr mail 1 , .Xr smtpd 8 opensmtpd-7.7.0p0/usr.sbin/smtpd/smtp_session.c0000644000175000001440000023144514674615567015275 /* $OpenBSD: smtp_session.c,v 1.442 2024/03/20 17:52:43 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade * Copyright (c) 2008 Pierre-Yves Ritschard * Copyright (c) 2008-2009 Jacek Masiulaniec * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include /* for asr_freeaddrinfo() */ #include #include #include #include #include #include #include #include #if defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #else #include "bsd-vis.h" #endif #include "smtpd.h" #include "log.h" #include "rfc5322.h" #define SMTP_LINE_MAX 65535 #define DATA_HIWAT 65535 #define APPEND_DOMAIN_BUFFER_SIZE SMTP_LINE_MAX enum smtp_state { STATE_NEW = 0, STATE_CONNECTED, STATE_TLS, STATE_HELO, STATE_AUTH_INIT, STATE_AUTH_USERNAME, STATE_AUTH_PASSWORD, STATE_AUTH_FINALIZE, STATE_BODY, STATE_QUIT, }; enum session_flags { SF_EHLO = 0x0001, SF_8BITMIME = 0x0002, SF_SECURE = 0x0004, SF_AUTHENTICATED = 0x0008, SF_BOUNCE = 0x0010, SF_VERIFIED = 0x0020, SF_BADINPUT = 0x0080, }; enum { TX_OK = 0, TX_ERROR_ENVELOPE, TX_ERROR_SIZE, TX_ERROR_IO, TX_ERROR_LOOP, TX_ERROR_MALFORMED, TX_ERROR_RESOURCES, TX_ERROR_INTERNAL, }; enum smtp_command { CMD_HELO = 0, CMD_EHLO, CMD_STARTTLS, CMD_AUTH, CMD_MAIL_FROM, CMD_RCPT_TO, CMD_DATA, CMD_RSET, CMD_QUIT, CMD_HELP, CMD_WIZ, CMD_NOOP, CMD_COMMIT, }; struct smtp_rcpt { TAILQ_ENTRY(smtp_rcpt) entry; uint64_t evpid; struct mailaddr maddr; size_t destcount; }; struct smtp_tx { struct smtp_session *session; uint32_t msgid; struct envelope evp; size_t rcptcount; size_t destcount; TAILQ_HEAD(, smtp_rcpt) rcpts; time_t time; int error; size_t datain; size_t odatalen; FILE *ofile; struct io *filter; struct rfc5322_parser *parser; int rcvcount; int has_date; int has_message_id; uint8_t junk; }; struct smtp_session { uint64_t id; struct io *io; struct listener *listener; void *ssl_ctx; struct sockaddr_storage ss; char rdns[HOST_NAME_MAX+1]; char smtpname[HOST_NAME_MAX+1]; int fcrdns; int flags; enum smtp_state state; uint8_t banner_sent; char helo[LINE_MAX]; char cmd[LINE_MAX]; char username[SMTPD_MAXMAILADDRSIZE]; size_t mailcount; struct event pause; struct smtp_tx *tx; enum smtp_command last_cmd; enum filter_phase filter_phase; const char *filter_param; uint8_t junk; }; #define ADVERTISE_TLS(s) \ ((s)->listener->flags & F_STARTTLS && !((s)->flags & SF_SECURE)) #define ADVERTISE_AUTH(s) \ ((s)->listener->flags & F_AUTH && (s)->flags & SF_SECURE && \ !((s)->flags & SF_AUTHENTICATED)) #define ADVERTISE_EXT_DSN(s) \ ((s)->listener->flags & F_EXT_DSN) #define SESSION_FILTERED(s) \ ((s)->listener->flags & F_FILTERED) #define SESSION_DATA_FILTERED(s) \ ((s)->listener->flags & F_FILTERED) static int smtp_mailaddr(struct mailaddr *, char *, int, char **, const char *); static void smtp_session_init(void); static void smtp_lookup_servername(struct smtp_session *); static void smtp_getnameinfo_cb(void *, int, const char *, const char *); static void smtp_getaddrinfo_cb(void *, int, struct addrinfo *); static void smtp_connected(struct smtp_session *); static void smtp_send_banner(struct smtp_session *); static void smtp_tls_init(struct smtp_session *); static void smtp_tls_started(struct smtp_session *); static void smtp_io(struct io *, int, void *); static void smtp_enter_state(struct smtp_session *, int); static void smtp_reply(struct smtp_session *, char *, ...); static void smtp_command(struct smtp_session *, char *); static void smtp_rfc4954_auth_plain(struct smtp_session *, char *); static void smtp_rfc4954_auth_login(struct smtp_session *, char *); static void smtp_free(struct smtp_session *, const char *); static const char *smtp_strstate(int); static void smtp_auth_failure_pause(struct smtp_session *); static void smtp_auth_failure_resume(int, short, void *); static int smtp_tx(struct smtp_session *); static void smtp_tx_free(struct smtp_tx *); static void smtp_tx_create_message(struct smtp_tx *); static void smtp_tx_mail_from(struct smtp_tx *, const char *); static void smtp_tx_rcpt_to(struct smtp_tx *, const char *); static void smtp_tx_open_message(struct smtp_tx *); static void smtp_tx_commit(struct smtp_tx *); static void smtp_tx_rollback(struct smtp_tx *); static int smtp_tx_dataline(struct smtp_tx *, const char *); static int smtp_tx_filtered_dataline(struct smtp_tx *, const char *); static void smtp_tx_eom(struct smtp_tx *); static void smtp_filter_fd(struct smtp_tx *, int); static int smtp_message_fd(struct smtp_tx *, int); static void smtp_message_begin(struct smtp_tx *); static void smtp_message_end(struct smtp_tx *); static int smtp_filter_printf(struct smtp_tx *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); static int smtp_message_printf(struct smtp_tx *, const char *, ...) __attribute__((__format__ (printf, 2, 3))); static int smtp_check_rset(struct smtp_session *, const char *); static int smtp_check_helo(struct smtp_session *, const char *); static int smtp_check_ehlo(struct smtp_session *, const char *); static int smtp_check_auth(struct smtp_session *s, const char *); static int smtp_check_starttls(struct smtp_session *, const char *); static int smtp_check_mail_from(struct smtp_session *, const char *); static int smtp_check_rcpt_to(struct smtp_session *, const char *); static int smtp_check_data(struct smtp_session *, const char *); static int smtp_check_noop(struct smtp_session *, const char *); static int smtp_check_noparam(struct smtp_session *, const char *); static void smtp_filter_phase(enum filter_phase, struct smtp_session *, const char *); static void smtp_proceed_connected(struct smtp_session *); static void smtp_proceed_rset(struct smtp_session *, const char *); static void smtp_proceed_helo(struct smtp_session *, const char *); static void smtp_proceed_ehlo(struct smtp_session *, const char *); static void smtp_proceed_auth(struct smtp_session *, const char *); static void smtp_proceed_starttls(struct smtp_session *, const char *); static void smtp_proceed_mail_from(struct smtp_session *, const char *); static void smtp_proceed_rcpt_to(struct smtp_session *, const char *); static void smtp_proceed_data(struct smtp_session *, const char *); static void smtp_proceed_noop(struct smtp_session *, const char *); static void smtp_proceed_help(struct smtp_session *, const char *); static void smtp_proceed_wiz(struct smtp_session *, const char *); static void smtp_proceed_quit(struct smtp_session *, const char *); static void smtp_proceed_commit(struct smtp_session *, const char *); static void smtp_proceed_rollback(struct smtp_session *, const char *); static void smtp_filter_begin(struct smtp_session *); static void smtp_filter_end(struct smtp_session *); static void smtp_filter_data_begin(struct smtp_session *); static void smtp_filter_data_end(struct smtp_session *); static void smtp_report_link_connect(struct smtp_session *, const char *, int, const struct sockaddr_storage *, const struct sockaddr_storage *); static void smtp_report_link_greeting(struct smtp_session *, const char *); static void smtp_report_link_identify(struct smtp_session *, const char *, const char *); static void smtp_report_link_tls(struct smtp_session *, const char *); static void smtp_report_link_disconnect(struct smtp_session *); static void smtp_report_link_auth(struct smtp_session *, const char *, const char *); static void smtp_report_tx_reset(struct smtp_session *, uint32_t); static void smtp_report_tx_begin(struct smtp_session *, uint32_t); static void smtp_report_tx_mail(struct smtp_session *, uint32_t, const char *, int); static void smtp_report_tx_rcpt(struct smtp_session *, uint32_t, const char *, int); static void smtp_report_tx_envelope(struct smtp_session *, uint32_t, uint64_t); static void smtp_report_tx_data(struct smtp_session *, uint32_t, int); static void smtp_report_tx_commit(struct smtp_session *, uint32_t, size_t); static void smtp_report_tx_rollback(struct smtp_session *, uint32_t); static void smtp_report_protocol_client(struct smtp_session *, const char *); static void smtp_report_protocol_server(struct smtp_session *, const char *); static void smtp_report_filter_response(struct smtp_session *, int, int, const char *); static void smtp_report_timeout(struct smtp_session *); static struct { int code; enum filter_phase filter_phase; const char *cmd; int (*check)(struct smtp_session *, const char *); void (*proceed)(struct smtp_session *, const char *); } commands[] = { { CMD_HELO, FILTER_HELO, "HELO", smtp_check_helo, smtp_proceed_helo }, { CMD_EHLO, FILTER_EHLO, "EHLO", smtp_check_ehlo, smtp_proceed_ehlo }, { CMD_STARTTLS, FILTER_STARTTLS, "STARTTLS", smtp_check_starttls, smtp_proceed_starttls }, { CMD_AUTH, FILTER_AUTH, "AUTH", smtp_check_auth, smtp_proceed_auth }, { CMD_MAIL_FROM, FILTER_MAIL_FROM, "MAIL FROM", smtp_check_mail_from, smtp_proceed_mail_from }, { CMD_RCPT_TO, FILTER_RCPT_TO, "RCPT TO", smtp_check_rcpt_to, smtp_proceed_rcpt_to }, { CMD_DATA, FILTER_DATA, "DATA", smtp_check_data, smtp_proceed_data }, { CMD_RSET, FILTER_RSET, "RSET", smtp_check_rset, smtp_proceed_rset }, { CMD_QUIT, FILTER_QUIT, "QUIT", smtp_check_noparam, smtp_proceed_quit }, { CMD_NOOP, FILTER_NOOP, "NOOP", smtp_check_noop, smtp_proceed_noop }, { CMD_HELP, FILTER_HELP, "HELP", smtp_check_noparam, smtp_proceed_help }, { CMD_WIZ, FILTER_WIZ, "WIZ", smtp_check_noparam, smtp_proceed_wiz }, { CMD_COMMIT, FILTER_COMMIT, ".", smtp_check_noparam, smtp_proceed_commit }, { -1, 0, NULL, NULL }, }; static struct tree wait_lka_helo; static struct tree wait_lka_mail; static struct tree wait_lka_rcpt; static struct tree wait_parent_auth; static struct tree wait_queue_msg; static struct tree wait_queue_fd; static struct tree wait_queue_commit; static struct tree wait_ssl_init; static struct tree wait_ssl_verify; static struct tree wait_filters; static struct tree wait_filter_fd; static void header_append_domain_buffer(char *buffer, char *domain, size_t len) { size_t i; int escape, quote, comment, bracket; int has_domain, has_bracket, has_group; int pos_bracket, pos_component, pos_insert; char copy[APPEND_DOMAIN_BUFFER_SIZE]; escape = quote = comment = bracket = 0; has_domain = has_bracket = has_group = 0; pos_bracket = pos_insert = pos_component = 0; for (i = 0; buffer[i]; ++i) { if (buffer[i] == '(' && !escape && !quote) comment++; if (buffer[i] == '"' && !escape && !comment) quote = !quote; if (buffer[i] == ')' && !escape && !quote && comment) comment--; if (buffer[i] == '\\' && !escape && !comment && !quote) escape = 1; else escape = 0; if (buffer[i] == '<' && !escape && !comment && !quote && !bracket) { bracket++; has_bracket = 1; } if (buffer[i] == '>' && !escape && !comment && !quote && bracket) { bracket--; pos_bracket = i; } if (buffer[i] == '@' && !escape && !comment && !quote) has_domain = 1; if (buffer[i] == ':' && !escape && !comment && !quote) has_group = 1; /* update insert point if not in comment and not on a whitespace */ if (!comment && buffer[i] != ')' && !isspace((unsigned char)buffer[i])) pos_component = i; } /* parse error, do not attempt to modify */ if (escape || quote || comment || bracket) return; /* domain already present, no need to modify */ if (has_domain) return; /* address is group, skip */ if (has_group) return; /* there's an address between brackets, just append domain */ if (has_bracket) { pos_bracket--; while (isspace((unsigned char)buffer[pos_bracket])) pos_bracket--; if (buffer[pos_bracket] == '<') return; pos_insert = pos_bracket + 1; } else { /* otherwise append address to last component */ pos_insert = pos_component + 1; /* empty address */ if (buffer[pos_component] == '\0' || isspace((unsigned char)buffer[pos_component])) return; } if (snprintf(copy, sizeof copy, "%.*s@%s%s", (int)pos_insert, buffer, domain, buffer+pos_insert) >= (int)sizeof copy) return; memcpy(buffer, copy, len); } static void header_address_rewrite_buffer(char *buffer, const char *address, size_t len) { size_t i; int address_len; int escape, quote, comment, bracket; int has_bracket, has_group; int pos_bracket_beg, pos_bracket_end, pos_component_beg, pos_component_end; int insert_beg, insert_end; char copy[APPEND_DOMAIN_BUFFER_SIZE]; escape = quote = comment = bracket = 0; has_bracket = has_group = 0; pos_bracket_beg = pos_bracket_end = pos_component_beg = pos_component_end = 0; for (i = 0; buffer[i]; ++i) { if (buffer[i] == '(' && !escape && !quote) comment++; if (buffer[i] == '"' && !escape && !comment) quote = !quote; if (buffer[i] == ')' && !escape && !quote && comment) comment--; if (buffer[i] == '\\' && !escape && !comment && !quote) escape = 1; else escape = 0; if (buffer[i] == '<' && !escape && !comment && !quote && !bracket) { bracket++; has_bracket = 1; pos_bracket_beg = i+1; } if (buffer[i] == '>' && !escape && !comment && !quote && bracket) { bracket--; pos_bracket_end = i; } if (buffer[i] == ':' && !escape && !comment && !quote) has_group = 1; /* update insert point if not in comment and not on a whitespace */ if (!comment && buffer[i] != ')' && !isspace((unsigned char)buffer[i])) pos_component_end = i; } /* parse error, do not attempt to modify */ if (escape || quote || comment || bracket) return; /* address is group, skip */ if (has_group) return; /* there's an address between brackets, just replace everything brackets */ if (has_bracket) { insert_beg = pos_bracket_beg; insert_end = pos_bracket_end; } else { if (pos_component_end == 0) pos_component_beg = 0; else { for (pos_component_beg = pos_component_end; pos_component_beg >= 0; --pos_component_beg) if (buffer[pos_component_beg] == ')' || isspace((unsigned char)buffer[pos_component_beg])) break; pos_component_beg += 1; pos_component_end += 1; } insert_beg = pos_component_beg; insert_end = pos_component_end; } /* check that masquerade won' t overflow */ address_len = strlen(address); if (strlen(buffer) - (insert_end - insert_beg) + address_len >= len) return; (void)strlcpy(copy, buffer, sizeof copy); (void)strlcpy(copy+insert_beg, address, sizeof (copy) - insert_beg); (void)strlcat(copy, buffer+insert_end, sizeof (copy)); memcpy(buffer, copy, len); } static void header_domain_append_callback(struct smtp_tx *tx, const char *hdr, const char *val) { size_t i, j, linelen; int escape, quote, comment, skip; char buffer[APPEND_DOMAIN_BUFFER_SIZE]; const char *line, *end; if (smtp_message_printf(tx, "%s:", hdr) == -1) return; j = 0; escape = quote = comment = skip = 0; memset(buffer, 0, sizeof buffer); for (line = val; line; line = end) { end = strchr(line, '\n'); if (end) { linelen = end - line; end++; } else linelen = strlen(line); for (i = 0; i < linelen; ++i) { if (line[i] == '(' && !escape && !quote) comment++; if (line[i] == '"' && !escape && !comment) quote = !quote; if (line[i] == ')' && !escape && !quote && comment) comment--; if (line[i] == '\\' && !escape && !comment) escape = 1; else escape = 0; /* found a separator, buffer contains a full address */ if (line[i] == ',' && !escape && !quote && !comment) { if (!skip && j + strlen(tx->session->listener->hostname) + 1 < sizeof buffer) { header_append_domain_buffer(buffer, tx->session->listener->hostname, sizeof buffer); if (tx->session->flags & SF_AUTHENTICATED && tx->session->listener->sendertable[0] && tx->session->listener->flags & F_MASQUERADE && !(strcasecmp(hdr, "From"))) header_address_rewrite_buffer(buffer, mailaddr_to_text(&tx->evp.sender), sizeof buffer); } if (smtp_message_printf(tx, "%s,", buffer) == -1) return; j = 0; skip = 0; memset(buffer, 0, sizeof buffer); } else { if (skip) { if (smtp_message_printf(tx, "%c", line[i]) == -1) return; } else { buffer[j++] = line[i]; if (j == sizeof (buffer) - 1) { if (smtp_message_printf(tx, "%s", buffer) == -1) return; skip = 1; j = 0; memset(buffer, 0, sizeof buffer); } } } } if (skip) { if (smtp_message_printf(tx, "\n") == -1) return; } else { buffer[j++] = '\n'; if (j == sizeof (buffer) - 1) { if (smtp_message_printf(tx, "%s", buffer) == -1) return; skip = 1; j = 0; memset(buffer, 0, sizeof buffer); } } } /* end of header, if buffer is not empty we'll process it */ if (buffer[0]) { if (j + strlen(tx->session->listener->hostname) + 1 < sizeof buffer) { header_append_domain_buffer(buffer, tx->session->listener->hostname, sizeof buffer); if (tx->session->flags & SF_AUTHENTICATED && tx->session->listener->sendertable[0] && tx->session->listener->flags & F_MASQUERADE && !(strcasecmp(hdr, "From"))) header_address_rewrite_buffer(buffer, mailaddr_to_text(&tx->evp.sender), sizeof buffer); } smtp_message_printf(tx, "%s", buffer); } } static void smtp_session_init(void) { static int init = 0; if (!init) { tree_init(&wait_lka_helo); tree_init(&wait_lka_mail); tree_init(&wait_lka_rcpt); tree_init(&wait_parent_auth); tree_init(&wait_queue_msg); tree_init(&wait_queue_fd); tree_init(&wait_queue_commit); tree_init(&wait_ssl_init); tree_init(&wait_ssl_verify); tree_init(&wait_filters); tree_init(&wait_filter_fd); init = 1; } } int smtp_session(struct listener *listener, int sock, const struct sockaddr_storage *ss, const char *hostname, struct io *io) { struct smtp_session *s; smtp_session_init(); if ((s = calloc(1, sizeof(*s))) == NULL) return (-1); s->id = generate_uid(); s->listener = listener; memmove(&s->ss, ss, sizeof(*ss)); if (io != NULL) s->io = io; else s->io = io_new(); io_set_callback(s->io, smtp_io, s); io_set_fd(s->io, sock); io_set_timeout(s->io, SMTPD_SESSION_TIMEOUT * 1000); io_set_write(s->io); s->state = STATE_NEW; (void)strlcpy(s->smtpname, listener->hostname, sizeof(s->smtpname)); log_trace(TRACE_SMTP, "smtp: %p: connected to listener %p " "[hostname=%s, port=%d, tag=%s]", s, listener, listener->hostname, ntohs(listener->port), listener->tag); /* For local enqueueing, the hostname is already set */ if (hostname) { s->flags |= SF_AUTHENTICATED; /* A bit of a hack */ if (!strcmp(hostname, "localhost")) s->flags |= SF_BOUNCE; (void)strlcpy(s->rdns, hostname, sizeof(s->rdns)); s->fcrdns = 1; smtp_lookup_servername(s); } else { resolver_getnameinfo((struct sockaddr *)&s->ss, NI_NAMEREQD | NI_NUMERICSERV, smtp_getnameinfo_cb, s); } /* session may have been freed by now */ return (0); } static void smtp_getnameinfo_cb(void *arg, int gaierrno, const char *host, const char *serv) { struct smtp_session *s = arg; struct addrinfo hints; if (gaierrno) { (void)strlcpy(s->rdns, "", sizeof(s->rdns)); if (gaierrno == EAI_NODATA || gaierrno == EAI_NONAME) s->fcrdns = 0; else { log_warnx("getnameinfo: %s: %s", ss_to_text(&s->ss), gai_strerror(gaierrno)); s->fcrdns = -1; } smtp_lookup_servername(s); return; } (void)strlcpy(s->rdns, host, sizeof(s->rdns)); memset(&hints, 0, sizeof(hints)); hints.ai_family = s->ss.ss_family; hints.ai_socktype = SOCK_STREAM; resolver_getaddrinfo(s->rdns, NULL, &hints, smtp_getaddrinfo_cb, s); } static void smtp_getaddrinfo_cb(void *arg, int gaierrno, struct addrinfo *ai0) { struct smtp_session *s = arg; struct addrinfo *ai; char fwd[64], rev[64]; if (gaierrno) { if (gaierrno == EAI_NODATA || gaierrno == EAI_NONAME) s->fcrdns = 0; else { log_warnx("getaddrinfo: %s: %s", s->rdns, gai_strerror(gaierrno)); s->fcrdns = -1; } } else { strlcpy(rev, ss_to_text(&s->ss), sizeof(rev)); for (ai = ai0; ai; ai = ai->ai_next) { strlcpy(fwd, sa_to_text(ai->ai_addr), sizeof(fwd)); if (!strcmp(fwd, rev)) { s->fcrdns = 1; break; } } asr_freeaddrinfo(ai0); } smtp_lookup_servername(s); } void smtp_session_imsg(struct mproc *p, struct imsg *imsg) { struct smtp_session *s; struct smtp_rcpt *rcpt; char user[SMTPD_MAXMAILADDRSIZE]; char tmp[SMTP_LINE_MAX]; struct msg m; const char *line, *helo; uint64_t reqid, evpid; uint32_t msgid; int status, success, fd; int filter_response; const char *filter_param; uint8_t i; switch (imsg->hdr.type) { case IMSG_SMTP_CHECK_SENDER: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &status); m_end(&m); s = tree_xpop(&wait_lka_mail, reqid); switch (status) { case LKA_OK: smtp_tx_create_message(s->tx); break; case LKA_PERMFAIL: smtp_tx_free(s->tx); smtp_reply(s, "%d %s", 530, "Sender rejected"); break; case LKA_TEMPFAIL: smtp_tx_free(s->tx); smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); break; } return; case IMSG_SMTP_EXPAND_RCPT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &status); m_get_string(&m, &line); m_end(&m); s = tree_xpop(&wait_lka_rcpt, reqid); tmp[0] = '\0'; if (s->tx->evp.rcpt.user[0]) { (void)strlcpy(tmp, s->tx->evp.rcpt.user, sizeof tmp); if (s->tx->evp.rcpt.domain[0]) { (void)strlcat(tmp, "@", sizeof tmp); (void)strlcat(tmp, s->tx->evp.rcpt.domain, sizeof tmp); } } switch (status) { case LKA_OK: fatalx("unexpected ok"); case LKA_PERMFAIL: smtp_reply(s, "%s: <%s>", line, tmp); break; case LKA_TEMPFAIL: smtp_reply(s, "%s: <%s>", line, tmp); break; } return; case IMSG_SMTP_LOOKUP_HELO: m_msg(&m, imsg); m_get_id(&m, &reqid); s = tree_xpop(&wait_lka_helo, reqid); m_get_int(&m, &status); if (status == LKA_OK) { m_get_string(&m, &helo); (void)strlcpy(s->smtpname, helo, sizeof(s->smtpname)); } m_end(&m); smtp_connected(s); return; case IMSG_SMTP_MESSAGE_CREATE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); s = tree_xpop(&wait_queue_msg, reqid); if (success) { m_get_msgid(&m, &msgid); s->tx->msgid = msgid; s->tx->evp.id = msgid_to_evpid(msgid); s->tx->rcptcount = 0; smtp_reply(s, "250 %s Ok", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); } else { smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_tx_free(s->tx); smtp_enter_state(s, STATE_QUIT); } m_end(&m); return; case IMSG_SMTP_MESSAGE_OPEN: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); m_end(&m); fd = imsg_get_fd(imsg); s = tree_xpop(&wait_queue_fd, reqid); if (!success || fd == -1) { if (fd != -1) close(fd); smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_enter_state(s, STATE_QUIT); return; } log_debug("smtp: %p: fd %d from queue", s, fd); if (smtp_message_fd(s->tx, fd)) { if (!SESSION_DATA_FILTERED(s)) smtp_message_begin(s->tx); else smtp_filter_data_begin(s); } return; case IMSG_FILTER_SMTP_DATA_BEGIN: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); m_end(&m); fd = imsg_get_fd(imsg); s = tree_xpop(&wait_filter_fd, reqid); if (!success || fd == -1) { if (fd != -1) close(fd); smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_enter_state(s, STATE_QUIT); return; } log_debug("smtp: %p: fd %d from lka", s, fd); smtp_filter_fd(s->tx, fd); smtp_message_begin(s->tx); return; case IMSG_QUEUE_ENVELOPE_SUBMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); s = tree_xget(&wait_lka_rcpt, reqid); if (success) { m_get_evpid(&m, &evpid); s->tx->evp.id = evpid; s->tx->destcount++; smtp_report_tx_envelope(s, s->tx->msgid, evpid); } else s->tx->error = TX_ERROR_ENVELOPE; m_end(&m); return; case IMSG_QUEUE_ENVELOPE_COMMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); m_end(&m); if (!success) fatalx("commit evp failed: not supposed to happen"); s = tree_xpop(&wait_lka_rcpt, reqid); if (s->tx->error) { /* * If an envelope failed, we can't cancel the last * RCPT only so we must cancel the whole transaction * and close the connection. */ smtp_reply(s, "421 %s Temporary failure", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_enter_state(s, STATE_QUIT); } else { rcpt = xcalloc(1, sizeof(*rcpt)); rcpt->evpid = s->tx->evp.id; rcpt->destcount = s->tx->destcount; rcpt->maddr = s->tx->evp.rcpt; TAILQ_INSERT_TAIL(&s->tx->rcpts, rcpt, entry); s->tx->destcount = 0; s->tx->rcptcount++; smtp_reply(s, "250 %s %s: Recipient ok", esc_code(ESC_STATUS_OK, ESC_DESTINATION_ADDRESS_VALID), esc_description(ESC_DESTINATION_ADDRESS_VALID)); } return; case IMSG_SMTP_MESSAGE_COMMIT: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); m_end(&m); s = tree_xpop(&wait_queue_commit, reqid); if (!success) { smtp_reply(s, "421 %s Temporary failure", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_tx_free(s->tx); smtp_enter_state(s, STATE_QUIT); return; } smtp_reply(s, "250 %s %08x Message accepted for delivery", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS), s->tx->msgid); smtp_report_tx_commit(s, s->tx->msgid, s->tx->odatalen); smtp_report_tx_reset(s, s->tx->msgid); log_info("%016"PRIx64" smtp message " "msgid=%08x size=%zu nrcpt=%zu proto=%s", s->id, s->tx->msgid, s->tx->odatalen, s->tx->rcptcount, s->flags & SF_EHLO ? "ESMTP" : "SMTP"); TAILQ_FOREACH(rcpt, &s->tx->rcpts, entry) { log_info("%016"PRIx64" smtp envelope " "evpid=%016"PRIx64" from=<%s%s%s> to=<%s%s%s>", s->id, rcpt->evpid, s->tx->evp.sender.user, s->tx->evp.sender.user[0] == '\0' ? "" : "@", s->tx->evp.sender.domain, rcpt->maddr.user, rcpt->maddr.user[0] == '\0' ? "" : "@", rcpt->maddr.domain); } smtp_tx_free(s->tx); s->mailcount++; smtp_enter_state(s, STATE_HELO); return; case IMSG_SMTP_AUTHENTICATE: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &success); m_end(&m); s = tree_xpop(&wait_parent_auth, reqid); strnvis(user, s->username, sizeof user, VIS_WHITE | VIS_SAFE); if (success == LKA_OK) { log_info("%016"PRIx64" smtp " "authentication user=%s " "result=ok", s->id, user); s->flags |= SF_AUTHENTICATED; smtp_report_link_auth(s, user, "pass"); smtp_reply(s, "235 %s Authentication succeeded", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); } else if (success == LKA_PERMFAIL) { log_info("%016"PRIx64" smtp " "authentication user=%s " "result=permfail", s->id, user); smtp_report_link_auth(s, user, "fail"); smtp_auth_failure_pause(s); return; } else if (success == LKA_TEMPFAIL) { log_info("%016"PRIx64" smtp " "authentication user=%s " "result=tempfail", s->id, user); smtp_report_link_auth(s, user, "error"); smtp_reply(s, "421 %s Temporary failure", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); } else fatalx("bad lka response"); smtp_enter_state(s, STATE_HELO); return; case IMSG_FILTER_SMTP_PROTOCOL: m_msg(&m, imsg); m_get_id(&m, &reqid); m_get_int(&m, &filter_response); if (filter_response != FILTER_PROCEED && filter_response != FILTER_JUNK) m_get_string(&m, &filter_param); else filter_param = NULL; m_end(&m); s = tree_xpop(&wait_filters, reqid); switch (filter_response) { case FILTER_REJECT: case FILTER_DISCONNECT: if (!valid_smtp_response(filter_param) || (filter_param[0] != '4' && filter_param[0] != '5')) filter_param = "421 Internal server error"; if (!strncmp(filter_param, "421", 3)) filter_response = FILTER_DISCONNECT; smtp_report_filter_response(s, s->filter_phase, filter_response, filter_param); smtp_reply(s, "%s", filter_param); if (filter_response == FILTER_DISCONNECT) smtp_enter_state(s, STATE_QUIT); else if (s->filter_phase == FILTER_COMMIT) smtp_proceed_rollback(s, NULL); break; case FILTER_JUNK: if (s->tx) s->tx->junk = 1; else s->junk = 1; /* fallthrough */ case FILTER_PROCEED: filter_param = s->filter_param; /* fallthrough */ case FILTER_REPORT: case FILTER_REWRITE: smtp_report_filter_response(s, s->filter_phase, filter_response, filter_param == s->filter_param ? NULL : filter_param); if (s->filter_phase == FILTER_CONNECT) { smtp_proceed_connected(s); return; } for (i = 0; i < nitems(commands); ++i) if (commands[i].filter_phase == s->filter_phase) { if (filter_response == FILTER_REWRITE) if (!commands[i].check(s, filter_param)) break; commands[i].proceed(s, filter_param); break; } break; } return; } log_warnx("smtp_session_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); fatalx(NULL); } static void smtp_tls_init(struct smtp_session *s) { io_set_read(s->io); if (io_accept_tls(s->io, s->listener->tls) == -1) { log_info("%016"PRIx64" smtp disconnected " "reason=tls-accept-failed", s->id); smtp_free(s, "accept failed"); } } static void smtp_tls_started(struct smtp_session *s) { if (tls_peer_cert_provided(io_tls(s->io))) { log_info("%016"PRIx64" smtp " "cert-check result=\"%s\" fingerprint=\"%s\"", s->id, (s->flags & SF_VERIFIED) ? "verified" : "unchecked", tls_peer_cert_hash(io_tls(s->io))); } if (s->listener->flags & F_SMTPS) { stat_increment("smtp.smtps", 1); io_set_write(s->io); smtp_send_banner(s); } else { stat_increment("smtp.tls", 1); smtp_enter_state(s, STATE_HELO); } } static void smtp_io(struct io *io, int evt, void *arg) { struct smtp_session *s = arg; char *line; size_t len; int eom; log_trace(TRACE_IO, "smtp: %p: %s %s", s, io_strevent(evt), io_strio(io)); switch (evt) { case IO_TLSREADY: log_info("%016"PRIx64" smtp tls ciphers=%s", s->id, tls_to_text(io_tls(s->io))); smtp_report_link_tls(s, tls_to_text(io_tls(s->io))); s->flags |= SF_SECURE; if (s->listener->flags & F_TLS_VERIFY) s->flags |= SF_VERIFIED; s->helo[0] = '\0'; smtp_tls_started(s); break; case IO_DATAIN: nextline: line = io_getline(s->io, &len); if ((line == NULL && io_datalen(s->io) >= SMTP_LINE_MAX) || (line && len >= SMTP_LINE_MAX)) { s->flags |= SF_BADINPUT; smtp_reply(s, "500 %s Line too long", esc_code(ESC_STATUS_PERMFAIL, ESC_OTHER_STATUS)); smtp_enter_state(s, STATE_QUIT); io_set_write(io); return; } /* No complete line received */ if (line == NULL) return; /* Strip trailing '\r' */ if (len && line[len - 1] == '\r') line[--len] = '\0'; /* Message body */ eom = 0; if (s->state == STATE_BODY) { if (strcmp(line, ".")) { s->tx->datain += strlen(line) + 1; if (s->tx->datain > env->sc_maxsize) s->tx->error = TX_ERROR_SIZE; } eom = (s->tx->filter == NULL) ? smtp_tx_dataline(s->tx, line) : smtp_tx_filtered_dataline(s->tx, line); if (eom == 0) goto nextline; } /* Pipelining not supported */ if (io_datalen(s->io)) { s->flags |= SF_BADINPUT; smtp_reply(s, "500 %s %s: Pipelining not supported", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); smtp_enter_state(s, STATE_QUIT); io_set_write(io); return; } if (eom) { io_set_write(io); if (s->tx->filter == NULL) smtp_tx_eom(s->tx); return; } /* Must be a command */ if (strlcpy(s->cmd, line, sizeof(s->cmd)) >= sizeof(s->cmd)) { s->flags |= SF_BADINPUT; smtp_reply(s, "500 %s Command line too long", esc_code(ESC_STATUS_PERMFAIL, ESC_OTHER_STATUS)); smtp_enter_state(s, STATE_QUIT); io_set_write(io); return; } io_set_write(io); smtp_command(s, line); break; case IO_LOWAT: if (s->state == STATE_QUIT) { log_info("%016"PRIx64" smtp disconnected " "reason=quit", s->id); smtp_free(s, "done"); break; } /* Wait for the client to start tls */ if (s->state == STATE_TLS) { smtp_tls_init(s); break; } io_set_read(io); break; case IO_TIMEOUT: log_info("%016"PRIx64" smtp disconnected " "reason=timeout", s->id); smtp_report_timeout(s); smtp_free(s, "timeout"); break; case IO_DISCONNECTED: log_info("%016"PRIx64" smtp disconnected " "reason=disconnect", s->id); smtp_free(s, "disconnected"); break; case IO_ERROR: log_info("%016"PRIx64" smtp disconnected " "reason=\"io-error: %s\"", s->id, io_error(io)); smtp_free(s, "IO error"); break; default: fatalx("smtp_io()"); } } static void smtp_command(struct smtp_session *s, char *line) { char *args; int cmd, i; log_trace(TRACE_SMTP, "smtp: %p: <<< %s", s, line); /* * These states are special. */ if (s->state == STATE_AUTH_INIT) { smtp_report_protocol_client(s, "********"); smtp_rfc4954_auth_plain(s, line); return; } if (s->state == STATE_AUTH_USERNAME || s->state == STATE_AUTH_PASSWORD) { smtp_report_protocol_client(s, "********"); smtp_rfc4954_auth_login(s, line); return; } if (s->state == STATE_HELO && strncasecmp(line, "AUTH PLAIN ", 11) == 0) smtp_report_protocol_client(s, "AUTH PLAIN ********"); else smtp_report_protocol_client(s, line); /* * Unlike other commands, "mail from" and "rcpt to" contain a * space in the command name. */ if (strncasecmp("mail from:", line, 10) == 0 || strncasecmp("rcpt to:", line, 8) == 0) args = strchr(line, ':'); else args = strchr(line, ' '); if (args) { *args++ = '\0'; while (isspace((unsigned char)*args)) args++; } cmd = -1; for (i = 0; commands[i].code != -1; i++) if (!strcasecmp(line, commands[i].cmd)) { cmd = commands[i].code; break; } s->last_cmd = cmd; switch (cmd) { /* * INIT */ case CMD_HELO: if (!smtp_check_helo(s, args)) break; smtp_filter_phase(FILTER_HELO, s, args); break; case CMD_EHLO: if (!smtp_check_ehlo(s, args)) break; smtp_filter_phase(FILTER_EHLO, s, args); break; /* * SETUP */ case CMD_STARTTLS: if (!smtp_check_starttls(s, args)) break; smtp_filter_phase(FILTER_STARTTLS, s, NULL); break; case CMD_AUTH: if (!smtp_check_auth(s, args)) break; smtp_filter_phase(FILTER_AUTH, s, args); break; case CMD_MAIL_FROM: if (!smtp_check_mail_from(s, args)) break; smtp_filter_phase(FILTER_MAIL_FROM, s, args); break; /* * TRANSACTION */ case CMD_RCPT_TO: if (!smtp_check_rcpt_to(s, args)) break; smtp_filter_phase(FILTER_RCPT_TO, s, args); break; case CMD_RSET: if (!smtp_check_rset(s, args)) break; smtp_filter_phase(FILTER_RSET, s, NULL); break; case CMD_DATA: if (!smtp_check_data(s, args)) break; smtp_filter_phase(FILTER_DATA, s, NULL); break; /* * ANY */ case CMD_QUIT: if (!smtp_check_noparam(s, args)) break; smtp_filter_phase(FILTER_QUIT, s, NULL); break; case CMD_NOOP: if (!smtp_check_noop(s, args)) break; smtp_filter_phase(FILTER_NOOP, s, NULL); break; case CMD_HELP: if (!smtp_check_noparam(s, args)) break; smtp_proceed_help(s, NULL); break; case CMD_WIZ: if (!smtp_check_noparam(s, args)) break; smtp_proceed_wiz(s, NULL); break; default: smtp_reply(s, "500 %s %s: Command unrecognized", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); break; } } static int smtp_check_rset(struct smtp_session *s, const char *args) { if (!smtp_check_noparam(s, args)) return 0; if (s->helo[0] == '\0') { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } return 1; } static int smtp_check_helo(struct smtp_session *s, const char *args) { if (!s->banner_sent) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->helo[0]) { smtp_reply(s, "503 %s %s: Already identified", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (args == NULL) { smtp_reply(s, "501 %s %s: HELO requires domain name", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (!valid_domainpart(args)) { smtp_reply(s, "501 %s %s: Invalid domain name", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static int smtp_check_ehlo(struct smtp_session *s, const char *args) { if (!s->banner_sent) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->helo[0]) { smtp_reply(s, "503 %s %s: Already identified", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (args == NULL) { smtp_reply(s, "501 %s %s: EHLO requires domain name", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (!valid_domainpart(args)) { smtp_reply(s, "501 %s %s: Invalid domain name", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static int smtp_check_auth(struct smtp_session *s, const char *args) { if (s->helo[0] == '\0' || s->tx) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->flags & SF_AUTHENTICATED) { smtp_reply(s, "503 %s %s: Already authenticated", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (!ADVERTISE_AUTH(s)) { smtp_reply(s, "503 %s %s: Command not supported", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (args == NULL) { smtp_reply(s, "501 %s %s: No parameters given", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static int smtp_check_starttls(struct smtp_session *s, const char *args) { if (s->helo[0] == '\0' || s->tx) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (!(s->listener->flags & F_STARTTLS)) { smtp_reply(s, "503 %s %s: Command not supported", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->flags & SF_SECURE) { smtp_reply(s, "503 %s %s: Channel already secured", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (args != NULL) { smtp_reply(s, "501 %s %s: No parameters allowed", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static int smtp_check_mail_from(struct smtp_session *s, const char *args) { char *copy; char tmp[SMTP_LINE_MAX]; struct mailaddr sender; (void)strlcpy(tmp, args, sizeof tmp); copy = tmp; if (s->helo[0] == '\0' || s->tx) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->listener->flags & F_STARTTLS_REQUIRE && !(s->flags & SF_SECURE)) { smtp_reply(s, "530 %s %s: Must issue a STARTTLS command first", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->listener->flags & F_AUTH_REQUIRE && !(s->flags & SF_AUTHENTICATED)) { smtp_reply(s, "530 %s %s: Must issue an AUTH command first", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->mailcount >= env->sc_session_max_mails) { /* we can pretend we had too many recipients */ smtp_reply(s, "452 %s %s: Too many messages sent", esc_code(ESC_STATUS_TEMPFAIL, ESC_TOO_MANY_RECIPIENTS), esc_description(ESC_TOO_MANY_RECIPIENTS)); return 0; } if (smtp_mailaddr(&sender, copy, 1, ©, s->smtpname) == 0) { smtp_reply(s, "553 %s Sender address syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_OTHER_ADDRESS_STATUS)); return 0; } return 1; } static int smtp_check_rcpt_to(struct smtp_session *s, const char *args) { char *copy; char tmp[SMTP_LINE_MAX]; (void)strlcpy(tmp, args, sizeof tmp); copy = tmp; if (s->tx == NULL) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->tx->rcptcount >= env->sc_session_max_rcpt) { smtp_reply(s->tx->session, "451 %s %s: Too many recipients", esc_code(ESC_STATUS_TEMPFAIL, ESC_TOO_MANY_RECIPIENTS), esc_description(ESC_TOO_MANY_RECIPIENTS)); return 0; } if (smtp_mailaddr(&s->tx->evp.rcpt, copy, 0, ©, s->tx->session->smtpname) == 0) { smtp_reply(s->tx->session, "501 %s Recipient address syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_BAD_DESTINATION_MAILBOX_ADDRESS_SYNTAX)); return 0; } return 1; } static int smtp_check_data(struct smtp_session *s, const char *args) { if (!smtp_check_noparam(s, args)) return 0; if (s->tx == NULL) { smtp_reply(s, "503 %s %s: Command not allowed at this point.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); return 0; } if (s->tx->rcptcount == 0) { smtp_reply(s, "503 %s %s: No recipient specified", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static int smtp_check_noop(struct smtp_session *s, const char *args) { return 1; } static int smtp_check_noparam(struct smtp_session *s, const char *args) { if (args != NULL) { smtp_reply(s, "500 %s %s: command does not accept arguments.", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS)); return 0; } return 1; } static void smtp_query_filters(enum filter_phase phase, struct smtp_session *s, const char *args) { m_create(p_lka, IMSG_FILTER_SMTP_PROTOCOL, 0, 0, -1); m_add_id(p_lka, s->id); m_add_int(p_lka, phase); m_add_string(p_lka, args); m_close(p_lka); tree_xset(&wait_filters, s->id, s); } static void smtp_filter_begin(struct smtp_session *s) { if (!SESSION_FILTERED(s)) return; m_create(p_lka, IMSG_FILTER_SMTP_BEGIN, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->listener->filter_name); m_close(p_lka); } static void smtp_filter_end(struct smtp_session *s) { if (!SESSION_FILTERED(s)) return; m_create(p_lka, IMSG_FILTER_SMTP_END, 0, 0, -1); m_add_id(p_lka, s->id); m_close(p_lka); } static void smtp_filter_data_begin(struct smtp_session *s) { if (!SESSION_FILTERED(s)) return; m_create(p_lka, IMSG_FILTER_SMTP_DATA_BEGIN, 0, 0, -1); m_add_id(p_lka, s->id); m_close(p_lka); tree_xset(&wait_filter_fd, s->id, s); } static void smtp_filter_data_end(struct smtp_session *s) { if (!SESSION_FILTERED(s)) return; if (s->tx->filter == NULL) return; io_free(s->tx->filter); s->tx->filter = NULL; m_create(p_lka, IMSG_FILTER_SMTP_DATA_END, 0, 0, -1); m_add_id(p_lka, s->id); m_close(p_lka); } static void smtp_filter_phase(enum filter_phase phase, struct smtp_session *s, const char *param) { uint8_t i; s->filter_phase = phase; s->filter_param = param; if (SESSION_FILTERED(s)) { smtp_query_filters(phase, s, param ? param : ""); return; } if (s->filter_phase == FILTER_CONNECT) { smtp_proceed_connected(s); return; } for (i = 0; i < nitems(commands); ++i) if (commands[i].filter_phase == s->filter_phase) { commands[i].proceed(s, param); break; } } static void smtp_proceed_rset(struct smtp_session *s, const char *args) { smtp_reply(s, "250 %s Reset state", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); if (s->tx) { if (s->tx->msgid) smtp_tx_rollback(s->tx); smtp_tx_free(s->tx); } } static void smtp_proceed_helo(struct smtp_session *s, const char *args) { (void)strlcpy(s->helo, args, sizeof(s->helo)); s->flags &= SF_SECURE | SF_AUTHENTICATED | SF_VERIFIED; smtp_report_link_identify(s, "HELO", s->helo); smtp_enter_state(s, STATE_HELO); smtp_reply(s, "250 %s Hello %s %s%s%s, pleased to meet you", s->smtpname, s->helo, s->ss.ss_family == AF_INET6 ? "" : "[", ss_to_text(&s->ss), s->ss.ss_family == AF_INET6 ? "" : "]"); } static void smtp_proceed_ehlo(struct smtp_session *s, const char *args) { (void)strlcpy(s->helo, args, sizeof(s->helo)); s->flags &= SF_SECURE | SF_AUTHENTICATED | SF_VERIFIED; s->flags |= SF_EHLO; s->flags |= SF_8BITMIME; smtp_report_link_identify(s, "EHLO", s->helo); smtp_enter_state(s, STATE_HELO); smtp_reply(s, "250-%s Hello %s %s%s%s, pleased to meet you", s->smtpname, s->helo, s->ss.ss_family == AF_INET6 ? "" : "[", ss_to_text(&s->ss), s->ss.ss_family == AF_INET6 ? "" : "]"); smtp_reply(s, "250-8BITMIME"); smtp_reply(s, "250-ENHANCEDSTATUSCODES"); smtp_reply(s, "250-SIZE %zu", env->sc_maxsize); if (ADVERTISE_EXT_DSN(s)) smtp_reply(s, "250-DSN"); if (ADVERTISE_TLS(s)) smtp_reply(s, "250-STARTTLS"); if (ADVERTISE_AUTH(s)) smtp_reply(s, "250-AUTH PLAIN LOGIN"); smtp_reply(s, "250 HELP"); } static void smtp_proceed_auth(struct smtp_session *s, const char *args) { char tmp[SMTP_LINE_MAX]; char *eom, *method; (void)strlcpy(tmp, args, sizeof tmp); method = tmp; eom = strchr(tmp, ' '); if (eom == NULL) eom = strchr(tmp, '\t'); if (eom != NULL) *eom++ = '\0'; if (strcasecmp(method, "PLAIN") == 0) smtp_rfc4954_auth_plain(s, eom); else if (strcasecmp(method, "LOGIN") == 0) smtp_rfc4954_auth_login(s, eom); else smtp_reply(s, "504 %s %s: AUTH method \"%s\" not supported", esc_code(ESC_STATUS_PERMFAIL, ESC_SECURITY_FEATURES_NOT_SUPPORTED), esc_description(ESC_SECURITY_FEATURES_NOT_SUPPORTED), method); } static void smtp_proceed_starttls(struct smtp_session *s, const char *args) { smtp_reply(s, "220 %s Ready to start TLS", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); smtp_enter_state(s, STATE_TLS); } static void smtp_proceed_mail_from(struct smtp_session *s, const char *args) { char *copy; char tmp[SMTP_LINE_MAX]; (void)strlcpy(tmp, args, sizeof tmp); copy = tmp; if (!smtp_tx(s)) { smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_enter_state(s, STATE_QUIT); return; } if (smtp_mailaddr(&s->tx->evp.sender, copy, 1, ©, s->smtpname) == 0) { smtp_reply(s, "553 %s Sender address syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_OTHER_ADDRESS_STATUS)); smtp_tx_free(s->tx); return; } smtp_tx_mail_from(s->tx, args); } static void smtp_proceed_rcpt_to(struct smtp_session *s, const char *args) { smtp_tx_rcpt_to(s->tx, args); } static void smtp_proceed_data(struct smtp_session *s, const char *args) { smtp_tx_open_message(s->tx); } static void smtp_proceed_quit(struct smtp_session *s, const char *args) { smtp_reply(s, "221 %s Bye", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); smtp_enter_state(s, STATE_QUIT); } static void smtp_proceed_noop(struct smtp_session *s, const char *args) { smtp_reply(s, "250 %s Ok", esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS)); } static void smtp_proceed_help(struct smtp_session *s, const char *args) { const char *code = esc_code(ESC_STATUS_OK, ESC_OTHER_STATUS); smtp_reply(s, "214-%s This is " SMTPD_NAME, code); smtp_reply(s, "214-%s To report bugs in the implementation, " "please contact bugs@openbsd.org", code); smtp_reply(s, "214-%s with full details", code); smtp_reply(s, "214 %s End of HELP info", code); } static void smtp_proceed_wiz(struct smtp_session *s, const char *args) { smtp_reply(s, "500 %s %s: this feature is not supported yet ;-)", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND), esc_description(ESC_INVALID_COMMAND)); } static void smtp_proceed_commit(struct smtp_session *s, const char *args) { smtp_message_end(s->tx); } static void smtp_proceed_rollback(struct smtp_session *s, const char *args) { struct smtp_tx *tx; tx = s->tx; fclose(tx->ofile); tx->ofile = NULL; smtp_tx_rollback(tx); smtp_tx_free(tx); smtp_enter_state(s, STATE_HELO); } static void smtp_rfc4954_auth_plain(struct smtp_session *s, char *arg) { char buf[1024], *user, *pass; int len; switch (s->state) { case STATE_HELO: if (arg == NULL) { smtp_enter_state(s, STATE_AUTH_INIT); smtp_reply(s, "334 "); return; } smtp_enter_state(s, STATE_AUTH_INIT); /* FALLTHROUGH */ case STATE_AUTH_INIT: /* String is not NUL terminated, leave room. */ if ((len = base64_decode(arg, (unsigned char *)buf, sizeof(buf) - 1)) == -1) goto abort; /* buf is a byte string, NUL terminate. */ buf[len] = '\0'; /* * Skip "foo" in "foo\0user\0pass", if present. */ user = memchr(buf, '\0', len); if (user == NULL || user >= buf + len - 2) goto abort; user++; /* skip NUL */ if (strlcpy(s->username, user, sizeof(s->username)) >= sizeof(s->username)) goto abort; pass = memchr(user, '\0', len - (user - buf)); if (pass == NULL || pass >= buf + len - 2) goto abort; pass++; /* skip NUL */ m_create(p_lka, IMSG_SMTP_AUTHENTICATE, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->listener->authtable); m_add_string(p_lka, user); m_add_string(p_lka, pass); m_close(p_lka); tree_xset(&wait_parent_auth, s->id, s); return; default: fatal("smtp_rfc4954_auth_plain: unknown state"); } abort: smtp_reply(s, "501 %s %s: Syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_SYNTAX_ERROR), esc_description(ESC_SYNTAX_ERROR)); smtp_enter_state(s, STATE_HELO); } static void smtp_rfc4954_auth_login(struct smtp_session *s, char *arg) { char buf[LINE_MAX]; switch (s->state) { case STATE_HELO: smtp_enter_state(s, STATE_AUTH_USERNAME); if (arg != NULL && *arg != '\0') { smtp_rfc4954_auth_login(s, arg); return; } smtp_reply(s, "334 VXNlcm5hbWU6"); return; case STATE_AUTH_USERNAME: memset(s->username, 0, sizeof(s->username)); if (base64_decode(arg, (unsigned char *)s->username, sizeof(s->username) - 1) == -1) goto abort; smtp_enter_state(s, STATE_AUTH_PASSWORD); smtp_reply(s, "334 UGFzc3dvcmQ6"); return; case STATE_AUTH_PASSWORD: memset(buf, 0, sizeof(buf)); if (base64_decode(arg, (unsigned char *)buf, sizeof(buf)-1) == -1) goto abort; m_create(p_lka, IMSG_SMTP_AUTHENTICATE, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->listener->authtable); m_add_string(p_lka, s->username); m_add_string(p_lka, buf); m_close(p_lka); tree_xset(&wait_parent_auth, s->id, s); return; default: fatal("smtp_rfc4954_auth_login: unknown state"); } abort: smtp_reply(s, "501 %s %s: Syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_SYNTAX_ERROR), esc_description(ESC_SYNTAX_ERROR)); smtp_enter_state(s, STATE_HELO); } static void smtp_lookup_servername(struct smtp_session *s) { if (s->listener->hostnametable[0]) { m_create(p_lka, IMSG_SMTP_LOOKUP_HELO, 0, 0, -1); m_add_id(p_lka, s->id); m_add_string(p_lka, s->listener->hostnametable); m_add_sockaddr(p_lka, (struct sockaddr*)&s->listener->ss); m_close(p_lka); tree_xset(&wait_lka_helo, s->id, s); return; } smtp_connected(s); } static void smtp_connected(struct smtp_session *s) { smtp_enter_state(s, STATE_CONNECTED); log_info("%016"PRIx64" smtp connected address=%s host=%s", s->id, ss_to_text(&s->ss), s->rdns); smtp_filter_begin(s); smtp_report_link_connect(s, s->rdns, s->fcrdns, &s->ss, &s->listener->ss); smtp_filter_phase(FILTER_CONNECT, s, ss_to_text(&s->ss)); } static void smtp_proceed_connected(struct smtp_session *s) { if (s->listener->flags & F_SMTPS) smtp_tls_init(s); else smtp_send_banner(s); } static void smtp_send_banner(struct smtp_session *s) { smtp_reply(s, "220 %s ESMTP %s", s->smtpname, SMTPD_NAME); s->banner_sent = 1; smtp_report_link_greeting(s, s->smtpname); } void smtp_enter_state(struct smtp_session *s, int newstate) { log_trace(TRACE_SMTP, "smtp: %p: %s -> %s", s, smtp_strstate(s->state), smtp_strstate(newstate)); s->state = newstate; } static void smtp_reply(struct smtp_session *s, char *fmt, ...) { va_list ap; int n; char buf[LINE_MAX*2], tmp[LINE_MAX*2]; va_start(ap, fmt); n = vsnprintf(buf, sizeof buf, fmt, ap); va_end(ap); if (n < 0) fatalx("smtp_reply: response format error"); if (n < 4) fatalx("smtp_reply: response too short"); if (n >= (int)sizeof buf) { /* only first three bytes are used by SMTP logic, * so if _our_ reply does not fit entirely in the * buffer, it's ok to truncate. */ } log_trace(TRACE_SMTP, "smtp: %p: >>> %s", s, buf); smtp_report_protocol_server(s, buf); switch (buf[0]) { case '2': if (s->tx) { if (s->last_cmd == CMD_MAIL_FROM) { smtp_report_tx_begin(s, s->tx->msgid); smtp_report_tx_mail(s, s->tx->msgid, s->cmd + 10, 1); } else if (s->last_cmd == CMD_RCPT_TO) smtp_report_tx_rcpt(s, s->tx->msgid, s->cmd + 8, 1); } break; case '3': if (s->tx) { if (s->last_cmd == CMD_DATA) smtp_report_tx_data(s, s->tx->msgid, 1); } break; case '5': case '4': /* do not report smtp_tx_mail/smtp_tx_rcpt errors * if they happened outside of a transaction. */ if (s->tx) { if (s->last_cmd == CMD_MAIL_FROM) smtp_report_tx_mail(s, s->tx->msgid, s->cmd + 10, buf[0] == '4' ? -1 : 0); else if (s->last_cmd == CMD_RCPT_TO) smtp_report_tx_rcpt(s, s->tx->msgid, s->cmd + 8, buf[0] == '4' ? -1 : 0); else if (s->last_cmd == CMD_DATA && s->tx->rcptcount) smtp_report_tx_data(s, s->tx->msgid, buf[0] == '4' ? -1 : 0); } if (s->flags & SF_BADINPUT) { log_info("%016"PRIx64" smtp " "bad-input result=\"%.*s\"", s->id, n, buf); } else if (s->state == STATE_AUTH_INIT) { log_info("%016"PRIx64" smtp " "failed-command " "command=\"AUTH PLAIN (...)\" result=\"%.*s\"", s->id, n, buf); } else if (s->state == STATE_AUTH_USERNAME) { log_info("%016"PRIx64" smtp " "failed-command " "command=\"AUTH LOGIN (username)\" result=\"%.*s\"", s->id, n, buf); } else if (s->state == STATE_AUTH_PASSWORD) { log_info("%016"PRIx64" smtp " "failed-command " "command=\"AUTH LOGIN (password)\" result=\"%.*s\"", s->id, n, buf); } else { strnvis(tmp, s->cmd, sizeof tmp, VIS_SAFE | VIS_CSTYLE); log_info("%016"PRIx64" smtp " "failed-command command=\"%s\" " "result=\"%.*s\"", s->id, tmp, n, buf); } break; } io_xprintf(s->io, "%s\r\n", buf); } static void smtp_free(struct smtp_session *s, const char * reason) { if (s->tx) { if (s->tx->msgid) smtp_tx_rollback(s->tx); smtp_tx_free(s->tx); } smtp_report_link_disconnect(s); smtp_filter_end(s); if (s->flags & SF_SECURE && s->listener->flags & F_SMTPS) stat_decrement("smtp.smtps", 1); if (s->flags & SF_SECURE && s->listener->flags & F_STARTTLS) stat_decrement("smtp.tls", 1); io_free(s->io); free(s); smtp_collect(); } static int smtp_mailaddr(struct mailaddr *maddr, char *line, int mailfrom, char **args, const char *domain) { char *p, *e; if (line == NULL) return (0); if (*line != '<') return (0); e = strchr(line, '>'); if (e == NULL) return (0); *e++ = '\0'; while (*e == ' ') e++; *args = e; if (!text_to_mailaddr(maddr, line + 1)) return (0); p = strchr(maddr->user, ':'); if (p != NULL) { p++; memmove(maddr->user, p, strlen(p) + 1); } /* accept empty return-path in MAIL FROM, required for bounces */ if (mailfrom && maddr->user[0] == '\0' && maddr->domain[0] == '\0') return (1); /* no or invalid user-part, reject */ if (maddr->user[0] == '\0' || !valid_localpart(maddr->user)) return (0); /* no domain part, local user */ if (maddr->domain[0] == '\0') { (void)strlcpy(maddr->domain, domain, sizeof(maddr->domain)); } if (!valid_domainpart(maddr->domain)) return (0); return (1); } static void smtp_auth_failure_resume(int fd, short event, void *p) { struct smtp_session *s = p; smtp_reply(s, "535 Authentication failed"); smtp_enter_state(s, STATE_HELO); } static void smtp_auth_failure_pause(struct smtp_session *s) { struct timeval tv; tv.tv_sec = 0; tv.tv_usec = arc4random_uniform(1000000); log_trace(TRACE_SMTP, "smtp: timing-attack protection triggered, " "will defer answer for %lu microseconds", (long)tv.tv_usec); evtimer_set(&s->pause, smtp_auth_failure_resume, s); evtimer_add(&s->pause, &tv); } static int smtp_tx(struct smtp_session *s) { struct smtp_tx *tx; tx = calloc(1, sizeof(*tx)); if (tx == NULL) return 0; TAILQ_INIT(&tx->rcpts); s->tx = tx; tx->session = s; /* setup the envelope */ tx->evp.ss = s->ss; (void)strlcpy(tx->evp.tag, s->listener->tag, sizeof(tx->evp.tag)); (void)strlcpy(tx->evp.smtpname, s->smtpname, sizeof(tx->evp.smtpname)); (void)strlcpy(tx->evp.hostname, s->rdns, sizeof tx->evp.hostname); (void)strlcpy(tx->evp.helo, s->helo, sizeof(tx->evp.helo)); (void)strlcpy(tx->evp.username, s->username, sizeof(tx->evp.username)); if (s->flags & SF_BOUNCE) tx->evp.flags |= EF_BOUNCE; if (s->flags & SF_AUTHENTICATED) tx->evp.flags |= EF_AUTHENTICATED; if ((tx->parser = rfc5322_parser_new()) == NULL) { free(tx); return 0; } return 1; } static void smtp_tx_free(struct smtp_tx *tx) { struct smtp_rcpt *rcpt; rfc5322_free(tx->parser); while ((rcpt = TAILQ_FIRST(&tx->rcpts))) { TAILQ_REMOVE(&tx->rcpts, rcpt, entry); free(rcpt); } if (tx->ofile) fclose(tx->ofile); tx->session->tx = NULL; free(tx); } static void smtp_tx_mail_from(struct smtp_tx *tx, const char *line) { char *opt; char *copy; char tmp[SMTP_LINE_MAX]; (void)strlcpy(tmp, line, sizeof tmp); copy = tmp; if (smtp_mailaddr(&tx->evp.sender, copy, 1, ©, tx->session->smtpname) == 0) { smtp_reply(tx->session, "553 %s Sender address syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_OTHER_ADDRESS_STATUS)); smtp_tx_free(tx); return; } while ((opt = strsep(©, " "))) { if (*opt == '\0') continue; if (strncasecmp(opt, "AUTH=", 5) == 0) log_debug("debug: smtp: AUTH in MAIL FROM command"); else if (strncasecmp(opt, "SIZE=", 5) == 0) log_debug("debug: smtp: SIZE in MAIL FROM command"); else if (strcasecmp(opt, "BODY=7BIT") == 0) /* XXX only for this transaction */ tx->session->flags &= ~SF_8BITMIME; else if (strcasecmp(opt, "BODY=8BITMIME") == 0) ; else if (ADVERTISE_EXT_DSN(tx->session) && strncasecmp(opt, "RET=", 4) == 0) { opt += 4; if (strcasecmp(opt, "HDRS") == 0) tx->evp.dsn_ret = DSN_RETHDRS; else if (strcasecmp(opt, "FULL") == 0) tx->evp.dsn_ret = DSN_RETFULL; } else if (ADVERTISE_EXT_DSN(tx->session) && strncasecmp(opt, "ENVID=", 6) == 0) { opt += 6; if (strlcpy(tx->evp.dsn_envid, opt, sizeof(tx->evp.dsn_envid)) >= sizeof(tx->evp.dsn_envid)) { smtp_reply(tx->session, "503 %s %s: option too large, truncated: %s", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS), opt); smtp_tx_free(tx); return; } } else { smtp_reply(tx->session, "503 %s %s: Unsupported option %s", esc_code(ESC_STATUS_PERMFAIL, ESC_INVALID_COMMAND_ARGUMENTS), esc_description(ESC_INVALID_COMMAND_ARGUMENTS), opt); smtp_tx_free(tx); return; } } /* only check sendertable if defined and user has authenticated */ if (tx->session->flags & SF_AUTHENTICATED && tx->session->listener->sendertable[0]) { m_create(p_lka, IMSG_SMTP_CHECK_SENDER, 0, 0, -1); m_add_id(p_lka, tx->session->id); m_add_string(p_lka, tx->session->listener->sendertable); m_add_string(p_lka, tx->session->username); m_add_mailaddr(p_lka, &tx->evp.sender); m_close(p_lka); tree_xset(&wait_lka_mail, tx->session->id, tx->session); } else smtp_tx_create_message(tx); } static void smtp_tx_create_message(struct smtp_tx *tx) { m_create(p_queue, IMSG_SMTP_MESSAGE_CREATE, 0, 0, -1); m_add_id(p_queue, tx->session->id); m_close(p_queue); tree_xset(&wait_queue_msg, tx->session->id, tx->session); } static void smtp_tx_rcpt_to(struct smtp_tx *tx, const char *line) { char *opt, *p; char *copy; char tmp[SMTP_LINE_MAX]; (void)strlcpy(tmp, line, sizeof tmp); copy = tmp; if (tx->rcptcount >= env->sc_session_max_rcpt) { smtp_reply(tx->session, "451 %s %s: Too many recipients", esc_code(ESC_STATUS_TEMPFAIL, ESC_TOO_MANY_RECIPIENTS), esc_description(ESC_TOO_MANY_RECIPIENTS)); return; } if (smtp_mailaddr(&tx->evp.rcpt, copy, 0, ©, tx->session->smtpname) == 0) { smtp_reply(tx->session, "501 %s Recipient address syntax error", esc_code(ESC_STATUS_PERMFAIL, ESC_BAD_DESTINATION_MAILBOX_ADDRESS_SYNTAX)); return; } while ((opt = strsep(©, " "))) { if (*opt == '\0') continue; if (ADVERTISE_EXT_DSN(tx->session) && strncasecmp(opt, "NOTIFY=", 7) == 0) { opt += 7; while ((p = strsep(&opt, ","))) { if (strcasecmp(p, "SUCCESS") == 0) tx->evp.dsn_notify |= DSN_SUCCESS; else if (strcasecmp(p, "FAILURE") == 0) tx->evp.dsn_notify |= DSN_FAILURE; else if (strcasecmp(p, "DELAY") == 0) tx->evp.dsn_notify |= DSN_DELAY; else if (strcasecmp(p, "NEVER") == 0) tx->evp.dsn_notify |= DSN_NEVER; } if (tx->evp.dsn_notify & DSN_NEVER && tx->evp.dsn_notify & (DSN_SUCCESS | DSN_FAILURE | DSN_DELAY)) { smtp_reply(tx->session, "553 NOTIFY option NEVER cannot be" " combined with other options"); return; } } else if (ADVERTISE_EXT_DSN(tx->session) && strncasecmp(opt, "ORCPT=", 6) == 0) { size_t len = sizeof(tx->evp.dsn_orcpt); opt += 6; if ((p = strchr(opt, ';')) == NULL || !valid_xtext(p + 1) || strlcpy(tx->evp.dsn_orcpt, opt, len) >= len) { smtp_reply(tx->session, "553 ORCPT address syntax error"); return; } } else { smtp_reply(tx->session, "503 Unsupported option %s", opt); return; } } m_create(p_lka, IMSG_SMTP_EXPAND_RCPT, 0, 0, -1); m_add_id(p_lka, tx->session->id); m_add_envelope(p_lka, &tx->evp); m_close(p_lka); tree_xset(&wait_lka_rcpt, tx->session->id, tx->session); } static void smtp_tx_open_message(struct smtp_tx *tx) { m_create(p_queue, IMSG_SMTP_MESSAGE_OPEN, 0, 0, -1); m_add_id(p_queue, tx->session->id); m_add_msgid(p_queue, tx->msgid); m_close(p_queue); tree_xset(&wait_queue_fd, tx->session->id, tx->session); } static void smtp_tx_commit(struct smtp_tx *tx) { m_create(p_queue, IMSG_SMTP_MESSAGE_COMMIT, 0, 0, -1); m_add_id(p_queue, tx->session->id); m_add_msgid(p_queue, tx->msgid); m_close(p_queue); tree_xset(&wait_queue_commit, tx->session->id, tx->session); smtp_filter_data_end(tx->session); } static void smtp_tx_rollback(struct smtp_tx *tx) { m_create(p_queue, IMSG_SMTP_MESSAGE_ROLLBACK, 0, 0, -1); m_add_msgid(p_queue, tx->msgid); m_close(p_queue); smtp_report_tx_rollback(tx->session, tx->msgid); smtp_report_tx_reset(tx->session, tx->msgid); smtp_filter_data_end(tx->session); } static int smtp_tx_dataline(struct smtp_tx *tx, const char *line) { struct rfc5322_result res; int r; log_trace(TRACE_SMTP, "<<< [MSG] %s", line); if (!strcmp(line, ".")) { smtp_report_protocol_client(tx->session, "."); log_trace(TRACE_SMTP, "<<< [EOM]"); if (tx->error) return 1; line = NULL; } else { /* ignore data line if an error is set */ if (tx->error) return 0; /* escape lines starting with a '.' */ if (line[0] == '.') line += 1; } if (rfc5322_push(tx->parser, line) == -1) { log_warnx("failed to push dataline"); tx->error = TX_ERROR_INTERNAL; return 0; } for(;;) { r = rfc5322_next(tx->parser, &res); switch (r) { case -1: if (errno == ENOMEM) tx->error = TX_ERROR_INTERNAL; else tx->error = TX_ERROR_MALFORMED; return 0; case RFC5322_NONE: /* Need more data */ return 0; case RFC5322_HEADER_START: /* ignore bcc */ if (!strcasecmp("Bcc", res.hdr)) continue; if (!strcasecmp("To", res.hdr) || !strcasecmp("Cc", res.hdr) || !strcasecmp("From", res.hdr)) { rfc5322_unfold_header(tx->parser); continue; } if (!strcasecmp("Received", res.hdr)) { if (++tx->rcvcount >= MAX_HOPS_COUNT) { log_warnx("warn: loop detected"); tx->error = TX_ERROR_LOOP; return 0; } } else if (!tx->has_date && !strcasecmp("Date", res.hdr)) tx->has_date = 1; else if (!tx->has_message_id && !strcasecmp("Message-Id", res.hdr)) tx->has_message_id = 1; smtp_message_printf(tx, "%s:%s\n", res.hdr, res.value); break; case RFC5322_HEADER_CONT: if (!strcasecmp("Bcc", res.hdr) || !strcasecmp("To", res.hdr) || !strcasecmp("Cc", res.hdr) || !strcasecmp("From", res.hdr)) continue; smtp_message_printf(tx, "%s\n", res.value); break; case RFC5322_HEADER_END: if (!strcasecmp("To", res.hdr) || !strcasecmp("Cc", res.hdr) || !strcasecmp("From", res.hdr)) header_domain_append_callback(tx, res.hdr, res.value); break; case RFC5322_END_OF_HEADERS: if (tx->session->listener->local || tx->session->listener->port == htons(587)) { if (!tx->has_date) { log_debug("debug: %p: adding Date", tx); smtp_message_printf(tx, "Date: %s\n", time_to_text(tx->time)); } if (!tx->has_message_id) { log_debug("debug: %p: adding Message-ID", tx); smtp_message_printf(tx, "Message-ID: <%016"PRIx64"@%s>\n", generate_uid(), tx->session->listener->hostname); } } break; case RFC5322_BODY_START: case RFC5322_BODY: smtp_message_printf(tx, "%s\n", res.value); break; case RFC5322_END_OF_MESSAGE: return 1; default: fatalx("%s", __func__); } } } static int smtp_tx_filtered_dataline(struct smtp_tx *tx, const char *line) { if (!strcmp(line, ".")) line = NULL; else { /* ignore data line if an error is set */ if (tx->error) return 0; } io_printf(tx->filter, "%s\n", line ? line : "."); return line ? 0 : 1; } static void smtp_tx_eom(struct smtp_tx *tx) { smtp_filter_phase(FILTER_COMMIT, tx->session, NULL); } static int smtp_message_fd(struct smtp_tx *tx, int fd) { struct smtp_session *s; s = tx->session; log_debug("smtp: %p: message fd %d", s, fd); if ((tx->ofile = fdopen(fd, "w")) == NULL) { close(fd); smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); smtp_enter_state(s, STATE_QUIT); return 0; } return 1; } static void filter_session_io(struct io *io, int evt, void *arg) { struct smtp_tx*tx = arg; char*line = NULL; ssize_t len; log_trace(TRACE_IO, "filter session io (smtp): %p: %s %s", tx, io_strevent(evt), io_strio(io)); switch (evt) { case IO_DATAIN: nextline: line = io_getline(tx->filter, &len); /* No complete line received */ if (line == NULL) return; if (smtp_tx_dataline(tx, line)) { smtp_tx_eom(tx); return; } goto nextline; } } static void smtp_filter_fd(struct smtp_tx *tx, int fd) { struct smtp_session *s; s = tx->session; log_debug("smtp: %p: filter fd %d", s, fd); tx->filter = io_new(); io_set_fd(tx->filter, fd); io_set_callback(tx->filter, filter_session_io, tx); } static void smtp_message_begin(struct smtp_tx *tx) { struct smtp_session *s; struct smtp_rcpt *rcpt; int (*m_printf)(struct smtp_tx *, const char *, ...); m_printf = smtp_message_printf; if (tx->filter) m_printf = smtp_filter_printf; s = tx->session; log_debug("smtp: %p: message begin", s); smtp_reply(s, "354 Enter mail, end with \".\"" " on a line by itself"); if (s->junk || (s->tx && s->tx->junk)) m_printf(tx, "X-Spam: Yes\n"); m_printf(tx, "Received: "); if (!(s->listener->flags & F_MASK_SOURCE)) { m_printf(tx, "from %s (%s %s%s%s)", s->helo, s->rdns, s->ss.ss_family == AF_INET6 ? "" : "[", ss_to_text(&s->ss), s->ss.ss_family == AF_INET6 ? "" : "]"); } m_printf(tx, "\n\tby %s (%s) with %sSMTP%s%s id %08x", s->smtpname, SMTPD_NAME, s->flags & SF_EHLO ? "E" : "", s->flags & SF_SECURE ? "S" : "", s->flags & SF_AUTHENTICATED ? "A" : "", tx->msgid); if (s->flags & SF_SECURE) { m_printf(tx, " (%s:%s:%d:%s)", tls_conn_version(io_tls(s->io)), tls_conn_cipher(io_tls(s->io)), tls_conn_cipher_strength(io_tls(s->io)), (s->flags & SF_VERIFIED) ? "YES" : "NO"); if (s->listener->flags & F_RECEIVEDAUTH) { m_printf(tx, " auth=%s", s->username[0] ? "yes" : "no"); if (s->username[0]) m_printf(tx, " user=%s", s->username); } } if (tx->rcptcount == 1) { rcpt = TAILQ_FIRST(&tx->rcpts); m_printf(tx, "\n\tfor <%s@%s>", rcpt->maddr.user, rcpt->maddr.domain); } m_printf(tx, ";\n\t%s\n", time_to_text(time(&tx->time))); smtp_enter_state(s, STATE_BODY); } static void smtp_message_end(struct smtp_tx *tx) { struct smtp_session *s; s = tx->session; log_debug("debug: %p: end of message, error=%d", s, tx->error); fclose(tx->ofile); tx->ofile = NULL; switch(tx->error) { case TX_OK: smtp_tx_commit(tx); return; case TX_ERROR_SIZE: smtp_reply(s, "554 %s %s: Transaction failed, message too big", esc_code(ESC_STATUS_PERMFAIL, ESC_MESSAGE_TOO_BIG_FOR_SYSTEM), esc_description(ESC_MESSAGE_TOO_BIG_FOR_SYSTEM)); break; case TX_ERROR_LOOP: smtp_reply(s, "500 %s %s: Loop detected", esc_code(ESC_STATUS_PERMFAIL, ESC_ROUTING_LOOP_DETECTED), esc_description(ESC_ROUTING_LOOP_DETECTED)); break; case TX_ERROR_MALFORMED: smtp_reply(s, "550 %s %s: Message is not RFC 2822 compliant", esc_code(ESC_STATUS_PERMFAIL, ESC_DELIVERY_NOT_AUTHORIZED_MESSAGE_REFUSED), esc_description(ESC_DELIVERY_NOT_AUTHORIZED_MESSAGE_REFUSED)); break; case TX_ERROR_IO: case TX_ERROR_RESOURCES: smtp_reply(s, "421 %s Temporary Error", esc_code(ESC_STATUS_TEMPFAIL, ESC_OTHER_MAIL_SYSTEM_STATUS)); break; default: /* fatal? */ smtp_reply(s, "421 Internal server error"); } smtp_tx_rollback(tx); smtp_tx_free(tx); smtp_enter_state(s, STATE_HELO); } static int smtp_filter_printf(struct smtp_tx *tx, const char *fmt, ...) { va_list ap; int len; if (tx->error) return -1; va_start(ap, fmt); len = io_vprintf(tx->filter, fmt, ap); va_end(ap); if (len < 0) { log_warn("smtp-in: session %016"PRIx64": vfprintf", tx->session->id); tx->error = TX_ERROR_IO; } else tx->odatalen += len; return len; } static int smtp_message_printf(struct smtp_tx *tx, const char *fmt, ...) { va_list ap; int len; if (tx->error) return -1; va_start(ap, fmt); len = vfprintf(tx->ofile, fmt, ap); va_end(ap); if (len == -1) { log_warn("smtp-in: session %016"PRIx64": vfprintf", tx->session->id); tx->error = TX_ERROR_IO; } else tx->odatalen += len; return len; } #define CASE(x) case x : return #x const char * smtp_strstate(int state) { static char buf[32]; switch (state) { CASE(STATE_NEW); CASE(STATE_CONNECTED); CASE(STATE_TLS); CASE(STATE_HELO); CASE(STATE_AUTH_INIT); CASE(STATE_AUTH_USERNAME); CASE(STATE_AUTH_PASSWORD); CASE(STATE_AUTH_FINALIZE); CASE(STATE_BODY); CASE(STATE_QUIT); default: (void)snprintf(buf, sizeof(buf), "STATE_??? (%d)", state); return (buf); } } static void smtp_report_link_connect(struct smtp_session *s, const char *rdns, int fcrdns, const struct sockaddr_storage *ss_src, const struct sockaddr_storage *ss_dest) { if (! SESSION_FILTERED(s)) return; report_smtp_link_connect("smtp-in", s->id, rdns, fcrdns, ss_src, ss_dest); } static void smtp_report_link_greeting(struct smtp_session *s, const char *domain) { if (! SESSION_FILTERED(s)) return; report_smtp_link_greeting("smtp-in", s->id, domain); } static void smtp_report_link_identify(struct smtp_session *s, const char *method, const char *identity) { if (! SESSION_FILTERED(s)) return; report_smtp_link_identify("smtp-in", s->id, method, identity); } static void smtp_report_link_tls(struct smtp_session *s, const char *ssl) { if (! SESSION_FILTERED(s)) return; report_smtp_link_tls("smtp-in", s->id, ssl); } static void smtp_report_link_disconnect(struct smtp_session *s) { if (! SESSION_FILTERED(s)) return; report_smtp_link_disconnect("smtp-in", s->id); } static void smtp_report_link_auth(struct smtp_session *s, const char *user, const char *result) { if (! SESSION_FILTERED(s)) return; report_smtp_link_auth("smtp-in", s->id, user, result); } static void smtp_report_tx_reset(struct smtp_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_reset("smtp-in", s->id, msgid); } static void smtp_report_tx_begin(struct smtp_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_begin("smtp-in", s->id, msgid); } static void smtp_report_tx_mail(struct smtp_session *s, uint32_t msgid, const char *address, int ok) { char mailaddr[SMTPD_MAXMAILADDRSIZE]; char *p; if (! SESSION_FILTERED(s)) return; if ((p = strchr(address, '<')) == NULL) return; (void)strlcpy(mailaddr, p + 1, sizeof mailaddr); if ((p = strchr(mailaddr, '>')) == NULL) return; *p = '\0'; report_smtp_tx_mail("smtp-in", s->id, msgid, mailaddr, ok); } static void smtp_report_tx_rcpt(struct smtp_session *s, uint32_t msgid, const char *address, int ok) { char mailaddr[SMTPD_MAXMAILADDRSIZE]; char *p; if (! SESSION_FILTERED(s)) return; if ((p = strchr(address, '<')) == NULL) return; (void)strlcpy(mailaddr, p + 1, sizeof mailaddr); if ((p = strchr(mailaddr, '>')) == NULL) return; *p = '\0'; report_smtp_tx_rcpt("smtp-in", s->id, msgid, mailaddr, ok); } static void smtp_report_tx_envelope(struct smtp_session *s, uint32_t msgid, uint64_t evpid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_envelope("smtp-in", s->id, msgid, evpid); } static void smtp_report_tx_data(struct smtp_session *s, uint32_t msgid, int ok) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_data("smtp-in", s->id, msgid, ok); } static void smtp_report_tx_commit(struct smtp_session *s, uint32_t msgid, size_t msgsz) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_commit("smtp-in", s->id, msgid, msgsz); } static void smtp_report_tx_rollback(struct smtp_session *s, uint32_t msgid) { if (! SESSION_FILTERED(s)) return; report_smtp_tx_rollback("smtp-in", s->id, msgid); } static void smtp_report_protocol_client(struct smtp_session *s, const char *command) { if (! SESSION_FILTERED(s)) return; report_smtp_protocol_client("smtp-in", s->id, command); } static void smtp_report_protocol_server(struct smtp_session *s, const char *response) { if (! SESSION_FILTERED(s)) return; report_smtp_protocol_server("smtp-in", s->id, response); } static void smtp_report_filter_response(struct smtp_session *s, int phase, int response, const char *param) { if (! SESSION_FILTERED(s)) return; report_smtp_filter_response("smtp-in", s->id, phase, response, param); } static void smtp_report_timeout(struct smtp_session *s) { if (! SESSION_FILTERED(s)) return; report_smtp_timeout("smtp-in", s->id); } opensmtpd-7.7.0p0/usr.sbin/smtpd/queue_null.c0000644000175000001440000000535414610663500014677 /* $OpenBSD: queue_null.c,v 1.10 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" static int queue_null_message_create(uint32_t *msgid) { *msgid = queue_generate_msgid(); return (1); } static int queue_null_message_commit(uint32_t msgid, const char *path) { return (1); } static int queue_null_message_delete(uint32_t msgid) { return (1); } static int queue_null_message_fd_r(uint32_t msgid) { return (-1); } static int queue_null_envelope_create(uint32_t msgid, const char *buf, size_t len, uint64_t *evpid) { *evpid = queue_generate_evpid(msgid); return (1); } static int queue_null_envelope_delete(uint64_t evpid) { return (1); } static int queue_null_envelope_update(uint64_t evpid, const char *buf, size_t len) { return (1); } static int queue_null_envelope_load(uint64_t evpid, char *buf, size_t len) { return (0); } static int queue_null_envelope_walk(uint64_t *evpid, char *buf, size_t len) { return (-1); } static int queue_null_init(struct passwd *pw, int server, const char *conf) { queue_api_on_message_create(queue_null_message_create); queue_api_on_message_commit(queue_null_message_commit); queue_api_on_message_delete(queue_null_message_delete); queue_api_on_message_fd_r(queue_null_message_fd_r); queue_api_on_envelope_create(queue_null_envelope_create); queue_api_on_envelope_delete(queue_null_envelope_delete); queue_api_on_envelope_update(queue_null_envelope_update); queue_api_on_envelope_load(queue_null_envelope_load); queue_api_on_envelope_walk(queue_null_envelope_walk); return (1); } struct queue_backend queue_backend_null = { queue_null_init, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/tree.c0000644000175000001440000001201614610663500013451 /* $OpenBSD: tree.c,v 1.8 2021/06/14 17:58:16 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include "tree.h" #include "log.h" struct treeentry { SPLAY_ENTRY(treeentry) entry; uint64_t id; void *data; }; static int treeentry_cmp(struct treeentry *, struct treeentry *); SPLAY_PROTOTYPE(_tree, treeentry, entry, treeentry_cmp); int tree_check(struct tree *t, uint64_t id) { struct treeentry key; key.id = id; return (SPLAY_FIND(_tree, &t->tree, &key) != NULL); } void * tree_set(struct tree *t, uint64_t id, void *data) { struct treeentry *entry, key; char *old; key.id = id; if ((entry = SPLAY_FIND(_tree, &t->tree, &key)) == NULL) { if ((entry = malloc(sizeof *entry)) == NULL) fatal("tree_set: malloc"); entry->id = id; SPLAY_INSERT(_tree, &t->tree, entry); old = NULL; t->count += 1; } else old = entry->data; entry->data = data; return (old); } void tree_xset(struct tree *t, uint64_t id, void *data) { struct treeentry *entry; if ((entry = malloc(sizeof *entry)) == NULL) fatal("tree_xset: malloc"); entry->id = id; entry->data = data; if (SPLAY_INSERT(_tree, &t->tree, entry)) fatalx("tree_xset(%p, 0x%016"PRIx64 ")", t, id); t->count += 1; } void * tree_get(struct tree *t, uint64_t id) { struct treeentry key, *entry; key.id = id; if ((entry = SPLAY_FIND(_tree, &t->tree, &key)) == NULL) return (NULL); return (entry->data); } void * tree_xget(struct tree *t, uint64_t id) { struct treeentry key, *entry; key.id = id; if ((entry = SPLAY_FIND(_tree, &t->tree, &key)) == NULL) fatalx("tree_get(%p, 0x%016"PRIx64 ")", t, id); return (entry->data); } void * tree_pop(struct tree *t, uint64_t id) { struct treeentry key, *entry; void *data; key.id = id; if ((entry = SPLAY_FIND(_tree, &t->tree, &key)) == NULL) return (NULL); data = entry->data; SPLAY_REMOVE(_tree, &t->tree, entry); free(entry); t->count -= 1; return (data); } void * tree_xpop(struct tree *t, uint64_t id) { struct treeentry key, *entry; void *data; key.id = id; if ((entry = SPLAY_FIND(_tree, &t->tree, &key)) == NULL) fatalx("tree_xpop(%p, 0x%016" PRIx64 ")", t, id); data = entry->data; SPLAY_REMOVE(_tree, &t->tree, entry); free(entry); t->count -= 1; return (data); } int tree_poproot(struct tree *t, uint64_t *id, void **data) { struct treeentry *entry; entry = SPLAY_ROOT(&t->tree); if (entry == NULL) return (0); if (id) *id = entry->id; if (data) *data = entry->data; SPLAY_REMOVE(_tree, &t->tree, entry); free(entry); t->count -= 1; return (1); } int tree_root(struct tree *t, uint64_t *id, void **data) { struct treeentry *entry; entry = SPLAY_ROOT(&t->tree); if (entry == NULL) return (0); if (id) *id = entry->id; if (data) *data = entry->data; return (1); } int tree_iter(struct tree *t, void **hdl, uint64_t *id, void **data) { struct treeentry *curr = *hdl; if (curr == NULL) curr = SPLAY_MIN(_tree, &t->tree); else curr = SPLAY_NEXT(_tree, &t->tree, curr); if (curr) { *hdl = curr; if (id) *id = curr->id; if (data) *data = curr->data; return (1); } return (0); } int tree_iterfrom(struct tree *t, void **hdl, uint64_t k, uint64_t *id, void **data) { struct treeentry *curr = *hdl, key; if (curr == NULL) { if (k == 0) curr = SPLAY_MIN(_tree, &t->tree); else { key.id = k; curr = SPLAY_FIND(_tree, &t->tree, &key); if (curr == NULL) { SPLAY_INSERT(_tree, &t->tree, &key); curr = SPLAY_NEXT(_tree, &t->tree, &key); SPLAY_REMOVE(_tree, &t->tree, &key); } } } else curr = SPLAY_NEXT(_tree, &t->tree, curr); if (curr) { *hdl = curr; if (id) *id = curr->id; if (data) *data = curr->data; return (1); } return (0); } void tree_merge(struct tree *dst, struct tree *src) { struct treeentry *entry; while (!SPLAY_EMPTY(&src->tree)) { entry = SPLAY_ROOT(&src->tree); SPLAY_REMOVE(_tree, &src->tree, entry); if (SPLAY_INSERT(_tree, &dst->tree, entry)) fatalx("tree_merge: duplicate"); } dst->count += src->count; src->count = 0; } static int treeentry_cmp(struct treeentry *a, struct treeentry *b) { if (a->id < b->id) return (-1); if (a->id > b->id) return (1); return (0); } SPLAY_GENERATE(_tree, treeentry, entry, treeentry_cmp); opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.maildir.80000644000175000001440000000267514610663500015013 .\" $OpenBSD: mail.maildir.8,v 1.6 2021/02/13 07:28:50 jmc Exp $ .\" .\" Copyright (c) 2017 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 13 2021 $ .Dt MAIL.MAILDIR 8 .Os .Sh NAME .Nm mail.maildir .Nd store mail in a maildir .Sh SYNOPSIS .Nm mail.maildir .Op Fl j .Op Ar pathname .Sh DESCRIPTION .Nm reads the standard input up to an end-of-file and adds it to the mail directory located in .Ar pathname or to the mail directory .Pa Maildir located in the user's home directory. .Pp The options are as follows: .Bl -tag -width Ds .It Fl j Scan the message for an X-Spam header and move to the Junk folder if the result is positive. .El .Sh EXIT STATUS .Ex -std mail.maildir .Sh SEE ALSO .Xr mail 1 , .Xr smtpd 8 opensmtpd-7.7.0p0/usr.sbin/smtpd/parser.c0000644000175000001440000001616314610663500014015 /* $OpenBSD: parser.c,v 1.43 2021/06/14 17:58:15 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "parser.h" uint64_t text_to_evpid(const char *); uint32_t text_to_msgid(const char *); struct node { int type; const char *token; struct node *parent; TAILQ_ENTRY(node) entry; TAILQ_HEAD(, node) children; int (*cmd)(int, struct parameter*); }; static struct node *root; static int text_to_sockaddr(struct sockaddr *, int, const char *); #define ARGVMAX 64 int cmd_install(const char *pattern, int (*cmd)(int, struct parameter*)) { struct node *node, *tmp; char *s, *str, *argv[ARGVMAX], **ap; int i, n; /* Tokenize */ str = s = strdup(pattern); if (str == NULL) err(1, "strdup"); n = 0; for (ap = argv; n < ARGVMAX && (*ap = strsep(&str, " \t")) != NULL;) { if (**ap != '\0') { ap++; n++; } } *ap = NULL; if (root == NULL) { root = calloc(1, sizeof (*root)); TAILQ_INIT(&root->children); } node = root; for (i = 0; i < n; i++) { TAILQ_FOREACH(tmp, &node->children, entry) { if (!strcmp(tmp->token, argv[i])) { node = tmp; break; } } if (tmp == NULL) { tmp = calloc(1, sizeof (*tmp)); TAILQ_INIT(&tmp->children); if (!strcmp(argv[i], "")) tmp->type = P_STR; else if (!strcmp(argv[i], "")) tmp->type = P_INT; else if (!strcmp(argv[i], "")) tmp->type = P_MSGID; else if (!strcmp(argv[i], "")) tmp->type = P_EVPID; else if (!strcmp(argv[i], "")) tmp->type = P_ROUTEID; else if (!strcmp(argv[i], "")) tmp->type = P_ADDR; else tmp->type = P_TOKEN; tmp->token = strdup(argv[i]); tmp->parent = node; TAILQ_INSERT_TAIL(&node->children, tmp, entry); node = tmp; } } if (node->cmd) errx(1, "duplicate pattern: %s", pattern); node->cmd = cmd; free(s); return (n); } static int cmd_check(const char *str, struct node *node, struct parameter *res) { const char *e; switch (node->type) { case P_TOKEN: if (!strcmp(str, node->token)) return (1); return (0); case P_STR: res->u.u_str = str; return (1); case P_INT: res->u.u_int = strtonum(str, INT_MIN, INT_MAX, &e); if (e) return (0); return (1); case P_MSGID: if (strlen(str) != 8) return (0); res->u.u_msgid = text_to_msgid(str); if (res->u.u_msgid == 0) return (0); return (1); case P_EVPID: if (strlen(str) != 16) return (0); res->u.u_evpid = text_to_evpid(str); if (res->u.u_evpid == 0) return (0); return (1); case P_ROUTEID: res->u.u_routeid = strtonum(str, 1, LLONG_MAX, &e); if (e) return (0); return (1); case P_ADDR: if (text_to_sockaddr((struct sockaddr *)&res->u.u_ss, PF_UNSPEC, str) == 0) return (1); return (0); default: errx(1, "bad token type: %d", node->type); return (0); } } int cmd_run(int argc, char **argv) { struct parameter param[ARGVMAX]; struct node *node, *tmp, *stack[ARGVMAX], *best; int i, j, np; node = root; np = 0; for (i = 0; i < argc; i++) { TAILQ_FOREACH(tmp, &node->children, entry) { if (cmd_check(argv[i], tmp, ¶m[np])) { stack[i] = tmp; node = tmp; param[np].type = node->type; if (node->type != P_TOKEN) np++; break; } } if (tmp == NULL) { best = NULL; TAILQ_FOREACH(tmp, &node->children, entry) { if (tmp->type != P_TOKEN) continue; if (strstr(tmp->token, argv[i]) != tmp->token) continue; if (best) goto fail; best = tmp; } if (best == NULL) goto fail; stack[i] = best; node = best; param[np].type = node->type; if (node->type != P_TOKEN) np++; } } if (node->cmd == NULL) goto fail; return (node->cmd(np, np ? param : NULL)); fail: if (TAILQ_FIRST(&node->children) == NULL) { fprintf(stderr, "invalid command\n"); return (-1); } fprintf(stderr, "possibilities are:\n"); TAILQ_FOREACH(tmp, &node->children, entry) { for (j = 0; j < i; j++) fprintf(stderr, "%s%s", j?" ":"", stack[j]->token); fprintf(stderr, "%s%s\n", i?" ":"", tmp->token); } return (-1); } int cmd_show_params(int argc, struct parameter *argv) { int i; for (i = 0; i < argc; i++) { switch(argv[i].type) { case P_STR: printf(" str:\"%s\"", argv[i].u.u_str); break; case P_INT: printf(" int:%d", argv[i].u.u_int); break; case P_MSGID: printf(" msgid:%08"PRIx32, argv[i].u.u_msgid); break; case P_EVPID: printf(" evpid:%016"PRIx64, argv[i].u.u_evpid); break; case P_ROUTEID: printf(" routeid:%016"PRIx64, argv[i].u.u_routeid); break; default: printf(" ???:%d", argv[i].type); } } printf ("\n"); return (1); } static int text_to_sockaddr(struct sockaddr *sa, int family, const char *str) { struct in_addr ina; struct in6_addr in6a; struct sockaddr_in *in; struct sockaddr_in6 *in6; char *cp, *str2; const char *errstr; switch (family) { case PF_UNSPEC: if (text_to_sockaddr(sa, PF_INET, str) == 0) return (0); return text_to_sockaddr(sa, PF_INET6, str); case PF_INET: if (inet_pton(PF_INET, str, &ina) != 1) return (-1); in = (struct sockaddr_in *)sa; memset(in, 0, sizeof *in); #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN in->sin_len = sizeof(struct sockaddr_in); #endif in->sin_family = PF_INET; in->sin_addr.s_addr = ina.s_addr; return (0); case PF_INET6: cp = strchr(str, SCOPE_DELIMITER); if (cp) { str2 = strdup(str); if (str2 == NULL) return (-1); str2[cp - str] = '\0'; if (inet_pton(PF_INET6, str2, &in6a) != 1) { free(str2); return (-1); } cp++; free(str2); } else if (inet_pton(PF_INET6, str, &in6a) != 1) return (-1); in6 = (struct sockaddr_in6 *)sa; memset(in6, 0, sizeof *in6); #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN in6->sin6_len = sizeof(struct sockaddr_in6); #endif in6->sin6_family = PF_INET6; in6->sin6_addr = in6a; if (cp == NULL) return (0); if (IN6_IS_ADDR_LINKLOCAL(&in6a) || IN6_IS_ADDR_MC_LINKLOCAL(&in6a) || IN6_IS_ADDR_MC_NODELOCAL(&in6a)) if ((in6->sin6_scope_id = if_nametoindex(cp))) return (0); in6->sin6_scope_id = strtonum(cp, 0, UINT32_MAX, &errstr); if (errstr) return (-1); return (0); default: break; } return (-1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/table_proc.c0000644000175000001440000001633114674615567014654 /* $OpenBSD: table_proc.c,v 1.23 2024/05/28 07:10:30 op Exp $ */ /* * Copyright (c) 2024 Omar Polo * Copyright (c) 2013 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include "smtpd.h" #include "log.h" #define PROTOCOL_VERSION "0.1" struct table_proc_priv { FILE *in; FILE *out; char *line; size_t linesize; /* * The last ID used in a request. At the moment the protocol * is synchronous from our point of view, so it's used to * assert that the table replied with the correct ID. */ char lastid[16]; }; static char * table_proc_nextid(struct table *table) { struct table_proc_priv *priv = table->t_handle; int r; r = snprintf(priv->lastid, sizeof(priv->lastid), "%08x", arc4random()); if (r < 0 || (size_t)r >= sizeof(priv->lastid)) fatal("table-proc: snprintf"); return (priv->lastid); } static void table_proc_send(struct table *table, const char *type, int service, const char *param) { struct table_proc_priv *priv = table->t_handle; struct timeval tv; gettimeofday(&tv, NULL); fprintf(priv->out, "table|%s|%lld.%06ld|%s|%s", PROTOCOL_VERSION, (long long)tv.tv_sec, (long)tv.tv_usec, table->t_name, type); if (service != -1) { fprintf(priv->out, "|%s|%s", table_service_name(service), table_proc_nextid(table)); if (param) fprintf(priv->out, "|%s", param); fputc('\n', priv->out); } else fprintf(priv->out, "|%s\n", table_proc_nextid(table)); if (fflush(priv->out) == EOF) fatal("table-proc: fflush"); } static const char * table_proc_recv(struct table *table, const char *type) { struct table_proc_priv *priv = table->t_handle; const char *l; ssize_t linelen; size_t len; if ((linelen = getline(&priv->line, &priv->linesize, priv->in)) == -1) fatal("table-proc: getline"); priv->line[strcspn(priv->line, "\n")] = '\0'; l = priv->line; len = strlen(type); if (strncmp(l, type, len) != 0) goto err; l += len; if (*l != '|') goto err; l++; len = strlen(priv->lastid); if (strncmp(l, priv->lastid, len) != 0) goto err; l += len; if (*l != '|') goto err; return (++l); err: log_warnx("warn: table-proc: failed to parse reply"); fatalx("table-proc: exiting"); } /* * API */ static int table_proc_open(struct table *table) { struct table_proc_priv *priv; const char *s; ssize_t len; int service, services = 0; int fd, fdd; priv = xcalloc(1, sizeof(*priv)); fd = fork_proc_backend("table", table->t_config, table->t_name, 1); if (fd == -1) fatalx("table-proc: exiting"); if ((fdd = dup(fd)) == -1) { log_warnx("warn: table-proc: dup"); fatalx("table-proc: exiting"); } if ((priv->in = fdopen(fd, "r")) == NULL) fatalx("table-proc: fdopen"); if ((priv->out = fdopen(fdd, "w")) == NULL) fatalx("table-proc: fdopen"); fprintf(priv->out, "config|smtpd-version|"SMTPD_VERSION"\n"); fprintf(priv->out, "config|protocol|"PROTOCOL_VERSION"\n"); fprintf(priv->out, "config|tablename|%s\n", table->t_name); fprintf(priv->out, "config|ready\n"); if (fflush(priv->out) == EOF) fatalx("table-proc: fflush"); while ((len = getline(&priv->line, &priv->linesize, priv->in)) != -1) { priv->line[strcspn(priv->line, "\n")] = '\0'; if (strncmp(priv->line, "register|", 9) != 0) fatalx("table-proc: invalid handshake reply"); s = priv->line + 9; if (!strcmp(s, "ready")) break; service = table_service_from_name(s); if (service == -1 || service == K_NONE) fatalx("table-proc: unknown service %s", s); services |= service; } if (ferror(priv->in)) fatal("table-proc: getline"); if (feof(priv->in)) fatalx("table-proc: unexpected EOF during handshake"); if (services == 0) fatalx("table-proc: no services registered"); table->t_services = services; table->t_handle = priv; return (1); } static int table_proc_update(struct table *table) { const char *r; table_proc_send(table, "update", -1, NULL); r = table_proc_recv(table, "update-result"); if (!strcmp(r, "ok")) return (1); if (!strncmp(r, "error", 5)) { if (r[5] == '|') { r += 6; log_warnx("warn: table-proc: %s update failed: %s", table->t_name, r); } return (0); } log_warnx("warn: table-proc: failed parse reply"); fatalx("table-proc: exiting"); } static void table_proc_close(struct table *table) { struct table_proc_priv *priv = table->t_handle; if (fclose(priv->in) == EOF) fatal("table-proc: fclose"); if (fclose(priv->out) == EOF) fatal("table-proc: fclose"); free(priv->line); free(priv); table->t_handle = NULL; } static int table_proc_lookup(struct table *table, enum table_service s, const char *k, char **dst) { const char *req = "lookup", *res = "lookup-result"; const char *r; if (dst == NULL) { req = "check"; res = "check-result"; } table_proc_send(table, req, s, k); r = table_proc_recv(table, res); if (!strcmp(r, "not-found")) return (0); if (!strncmp(r, "error", 5)) { if (r[5] == '|') { r += 6; log_warnx("warn: table-proc: %s %s failed: %s", table->t_name, req, r); } return (-1); } if (dst == NULL) { /* check op */ if (!strncmp(r, "found", 5)) return (1); log_warnx("warn: table-proc: failed to parse reply"); fatalx("table-proc: exiting"); } /* lookup op */ if (strncmp(r, "found|", 6) != 0) { log_warnx("warn: table-proc: failed to parse reply"); fatalx("table-proc: exiting"); } r += 6; if (*r == '\0') { log_warnx("warn: table-proc: empty response"); fatalx("table-proc: exiting"); } if ((*dst = strdup(r)) == NULL) return (-1); return (1); } static int table_proc_fetch(struct table *table, enum table_service s, char **dst) { const char *r; table_proc_send(table, "fetch", s, NULL); r = table_proc_recv(table, "fetch-result"); if (!strcmp(r, "not-found")) return (0); if (!strncmp(r, "error", 5)) { if (r[5] == '|') { r += 6; log_warnx("warn: table-proc: %s fetch failed: %s", table->t_name, r); } return (-1); } if (strncmp(r, "found|", 6) != 0) { log_warnx("warn: table-proc: failed to parse reply"); fatalx("table-proc: exiting"); } r += 6; if (*r == '\0') { log_warnx("warn: table-proc: empty response"); fatalx("table-proc: exiting"); } if ((*dst = strdup(r)) == NULL) return (-1); return (1); } struct table_backend table_backend_proc = { .name = "proc", .services = K_ANY, .config = NULL, .add = NULL, .dump = NULL, .open = table_proc_open, .update = table_proc_update, .close = table_proc_close, .lookup = table_proc_lookup, .fetch = table_proc_fetch, }; opensmtpd-7.7.0p0/usr.sbin/smtpd/ca.c0000644000175000001440000003115715007615267013114 /* $OpenBSD: ca.c,v 1.49 2024/11/21 13:22:21 claudio Exp $ */ /* * Copyright (c) 2014 Reyk Floeter * Copyright (c) 2012 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include /* needed for setgroups */ #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" #include "ssl.h" static int rsae_send_imsg(int, const unsigned char *, unsigned char *, RSA *, int, unsigned int); static int rsae_priv_enc(int, const unsigned char *, unsigned char *, RSA *, int); static int rsae_priv_dec(int, const unsigned char *, unsigned char *, RSA *, int); static ECDSA_SIG *ecdsae_do_sign(const unsigned char *, int, const BIGNUM *, const BIGNUM *, EC_KEY *); static struct dict pkeys; static uint64_t reqid = 0; static void ca_shutdown(void) { log_debug("debug: ca agent exiting"); _exit(0); } int ca(void) { struct passwd *pw; purge_config(PURGE_LISTENERS|PURGE_TABLES|PURGE_RULES|PURGE_DISPATCHERS); if ((pw = getpwnam(SMTPD_USER)) == NULL) fatalx("unknown user " SMTPD_USER); if (chroot(PATH_CHROOT) == -1) fatal("ca: chroot"); if (chdir("/") == -1) fatal("ca: chdir(\"/\")"); config_process(PROC_CA); if (setgroups(1, &pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("ca: cannot drop privileges"); imsg_callback = ca_imsg; event_init(); signal(SIGINT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, SIG_IGN); config_peer(PROC_CONTROL); config_peer(PROC_PARENT); config_peer(PROC_DISPATCHER); /* Ignore them until we get our config */ mproc_disable(p_dispatcher); #if HAVE_PLEDGE if (pledge("stdio", NULL) == -1) fatal("pledge"); #endif event_dispatch(); fatalx("exited event loop"); return (0); } void ca_init(void) { BIO *in = NULL; EVP_PKEY *pkey = NULL; struct pki *pki; const char *k; void *iter_dict; char *hash; log_debug("debug: init private ssl-tree"); dict_init(&pkeys); iter_dict = NULL; while (dict_iter(env->sc_pki_dict, &iter_dict, &k, (void **)&pki)) { if (pki->pki_key == NULL) continue; in = BIO_new_mem_buf(pki->pki_key, pki->pki_key_len); if (in == NULL) fatalx("ca_init: key"); pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, NULL); if (pkey == NULL) fatalx("ca_init: PEM"); BIO_free(in); hash = ssl_pubkey_hash(pki->pki_cert, pki->pki_cert_len); if (dict_check(&pkeys, hash)) EVP_PKEY_free(pkey); else dict_xset(&pkeys, hash, pkey); free(hash); } } int ca_X509_verify(void *certificate, void *chain, const char *CAfile, const char *CRLfile, const char **errstr) { X509_STORE *store = NULL; X509_STORE_CTX *xsc = NULL; int ret = 0; long error = 0; if ((store = X509_STORE_new()) == NULL) goto end; if (!X509_STORE_load_locations(store, CAfile, NULL)) { log_warn("warn: unable to load CA file %s", CAfile); goto end; } X509_STORE_set_default_paths(store); if ((xsc = X509_STORE_CTX_new()) == NULL) goto end; if (X509_STORE_CTX_init(xsc, store, certificate, chain) != 1) goto end; ret = X509_verify_cert(xsc); end: *errstr = NULL; if (ret != 1) { if (xsc) { error = X509_STORE_CTX_get_error(xsc); *errstr = X509_verify_cert_error_string(error); } else if (ERR_peek_last_error()) *errstr = ERR_error_string(ERR_peek_last_error(), NULL); } X509_STORE_CTX_free(xsc); X509_STORE_free(store); return ret > 0 ? 1 : 0; } void ca_imsg(struct mproc *p, struct imsg *imsg) { EVP_PKEY *pkey; RSA *rsa = NULL; EC_KEY *ecdsa = NULL; const void *from = NULL; unsigned char *to = NULL; struct msg m; const char *hash; size_t flen, tlen, padding; int buf_len; int ret = 0; uint64_t id; int v; if (imsg == NULL) ca_shutdown(); switch (imsg->hdr.type) { case IMSG_CONF_START: return; case IMSG_CONF_END: ca_init(); /* Start fulfilling requests */ mproc_enable(p_dispatcher); return; case IMSG_CTL_VERBOSE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); log_trace_verbose(v); return; case IMSG_CTL_PROFILE: m_msg(&m, imsg); m_get_int(&m, &v); m_end(&m); profiling = v; return; case IMSG_CA_RSA_PRIVENC: case IMSG_CA_RSA_PRIVDEC: m_msg(&m, imsg); m_get_id(&m, &id); m_get_string(&m, &hash); m_get_data(&m, &from, &flen); m_get_size(&m, &tlen); m_get_size(&m, &padding); m_end(&m); pkey = dict_get(&pkeys, hash); if (pkey == NULL || (rsa = EVP_PKEY_get1_RSA(pkey)) == NULL) fatalx("ca_imsg: invalid pkey hash"); if ((to = calloc(1, tlen)) == NULL) fatalx("ca_imsg: calloc"); switch (imsg->hdr.type) { case IMSG_CA_RSA_PRIVENC: ret = RSA_private_encrypt(flen, from, to, rsa, padding); break; case IMSG_CA_RSA_PRIVDEC: ret = RSA_private_decrypt(flen, from, to, rsa, padding); break; } m_create(p, imsg->hdr.type, 0, 0, -1); m_add_id(p, id); m_add_int(p, ret); if (ret > 0) m_add_data(p, to, (size_t)ret); m_close(p); free(to); RSA_free(rsa); return; case IMSG_CA_ECDSA_SIGN: m_msg(&m, imsg); m_get_id(&m, &id); m_get_string(&m, &hash); m_get_data(&m, &from, &flen); m_end(&m); pkey = dict_get(&pkeys, hash); if (pkey == NULL || (ecdsa = EVP_PKEY_get1_EC_KEY(pkey)) == NULL) fatalx("ca_imsg: invalid pkey hash"); buf_len = ECDSA_size(ecdsa); if ((to = calloc(1, buf_len)) == NULL) fatalx("ca_imsg: calloc"); ret = ECDSA_sign(0, from, flen, to, &buf_len, ecdsa); m_create(p, imsg->hdr.type, 0, 0, -1); m_add_id(p, id); m_add_int(p, ret); if (ret > 0) m_add_data(p, to, (size_t)buf_len); m_close(p); free(to); EC_KEY_free(ecdsa); return; } fatalx("ca_imsg: unexpected %s imsg", imsg_to_str(imsg->hdr.type)); } /* * RSA privsep engine (called from unprivileged processes) */ const RSA_METHOD *rsa_default = NULL; static RSA_METHOD *rsae_method = NULL; static int rsae_send_imsg(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding, unsigned int cmd) { int ret = 0; struct imsgbuf *ibuf; struct imsg imsg; int n, done = 0; const void *toptr; char *hash; size_t tlen; struct msg m; uint64_t id; if ((hash = RSA_get_ex_data(rsa, 0)) == NULL) return (0); /* * Send a synchronous imsg because we cannot defer the RSA * operation in OpenSSL's engine layer. */ m_create(p_ca, cmd, 0, 0, -1); reqid++; m_add_id(p_ca, reqid); m_add_string(p_ca, hash); m_add_data(p_ca, (const void *)from, (size_t)flen); m_add_size(p_ca, (size_t)RSA_size(rsa)); m_add_size(p_ca, (size_t)padding); m_flush(p_ca); ibuf = &p_ca->imsgbuf; while (!done) { if ((n = imsgbuf_read(ibuf)) == -1) fatalx("imsgbuf_read"); if (n == 0) fatalx("pipe closed"); while (!done) { if ((n = imsg_get(ibuf, &imsg)) == -1) fatalx("imsg_get error"); if (n == 0) break; log_imsg(PROC_DISPATCHER, PROC_CA, &imsg); switch (imsg.hdr.type) { case IMSG_CA_RSA_PRIVENC: case IMSG_CA_RSA_PRIVDEC: break; default: /* Another imsg is queued up in the buffer */ dispatcher_imsg(p_ca, &imsg); imsg_free(&imsg); continue; } m_msg(&m, &imsg); m_get_id(&m, &id); if (id != reqid) fatalx("invalid response id"); m_get_int(&m, &ret); if (ret > 0) m_get_data(&m, &toptr, &tlen); m_end(&m); if (ret > 0) memcpy(to, toptr, tlen); done = 1; imsg_free(&imsg); } } mproc_event_add(p_ca); return (ret); } static int rsae_priv_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); if (RSA_get_ex_data(rsa, 0) != NULL) return (rsae_send_imsg(flen, from, to, rsa, padding, IMSG_CA_RSA_PRIVENC)); return (RSA_meth_get_priv_enc(rsa_default)(flen, from, to, rsa, padding)); } static int rsae_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); if (RSA_get_ex_data(rsa, 0) != NULL) return (rsae_send_imsg(flen, from, to, rsa, padding, IMSG_CA_RSA_PRIVDEC)); return (RSA_meth_get_priv_dec(rsa_default)(flen, from, to, rsa, padding)); } /* * ECDSA privsep engine (called from unprivileged processes) */ const EC_KEY_METHOD *ecdsa_default = NULL; static EC_KEY_METHOD *ecdsae_method = NULL; static ECDSA_SIG * ecdsae_send_enc_imsg(const unsigned char *dgst, int dgst_len, const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey) { int ret = 0; struct imsgbuf *ibuf; struct imsg imsg; int n, done = 0; const void *toptr; char *hash; size_t tlen; struct msg m; uint64_t id; ECDSA_SIG *sig = NULL; if ((hash = EC_KEY_get_ex_data(eckey, 0)) == NULL) return (0); /* * Send a synchronous imsg because we cannot defer the ECDSA * operation in OpenSSL's engine layer. */ m_create(p_ca, IMSG_CA_ECDSA_SIGN, 0, 0, -1); reqid++; m_add_id(p_ca, reqid); m_add_string(p_ca, hash); m_add_data(p_ca, (const void *)dgst, (size_t)dgst_len); m_flush(p_ca); ibuf = &p_ca->imsgbuf; while (!done) { if ((n = imsgbuf_read(ibuf)) == -1) fatalx("imsgbuf_read"); if (n == 0) fatalx("pipe closed"); while (!done) { if ((n = imsg_get(ibuf, &imsg)) == -1) fatalx("imsg_get error"); if (n == 0) break; log_imsg(PROC_DISPATCHER, PROC_CA, &imsg); switch (imsg.hdr.type) { case IMSG_CA_ECDSA_SIGN: break; default: /* Another imsg is queued up in the buffer */ dispatcher_imsg(p_ca, &imsg); imsg_free(&imsg); continue; } m_msg(&m, &imsg); m_get_id(&m, &id); if (id != reqid) fatalx("invalid response id"); m_get_int(&m, &ret); if (ret > 0) m_get_data(&m, &toptr, &tlen); m_end(&m); done = 1; if (ret > 0) d2i_ECDSA_SIG(&sig, (const unsigned char **)&toptr, tlen); imsg_free(&imsg); } } mproc_event_add(p_ca); return (sig); } static ECDSA_SIG * ecdsae_do_sign(const unsigned char *dgst, int dgst_len, const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey) { ECDSA_SIG *(*psign_sig)(const unsigned char *, int, const BIGNUM *, const BIGNUM *, EC_KEY *); log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); if (EC_KEY_get_ex_data(eckey, 0) != NULL) return (ecdsae_send_enc_imsg(dgst, dgst_len, inv, rp, eckey)); EC_KEY_METHOD_get_sign(ecdsa_default, NULL, NULL, &psign_sig); return (psign_sig(dgst, dgst_len, inv, rp, eckey)); } static void rsa_engine_init(void) { const char *errstr; if ((rsa_default = RSA_get_default_method()) == NULL) { errstr = "RSA_get_default_method"; goto fail; } if ((rsae_method = RSA_meth_dup(rsa_default)) == NULL) { errstr = "RSA_meth_dup"; goto fail; } RSA_meth_set_priv_enc(rsae_method, rsae_priv_enc); RSA_meth_set_priv_dec(rsae_method, rsae_priv_dec); RSA_meth_set_flags(rsae_method, RSA_meth_get_flags(rsa_default) | RSA_METHOD_FLAG_NO_CHECK); RSA_meth_set0_app_data(rsae_method, RSA_meth_get0_app_data(rsa_default)); RSA_set_default_method(rsae_method); return; fail: ssl_error(errstr); fatalx("%s", errstr); } static void ecdsa_engine_init(void) { int (*sign)(int, const unsigned char *, int, unsigned char *, unsigned int *, const BIGNUM *, const BIGNUM *, EC_KEY *); int (*sign_setup)(EC_KEY *, BN_CTX *, BIGNUM **, BIGNUM **); const char *errstr; if ((ecdsa_default = EC_KEY_get_default_method()) == NULL) { errstr = "EC_KEY_get_default_method"; goto fail; } if ((ecdsae_method = EC_KEY_METHOD_new(ecdsa_default)) == NULL) { errstr = "EC_KEY_METHOD_new"; goto fail; } EC_KEY_METHOD_get_sign(ecdsa_default, &sign, &sign_setup, NULL); EC_KEY_METHOD_set_sign(ecdsae_method, sign, sign_setup, ecdsae_do_sign); EC_KEY_set_default_method(ecdsae_method); return; fail: ssl_error(errstr); fatalx("%s", errstr); } void ca_engine_init(void) { rsa_engine_init(); ecdsa_engine_init(); } opensmtpd-7.7.0p0/usr.sbin/smtpd/table.c0000644000175000001440000003770014674615567013634 /* $OpenBSD: table.c,v 1.54 2024/06/09 10:13:05 gilles Exp $ */ /* * Copyright (c) 2013 Eric Faurot * Copyright (c) 2008 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include "smtpd.h" #include "log.h" struct table_backend *table_backend_lookup(const char *); extern struct table_backend table_backend_static; #ifdef HAVE_DB_API extern struct table_backend table_backend_db; #endif extern struct table_backend table_backend_getpwnam; extern struct table_backend table_backend_proc; static int table_parse_lookup(enum table_service, const char *, const char *, union lookup *); static int parse_sockaddr(struct sockaddr *, int, const char *); static unsigned int last_table_id = 0; static struct table_backend *backends[] = { &table_backend_static, #ifdef HAVE_DB_API &table_backend_db, #endif &table_backend_getpwnam, &table_backend_proc, NULL }; struct table_backend * table_backend_lookup(const char *backend) { int i; if (!strcmp(backend, "file")) backend = "static"; for (i = 0; backends[i]; i++) if (!strcmp(backends[i]->name, backend)) return (backends[i]); return NULL; } const char * table_service_name(enum table_service s) { switch (s) { case K_NONE: return "none"; case K_ALIAS: return "alias"; case K_DOMAIN: return "domain"; case K_CREDENTIALS: return "credentials"; case K_NETADDR: return "netaddr"; case K_USERINFO: return "userinfo"; case K_SOURCE: return "source"; case K_MAILADDR: return "mailaddr"; case K_ADDRNAME: return "addrname"; case K_MAILADDRMAP: return "mailaddrmap"; case K_RELAYHOST: return "relayhost"; case K_STRING: return "string"; case K_REGEX: return "regex"; case K_AUTH: return "auth"; } return "???"; } int table_service_from_name(const char *service) { if (!strcmp(service, "none")) return K_NONE; if (!strcmp(service, "alias")) return K_ALIAS; if (!strcmp(service, "domain")) return K_DOMAIN; if (!strcmp(service, "credentials")) return K_CREDENTIALS; if (!strcmp(service, "netaddr")) return K_NETADDR; if (!strcmp(service, "userinfo")) return K_USERINFO; if (!strcmp(service, "source")) return K_SOURCE; if (!strcmp(service, "mailaddr")) return K_MAILADDR; if (!strcmp(service, "addrname")) return K_ADDRNAME; if (!strcmp(service, "mailaddrmap")) return K_MAILADDRMAP; if (!strcmp(service, "relayhost")) return K_RELAYHOST; if (!strcmp(service, "string")) return K_STRING; if (!strcmp(service, "regex")) return K_REGEX; if (!strcmp(service, "auth")) return K_AUTH; return (-1); } struct table * table_find(struct smtpd *conf, const char *name) { return dict_get(conf->sc_tables_dict, name); } int table_match(struct table *table, enum table_service kind, const char *key) { return table_lookup(table, kind, key, NULL); } int table_lookup(struct table *table, enum table_service kind, const char *key, union lookup *lk) { char lkey[1024], *buf = NULL; int r; r = -1; if (table->t_backend->lookup == NULL) errno = ENOTSUP; else if (!lowercase(lkey, key, sizeof lkey)) { log_warnx("warn: lookup key too long: %s", key); errno = EINVAL; } else r = table->t_backend->lookup(table, kind, lkey, lk ? &buf : NULL); if (r == 1) { log_trace(TRACE_LOOKUP, "lookup: %s \"%s\" as %s in table %s:%s -> %s%s%s", lk ? "lookup" : "match", key, table_service_name(kind), table->t_backend->name, table->t_name, lk ? "\"" : "", lk ? buf : "true", lk ? "\"" : ""); if (buf) r = table_parse_lookup(kind, lkey, buf, lk); } else log_trace(TRACE_LOOKUP, "lookup: %s \"%s\" as %s in table %s:%s -> %s%s", lk ? "lookup" : "match", key, table_service_name(kind), table->t_backend->name, table->t_name, (r == -1) ? "error: " : (lk ? "none" : "false"), (r == -1) ? strerror(errno) : ""); free(buf); return (r); } int table_fetch(struct table *table, enum table_service kind, union lookup *lk) { char *buf = NULL; int r; r = -1; if (table->t_backend->fetch == NULL) errno = ENOTSUP; else r = table->t_backend->fetch(table, kind, &buf); if (r == 1) { log_trace(TRACE_LOOKUP, "lookup: fetch %s from table %s:%s -> \"%s\"", table_service_name(kind), table->t_backend->name, table->t_name, buf); r = table_parse_lookup(kind, NULL, buf, lk); } else log_trace(TRACE_LOOKUP, "lookup: fetch %s from table %s:%s -> %s%s", table_service_name(kind), table->t_backend->name, table->t_name, (r == -1) ? "error: " : "none", (r == -1) ? strerror(errno) : ""); free(buf); return (r); } struct table * table_create(struct smtpd *conf, const char *backend, const char *name, const char *config) { struct table *t; struct table_backend *tb; char path[LINE_MAX]; size_t n; struct stat sb; if (name && table_find(conf, name)) fatalx("table_create: table \"%s\" already defined", name); if ((tb = table_backend_lookup(backend)) == NULL) { if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC"/table-%s", backend) >= sizeof(path)) { fatalx("table_create: path too long \"" PATH_LIBEXEC"/table-%s\"", backend); } if (stat(path, &sb) == 0) { tb = table_backend_lookup("proc"); (void)strlcpy(path, backend, sizeof(path)); if (config) { (void)strlcat(path, ":", sizeof(path)); if (strlcat(path, config, sizeof(path)) >= sizeof(path)) fatalx("table_create: config file path too long"); } config = path; } } if (tb == NULL) fatalx("table_create: backend \"%s\" does not exist", backend); t = xcalloc(1, sizeof(*t)); t->t_services = tb->services; t->t_backend = tb; if (config) { if (strlcpy(t->t_config, config, sizeof t->t_config) >= sizeof t->t_config) fatalx("table_create: table config \"%s\" too large", t->t_config); } if (strcmp(tb->name, "static") != 0) t->t_type = T_DYNAMIC; if (name == NULL) (void)snprintf(t->t_name, sizeof(t->t_name), "", last_table_id++); else { n = strlcpy(t->t_name, name, sizeof(t->t_name)); if (n >= sizeof(t->t_name)) fatalx("table_create: table name too long"); } dict_set(conf->sc_tables_dict, t->t_name, t); return (t); } void table_destroy(struct smtpd *conf, struct table *t) { dict_xpop(conf->sc_tables_dict, t->t_name); free(t); } int table_config(struct table *t) { if (t->t_backend->config == NULL) return (1); return (t->t_backend->config(t)); } void table_add(struct table *t, const char *key, const char *val) { if (t->t_backend->add == NULL) fatalx("table_add: cannot add to table"); if (t->t_backend->add(t, key, val) == 0) log_warnx("warn: failed to add \"%s\" in table \"%s\"", key, t->t_name); } void table_dump(struct table *t) { const char *type; char buf[LINE_MAX]; switch(t->t_type) { case T_NONE: type = "NONE"; break; case T_DYNAMIC: type = "DYNAMIC"; break; case T_LIST: type = "LIST"; break; case T_HASH: type = "HASH"; break; default: type = "???"; break; } if (t->t_config[0]) snprintf(buf, sizeof(buf), " config=\"%s\"", t->t_config); else buf[0] = '\0'; log_debug("TABLE \"%s\" backend=%s type=%s%s", t->t_name, t->t_backend->name, type, buf); if (t->t_backend->dump) t->t_backend->dump(t); } int table_check_type(struct table *t, uint32_t mask) { return t->t_type & mask; } int table_check_service(struct table *t, uint32_t mask) { return t->t_services & mask; } int table_check_use(struct table *t, uint32_t tmask, uint32_t smask) { return table_check_type(t, tmask) && table_check_service(t, smask); } int table_open(struct table *t) { if (t->t_backend->open == NULL) return (1); return (t->t_backend->open(t)); } void table_close(struct table *t) { if (t->t_backend->close) t->t_backend->close(t); } int table_update(struct table *t) { if (t->t_backend->update == NULL) return (1); return (t->t_backend->update(t)); } /* * quick reminder: * in *_match() s1 comes from session, s2 comes from table */ int table_domain_match(const char *s1, const char *s2) { return hostname_match(s1, s2); } int table_mailaddr_match(const char *s1, const char *s2) { struct mailaddr m1; struct mailaddr m2; if (!text_to_mailaddr(&m1, s1)) return 0; if (!text_to_mailaddr(&m2, s2)) return 0; return mailaddr_match(&m1, &m2); } static int table_match_mask(struct sockaddr_storage *, struct netaddr *); static int table_inet4_match(struct sockaddr_in *, struct netaddr *); static int table_inet6_match(struct sockaddr_in6 *, struct netaddr *); int table_netaddr_match(const char *s1, const char *s2) { struct netaddr n1; struct netaddr n2; if (strcasecmp(s1, s2) == 0) return 1; if (!text_to_netaddr(&n1, s1)) return 0; if (!text_to_netaddr(&n2, s2)) return 0; if (n1.ss.ss_family != n2.ss.ss_family) return 0; if (SS_LEN(&n1.ss) != SS_LEN(&n2.ss)) return 0; return table_match_mask(&n1.ss, &n2); } static int table_match_mask(struct sockaddr_storage *ss, struct netaddr *ssmask) { if (ss->ss_family == AF_INET) return table_inet4_match((struct sockaddr_in *)ss, ssmask); if (ss->ss_family == AF_INET6) return table_inet6_match((struct sockaddr_in6 *)ss, ssmask); return (0); } static int table_inet4_match(struct sockaddr_in *ss, struct netaddr *ssmask) { in_addr_t mask; int i; /* a.b.c.d/8 -> htonl(0xff000000) */ mask = 0; for (i = 0; i < ssmask->bits; ++i) mask = (mask >> 1) | 0x80000000; mask = htonl(mask); /* (addr & mask) == (net & mask) */ if ((ss->sin_addr.s_addr & mask) == (((struct sockaddr_in *)ssmask)->sin_addr.s_addr & mask)) return 1; return 0; } static int table_inet6_match(struct sockaddr_in6 *ss, struct netaddr *ssmask) { struct in6_addr *in; struct in6_addr *inmask; struct in6_addr mask; int i; memset(&mask, 0, sizeof(mask)); for (i = 0; i < ssmask->bits / 8; i++) mask.s6_addr[i] = 0xff; i = ssmask->bits % 8; if (i) mask.s6_addr[ssmask->bits / 8] = 0xff00 >> i; in = &ss->sin6_addr; inmask = &((struct sockaddr_in6 *)&ssmask->ss)->sin6_addr; for (i = 0; i < 16; i++) { if ((in->s6_addr[i] & mask.s6_addr[i]) != (inmask->s6_addr[i] & mask.s6_addr[i])) return (0); } return (1); } int table_regex_match(const char *string, const char *pattern) { regex_t preg; int cflags = REG_EXTENDED|REG_NOSUB; int ret; if (strncmp(pattern, "(?i)", 4) == 0) { cflags |= REG_ICASE; pattern += 4; } if (regcomp(&preg, pattern, cflags) != 0) return (0); ret = regexec(&preg, string, 0, NULL, 0); regfree(&preg); if (ret != 0) return (0); return (1); } void table_dump_all(struct smtpd *conf) { struct table *t; void *iter; iter = NULL; while (dict_iter(conf->sc_tables_dict, &iter, NULL, (void **)&t)) table_dump(t); } void table_open_all(struct smtpd *conf) { struct table *t; void *iter; iter = NULL; while (dict_iter(conf->sc_tables_dict, &iter, NULL, (void **)&t)) if (!table_open(t)) fatalx("failed to open table %s", t->t_name); } void table_close_all(struct smtpd *conf) { struct table *t; void *iter; iter = NULL; while (dict_iter(conf->sc_tables_dict, &iter, NULL, (void **)&t)) table_close(t); } static int table_parse_lookup(enum table_service service, const char *key, const char *line, union lookup *lk) { char buffer[LINE_MAX], *p; size_t len; len = strlen(line); switch (service) { case K_ALIAS: lk->expand = calloc(1, sizeof(*lk->expand)); if (lk->expand == NULL) return (-1); if (!expand_line(lk->expand, line, 1)) { expand_free(lk->expand); return (-1); } return (1); case K_DOMAIN: if (strlcpy(lk->domain.name, line, sizeof(lk->domain.name)) >= sizeof(lk->domain.name)) return (-1); return (1); case K_CREDENTIALS: /* credentials are stored as user:password */ if (len < 3) return (-1); /* too big to fit in a smtp session line */ if (len >= LINE_MAX) return (-1); p = strchr(line, ':'); if (p == NULL) { if (strlcpy(lk->creds.username, key, sizeof (lk->creds.username)) >= sizeof (lk->creds.username)) return (-1); if (strlcpy(lk->creds.password, line, sizeof(lk->creds.password)) >= sizeof(lk->creds.password)) return (-1); return (1); } if (p == line || p == line + len - 1) return (-1); memmove(lk->creds.username, line, p - line); lk->creds.username[p - line] = '\0'; if (strlcpy(lk->creds.password, p+1, sizeof(lk->creds.password)) >= sizeof(lk->creds.password)) return (-1); return (1); case K_NETADDR: if (!text_to_netaddr(&lk->netaddr, line)) return (-1); return (1); case K_USERINFO: if (!bsnprintf(buffer, sizeof(buffer), "%s:%s", key, line)) return (-1); if (!text_to_userinfo(&lk->userinfo, buffer)) return (-1); return (1); case K_SOURCE: if (parse_sockaddr((struct sockaddr *)&lk->source.addr, PF_UNSPEC, line) == -1) return (-1); return (1); case K_MAILADDR: if (!text_to_mailaddr(&lk->mailaddr, line)) return (-1); return (1); case K_MAILADDRMAP: lk->maddrmap = calloc(1, sizeof(*lk->maddrmap)); if (lk->maddrmap == NULL) return (-1); maddrmap_init(lk->maddrmap); if (!mailaddr_line(lk->maddrmap, line)) { maddrmap_free(lk->maddrmap); return (-1); } return (1); case K_ADDRNAME: if (parse_sockaddr((struct sockaddr *)&lk->addrname.addr, PF_UNSPEC, key) == -1) return (-1); if (strlcpy(lk->addrname.name, line, sizeof(lk->addrname.name)) >= sizeof(lk->addrname.name)) return (-1); return (1); case K_RELAYHOST: if (strlcpy(lk->relayhost, line, sizeof(lk->relayhost)) >= sizeof(lk->relayhost)) return (-1); return (1); default: return (-1); } } static int parse_sockaddr(struct sockaddr *sa, int family, const char *str) { struct in_addr ina; struct in6_addr in6a; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; char *cp; char addr[NI_MAXHOST]; const char *errstr; switch (family) { case PF_UNSPEC: if (parse_sockaddr(sa, PF_INET, str) == 0) return (0); return parse_sockaddr(sa, PF_INET6, str); case PF_INET: if (inet_pton(PF_INET, str, &ina) != 1) return (-1); sin = (struct sockaddr_in *)sa; memset(sin, 0, sizeof *sin); #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN sin->sin_len = sizeof(struct sockaddr_in); #endif sin->sin_family = PF_INET; sin->sin_addr.s_addr = ina.s_addr; return (0); case PF_INET6: if (*str == '[') str++; if (!strncasecmp("ipv6:", str, 5)) str += 5; if (strlcpy(addr, str, sizeof(addr)) >= sizeof(addr)) return (-1); if ((cp = strchr(addr, ']')) != NULL) *cp = '\0'; if ((cp = strchr(addr, SCOPE_DELIMITER)) != NULL) *cp++ = '\0'; if (inet_pton(PF_INET, addr, &in6a) != 1) return (-1); sin6 = (struct sockaddr_in6 *)sa; memset(sin6, 0, sizeof *sin6); #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_family = PF_INET6; sin6->sin6_addr = in6a; if (cp == NULL) return (0); if (IN6_IS_ADDR_LINKLOCAL(&in6a) || IN6_IS_ADDR_MC_LINKLOCAL(&in6a) || IN6_IS_ADDR_MC_NODELOCAL(&in6a)) if ((sin6->sin6_scope_id = if_nametoindex(cp))) return (0); sin6->sin6_scope_id = strtonum(cp, 0, UINT32_MAX, &errstr); if (errstr) return (-1); return (0); default: break; } return (-1); } opensmtpd-7.7.0p0/usr.sbin/smtpd/runq.c0000644000175000001440000000670214610663500013504 /* $OpenBSD: runq.c,v 1.5 2023/05/31 16:51:46 op Exp $ */ /* * Copyright (c) 2013,2019 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include "smtpd.h" struct job { TAILQ_ENTRY(job) entry; time_t when; void *arg; }; struct runq { TAILQ_HEAD(, job) jobs; void (*cb)(struct runq *, void *); struct event ev; }; static void runq_timeout(int, short, void *); static struct runq *active; static void runq_reset(struct runq *runq) { struct timeval tv; struct job *job; time_t now; job = TAILQ_FIRST(&runq->jobs); if (job == NULL) return; now = time(NULL); if (job->when <= now) tv.tv_sec = 0; else tv.tv_sec = job->when - now; tv.tv_usec = 0; evtimer_add(&runq->ev, &tv); } static void runq_timeout(int fd, short ev, void *arg) { struct runq *runq = arg; struct job *job; time_t now; active = runq; now = time(NULL); while((job = TAILQ_FIRST(&runq->jobs))) { if (job->when > now) break; TAILQ_REMOVE(&runq->jobs, job, entry); runq->cb(runq, job->arg); free(job); } active = NULL; runq_reset(runq); } int runq_init(struct runq **runqp, void (*cb)(struct runq *, void *)) { struct runq *runq; runq = malloc(sizeof(*runq)); if (runq == NULL) return (0); runq->cb = cb; TAILQ_INIT(&runq->jobs); evtimer_set(&runq->ev, runq_timeout, runq); *runqp = runq; return (1); } int runq_schedule(struct runq *runq, time_t delay, void *arg) { time_t t; time(&t); return runq_schedule_at(runq, t + delay, arg); } int runq_schedule_at(struct runq *runq, time_t when, void *arg) { struct job *job, *tmpjob; job = malloc(sizeof(*job)); if (job == NULL) return (0); job->arg = arg; job->when = when; TAILQ_FOREACH(tmpjob, &runq->jobs, entry) { if (tmpjob->when > job->when) { TAILQ_INSERT_BEFORE(tmpjob, job, entry); goto done; } } TAILQ_INSERT_TAIL(&runq->jobs, job, entry); done: if (runq != active && job == TAILQ_FIRST(&runq->jobs)) { evtimer_del(&runq->ev); runq_reset(runq); } return (1); } int runq_cancel(struct runq *runq, void *arg) { struct job *job, *first; first = TAILQ_FIRST(&runq->jobs); TAILQ_FOREACH(job, &runq->jobs, entry) { if (job->arg == arg) { TAILQ_REMOVE(&runq->jobs, job, entry); free(job); if (runq != active && job == first) { evtimer_del(&runq->ev); runq_reset(runq); } return (1); } } return (0); } int runq_pending(struct runq *runq, void *arg, time_t *when) { struct job *job; TAILQ_FOREACH(job, &runq->jobs, entry) { if (job->arg == arg) { if (when) *when = job->when; return (1); } } return (0); } opensmtpd-7.7.0p0/usr.sbin/smtpd/smtp.h0000644000175000001440000000567614674615567013544 /* $OpenBSD: smtp.h,v 1.5 2024/06/02 23:26:39 jsg Exp $ */ /* * Copyright (c) 2018 Eric Faurot * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define TLS_NO 0 #define TLS_YES 1 #define TLS_FORCE 2 #define TLS_SMTPS 3 #define CERT_OK 0 #define CERT_UNKNOWN 1 #define CERT_INVALID 2 #define FAIL_INTERNAL 1 /* malloc, etc. (check errno) */ #define FAIL_CONN 2 /* disconnect, timeout... (check errno) */ #define FAIL_PROTO 3 /* protocol violation */ #define FAIL_IMPL 4 /* server lacks a required feature */ #define FAIL_RESP 5 /* rejected command */ struct smtp_params { /* Client options */ size_t linemax; /* max input line size */ size_t ibufmax; /* max input buffer size */ size_t obufmax; /* max output buffer size */ /* Connection settings */ const struct sockaddr *dst; /* address to connect to */ const struct sockaddr *src; /* address to bind to */ int timeout; /* timeout in seconds */ /* TLS options */ int tls_req; /* requested TLS mode */ int tls_verify; /* need valid server certificate */ const char *tls_servname; /* SNI */ /* SMTP options */ int lmtp; /* use LMTP protocol */ const char *helo; /* string to use with HELO */ const char *auth_user; /* for AUTH */ const char *auth_pass; /* for AUTH */ }; struct smtp_rcpt { const char *to; const char *dsn_notify; const char *dsn_orcpt; int done; }; struct smtp_mail { const char *from; const char *dsn_ret; const char *dsn_envid; struct smtp_rcpt *rcpt; int rcptcount; FILE *fp; }; struct smtp_status { struct smtp_rcpt *rcpt; const char *cmd; const char *status; }; struct smtp_client; /* smtp_client.c */ struct smtp_client *smtp_connect(const struct smtp_params *, void *); void smtp_cert_verified(struct smtp_client *, int); void smtp_set_tls(struct smtp_client *, void *); void smtp_quit(struct smtp_client *); void smtp_sendmail(struct smtp_client *, struct smtp_mail *); /* callbacks */ void smtp_require_tls(void *, struct smtp_client *); void smtp_ready(void *, struct smtp_client *); void smtp_failed(void *, struct smtp_client *, int, const char *); void smtp_closed(void *, struct smtp_client *); void smtp_status(void *, struct smtp_client *, struct smtp_status *); void smtp_done(void *, struct smtp_client *, struct smtp_mail *); opensmtpd-7.7.0p0/usr.sbin/smtpd/smtpd.80000644000175000001440000000741414610663500013574 .\" $OpenBSD: smtpd.8,v 1.33 2023/03/02 17:09:53 jmc Exp $ .\" .\" Copyright (c) 2012, Eric Faurot .\" Copyright (c) 2008, Gilles Chehade .\" Copyright (c) 2008, Pierre-Yves Ritschard .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: March 2 2023 $ .Dt SMTPD 8 .Os .Sh NAME .Nm smtpd .Nd Simple Mail Transfer Protocol (SMTP) daemon .Sh SYNOPSIS .Nm .Op Fl dFhnv .Op Fl D Ar macro Ns = Ns Ar value .Op Fl f Ar file .Op Fl P Ar system .Op Fl T Ar trace .Sh DESCRIPTION .Nm is a Simple Mail Transfer Protocol .Pq SMTP daemon which can be used as a machine's primary mail system. .Nm can listen on a network interface and handle SMTP transactions; it can also be fed messages through the standard .Xr sendmail 8 interface. It can relay messages through remote mail transfer agents or store them locally using either the mbox or maildir format. This implementation supports SMTP as defined by RFC 5321 as well as several extensions. A running .Nm can be controlled through .Xr smtpctl 8 . .Pp The options are as follows: .Bl -tag -width Ds .It Fl D Ar macro Ns = Ns Ar value Define .Ar macro to be set to .Ar value on the command line. Overrides the definition of .Ar macro in the configuration file. .It Fl d Do not daemonize. If this option is specified, .Nm will run in the foreground and log to .Em stderr . .It Fl F Do not daemonize. If this option is specified, .Nm will run in the foreground and log to .Xr syslogd 8 . .It Fl f Ar file Specify an alternative configuration file. .It Fl h Display version and usage. .It Fl n Configtest mode. Only check the configuration file for validity. .It Fl P Ar system Pause a specific subsystem at startup. Normal operation can be resumed using .Xr smtpctl 8 . This option can be used multiple times. The accepted values are: .Pp .Bl -tag -width "smtpXXX" -compact .It mda Do not schedule local deliveries. .It mta Do not schedule remote transfers. .It smtp Do not listen on SMTP sockets. .El .It Fl T Ar trace Enables real-time tracing at startup. Normal operation can be resumed using .Xr smtpctl 8 . This option can be used multiple times. The accepted values are: .Pp .Bl -bullet -compact .It imsg .It io .It smtp (incoming sessions) .It filters .It transfer (outgoing sessions) .It bounce .It scheduler .It expand (aliases/virtual/forward expansion) .It lookup (user/credentials lookups) .It stat .It rules (matched by incoming sessions) .It mproc .It all .El .It Fl v Produce more verbose output. .El .Sh FILES .Bl -tag -width "/etc/mail/smtpd.confXXX" -compact .It Pa /etc/mail/mailname Alternate server name to use. .It Pa /etc/mail/smtpd.conf Default .Nm configuration file. .It Pa /var/run/smtpd.sock .Ux Ns -domain socket used for communication with .Xr smtpctl 8 . .It Pa /var/spool/smtpd/ Spool directories for mail during processing. .It Pa ~/.forward User email forwarding information. .El .Sh SEE ALSO .Xr forward 5 , .Xr smtpd.conf 5 , .Xr mailwrapper 8 , .Xr smtpctl 8 .Sh STANDARDS .Rs .%A J. Klensin .%D October 2008 .%R RFC 5321 .%T Simple Mail Transfer Protocol .Re .Sh HISTORY The .Nm program first appeared in .Ox 4.6 . opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.maildir.c0000644000175000001440000001407414610663500015062 /* * Copyright (c) 2017 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) #endif #include #include #include #include #include #include #include #include #include #include #include #include #define MAILADDR_ESCAPE "!#$%&'*/?^`{|}~" static int maildir_subdir(const char *, char *, size_t); static void maildir_mkdirs(const char *); static void maildir_engine(const char *, int); static int mkdirs_component(const char *, mode_t); static int mkdirs(const char *, mode_t); int main(int argc, char *argv[]) { int ch; int junk = 0; if (! geteuid()) errx(1, "mail.maildir: may not be executed as root"); while ((ch = getopt(argc, argv, "j")) != -1) { switch (ch) { case 'j': junk = 1; break; default: break; } } argc -= optind; argv += optind; if (argc > 1) errx(1, "mail.maildir: only one maildir is allowed"); maildir_engine(argv[0], junk); return (0); } static int maildir_subdir(const char *extension, char *dest, size_t len) { char *sanitized; if (strlcpy(dest, extension, len) >= len) return 0; for (sanitized = dest; *sanitized; sanitized++) if (strchr(MAILADDR_ESCAPE, *sanitized)) *sanitized = ':'; return 1; } static void maildir_mkdirs(const char *dirname) { uint i; int ret; char pathname[PATH_MAX]; char *subdirs[] = { "cur", "tmp", "new" }; if (mkdirs(dirname, 0700) == -1 && errno != EEXIST) { if (errno == EINVAL || errno == ENAMETOOLONG) err(1, NULL); err(EX_TEMPFAIL, NULL); } for (i = 0; i < nitems(subdirs); ++i) { ret = snprintf(pathname, sizeof pathname, "%s/%s", dirname, subdirs[i]); if (ret < 0 || (size_t)ret >= sizeof pathname) errc(1, ENAMETOOLONG, "%s/%s", dirname, subdirs[i]); if (mkdir(pathname, 0700) == -1 && errno != EEXIST) err(EX_TEMPFAIL, NULL); } } static void maildir_engine(const char *dirname, int junk) { char rootpath[PATH_MAX]; char junkpath[PATH_MAX]; char extpath[PATH_MAX]; char subdir[PATH_MAX]; char filename[PATH_MAX]; char hostname[HOST_NAME_MAX+1]; char tmp[PATH_MAX]; char new[PATH_MAX]; int ret; int fd; FILE *fp; char *line = NULL; size_t linesize = 0; struct stat sb; char *home; char *extension; int is_junk = 0; int in_hdr = 1; if (dirname == NULL) { if ((home = getenv("HOME")) == NULL) err(1, NULL); ret = snprintf(rootpath, sizeof rootpath, "%s/Maildir", home); if (ret < 0 || (size_t)ret >= sizeof rootpath) errc(1, ENAMETOOLONG, "%s/Maildir", home); dirname = rootpath; } maildir_mkdirs(dirname); if (junk) { /* create Junk subdirectory */ ret = snprintf(junkpath, sizeof junkpath, "%s/.Junk", dirname); if (ret < 0 || (size_t)ret >= sizeof junkpath) errc(1, ENAMETOOLONG, "%s/.Junk", dirname); maildir_mkdirs(junkpath); } if ((extension = getenv("EXTENSION")) != NULL) { if (maildir_subdir(extension, subdir, sizeof(subdir)) && subdir[0]) { ret = snprintf(extpath, sizeof extpath, "%s/.%s", dirname, subdir); if (ret < 0 || (size_t)ret >= sizeof extpath) errc(1, ENAMETOOLONG, "%s/.%s", dirname, subdir); if (stat(extpath, &sb) != -1) { dirname = extpath; maildir_mkdirs(dirname); } } } if (gethostname(hostname, sizeof hostname) != 0) (void)strlcpy(hostname, "localhost", sizeof hostname); (void)snprintf(filename, sizeof filename, "%lld.%08x.%s", (long long)time(NULL), arc4random(), hostname); (void)snprintf(tmp, sizeof tmp, "%s/tmp/%s", dirname, filename); fd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0600); if (fd == -1) err(EX_TEMPFAIL, NULL); if ((fp = fdopen(fd, "w")) == NULL) err(EX_TEMPFAIL, NULL); while (getline(&line, &linesize, stdin) != -1) { line[strcspn(line, "\n")] = '\0'; if (line[0] == '\0') in_hdr = 0; if (junk && in_hdr && (strcasecmp(line, "x-spam: yes") == 0 || strcasecmp(line, "x-spam-flag: yes") == 0)) is_junk = 1; fprintf(fp, "%s\n", line); } free(line); if (ferror(stdin)) err(EX_TEMPFAIL, NULL); if (fflush(fp) == EOF || ferror(fp) || fsync(fd) == -1 || fclose(fp) == EOF) err(EX_TEMPFAIL, NULL); (void)snprintf(new, sizeof new, "%s/new/%s", is_junk ? junkpath : dirname, filename); if (rename(tmp, new) == -1) err(EX_TEMPFAIL, NULL); exit(0); } static int mkdirs_component(const char *path, mode_t mode) { struct stat sb; if (stat(path, &sb) == -1) { if (errno != ENOENT) return 0; if (mkdir(path, mode | S_IWUSR | S_IXUSR) == -1) return 0; } else if (!S_ISDIR(sb.st_mode)) { errno = ENOTDIR; return 0; } return 1; } static int mkdirs(const char *path, mode_t mode) { char buf[PATH_MAX]; int i = 0; int done = 0; const char *p; /* absolute path required */ if (*path != '/') { errno = EINVAL; return 0; } /* make sure we don't exceed PATH_MAX */ if (strlen(path) >= sizeof buf) { errno = ENAMETOOLONG; return 0; } memset(buf, 0, sizeof buf); for (p = path; *p; p++) { if (*p == '/') { if (buf[0] != '\0') if (!mkdirs_component(buf, mode)) return 0; while (*p == '/') p++; buf[i++] = '/'; buf[i++] = *p; if (*p == '\0' && ++done) break; continue; } buf[i++] = *p; } if (!done) if (!mkdirs_component(buf, mode)) return 0; if (chmod(path, mode) == -1) return 0; return 1; } opensmtpd-7.7.0p0/usr.sbin/smtpd/forward.50000644000175000001440000000467114764503545014124 .\" $OpenBSD: forward.5,v 1.12 2024/09/05 06:33:04 jmc Exp $ .\" .\" Copyright (c) 2012 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: September 5 2024 $ .Dt FORWARD 5 .Os .Sh NAME .Nm forward .Nd email forwarding information file .Sh DESCRIPTION Users may put a .Nm .forward file in their home directory. If this file exists, .Xr smtpd 8 forwards email to the destinations specified therein. .Pp A .Nm .forward file contains a list of expansion values, as described in .Xr aliases 5 . Each expansion value should be on a line by itself. Expansion is performed under the user ID of the .Nm .forward file owner. .Pp Permissions on the .Nm .forward file are very strict and expansion is rejected if the file is group or world-writable; if the home directory is group writeable; or if the file is not owned by the user. .Pp Users should avoid editing the .Nm .forward file directly, to prevent delivery failures from occurring if a message arrives while the file is not fully written. The best option is to use a temporary file and use the .Xr mv 1 command to atomically overwrite the former .Nm .forward . Alternatively, setting the .Xr sticky 8 bit on the home directory will cause the .Nm .forward lookup to return a temporary failure, causing mails to be deferred. .Sh FILES .Bl -tag -width "~/.forwardXXX" -compact .It Pa ~/.forward Email forwarding information. .El .Sh EXAMPLES The following file forwards mail to .Dq user@example.com , and pipes the same mail to .Dq examplemda . .Bd -literal -offset indent # empty lines are ignored user@example.com # anything after # is ignored "|/path/to/examplemda" .Ed .Sh SEE ALSO .Xr aliases 5 , .Xr smtpd 8 .Sh CAVEATS The pipe .Sq | and :include: mechanisms are not allowed for the root user. opensmtpd-7.7.0p0/usr.sbin/smtpd/mail.lmtp.80000644000175000001440000000315114610663500014334 .\" $OpenBSD: mail.lmtp.8,v 1.1 2017/02/14 15:16:34 gilles Exp $ .\" .\" Copyright (c) 2017 Gilles Chehade .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: February 14 2017 $ .Dt MAIL.LMTP 8 .Os .Sh NAME .Nm mail.lmtp .Nd deliver mail through LMTP .Sh SYNOPSIS .Nm mail.lmtp .Op Fl d Ar destination .Op Fl f Ar from .Op Fl l Ar lhlo .Ar user ... .Sh DESCRIPTION .Nm reads the standard input up to an end-of-file and delivers it to an LMTP server for each .Ar user Ns 's address. The .Ar user must be a valid user name or email address. .Pp The options are as follows: .Bl -tag -width Ds .It Fl d Ar destination Specify the destination LMTP address. .It Fl f Ar from Specify the sender's name or email address. .It Fl l Ar lhlo Specify the LHLO argument used in the LMTP session. By default, .Nm mail.lmtp will default to "localhost". .El .Sh EXIT STATUS .Ex -std mail.lmtp .Sh SEE ALSO .Xr mail 1 , .Xr smtpd 8 opensmtpd-7.7.0p0/ylwrap0000555000175000001440000001531414764503774010742 #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: opensmtpd-7.7.0p0/depcomp0000555000175000001440000005602014764503774011052 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: opensmtpd-7.7.0p0/Makefile.am0000644000175000001440000000023014610663500011503 SUBDIRS = mk contrib openbsd-compat EXTRA_DIST = CHANGES.md \ LICENSE \ bootstrap \ etc/README.md \ etc/aliases ACLOCAL_AMFLAGS = -I m4 opensmtpd-7.7.0p0/bootstrap0000755000175000001440000000004114610663500011412 #! /bin/sh exec autoreconf -vfi opensmtpd-7.7.0p0/contrib/0000755000175000001440000000000015010115322011161 5opensmtpd-7.7.0p0/contrib/Makefile.am0000644000175000001440000000002214610663500013142 SUBDIRS = libexec opensmtpd-7.7.0p0/contrib/libexec/0000755000175000001440000000000015010115322012574 5opensmtpd-7.7.0p0/contrib/libexec/encrypt/0000755000175000001440000000000015010115322014260 5opensmtpd-7.7.0p0/contrib/libexec/encrypt/Makefile.am0000644000175000001440000000037514764503545016270 pkglibexec_PROGRAMS = encrypt encrypt_SOURCES = encrypt.c encrypt_SOURCES += $(top_srcdir)/usr.sbin/smtpd/log.c AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/contrib/libexec/encrypt/encrypt.c0000644000175000001440000000565314610663500016054 /* * Copyright (c) 2013 Sunil Nimmagadda * Copyright (c) 2013 Gilles Chehade * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "includes.h" #ifdef HAVE_CRYPT_H #include /* needed for crypt() */ #endif #include #include #include #include #ifndef CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX #define PASSWORD_LEN 128 #endif #define SALT_LEN 16 struct hashing_method { char *prefix; unsigned long count; }; static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static struct hashing_method ids[] = { {"$y$", 8}, {"$gy$", 8}, {"$7$", 8}, {"$2a$", 10}, {"$2b$", 10}, {"$2y$", 10}, {"$6$", 5000}, {"$5$", 5000}, {"$3$", 1}, {"$2$", 10}, {"$1$", 1000} }; static void to64(char *, long int, int); static void print_passwd(const char *); int main(int argc, char *argv[]) { char *line; size_t linesz; ssize_t linelen; if (argc > 2) { fprintf(stderr, "usage: encrypt \n"); return (1); } if (argc == 2) { print_passwd(argv[1]); return (0); } line = NULL; linesz = 0; while ((linelen = getline(&line, &linesz, stdin)) != -1) { if (line[linelen - 1] == '\n') line[linelen - 1] = '\0'; print_passwd(line); } free(line); return (0); } void print_passwd(const char *string) { const char *id; char salt[SALT_LEN+1]; #ifndef CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX char buffer[PASSWORD_LEN]; #else char *buffer; #endif int n; const char *p; int nb_ids = sizeof(ids) / sizeof(ids[0]); for (n = 0; n < SALT_LEN; ++n) to64(&salt[n], arc4random_uniform(0xff), 1); salt[SALT_LEN] = '\0'; for (n = 0; n < nb_ids; n++) { id = ids[n].prefix; #ifndef CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX (void)snprintf(buffer, sizeof buffer, "%s%s$", id, salt); #else buffer = crypt_gensalt(id, ids[n].count, NULL, 0); #endif if ((p = crypt(string, buffer)) == NULL) continue; if (strncmp(p, buffer, strlen(buffer)) != 0) continue; printf("%s\n", p); return; } salt[2] = 0; printf("%s\n", crypt(string, salt)); } void to64(char *s, long int v, int n) { while (--n >= 0) { *s++ = itoa64[v & 0x3f]; v >>= 6; } } opensmtpd-7.7.0p0/contrib/libexec/encrypt/Makefile.in0000644000175000001440000012333115010115300016244 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = encrypt$(EXEEXT) subdir = contrib/libexec/encrypt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_encrypt_OBJECTS = encrypt.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) encrypt_OBJECTS = $(am_encrypt_OBJECTS) encrypt_LDADD = $(LDADD) encrypt_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po \ ./$(DEPDIR)/encrypt.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(encrypt_SOURCES) DIST_SOURCES = $(encrypt_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ encrypt_SOURCES = encrypt.c $(top_srcdir)/usr.sbin/smtpd/log.c AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/libexec/encrypt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/libexec/encrypt/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) encrypt$(EXEEXT): $(encrypt_OBJECTS) $(encrypt_DEPENDENCIES) $(EXTRA_encrypt_DEPENDENCIES) @rm -f encrypt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encrypt_OBJECTS) $(encrypt_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encrypt.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/encrypt.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/encrypt.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibexecPROGRAMS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/contrib/libexec/lockspool/0000755000175000001440000000000015010115322014601 5opensmtpd-7.7.0p0/contrib/libexec/lockspool/lockspool.c0000644000175000001440000000605514610663500016713 /* $OpenBSD: lockspool.c,v 1.21 2020/02/09 14:59:20 millert Exp $ */ /* * Copyright (c) 1998 Theo de Raadt * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include "mail.local.h" void unhold(int); void usage(void); extern char *__progname; int main(int argc, char *argv[]) { struct passwd *pw; struct pollfd pfd; ssize_t nread; char *from, c; int holdfd; #if HAVE_UNVEIL if (unveil(_PATH_MAILDIR, "rwc") == -1) err(1, "unveil"); #endif #if HAVE_PLEDGE if (pledge("stdio rpath wpath getpw cpath fattr", NULL) == -1) err(1, "pledge"); #endif openlog(__progname, LOG_PERROR, LOG_MAIL); if (argc != 1 && argc != 2) usage(); if (argc == 2 && getuid() != 0) merr(1, "you must be root to lock someone else's spool"); signal(SIGTERM, unhold); signal(SIGINT, unhold); signal(SIGHUP, unhold); signal(SIGPIPE, unhold); if (argc == 2) pw = getpwnam(argv[1]); else pw = getpwuid(getuid()); if (pw == NULL) exit (1); from = pw->pw_name; holdfd = getlock(from, pw); if (holdfd == -1) { write(STDOUT_FILENO, "0\n", 2); exit (1); } write(STDOUT_FILENO, "1\n", 2); /* wait for the other end of the pipe to close, then release the lock */ pfd.fd = STDIN_FILENO; pfd.events = POLLIN; do { if (poll(&pfd, 1, INFTIM) == -1) { if (errno != EINTR) break; } do { nread = read(STDIN_FILENO, &c, 1); } while (nread == 1 || (nread == -1 && errno == EINTR)); } while (nread == -1 && errno == EAGAIN); rellock(); exit (0); } /*ARGSUSED*/ void unhold(int signo) { rellock(); _exit(0); } void usage(void) { merr(1, "usage: %s [username]", __progname); } opensmtpd-7.7.0p0/contrib/libexec/lockspool/mail.local.h0000644000175000001440000000367214610663500016730 /* $OpenBSD: mail.local.h,v 1.7 2020/02/09 14:59:21 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ void baditem(char *); int deliver(int, char *, int); void merr(int, const char *, ...); void mwarn(const char *, ...); int getlock(const char *, struct passwd *); void notifybiff(char *); void rellock(void); int storemail(char *); int lockspool(const char *, struct passwd *); void unlockspool(void); void usage(void); opensmtpd-7.7.0p0/contrib/libexec/lockspool/Makefile.am0000644000175000001440000000101514764503545016601 pkglibexec_PROGRAMS = lockspool lockspool_SOURCES = lockspool.c lockspool_SOURCES += locking.c lockspool_SOURCES += $(top_srcdir)/usr.sbin/smtpd/log.c dist_man1_MANS = lockspool.1 EXTRA_DIST = mail.local.h pathnames.h AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ LDADD = $(LIBOBJS) install-exec-hook: $(CONFIGFILES) $(MANPAGES) chown root $(DESTDIR)$(pkglibexecdir)/lockspool || true chmod 4555 $(DESTDIR)$(pkglibexecdir)/lockspool || true uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/contrib/libexec/lockspool/lockspool.10000644000175000001440000000404614610663500016627 .\" $OpenBSD: lockspool.1,v 1.14 2019/01/25 00:19:26 millert Exp $ .\" .\" Copyright (c) 1998 Todd C. Miller .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: January 25 2019 $ .Dt LOCKSPOOL 1 .Os .Sh NAME .Nm lockspool .Nd lock user's system mailbox .Sh SYNOPSIS .Nm lockspool .Op Ar username .Sh DESCRIPTION .Nm is useful for a client mail program to attain proper locking. .Nm obtains a .Pa username.lock for the calling user and retains it until stdin is closed or a signal like .Dv SIGINT , .Dv SIGTERM , or .Dv SIGHUP is received. Additionally, the superuser may specify the name of a user in order to lock a different mailbox. .Pp If .Nm is able to create the lock file, .Dq 1 is written to stdout, otherwise .Dq 0 is written and an error message is written to stderr. .Nm will try up to 10 times to get the lock (sleeping for a short period in between tries). .Pp Typical usage is for a user mail agent (such as .Xr mail 1 ) to open a pipe to .Nm when it needs to lock the user's mail spool. Closing the pipe will cause .Nm to release the lock. .Sh FILES .Bl -tag -width /var/mail/username.lock -compact .It Pa /var/mail/username.lock user's mail lock file .El .Sh EXIT STATUS The .Nm utility exits 0 on success, and 1 if an error occurs. .Sh SEE ALSO .Xr mail 1 , .Xr mail.local 8 , .Xr smtpd 8 .Sh HISTORY The .Nm program appeared in .Ox 2.4 . opensmtpd-7.7.0p0/contrib/libexec/lockspool/locking.c0000644000175000001440000001055014610663500016327 /* $OpenBSD: locking.c,v 1.14 2020/02/09 14:59:20 millert Exp $ */ /* * Copyright (c) 1996-1998 Theo de Raadt * Copyright (c) 1996-1998 David Mazieres * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pathnames.h" #include "mail.local.h" static char lpath[PATH_MAX]; void rellock(void) { if (lpath[0]) unlink(lpath); } int getlock(const char *name, struct passwd *pw) { struct stat sb, fsb; int lfd=-1; char buf[8*1024]; int tries = 0; (void)snprintf(lpath, sizeof lpath, "%s/%s.lock", _PATH_MAILDIR, name); if (stat(_PATH_MAILDIR, &sb) != -1 && (sb.st_mode & S_IWOTH) == S_IWOTH) { /* * We have a writeable spool, deal with it as * securely as possible. */ time_t ctim = -1; seteuid(pw->pw_uid); if (lstat(lpath, &sb) != -1) ctim = sb.st_ctime; while (1) { /* * Deal with existing user.lock files * or directories or symbolic links that * should not be here. */ if (readlink(lpath, buf, sizeof buf-1) != -1) { if (lstat(lpath, &sb) != -1 && S_ISLNK(sb.st_mode)) { seteuid(sb.st_uid); unlink(lpath); seteuid(pw->pw_uid); } goto again; } if ((lfd = open(lpath, O_CREAT|O_WRONLY|O_EXCL|O_EXLOCK, S_IRUSR|S_IWUSR)) != -1) break; again: if (tries > 10) { mwarn("%s: %s", lpath, strerror(errno)); seteuid(0); return(-1); } if (tries > 9 && (lfd = open(lpath, O_WRONLY|O_EXLOCK, 0)) != -1) { if (fstat(lfd, &fsb) != -1 && lstat(lpath, &sb) != -1) { if (fsb.st_dev == sb.st_dev && fsb.st_ino == sb.st_ino && ctim == fsb.st_ctime ) { seteuid(fsb.st_uid); baditem(lpath); seteuid(pw->pw_uid); } } close(lfd); } sleep(1U << tries); tries++; continue; } seteuid(0); } else { /* * Only root can write the spool directory. */ while (1) { if ((lfd = open(lpath, O_CREAT|O_WRONLY|O_EXCL, S_IRUSR|S_IWUSR)) != -1) break; if (tries > 9) { mwarn("%s: %s", lpath, strerror(errno)); return(-1); } sleep(1U << tries); tries++; } } return(lfd); } void baditem(char *path) { char npath[PATH_MAX]; int fd; if (unlink(path) == 0) return; snprintf(npath, sizeof npath, "%s/mailXXXXXXXXXX", _PATH_MAILDIR); if ((fd = mkstemp(npath)) == -1) return; close(fd); if (rename(path, npath) == -1) unlink(npath); else mwarn("nasty spool item %s renamed to %s", path, npath); /* XXX if we fail to rename, another attempt will happen later */ } void mwarn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vsyslog(LOG_ERR, fmt, ap); va_end(ap); } void merr(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vsyslog(LOG_ERR, fmt, ap); va_end(ap); exit(eval); } opensmtpd-7.7.0p0/contrib/libexec/lockspool/Makefile.in0000644000175000001440000013232515010115300016570 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = lockspool$(EXEEXT) subdir = contrib/libexec/lockspool ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_lockspool_OBJECTS = lockspool.$(OBJEXT) locking.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) lockspool_OBJECTS = $(am_lockspool_OBJECTS) lockspool_LDADD = $(LDADD) lockspool_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po \ ./$(DEPDIR)/locking.Po ./$(DEPDIR)/lockspool.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(lockspool_SOURCES) DIST_SOURCES = $(lockspool_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lockspool_SOURCES = lockspool.c locking.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man1_MANS = lockspool.1 EXTRA_DIST = mail.local.h pathnames.h AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/libexec/lockspool/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/libexec/lockspool/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) lockspool$(EXEEXT): $(lockspool_OBJECTS) $(lockspool_DEPENDENCIES) $(EXTRA_lockspool_DEPENDENCIES) @rm -f lockspool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lockspool_OBJECTS) $(lockspool_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locking.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lockspool.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/locking.Po -rm -f ./$(DEPDIR)/lockspool.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/locking.Po -rm -f ./$(DEPDIR)/lockspool.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am \ install-pkglibexecPROGRAMS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-hook uninstall-man uninstall-man1 \ uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile install-exec-hook: $(CONFIGFILES) $(MANPAGES) chown root $(DESTDIR)$(pkglibexecdir)/lockspool || true chmod 4555 $(DESTDIR)$(pkglibexecdir)/lockspool || true uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/contrib/libexec/lockspool/pathnames.h0000644000175000001440000000343514610663500016672 /* $OpenBSD: pathnames.h,v 1.5 2003/06/02 19:38:24 millert Exp $*/ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: @(#)pathnames.h 5.3 (Berkeley) 1/17/91 */ #include #define _PATH_LOCTMP "/tmp/local.XXXXXXXXXX" #define _PATH_LOCKSPOOL PATH_LIBEXEC"/lockspool" opensmtpd-7.7.0p0/contrib/libexec/mail.local/0000755000175000001440000000000015010115322014607 5opensmtpd-7.7.0p0/contrib/libexec/mail.local/mail.local.h0000644000175000001440000000367214610663500016736 /* $OpenBSD: mail.local.h,v 1.7 2020/02/09 14:59:21 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ void baditem(char *); int deliver(int, char *, int); void merr(int, const char *, ...); void mwarn(const char *, ...); int getlock(const char *, struct passwd *); void notifybiff(char *); void rellock(void); int storemail(char *); int lockspool(const char *, struct passwd *); void unlockspool(void); void usage(void); opensmtpd-7.7.0p0/contrib/libexec/mail.local/mail.local.80000644000175000001440000001236214610663500016652 .\" $OpenBSD: mail.local.8,v 1.31 2014/09/16 21:28:51 jmc Exp $ .\" Copyright (c) 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" from: @(#)mail.local.8 6.8 (Berkeley) 4/27/91 .\" .Dd $Mdocdate: September 16 2014 $ .Dt MAIL.LOCAL 8 .Os .Sh NAME .Nm mail.local .Nd store mail in a mailbox .Sh SYNOPSIS .Nm mail.local .Op Fl Ll .Op Fl f Ar from .Ar user ... .Sh DESCRIPTION .Nm reads the standard input up to an end-of-file and appends it to each .Ar user Ns 's .Pa mail file. The .Ar user must be a valid user name. .Pp The options are as follows: .Bl -tag -width Ds .It Fl f Ar from Specify the sender's name. .It Fl L Don't create a .Pa username.lock file while locking the spool. .It Fl l For compatibility, request that files named .Pa username.lock be used for locking. (This is the default behavior.) .El .Pp Individual mail messages in the mailbox are delimited by an empty line followed by a line beginning with the string .Dq "From\&\ " . A line containing the string .Dq "From\&\ " , the sender's name and a timestamp is prepended to each delivered mail message. A blank line is appended to each message. A greater-than character .Pq Ql > is prepended to any line in the message which could be mistaken for a .Dq "From\&\ " delimiter line. .Pp Significant efforts have been made to ensure that .Nm acts as securely as possible if the spool directory is mode 1777 or 755. The default of mode 755 is more secure, but it prevents mail clients from using .Pa username.lock style locking. The use of 1777 is more flexible in an NFS shared-spool environment, so many sites use it. However, it does carry some risks, such as attackers filling the spool disk. Some of these problems may be alleviated by making the spool a separate filesystem, and placing quotas on it. The use of any mode other than 1777 and 755 for the spool directory is recommended against but may work properly. .Pp The mailbox is always locked using .Xr flock 2 while mail is appended. Unless the .Fl L flag is specified, a .Pa username.lock file is also used. .Pp If the .Xr biff 1 service is returned by .Xr getservbyname 3 , the biff server is notified of delivered mail. .Sh ENVIRONMENT .Bl -tag -width indent .It Ev TZ Used to set the appropriate time zone on the timestamp. .El .Sh FILES .Bl -tag -width /tmp/local.XXXXXXXXXX -compact .It Pa /tmp/local.XXXXXXXXXX temporary files .It Pa /var/mail/user user's mailbox directory .El .Sh EXIT STATUS .Ex -std mail.local .Sh SEE ALSO .Xr biff 1 , .Xr mail 1 , .Xr flock 2 , .Xr getservbyname 3 , .Xr comsat 8 , .Xr smtpd 8 .Sh HISTORY A superset of .Nm (handling mailbox reading as well as mail delivery) appeared in .At v7 as the program .Xr mail 1 . .Sh BUGS Using quotas in .Pa /var/mail can be problematic if using .Xr sendmail 8 as an MTA, since it asks .Nm to deliver a message to multiple recipients if possible. This causes problems in a quota environment since a message may be delivered to some users but not others due to disk quotas. Even though the message was delivered to some of the recipients, .Nm will exit with an exit code > 0, causing .Xr sendmail 8 to attempt redelivery later. That means that some users will keep getting the same message every time .Xr sendmail 8 runs its queue. This problem does not exist for .Xr smtpd 8 users. .Pp If you are running .Xr sendmail 8 and have disk quotas on .Pa /var/mail it is imperative that you unset the .Dq m mailer flag for the .Sq local mailer. To do this, locate the line beginning with .Dq Mlocal in .Pa /etc/mail/sendmail.cf and remove the .Dq m from the flags section, denoted by .Dq F= . Alternately, you can override the default mailer flags by adding the line: .Pp .Dl define(`LOCAL_MAILER_FLAGS', `rn9S')dnl .Pp to your .Dq \.mc file (this is the source file that is used to generate .Pa /etc/mail/sendmail.cf ) . opensmtpd-7.7.0p0/contrib/libexec/mail.local/mail.local.c0000644000175000001440000002177614610663500016736 /* $OpenBSD: mail.local.c,v 1.42 2023/06/05 08:07:18 op Exp $ */ /*- * Copyright (c) 1996-1998 Theo de Raadt * Copyright (c) 1996-1998 David Mazieres * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pathnames.h" #include "mail.local.h" int main(int argc, char *argv[]) { struct passwd *pw; int ch, fd, eval, lockfile=1; uid_t uid; char *from; openlog("mail.local", LOG_PERROR, LOG_MAIL); from = NULL; while ((ch = getopt(argc, argv, "lLdf:r:")) != -1) switch (ch) { case 'd': /* backward compatible */ break; case 'f': case 'r': /* backward compatible */ if (from) merr(EX_USAGE, "multiple -f options"); from = optarg; break; case 'l': lockfile=1; break; case 'L': lockfile=0; break; default: usage(); } argc -= optind; argv += optind; if (!*argv) usage(); /* * If from not specified, use the name from getlogin() if the * uid matches, otherwise, use the name from the password file * corresponding to the uid. */ uid = getuid(); if (!from && (!(from = getlogin()) || !(pw = getpwnam(from)) || pw->pw_uid != uid)) from = (pw = getpwuid(uid)) ? pw->pw_name : "???"; fd = storemail(from); for (eval = 0; *argv; ++argv) { if ((ch = deliver(fd, *argv, lockfile)) != 0) eval = ch; } exit(eval); } int storemail(char *from) { FILE *fp = NULL; time_t tval; int fd, eline = 1; char *tbuf, *line = NULL; size_t linesize = 0; ssize_t linelen; if ((tbuf = strdup(_PATH_LOCTMP)) == NULL) merr(EX_OSERR, "unable to allocate memory"); if ((fd = mkstemp(tbuf)) == -1 || !(fp = fdopen(fd, "w+"))) merr(EX_OSERR, "unable to open temporary file"); (void)unlink(tbuf); free(tbuf); (void)time(&tval); (void)fprintf(fp, "From %s %s", from, ctime(&tval)); while ((linelen = getline(&line, &linesize, stdin)) != -1) { if (line[linelen - 1] == '\n') line[linelen - 1] = '\0'; if (line[0] == '\0') eline = 1; else { if (eline && !strncmp(line, "From ", 5)) (void)putc('>', fp); eline = 0; } (void)fprintf(fp, "%s\n", line); if (ferror(fp)) break; } free(line); /* Output a newline; note, empty messages are allowed. */ (void)putc('\n', fp); (void)fflush(fp); if (ferror(fp)) merr(EX_OSERR, "temporary file write error"); return(fd); } int deliver(int fd, char *name, int lockfile) { struct stat sb, fsb; struct passwd *pw; int mbfd=-1, lfd=-1, rval=EX_OSERR; char biffmsg[100], buf[8*1024], path[PATH_MAX]; off_t curoff; size_t off; ssize_t nr, nw; /* * Disallow delivery to unknown names -- special mailboxes can be * handled in the sendmail aliases file. */ if (!(pw = getpwnam(name))) { mwarn("unknown name: %s", name); return(EX_NOUSER); } (void)snprintf(path, sizeof path, "%s/%s", _PATH_MAILDIR, name); if (lockfile) { lfd = lockspool(name, pw); if (lfd == -1) return(EX_OSERR); } /* after this point, always exit via bad to remove lockfile */ retry: if (lstat(path, &sb)) { if (errno != ENOENT) { mwarn("%s: %s", path, strerror(errno)); goto bad; } if ((mbfd = open(path, O_APPEND|O_CREAT|O_EXCL|O_WRONLY|O_EXLOCK, S_IRUSR|S_IWUSR)) == -1) { #ifndef HAVE_O_EXLOCK /* XXX : do something! */ #endif if (errno == EEXIST) { /* file appeared since lstat */ goto retry; } else { mwarn("%s: %s", path, strerror(errno)); rval = EX_CANTCREAT; goto bad; } } /* * Set the owner and group. Historically, binmail repeated * this at each mail delivery. We no longer do this, assuming * that if the ownership or permissions were changed there * was a reason for doing so. */ if (fchown(mbfd, pw->pw_uid, pw->pw_gid) == -1) { mwarn("chown %u:%u: %s", pw->pw_uid, pw->pw_gid, name); goto bad; } } else { if (sb.st_nlink != 1 || !S_ISREG(sb.st_mode)) { mwarn("%s: linked or special file", path); goto bad; } if ((mbfd = open(path, O_APPEND|O_WRONLY|O_EXLOCK, S_IRUSR|S_IWUSR)) == -1) { mwarn("%s: %s", path, strerror(errno)); goto bad; } if (fstat(mbfd, &fsb) == -1) { /* relating error to path may be bad style */ mwarn("%s: %s", path, strerror(errno)); goto bad; } if (sb.st_dev != fsb.st_dev || sb.st_ino != fsb.st_ino) { mwarn("%s: changed after open", path); goto bad; } /* paranoia? */ if (fsb.st_nlink != 1 || !S_ISREG(fsb.st_mode)) { mwarn("%s: linked or special file", path); rval = EX_CANTCREAT; goto bad; } } curoff = lseek(mbfd, 0, SEEK_END); (void)snprintf(biffmsg, sizeof biffmsg, "%s@%lld\n", name, (long long)curoff); if (lseek(fd, 0, SEEK_SET) == (off_t)-1) { mwarn("temporary file: %s", strerror(errno)); goto bad; } while ((nr = read(fd, buf, sizeof(buf))) > 0) for (off = 0; off < nr; off += nw) if ((nw = write(mbfd, buf + off, nr - off)) == -1) { mwarn("%s: %s", path, strerror(errno)); (void)ftruncate(mbfd, curoff); goto bad; } if (nr == 0) { rval = 0; } else { (void)ftruncate(mbfd, curoff); mwarn("temporary file: %s", strerror(errno)); } bad: if (lfd != -1) unlockspool(); if (mbfd != -1) { (void)fsync(mbfd); /* Don't wait for update. */ (void)close(mbfd); /* Implicit unlock. */ } if (!rval) notifybiff(biffmsg); return(rval); } void notifybiff(char *msg) { static struct addrinfo *res0; struct addrinfo hints, *res; static int f = -1; size_t len; int error; if (res0 == NULL) { memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; error = getaddrinfo("localhost", "biff", &hints, &res0); if (error) { /* Be silent if biff service not available. */ if (error != EAI_SERVICE) { mwarn("localhost: %s", gai_strerror(error)); } return; } } if (f == -1) { for (res = res0; res != NULL; res = res->ai_next) { f = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (f != -1) break; } } if (f == -1) { mwarn("socket: %s", strerror(errno)); return; } len = strlen(msg) + 1; /* XXX */ if (sendto(f, msg, len, 0, res->ai_addr, res->ai_addrlen) != len) mwarn("sendto biff: %s", strerror(errno)); } static int lockfd = -1; static pid_t lockpid = -1; int lockspool(const char *name, struct passwd *pw) { int pfd[2]; char ch; if (geteuid() == 0) return getlock(name, pw); /* If not privileged, open pipe to lockspool(1) instead */ if (pipe2(pfd, O_CLOEXEC) == -1) { merr(EX_OSERR, "pipe: %s", strerror(errno)); return -1; } signal(SIGPIPE, SIG_IGN); switch ((lockpid = fork())) { case -1: merr(EX_OSERR, "fork: %s", strerror(errno)); return -1; case 0: /* child */ close(pfd[0]); dup2(pfd[1], STDOUT_FILENO); execl(_PATH_LOCKSPOOL, "lockspool", (char *)NULL); merr(EX_OSERR, "execl: lockspool: %s", strerror(errno)); /* NOTREACHED */ break; default: /* parent */ close(pfd[1]); lockfd = pfd[0]; break; } if (read(lockfd, &ch, 1) != 1 || ch != '1') { unlockspool(); merr(EX_OSERR, "lockspool: unable to get lock"); } return lockfd; } void unlockspool(void) { if (lockpid != -1) { waitpid(lockpid, NULL, 0); lockpid = -1; } else { rellock(); } close(lockfd); lockfd = -1; } void usage(void) { merr(EX_USAGE, "usage: mail.local [-Ll] [-f from] user ..."); } opensmtpd-7.7.0p0/contrib/libexec/mail.local/Makefile.am0000644000175000001440000000063314764503545016614 pkglibexec_PROGRAMS = mail.local mail_local_SOURCES = mail.local.c mail_local_SOURCES += locking.c mail_local_SOURCES += $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = mail.local.8 EXTRA_DIST = mail.local.h pathnames.h AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" LDADD = $(LIBOBJS) uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true opensmtpd-7.7.0p0/contrib/libexec/mail.local/locking.c0000644000175000001440000001055114610663500016336 /* $OpenBSD: locking.c,v 1.14 2020/02/09 14:59:20 millert Exp $ */ /* * Copyright (c) 1996-1998 Theo de Raadt * Copyright (c) 1996-1998 David Mazieres * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pathnames.h" #include "mail.local.h" static char lpath[PATH_MAX]; void rellock(void) { if (lpath[0]) unlink(lpath); } int getlock(const char *name, struct passwd *pw) { struct stat sb, fsb; int lfd=-1; char buf[8*1024]; int tries = 0; (void)snprintf(lpath, sizeof lpath, "%s/%s.lock", _PATH_MAILDIR, name); if (stat(_PATH_MAILDIR, &sb) != -1 && (sb.st_mode & S_IWOTH) == S_IWOTH) { /* * We have a writeable spool, deal with it as * securely as possible. */ time_t ctim = -1; seteuid(pw->pw_uid); if (lstat(lpath, &sb) != -1) ctim = sb.st_ctime; while (1) { /* * Deal with existing user.lock files * or directories or symbolic links that * should not be here. */ if (readlink(lpath, buf, sizeof buf-1) != -1) { if (lstat(lpath, &sb) != -1 && S_ISLNK(sb.st_mode)) { seteuid(sb.st_uid); unlink(lpath); seteuid(pw->pw_uid); } goto again; } if ((lfd = open(lpath, O_CREAT|O_WRONLY|O_EXCL|O_EXLOCK, S_IRUSR|S_IWUSR)) != -1) break; again: if (tries > 10) { mwarn("%s: %s", lpath, strerror(errno)); seteuid(0); return(-1); } if (tries > 9 && (lfd = open(lpath, O_WRONLY|O_EXLOCK, 0)) != -1) { if (fstat(lfd, &fsb) != -1 && lstat(lpath, &sb) != -1) { if (fsb.st_dev == sb.st_dev && fsb.st_ino == sb.st_ino && ctim == fsb.st_ctime ) { seteuid(fsb.st_uid); baditem(lpath); seteuid(pw->pw_uid); } } close(lfd); } sleep(1U << tries); tries++; continue; } seteuid(0); } else { /* * Only root can write the spool directory. */ while (1) { if ((lfd = open(lpath, O_CREAT|O_WRONLY|O_EXCL, S_IRUSR|S_IWUSR)) != -1) break; if (tries > 9) { mwarn("%s: %s", lpath, strerror(errno)); return(-1); } sleep(1U << tries); tries++; } } return(lfd); } void baditem(char *path) { char npath[PATH_MAX]; int fd; if (unlink(path) == 0) return; snprintf(npath, sizeof npath, "%s/mailXXXXXXXXXX", _PATH_MAILDIR); if ((fd = mkstemp(npath)) == -1) return; close(fd); if (rename(path, npath) == -1) unlink(npath); else mwarn("nasty spool item %s renamed to %s", path, npath); /* XXX if we fail to rename, another attempt will happen later */ } void mwarn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vsyslog(LOG_ERR, fmt, ap); va_end(ap); } void merr(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vsyslog(LOG_ERR, fmt, ap); va_end(ap); exit(eval); } opensmtpd-7.7.0p0/contrib/libexec/mail.local/Makefile.in0000644000175000001440000013202515010115300016573 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = mail.local$(EXEEXT) subdir = contrib/libexec/mail.local ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)" PROGRAMS = $(pkglibexec_PROGRAMS) LIBOBJDIR = ../../../openbsd-compat/ am__dirstamp = $(am__leading_dot)dirstamp am_mail_local_OBJECTS = mail.local.$(OBJEXT) locking.$(OBJEXT) \ $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT) mail_local_OBJECTS = $(am_mail_local_OBJECTS) mail_local_LDADD = $(LDADD) mail_local_DEPENDENCIES = $(LIBOBJS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po \ ../../../openbsd-compat/$(DEPDIR)/arc4random.Po \ ../../../openbsd-compat/$(DEPDIR)/base64.Po \ ../../../openbsd-compat/$(DEPDIR)/basename.Po \ ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po \ ../../../openbsd-compat/$(DEPDIR)/closefrom.Po \ ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po \ ../../../openbsd-compat/$(DEPDIR)/daemon.Po \ ../../../openbsd-compat/$(DEPDIR)/dirname.Po \ ../../../openbsd-compat/$(DEPDIR)/errc.Po \ ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po \ ../../../openbsd-compat/$(DEPDIR)/fgetln.Po \ ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po \ ../../../openbsd-compat/$(DEPDIR)/fparseln.Po \ ../../../openbsd-compat/$(DEPDIR)/freezero.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po \ ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po \ ../../../openbsd-compat/$(DEPDIR)/getopt.Po \ ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po \ ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po \ ../../../openbsd-compat/$(DEPDIR)/imsg.Po \ ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po \ ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po \ ../../../openbsd-compat/$(DEPDIR)/pidfile.Po \ ../../../openbsd-compat/$(DEPDIR)/pipe2.Po \ ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po \ ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po \ ../../../openbsd-compat/$(DEPDIR)/res_random.Po \ ../../../openbsd-compat/$(DEPDIR)/setegid.Po \ ../../../openbsd-compat/$(DEPDIR)/seteuid.Po \ ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po \ ../../../openbsd-compat/$(DEPDIR)/setresgid.Po \ ../../../openbsd-compat/$(DEPDIR)/setresuid.Po \ ../../../openbsd-compat/$(DEPDIR)/signal.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcat.Po \ ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po \ ../../../openbsd-compat/$(DEPDIR)/strmode.Po \ ../../../openbsd-compat/$(DEPDIR)/strndup.Po \ ../../../openbsd-compat/$(DEPDIR)/strnlen.Po \ ../../../openbsd-compat/$(DEPDIR)/strsep.Po \ ../../../openbsd-compat/$(DEPDIR)/strtonum.Po \ ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po \ ../../../openbsd-compat/$(DEPDIR)/usleep.Po \ ../../../openbsd-compat/$(DEPDIR)/vis.Po \ ./$(DEPDIR)/locking.Po ./$(DEPDIR)/mail.local.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mail_local_SOURCES) DIST_SOURCES = $(mail_local_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(dist_man8_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp \ $(top_srcdir)/openbsd-compat/arc4random.c \ $(top_srcdir)/openbsd-compat/base64.c \ $(top_srcdir)/openbsd-compat/basename.c \ $(top_srcdir)/openbsd-compat/clock_gettime.c \ $(top_srcdir)/openbsd-compat/closefrom.c \ $(top_srcdir)/openbsd-compat/crypt_checkpass.c \ $(top_srcdir)/openbsd-compat/daemon.c \ $(top_srcdir)/openbsd-compat/dirname.c \ $(top_srcdir)/openbsd-compat/errc.c \ $(top_srcdir)/openbsd-compat/explicit_bzero.c \ $(top_srcdir)/openbsd-compat/fgetln.c \ $(top_srcdir)/openbsd-compat/fmt_scaled.c \ $(top_srcdir)/openbsd-compat/fparseln.c \ $(top_srcdir)/openbsd-compat/freezero.c \ $(top_srcdir)/openbsd-compat/getdtablecount.c \ $(top_srcdir)/openbsd-compat/getdtablesize.c \ $(top_srcdir)/openbsd-compat/getopt.c \ $(top_srcdir)/openbsd-compat/getpeereid.c \ $(top_srcdir)/openbsd-compat/getsubopt.c \ $(top_srcdir)/openbsd-compat/imsg-buffer.c \ $(top_srcdir)/openbsd-compat/imsg.c \ $(top_srcdir)/openbsd-compat/inet_net_pton.c \ $(top_srcdir)/openbsd-compat/nanosleep.c \ $(top_srcdir)/openbsd-compat/pidfile.c \ $(top_srcdir)/openbsd-compat/pipe2.c \ $(top_srcdir)/openbsd-compat/reallocarray.c \ $(top_srcdir)/openbsd-compat/recallocarray.c \ $(top_srcdir)/openbsd-compat/res_hnok.c \ $(top_srcdir)/openbsd-compat/res_random.c \ $(top_srcdir)/openbsd-compat/setegid.c \ $(top_srcdir)/openbsd-compat/seteuid.c \ $(top_srcdir)/openbsd-compat/setproctitle.c \ $(top_srcdir)/openbsd-compat/setresgid.c \ $(top_srcdir)/openbsd-compat/setresuid.c \ $(top_srcdir)/openbsd-compat/signal.c \ $(top_srcdir)/openbsd-compat/strlcat.c \ $(top_srcdir)/openbsd-compat/strlcpy.c \ $(top_srcdir)/openbsd-compat/strmode.c \ $(top_srcdir)/openbsd-compat/strndup.c \ $(top_srcdir)/openbsd-compat/strnlen.c \ $(top_srcdir)/openbsd-compat/strsep.c \ $(top_srcdir)/openbsd-compat/strtonum.c \ $(top_srcdir)/openbsd-compat/timingsafe_memcmp.c \ $(top_srcdir)/openbsd-compat/usleep.c \ $(top_srcdir)/openbsd-compat/vis.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ mail_local_SOURCES = mail.local.c locking.c \ $(top_srcdir)/usr.sbin/smtpd/log.c dist_man8_MANS = mail.local.8 EXTRA_DIST = mail.local.h pathnames.h AM_CPPFLAGS = -I$(top_srcdir)/openbsd-compat/ \ -DPATH_LIBEXEC=\"$(pkglibexecdir)\" LDADD = $(LIBOBJS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/libexec/mail.local/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/libexec/mail.local/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../../openbsd-compat/$(am__dirstamp): @$(MKDIR_P) ../../../openbsd-compat/ @: > ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/arc4random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/base64.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/basename.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/clock_gettime.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/closefrom.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/crypt_checkpass.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/daemon.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/dirname.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/errc.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/explicit_bzero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fgetln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fmt_scaled.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/fparseln.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/freezero.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablecount.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getdtablesize.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getpeereid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/getsubopt.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg-buffer.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/imsg.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/inet_net_pton.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/nanosleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pidfile.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/pipe2.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/reallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/recallocarray.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_hnok.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/res_random.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setegid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/seteuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setproctitle.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresgid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/setresuid.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/signal.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcat.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strlcpy.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strmode.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strndup.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strnlen.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strsep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/strtonum.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/usleep.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) ../../../openbsd-compat/vis.$(OBJEXT): ../../../openbsd-compat/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd @: > $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) $(top_builddir)/usr.sbin/smtpd/$(DEPDIR) @: > $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) $(top_builddir)/usr.sbin/smtpd/log.$(OBJEXT): \ $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) \ $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) mail.local$(EXEEXT): $(mail_local_OBJECTS) $(mail_local_DEPENDENCIES) $(EXTRA_mail_local_DEPENDENCIES) @rm -f mail.local$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mail_local_OBJECTS) $(mail_local_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_builddir)/usr.sbin/smtpd/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/arc4random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/closefrom.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/daemon.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/errc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fgetln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/fparseln.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/freezero.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getpeereid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/imsg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pidfile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/recallocarray.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_hnok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/res_random.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setegid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/seteuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setproctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strmode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/strtonum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/usleep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../../../openbsd-compat/$(DEPDIR)/vis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locking.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mail.local.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(dist_man8_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(dist_man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -rm -f ../../../openbsd-compat/arc4random.$(OBJEXT) -rm -f ../../../openbsd-compat/base64.$(OBJEXT) -rm -f ../../../openbsd-compat/basename.$(OBJEXT) -rm -f ../../../openbsd-compat/clock_gettime.$(OBJEXT) -rm -f ../../../openbsd-compat/closefrom.$(OBJEXT) -rm -f ../../../openbsd-compat/crypt_checkpass.$(OBJEXT) -rm -f ../../../openbsd-compat/daemon.$(OBJEXT) -rm -f ../../../openbsd-compat/dirname.$(OBJEXT) -rm -f ../../../openbsd-compat/errc.$(OBJEXT) -rm -f ../../../openbsd-compat/explicit_bzero.$(OBJEXT) -rm -f ../../../openbsd-compat/fgetln.$(OBJEXT) -rm -f ../../../openbsd-compat/fmt_scaled.$(OBJEXT) -rm -f ../../../openbsd-compat/fparseln.$(OBJEXT) -rm -f ../../../openbsd-compat/freezero.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablecount.$(OBJEXT) -rm -f ../../../openbsd-compat/getdtablesize.$(OBJEXT) -rm -f ../../../openbsd-compat/getopt.$(OBJEXT) -rm -f ../../../openbsd-compat/getpeereid.$(OBJEXT) -rm -f ../../../openbsd-compat/getsubopt.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg-buffer.$(OBJEXT) -rm -f ../../../openbsd-compat/imsg.$(OBJEXT) -rm -f ../../../openbsd-compat/inet_net_pton.$(OBJEXT) -rm -f ../../../openbsd-compat/nanosleep.$(OBJEXT) -rm -f ../../../openbsd-compat/pidfile.$(OBJEXT) -rm -f ../../../openbsd-compat/pipe2.$(OBJEXT) -rm -f ../../../openbsd-compat/reallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/recallocarray.$(OBJEXT) -rm -f ../../../openbsd-compat/res_hnok.$(OBJEXT) -rm -f ../../../openbsd-compat/res_random.$(OBJEXT) -rm -f ../../../openbsd-compat/setegid.$(OBJEXT) -rm -f ../../../openbsd-compat/seteuid.$(OBJEXT) -rm -f ../../../openbsd-compat/setproctitle.$(OBJEXT) -rm -f ../../../openbsd-compat/setresgid.$(OBJEXT) -rm -f ../../../openbsd-compat/setresuid.$(OBJEXT) -rm -f ../../../openbsd-compat/signal.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcat.$(OBJEXT) -rm -f ../../../openbsd-compat/strlcpy.$(OBJEXT) -rm -f ../../../openbsd-compat/strmode.$(OBJEXT) -rm -f ../../../openbsd-compat/strndup.$(OBJEXT) -rm -f ../../../openbsd-compat/strnlen.$(OBJEXT) -rm -f ../../../openbsd-compat/strsep.$(OBJEXT) -rm -f ../../../openbsd-compat/strtonum.$(OBJEXT) -rm -f ../../../openbsd-compat/timingsafe_memcmp.$(OBJEXT) -rm -f ../../../openbsd-compat/usleep.$(OBJEXT) -rm -f ../../../openbsd-compat/vis.$(OBJEXT) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../../openbsd-compat/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/$(am__dirstamp) -test -z "$(top_builddir)/usr.sbin/smtpd/$(am__dirstamp)" || rm -f $(top_builddir)/usr.sbin/smtpd/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/locking.Po -rm -f ./$(DEPDIR)/mail.local.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(top_builddir)/usr.sbin/smtpd/$(DEPDIR)/log.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/arc4random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/base64.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/basename.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/clock_gettime.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/closefrom.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/crypt_checkpass.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/daemon.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/dirname.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/errc.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/explicit_bzero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fgetln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fmt_scaled.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/fparseln.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/freezero.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablecount.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getdtablesize.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getpeereid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/getsubopt.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg-buffer.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/imsg.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/inet_net_pton.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/nanosleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pidfile.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/pipe2.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/reallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/recallocarray.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_hnok.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/res_random.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setegid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/seteuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setproctitle.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresgid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/setresuid.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/signal.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcat.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strlcpy.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strmode.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strndup.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strnlen.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strsep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/strtonum.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/timingsafe_memcmp.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/usleep.Po -rm -f ../../../openbsd-compat/$(DEPDIR)/vis.Po -rm -f ./$(DEPDIR)/locking.Po -rm -f ./$(DEPDIR)/mail.local.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-pkglibexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man8 .MAKE: install-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man8 \ install-pdf install-pdf-am install-pkglibexecPROGRAMS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man8 uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile uninstall-hook: rmdir $(DESTDIR)$(pkglibexecdir) 2> /dev/null || true # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/contrib/libexec/mail.local/pathnames.h0000644000175000001440000000343514610663500016700 /* $OpenBSD: pathnames.h,v 1.5 2003/06/02 19:38:24 millert Exp $*/ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: @(#)pathnames.h 5.3 (Berkeley) 1/17/91 */ #include #define _PATH_LOCTMP "/tmp/local.XXXXXXXXXX" #define _PATH_LOCKSPOOL PATH_LIBEXEC"/lockspool" opensmtpd-7.7.0p0/contrib/libexec/Makefile.am0000644000175000001440000000005014610663500014556 SUBDIRS = mail.local lockspool encrypt opensmtpd-7.7.0p0/contrib/libexec/Makefile.in0000644000175000001440000004521415010115300014563 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib/libexec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mail.local lockspool encrypt all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/libexec/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/libexec/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/contrib/Makefile.in0000644000175000001440000004513715010115300013154 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = contrib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libexec all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/config.sub0000555000175000001440000010775614764503774011475 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. obj= case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 fi ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac case $obj in aout* | coff* | elf* | pe*) ;; '') # empty is fine ;; *) echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 exit 1 ;; esac # Here we handle the constraint that a (synthetic) cpu and os are # valid only in combination with each other and nowhere else. case $cpu-$os in # The "javascript-unknown-ghcjs" triple is used by GHC; we # accept it here in order to tolerate that, but reject any # variations. javascript-ghcjs) ;; javascript-* | *-ghcjs) echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-relibc*- | linux-uclibc*- ) ;; uclinux-uclibc*- ) ;; managarm-mlibc*- | managarm-kernel*- ) ;; windows*-msvc*-) ;; -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; kfreebsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; nto-qnx*-) ;; os2-emx-) ;; *-eabi*- | *-gnueabi*-) ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format ;; -*-) # Blank kernel with real OS is always fine. ;; --*) # Blank kernel and OS with real machine code file format is always fine. ;; *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: opensmtpd-7.7.0p0/config.guess0000555000175000001440000014304614764503774012022 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still # use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: opensmtpd-7.7.0p0/CHANGES.md0000644000175000001440000002753015007620061011051 # Release 7.7.0p0 (2025-05-12) - mail.lmtp: Correctly propagate LMTP permanent failures to smtpd. - Fixed connect filter request documentation in smtpd-filters.7. - Updated to new imsg APIs. # Release 7.6.0p1 (2024-10-20) - fixed distribution tarball - added missing forward(5) documentation fix # Release 7.6.0p0 (2024-10-13) - Introduced a new K_AUTH service to allow offloading the credentials to a proc table for non-crypt(3) authentication. Helps with use cases like LDAP or custom auth. - Implement report responses for proc-filters too. - Changed the table protocol to a simpler text-based one. Existing proc tables needs to be updated since old ones won't work. The new protocol is documented in smtpd-tables(7). - Fixed the parsing of IPv6 addresses in file-backed table(5) - Document expected MDA behavior and the environment set by OpenSMTPD. - Set ORIGINAL_RECIPIENT in the environment of MDA scripts for compatibility with postfix. - Updated the bundled libtls. # Release 7.5.0p0 (2024-04-10) - Added support for RFC 7505 "Null MX" handling and treat an MX of "localhost" as it were a "Null MX". - Allow inline tables and filter listings in smtpd.conf(5) to span over multiple lines. - Enabled DSN for the implicit socket too. - Added the `no-dsn' option for listen on socket too. - Reject headers that start with a space or a tab. - Fixed parsing of the ORCPT parameter. - Fixed table lookups of IPv6 addresses. - Fixed handling of escape characters in To, From and Cc headers. - Run LMTP deliveries as the recipient user again. - Disallow custom commands and file reading in root's .forward file. - Do not process other users .forward files when an alternate delivery user is provided in a dispatcher. - Unify the table(5) parser used in smtpd(8) and makemap(8). - Allow to use table(5) mappings on various match constraints. Portability fixes: - re-add ASR_IPV4_BEFORE_IPV6 compile-time knob to prefer connecting to IPv6 instead of IPv4. - update asr(3) and imsg with OpenBSD. - fixed rpath handling on NetBSD in the configure. # Release 7.4.0p1 (2023-11-16) - Fixed potential crash with LibreSSL versions prior 3.8 due to arc4random_buf() symbol clash. - Fixed manpage install path; reintroduced --with-mantype - Fixed typo in the configure help string: it's --without-libbsd - Fixed a couple of issues on MacOS: - Fixed typo that resulted in the re-declaration of strlcpy() and strlcat() - Cast suseconds_t to long for *printf - Fixed res_hnok() and b64_{pton,ntop}() discovery # Release 7.4.0p0 (2023-10-25) - Avoid truncation of filtered data lines. Lines in the email body passed through a filter were truncated to roughly LINE_MAX bytes. - Allow arguments on NOOP. - Swap link-auth filter arguments and bump filter protocol version. It was ambiguous in the case the user name would contain a '|' character. - Add Message-ID as needed for messages received on the submission port. This was dropped during the incoming message parser refactor in 2018. - Drop ENGINE support. - Updated the bundled copy of libtls. This includes the removal of the support for TLS v1.0 and 1.1 as they were "MUST NOT use" for more than two years already. The neverending cleanup of the -portable layer continued. This includes the complete rework of some parts: - Rework of the configure script: + use AC_SYSTEM_EXTENSIONS + better checks for libraries using AC_SEARCH_LIBS + dropped some useless and/or redundant checks + better checks for functions, shouldn't yield false-positives + various simplification to the -portable layer thanks to these changes - Simplified the `bootstrap` script. # Release 7.3.0p2 (2023-09-20) - avoid potential use of uninitialized in ASN1_time_parse - backport ENGINE removal fix the build with newer LibreSSL # Release 7.3.0p1 (2023-06-30) - add missing include of stdio.h for fparseln(3) on FreeBSD - fix a typo in the configure - use fatal() instead of err(3) in xclosefrom() - don't add "-lcrypto -lssl" thrice - fix the build of the bundled libtls with LibreSSL - force the use of the bundled libtls and libasr - append, not prepend, to LIBS during automatic configuration - do not add -L/usr/local/lib or -L/usr/lib, nor -I/usr/local/include or -I/usr/include as consequence of missing --with-libevent - optionally link libbsd-ctor too # Release 7.3.0p0 (2023-06-17) Includes the following security fixes: - OpenBSD 7.2 errata 20 "smtpd(8) could abort due to a connection from a local, scoped ipv6 address" - OpenBSD 7.2 errata 22 "Out of bounds accesses in libc resolver" ## Configuration changes - The certificate to use is now selected by looking at the names found in the certificates themselves rather than the `pki` name. The set of certificates for a TLS listener must be defined explicitly by using the `pki` listener option multiple times. ## Synced with OpenBSD 7.3 - OpenBSD 6.8: * Run LMTP deliveries as the smtpd user instead of the recipient user. - OpenBSD 6.9: * Introduced smtp(1) `-a` to perform authentication before sending a message. * Fixed a memory leak in smtpd(8) resolver. * Prevented a crash due to premature release of resources by the smtpd(8) filter state machine. * Switch to libtls internally. * Change the way SNI works in smtpd.conf(5). TLS listeners may be configured with multiple certificates. The matching is based on the names included in the certificates. * Allow to specify TLS protocols and ciphers per listener and relay action. - OpenBSD 7.0: * Fixed incorrect status code for expired mails resulting in misleading bounce report in smtpd(8). * Added TLS options `cafile=(path)`, `nosni`, `noverify` and `servername=(name)` to smtp(1). * Allowed specification of TLS ciphers and protocols in smtp(1). - OpenBSD 7.1: * Stop verifying the cert or CA for a relay using opportunistic TLS. * Enabled TLS verify by default for outbound "smtps://" and "smtp+tls://", restoring documented smtpd(8) behavior. - OpenBSD 7.3: * Prevented smtpd(8) abort due to a connection from a local, scoped ipv6 address. ## Portable layer changes - libbsd and libtls are now optionally used if found. + Added `--with-libbsd`/`--without-libbsd` configure flag to enable linking to libbsd-overlay. + Added `--with-bundled-libtls` to force the usage of the bundled libtls. LibreTLS 3.7.0 (last version at the time of writing) and previous have a regression with OpenSSL 3+, so please use the bundled one. See the GitHub issue #1171 for more info. - Updated and cleanup of the OpenBSD compats. + Ported `res_randomid()` from OpenBSD. - The configure option `--with-path-CAfile` shouldn't be required anymore in most systems but it is retained since it could be useful in some configuration when using the bundled libtls. - Various minor portability fixes. # Release 6.8.0p2 (2020-12-24) - Fixed an uninitialized variable and potential stack overflow with IPv6 connections in smtpd(8). - Fixed smtpd(8) handling of user names containing "@" symbols. - Allowed handling of long lines in an smtpd(8) aliases table. - Removed mail.local(8) support for world-writable mail spools. # Release 6.7.1p1 (2020-05-21) - fixes a packaging issue causing asr.h to be installed in target system - fixes a possible crash in the MTA when establishing IPv6 connections # Release 6.7.0p1 (2020-05-21) ## New Features: - Allowed use of the smtpd(8) session username in built-in filters when available. - Introduced a `bypass` keyword to smtpd(8) so that built-in filters can bypass processing when a condition is met. - Allowed use of 'auth' as an origin in smtpd.conf(5). - Allowed use of mail-from and rctp-to as for and from parameters in smtpd.conf(5). ## Bug fixes: - Ensured legacy ssl(8) session ID is persistent during a client TLS session, fixing an issue using TLSv1.3 with smtp.mail.yahoo.com. - Fixed security vulnerabilities in smtpd(8). Corrected an out-of-bounds read in smtpd allowing an attacker to inject arbitrary commands into the envelope file to be executed as root, and ensured privilege revocation in smtpctl(8) to prevent arbitrary commands from being run with the _smtpq group. - Allowed mail.local(8) to be run as non-root, opening a pipe to lockspool(1) for file locking. - Fixed a security vulnerability in smtpd(8) which could lead to a privilege escalation on mbox deliveries and unprivileged code execution on lmtp deliveries. - Added support for CIDR in a: spf atoms in smtpd(8). - Fixed a possible crash in smtpd(8) when combining "from rdns" with nested virtual aliases under a particular configuration. ## Experimental Features: - Introduced smtp-out event reporting. - Improved filtering protocol. # Release 6.6.4p1 (2020-02-24) An out of bounds read in smtpd allows an attacker to inject arbitrary commands into the envelope file which are then executed as root. Separately, missing privilege revocation in smtpctl allows arbitrary commands to be run with the _smtpq group. # Release 6.6.3p1 (2020-02-10) Following the 6.6.2p1 release, various improvements were done in OpenBSD -current to mitigate the risk of similar bugs. This release back-ports them to the portable version of OpenSMTPD. # Release 6.6.2p1 (2020-01-28) This is CRITICAL security bugfix for [CVE-2020-7247](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7247) Read more details in [this blog post](https://poolp.org/posts/2020-01-30/opensmtpd-advisory-dissected/) # Release 6.6.1p1 (2019-11-06) ## Changes in this release (since 6.6.0p1) This is a bugfix release. No new features were added. - Fixed crash on recipient expansion [#968](https://github.com/OpenSMTPD/OpenSMTPD/issues/968) - Fixed broken build with LibreSSL [#944](https://github.com/OpenSMTPD/OpenSMTPD/issues/944) - Fixed crash in `arc4random` caused by differences in OpenSSL vs LibreSSL compatibility layer plumbing [#958](https://github.com/OpenSMTPD/OpenSMTPD/issues/958) - Fixed issue where `from any` rules never matched by IPv6 sources [#969](https://github.com/OpenSMTPD/OpenSMTPD/issues/969) - Fixed crash that happened during mail relay on musl distros [#929](https://github.com/OpenSMTPD/OpenSMTPD/issues/929) - Added reference aliases file in `etc/aliases` - Fixed multiple compilation warnings [#965](https://github.com/OpenSMTPD/OpenSMTPD/issues/965) [#966](https://github.com/OpenSMTPD/OpenSMTPD/issues/966) [#967](https://github.com/OpenSMTPD/OpenSMTPD/issues/967) [#978](https://github.com/OpenSMTPD/OpenSMTPD/issues/978) [#977](https://github.com/OpenSMTPD/OpenSMTPD/issues/977) [#975](https://github.com/OpenSMTPD/OpenSMTPD/issues/975) # Release 6.6.0p1 (2019-10-26) ## Dependencies note: This release builds with LibreSSL > 3.0.2 or OpenSSL > 1.1.0. It's preferable to depend on LibreSSL as OpenSMTPD is written and tested with that dependency. In addition, the features parity is not respected, some features will not be available with OpenSSL, like ECDSA server-side certificates support in this release. OpenSSL library is considered as a best effort target TLS library and provided as a commodity, LibreSSL has become our target TLS library. ## Changes in this release (since 6.4.0): - various improvements to documentation and code - reverse dns session matching criteria added to smtpd.conf(5) - regex table lookup support added to smtpd.conf(5) - introduced support for ECDSA certificates with an ECDSA privsep engine - introduced builtin filters for basic filtering of incoming sessions - introduced option to deliver junk to a Junk folder in mail.maildir(8) - fixed the smtp(1) client so it uses correct default port for SMTPS - fixed an smtpd(8) crash on excessively large input - ensured mail rejected by an LMTP server stay queued ## Experimental features: - introduced a filters API to allow writing standalone filters for smtpd - introduced proxy-v2 support allowing smtpd to operate behind a proxy opensmtpd-7.7.0p0/Makefile.in0000644000175000001440000006354615010115300011520 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-openssh.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in INSTALL \ README.md ar-lib compile config.guess config.sub depcomp \ install-sh ltmain.sh missing ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHMOD = @CHMOD@ CHOWN = @CHOWN@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DB_LIB = @DB_LIB@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBBSD_CFLAGS = @LIBBSD_CFLAGS@ LIBBSD_LIBS = @LIBBSD_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANTYPE = @MANTYPE@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PRIVSEP_PATH = @PRIVSEP_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SMTPD_QUEUE_GROUP = @SMTPD_QUEUE_GROUP@ SMTPD_QUEUE_USER = @SMTPD_QUEUE_USER@ SMTPD_USER = @SMTPD_USER@ STRIP = @STRIP@ USE_PAM_SERVICE = @USE_PAM_SERVICE@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZCAT = @ZCAT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mansubdir = @mansubdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ piddir = @piddir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sockdir = @sockdir@ spooldir = @spooldir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mk contrib openbsd-compat EXTRA_DIST = CHANGES.md \ LICENSE \ bootstrap \ etc/README.md \ etc/aliases ACLOCAL_AMFLAGS = -I m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: opensmtpd-7.7.0p0/ltmain.sh0000444000175000001440000122322214764503772011314 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.5.4 package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. Assumes ARG has no leading or trailing path separator # characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 case $host in i[3456]86-*-mingw32*) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ;; *) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" ;; esac } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. # -q