opendnssec-1.4.9/0000755000175000017500000000000012650166152010673 500000000000000opendnssec-1.4.9/config.guess0000755000175000017500000012475312650165764013157 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-08-20' # 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: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -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-2015 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 trap 'exit 1' 1 2 15 # 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. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { 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) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; 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 ; set_cc_for_build= ;' # 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) >/dev/null 2>&1 ; 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/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; 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". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in 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. case "${UNAME_MACHINE_ARCH}" in arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $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. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) 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. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $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 [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; 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) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # 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:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $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; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $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 echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *: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 [ -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 echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 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 [ -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 [ "${HP_ARCH}" = "" ]; then eval $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 [ ${HP_ARCH} = "hppa2.0w" ] then eval $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 echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $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; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; 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*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 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/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` 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 echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; 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. echo i386-sequent-sysv4 exit ;; 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. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; 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 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; 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 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; 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 configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; 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*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$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 fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *: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 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /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 exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: opendnssec-1.4.9/NEWS0000644000175000017500000015324412650165732011326 00000000000000OpenDNSSEC 1.4.9 - 2016-01-21 Bugfixes: * Add TCP waiting queue. Fix signer getting 'stuck' when adding many zones at once. Thanks to Havard Eidnes to bringing this to our attention. * OPENDNSSEC-723: received SOA serial reported as on disk. * Fix potential locking issue on SOA serial. * Crash on shutdown. At all times join xfr and dns handler threads. * Make handling of notifies more consistent. Previous implementation would bounce between code paths. Known Issues: * When using SoftHSM2 compiled with OpenSSL, and libmysql with OpenSSL as database backend for OpenDNSSEC. "ods-ksmutil key list --verbose" crashes on exit. This is ultimately a bug in OpenSSL and not new for this particular release. Make sure you don't use this specific combination. OpenDNSSEC 1.4.8 - 2015-09-24 * Support for RFC5011 style KSK rollovers. KSK section in the KASP now accepts element. * Enforcer: New repository option allows to generate keys with CKA_EXTRACTABLE attribute set to TRUE so keys can be wrapped and extracted from HSM. Bugfixes: * SUPPORT-145: EOF handling an ARM architecture caused signer to hang. * Fixed signer hitting assertion on short reply XFR handler. * Include revoke bit in keytag calculation. * Increased stacksize on some systems (thanks Patrik Lundin!). * Stop ods-signerd on SIGINT. OpenDNSSEC 1.4.7 - 2014-12-04 Bugfixes: * SUPPORT-147: Zone updating via zone transfer can get stuck (HÃ¥vard Eidnes) * Crash on 'retransfer command when not using DNS adapters. OpenDNSSEC 1.4.6 - 2014-07-21 * Signer Engine: Print secondary server address when logging notify reply errors. * Build: Fixed various OpenBSD compatibility issues found by Patrik Lundin . * OPENDNSSEC-621: conf.xml: New options: for both enforcer and signer, and for the signer. * New tool: ods-getconf: to retrieve a configuration value from conf.xml given an expression. Bugfixes: * OPENDNSSEC-469: ods-ksmutil: 'zone add' command when zonelist.xml.backup can't be written zone is still added to database, solved it by checking the zonelist.xml.backup is writable before adding zones, and add error message when add zone failed. * OPENDNSSEC-617: Signer Engine: Fix DNS Input Adapter to not reject zone the first time due to RFC 1982 serial arethmetic. * OPENDNSSEC-619: memory leak when signer failed, solved it by add ldns_rr_free(signature) in libhsm.c * OPENDNSSEC-627: Signer Engine: Unable to update serial after restart when the backup files has been removed. * OPENDNSSEC-628: Signer Engine: Ingored notifies log level is changed from debug to info. * OPENDNSSEC-630: Signer Engine: Fix inbound zone transfer for root zone. * libhsm: Fixed a few other memory leaks. * simple-dnskey-mailer.sh: Fix syntax error. (by Patrik Lundin https://github.com/eest) OpenDNSSEC 1.4.5 - 2014-04-11 Bugfixes: * OPENDNSSEC-607: libhsm not using all mandatory attributes for GOST key generation. * OPENDNSSEC-609: ods-ksmutil: 'key list' command fails with error in 1.4.4 on MySQL. Reported by Mark Elkins OpenDNSSEC 1.4.4 - 2014-03-25 * SUPPORT-114: libhsm: Optimize storage in HSM by deleting the public key directly if SkipPublicKey is used [OPENDNSSEC-574]. * OPENDNSSEC-358: ods-ksmutil:Extend 'key list' command with options to filter on key type and state. This allows keys in the GENERATE and DEAD state to be output. * OPENDNSSEC-457: ods-ksmutil: Add a check on the 'zone add' input/output type parameter to allow only File or DNS. * OPENDNSSEC-549: Signer Engine: Put NSEC3 records on empty non-terminals derived from unsigned delegations (be compatible with servers that are incompatible with RFC 5155 errata 3441). * Make/build: Include README.md in dist tar-ball. Bugfixes: * SUPPORT-86: Fixed build on OS X [OPENDNSSEC-512]. * SUPPORT-97: Signer Engine: Fix after restart signer thinks zone has expired [OPENDNSSEC-526]. * SUPPORT-101: Signer Engine: Fix multiple zone transfer to single file bug [OPENDNSSEC-529]. * SUPPORT-102: Signer Engine: Fix statistics (count can be negative)/ * SUPPORT-108: Signer Engine: Don't replace tabs in RRs with whitespace [OPENDNSSEC-520]. * SUPPORT-116: ods-ksmutil: 'key import' date validation fails on certain dates [OPENDNSSEC-553]. * SUPPORT-128: ods-ksmutil. Man page had incorrect formatting [OPENDNSSEC-576]. * SUPPORT-127: ods-signer: Fix manpage sections. * OPENDNSSEC-481: libhsm: Fix an off-by-one length check error. * OPENDNSSEC-482: libhsm: Improved cleanup for C_FindObjects. * OPENDNSSEC-531: ods-ksmutil: Exported value of in 'policy export' output could be wrong on MySQL. * OPENDNSSEC-537: libhsm: Possible memory corruption in hsm_get_slot_id. * OPENDNSSEC-544: Signer Engine: Fix assertion error that happens on an IXFR request with EDNS. * OPENDNSSEC-546: enforcer & ods-ksmutil: Improve logging on key creation and alloctaion. * OPENDNSSEC-560: Signer Engine: Don't crash when unsigned zone has no SOA. * Signer Engine: Fix a race condition when stopping daemon. OpenDNSSEC 1.4.3 - 2013-12-04 * SUPPORT-72: Improve logging when failed to increment serial in case of key rollover and serial value "keep" [OPENDNSSEC-461]. * OPENDNSSEC-106: Add 'ods-enforcerd -p ' option. This prompts the enforcer to run once and only process the specified policy and associated zones. * OPENDNSSEC-330: NSEC3PARAM TTL can now be optionally configured in kasp.xml. Default value remains PT0S. * OPENDNSSEC-390: ods-ksmutil: Add an option to the 'ods-ksmutil key ds-seen' command so the user can choose not to notify the enforcer. * OPENDNSSEC-430: ods-ksmutil: Improve 'zone add' - Zone add command could warn if a specified zone file or adapter file does not exits. * OPENDNSSEC-431: ods-ksmutil: Improve 'zone add' - Support default and values for DNS adapters. * OPENDNSSEC-454: ods-ksmutil: Add option for 'ods-ksmutil key import' to check if there is a matching key in the repository before import. Bugfixes: * OPENDNSSEC-435: Signer Engine: Fix a serious memory leak in signature cleanup. * OPENDNSSEC-463: Signer Engine: Duration PT0S is now printed correctly. * OPENDNSSEC-466: Signer Engine: Created bad TSIG signature when falling back to AXFR. * OPENDNSSEC-467: Signer Engine: After ods-signer clear, signer should not use inbound serial. OpenDNSSEC 1.4.2 - 2013-09-11 * OPENDNSSEC-428: ods-ksmutil: Add option for 'ods-ksmutil key generate' to take number of zones as a parameter Bugfixes: * SUPPORT-66: Signer Engine: Fix file descriptor leak in case of TCP write error [OPENDNSSEC-427]. * SUPPORT-71: Signer Engine: Fix double free crash in case of HSM connection error during signing [OPENDNSSEC-444]. * OPENDNSSEC-401: 'ods-signer sign --serial ' command produces seg fault when run directly on command line (i.e. not via interactive mode) * OPENDNSSEC-440: 'ods-ksmutil key generate' and the enforcer can create too many keys if there are keys already available and the KSK and ZSK use same algorithm and length * OPENDNSSEC-424: Signer Engine: Respond to SOA queries from file instead of memory. Makes response non-blocking. * OPENDNSSEC-425 Change "hsmutil list" output so that the table header goes to stdout not stderr * OPENDNSSEC-438: 'ods-ksmutil key generate' and the enforcer can create too many keys for policies when KSK and ZSK use same algorithm and length * OPENDNSSEC-443: ods-ksmutil: Clean up of hsm connection handling * Signer Engine: Improved Inbound XFR checking. * Signer Engine: Fix double free corruption in case of adding zone with DNS Outbound Adapters and NotifyCommand enabled. OpenDNSSEC 1.4.1 - 2013-06-27 * SUPPORT-58: Extend ods-signer sign with --serial so that the user can specify the SOA serial to use in the signed zone [OPENDNSSEC-401]. * OPENDNSSEC-91: Make the keytype flag required when rolling keys Bugfixes: * SUPPORT-60: Fix datecounter in case inbound serial is higher than outbound serial [OPENDNSSEC-420]. * OPENDNSSEC-247: Signer Engine: TTL on NSEC3 was not updated on SOA Minimum change. * OPENDNSSEC-421: Signer Engine: Fix assertion error in case NSEC3 hash algorithm in signconf is not SHA1. * OPENDNSSEC-421: ods-kaspcheck: Check whether NSEC3 hash algorithm in kasp is valid. * Bugfix: The time when inbound serial is acquired was reset invalidly, could cause OpenDNSSEC wanting AXFR responses while requesting IXFR (thanks Stuart Lau). * Bugfix: Fix malform in Outbound IXFR/TCP subsequent packet (thanks Stuart Lau). * OPENDNSSEC-398: The ods-ksmutil key rollover command does not work correctly when rolling all keys using the --policy option OpenDNSSEC 1.4.0 - 2013-04-22 * Production release of 1.4 * Versioning scheme and release support policies updated * Summary of changes in 1.4 can be found on the wiki: http://wiki.opendnssec.org/display/DOCS OpenDNSSEC 1.4.0rc3 - 2013-03-15 * Further testing of OPENDNSSEC-387 completed, release returned to rc status. OpenDNSSEC 1.4.0b3 - 2013-02-20 Note: This release is marked as a beta release (rather than rc3) due to OPENDNSSEC-387, which is a significant functional change compared to rc2. * OPENDNSSEC-387: Rollback of multi-threaded enforcer. Due to key allocation issues the usefulness of the threaded enforcer is outweighed by the code complications. The option still remains in conf.xml for compatibility with existing use; but it will now be silently ignored. Bugfixes: * OPENDNSSEC-388: Signer Engine: Internal serial should take into account the inbound serial. * SUPPORT-50/51: Signer Engine: Inbound DNS Adapter incorrectly updates NSEC3PARAM and DNSKEY RRset [OPENDNSSEC-389] * OPENDNSSEC-389: Input DNS Adapter incorrectly updating NSEC3PARAM and DNSKEY RRsets OpenDNSSEC 1.4.0rc2 - 2013-01-25 * OPENDNSSEC-350: Signer Engine: Better log message when IXFR is not ready for reading. * OPENDNSSEC-367: ods-ksmutil: Require user confirmation if the algorithm for a key is changed in a policy (as this rollover is not handled cleanly) Bugfixes: * SUPPORT-44: Signer Engine: Drop privileges after binding to socket [OPENDNSSEC-364]. * Signer Engine: XFR not ready should not be a fatal status for task read (thanks Ville Mattila). * OPENDNSSEC-365: Enforcer: Nasty bug where KSKs could get prematurely retired. OpenDNSSEC 1.4.0rc1 - 2013-01-10 * OPENDNSSEC-359: Remove eppclient OpenDNSSEC 1.4.0b2 - 2012-12-17 * OPENDNSSEC-292: Provide scripts to convert database between different supported formats * OPENDNSSEC-299: ods-ksmutil: ods-ksmutil now includes policy import * OPENDNSSEC-300: ods-ksmutil: policy purge documented with a warning * OPENDNSSEC-315: "ods-hsmutil logout" will delete any credentials in the shared memory. * OPENDNSSEC-330: Signer Engine: NSEC3PARAM TTL should be set to zero. * OPENDNSSEC-338: ods-ksmutil: fix zone delete on MySQL (broken by SUPPORT-27) * OPENDNSSEC-345: ods-ksmutil: use ods-control to HUP the enforcerd process * ods-ksmutil: Deprecate the one-step key backup command Bugfixes: * SUPPORT-40: Signer Engine: Keep occluded data in signed zone files/transfers. * OPENDNSSEC-349: Enforcer: Fix some memory leaks in the enforcer found by valgrind. * OPENDNSSEC-353: Signer Engine: Add/remove NSEC3s for empty non-terminals between apex and delegation when DS is added/removed. * Signer Engine: Fixed locking and notification on the drudge work queue, signals could be missed so that drudgers would stall when there was work to be done. * libhsm: Fixed PIN handling on OpenBSD. * Enforcer: If enabled enforcer workers and configured number of workers is 1, make sure that enforcer runs the signer update command after signer configuration change. * Signer Engine: Don't add double RRSIGs generated by the same key for the DNSKEY RRset. * Signer Engine: Rollback incompleted zone transfers on disk (could happen if a connection was reset during transfer). * Multi-threaded enforcer: various minor fixes including deadlock problems. OpenDNSSEC 1.4.0b1 - 2012-09-06 * OPENDNSSEC-130: libhsm: The PIN is now optional in conf.xml. The PIN can be entered using "ods-hsmutil login" and is stored in shared memory. The daemons will not start until this has been done by the user. * OPENDNSSEC-297: Enforcer: Multi-threaded option available for the enforcer to improve performance (MySQL only). * OPENDNSSEC-320: Signer Engine: The , , and elements are now optional, but if provided they require one or more or elements. Bugfixes: * OPENDNSSEC-255: Signer Engine: OpenDNSSEC 1.4.0a1 writes out mangled RRSIG record. * OPENDNSSEC-261: Signer Engine: Ldns fails to parse RR that seems syntactically correct. * OPENDNSSEC-269: Signer Engine: Crash when multiple threads access ixfr struct. * OPENDNSSEC-281: Commandhandler sometimes unresponsive. * OPENDNSSEC-318: Signer Engine: Don't stop dns and xfr handlers if these threads have not yet been started. * OPENDNSSEC-319: Signer Engine: Fix TSIG segfault on signer shutdown. * OPENDNSSEC-325: Signer Engine: Don't include RRSIG records when DO bit is not set. * OPENDNSSEC-326: Signer Engine: Stop serving a zone that could not be transferred from master and has been expired. OpenDNSSEC 1.4.0a3 - 2012-08-08 * OPENDNSSEC-258: Optionally include cka_id in output to DelegationSignerSubmitCommand. Bugfixes: * SUPPORT-27: ods-ksmutil: simplify zone delete so that it only marks keys as dead (rather than actually removing them). Leave the key removal to purge jobs. * SUPPORT-29: Signer Engine: Fix ods-signer clear command exits prematurely [OPENDNSSEC-289]. * SUPPORT-30: Signer Engine: RRSIGs are left in the signed zone when authoritative RRsets become glue [OPENDNSSEC-282]. * OPENDNSSEC-278: ods-ksmutil processes waiting forever to get DB lock * OPENDNSSEC-290: Signer Engine: Fix false conflict when changing CNAME into other RRtype. * OPENDNSSEC-298: Enforcer: Only unlink existing pidfile on exit if we wrote it. * OPENDNSSEC-304: Signer Engine: Check pidfile on startup, if pidfile exists and corresponding process is running, then complain and exit. * OPENDNSSEC-306: Can't delete zone until Enforcer made signconf. * Fix assertion error when printing signed zone with empty non-terminals and NSEC. * Make setting QUERY ID in XFR requests more random. OpenDNSSEC 1.4.0a2 - 2012-05-24 * OPENDNSSEC-226: Change in conf.xml: Configure the DNS listener IP address with /Listener/Interface/Address instead of /Listener/Interface/IPv{4,6}. * OPENDNSSEC-228: Signer Engine: Make 'ods-signer update' reload signconfs even if zonelist has not changed. * OPENDNSSEC-231: Signer Engine: Allow for Classless IN-ADDR.ARPA names (RFC 2317). * OPENDNSSEC-249: ods-ksmutil: If key export finds nothing to do then say so rather than display nothing which might be misinterpreted. * OPENDNSSEC-262: Signer Engine: Make DNS Adapter ACL optional. * OPENDNSSEC-263: Signer Engine: Added EDNS0 support, so that zone transfers and SOA requests with OPT RRs are possible. * Enforcer: Add indexes for foreign keys. (sqlite only, MySQL already has them.) Bugfixes: * OPENDNSSEC-247: Signer Engine: TTL on NSEC(3) was not updated on SOA Minimum change. * OPENDNSSEC-252: Signer Engine: Mark xfrhandler started, so that we don't try to join a non-existing thread on exit. * OPENDNSSEC-259: Signer Engine: Fix assertion failure for outbound AXFR for large zones. * OPENDNSSEC-264: Signer Engine: Fix assertion error on reading IXFR from backup. * OPENDNSSEC-265: Signer Engine: Fix crash in corner cases when signing zone with NSEC3 and Opt-out. * OPENDNSSEC-267: Signer Engine: Sign NOTIFY OK response with TSIG, if present in the query and ACL. OpenDNSSEC 1.4.0a1 - 2012-03-15 * Auditor: The Auditor has been removed. * Enforcer: Key label logging upon deletion (#192 Sebastian Castro) * Enforcer: Stop multiple instances of the Enforcer running by checking for the pidfile at startup. If you want to run multiple instances then a different pidfile will need to be specified with the -P flag. * Enforcer/ods-ksmutil: Use TTLs from KASP when generating DNSKEY and DS records for output. * Enforcer/ods-ksmutil: Give a more descriptive error message if the tag in conf.xml does not match the database-backend set at compile time. * ods-ksmutil: Add warnings on "key export --ds" if no active or ready keys were seen, or if both were seen (so a key rollover is happening). * ods-ksmutil: Prevent MySQL username or password being interpreted by the shell when running "ods-ksmutil setup" * ods-ksmutil: "zone delete" renames the signconf file; so that if the zone is put back the signer will not pick up the old file. * ods-ksmutil: "key delete" added. It allows keys that are not currently in use to be deleted from the database and HSM. * OPENDNSSEC-1: Enforcer: Check DelegationSignerSubmitCommand exists and can be executed by ods-enforcerd. * OPENDNSSEC-10: ods-ksmutil: Include key size and algorithm in "key list" with -v flag. * OPENDNSSEC-28: ods-ksmutil: "key list" shows next state with -v flag. * OPENDNSSEC-35: ods-ksmutil: "rollover list -v" now includes more information on the KSKs waiting for the ds-seen command. * OPENDNSSEC-83: ods-ksmutil: "key generate" now displays how many keys will be generated and presents the user with the opportunity to stop the operation. * OPENDNSSEC-124: ods-ksmutil: Suppress database connection information when no -v flag is given. * Signer Engine: Input and Output DNS Adapters. * Signer Engine: Zonefetcher has been removed. Known issues: * Signer Engine: The backup files do not work correctly in this alpha release. Bugfixes: * Bugfix #246: Less confusing text for XML validation in ods-kaspcheck. * ods-ksmutil: "update kasp" now reflects changes in policy descriptions. * ods-ksmutil: Policy descriptions now have special characters quoted. * ods-ksmutil: Fix typo in policy export with NSEC3. OpenDNSSEC 1.3.13 - 2013-02-20 Bugfixes: * OPENDNSSEC-388: Signer Engine: Internal serial should take into account the inbound serial. * OPENDNSSEC-242: Signer Engine: Could get stuck on load signconf while signconf was not changed. * Signer Engine: Fixed locking and notification on the drudge work queue, signals could be missed so that drudgers would stall when there was work to be done. OpenDNSSEC 1.3.12 - 2012-12-03 Bugfixes: * SUPPORT-42: ./configure fails on FreeBSD (or if ldns is not installed in a directory in the default search path of the complier). * OpenDNSSEC does not compile against ldns 1.6.16 on platforms that rely on the OpenDNSSEC implementation of strlcpy/cat OpenDNSSEC 1.3.11 - 2012-11-13 * OPENDNSSEC-330: NSEC3PARAM TTL should be set to zero. Bugfixes: * OPENDNSSEC-306: Cant delete zone until Enforcer made signerconf. * OPENDNSSEC-281: Commandhandler sometimes unresponsive. * OPENDNSSEC-299: ods-ksmutil now includes policy import * OPENDNSSEC-300: ods-ksmutil policy purge documented with a warning * OPENDNSSEC-338: ods-ksmutil: fix zone delete on MySQL (broken by SUPPORT-27) * OPENDNSSEC-342: Auditor comparisons made case-insensitive * OPENDNSSEC-345: ods-ksmutil: use ods-control to HUP the enforcerd process OpenDNSSEC 1.3.10 - 2012-08-10 Bugfixes: * SUPPORT-30: RRSIGs are left in the signed zone when authoritative RRsets become glue [OPENDNSSEC-282]. * OPENDNSSEC-261: Ldns fails to parse RR that seems syntactically correct. Was due to memory allocation issues. Provided better log message. * OPENDNSSEC-285: Signer segfault for 6 or more -v options * OPENDNSSEC-298: Only unlink existing pidfile on exit if we wrote it. * OPENDNSSEC-303: Return if open/parse of zonelist.xml fails in ksmutil.c update_zones() and cmd_listzone(). * OPENDNSSEC-304: Signer Engine: Check pidfile on startup, if pidfile exists and corresponding process is running, then complain and exit. * Signer seems to hang on a ods-signer command. Shutdown client explicitly with shutdown(). * opendnssec.spec file removed OpenDNSSEC 1.3.9 - 2012-06-15 * OPENDNSSEC-277: Enforcer: Performance optimisation of database access. Bugfixes: * SUPPORT-27: ods-ksmutil: simplify zone delete so that it only marks keys as dead (rather than actually removing them). Leave the key removal to purge jobs. OpenDNSSEC 1.3.8 - 2012-05-09 * OPENDNSSEC-228: Signer Engine: Make 'ods-signer update' reload signconfs even if zonelist has not changed. * OPENDNSSEC-231: Signer Engine: Allow for Classless IN-ADDR.ARPA names (RFC 2317). * OPENDNSSEC-234: Enforcer: Add indexes for foreign keys in kasp DB. (sqlite only, MySQL already has them.) * OPENDNSSEC-246: Signer Engine: Warn if is in signer configuration, but ods-auditor is not installed * OPENDNSSEC-249: Enforcer: ods-ksmutil: If key export finds nothing to do then say so rather than display nothing which might be misinterpreted. Bugfixes: * OPENDNSSEC-247: Signer Engine: TTL on NSEC(3) was not updated on SOA Minimum change. * OPENDNSSEC-253: Enforcer: Fix "ods-ksmutil zone delete --all" OpenDNSSEC 1.3.7 - 2012-03-13 * OPENDNSSEC-215: Signer Engine: Always recover serial from backup, even if it is corrupted, preventing unnecessary serial decrementals. * OPENDNSSEC-217: Enforcer: Tries to detect pidfile staleness, so that the daemon will start after a power failure. Bugfixes: * ods-hsmutil: Fixed a small memory leak when printing a DNSKEY. * OPENDNSSEC-216: Signer Engine: Fix duplicate NSEC3PARAM bug. * OPENDNSSEC-218: Signer Engine: Prevent endless loop in case the locators in the signer backup files and the HSM are out of sync. * OPENDNSSEC-225: Fix problem with pid found when not existing. * SUPPORT-21: HSM SCA 6000 in combination with OpenCryptoki can return RSA key material with leading zeroes. DNSSEC does not allow leading zeroes in key data. You are affected by this bug if your DNSKEY RDATA e.g. begins with "BAABA". Normal keys begin with e.g. "AwEAA". OpenDNSSEC will now sanitize incoming data before adding it to the DNSKEY. Do not upgrade to this version if you are affected by the bug. You first need to go unsigned, then do the upgrade, and finally sign your zone again. SoftHSM and other HSM:s will not produce data with leading zeroes and the bug will thus not affect you. OpenDNSSEC 1.3.6 - 2012-02-17 * OPENDNSSEC-33: Signer Engine: Check HSM connection before use, attempt to reconnect if it is not valid. * OPENDNSSEC-178: Signer Engine: Instead of waiting an arbitrary amount of time, let worker wait with pushing sign operations until the queue is non-full. * Signer Engine: Adjust some log messages. Bugfixes: * ods-control: Wrong exit status if Enforcer was already running. * OPENDNSSEC-56: ods-ksmutil had the wrong option for config file in the help usage text. * OPENDNSSEC-207: Signer Engine: Fix communication from a process not attached to a shell. * OPENDNSSEC-209: Signer Engine: Make output file adapter atomic by writing signed file to an intermediate file first. OpenDNSSEC 1.3.5 - 2012-01-23 * Auditor: Include the zone name in the log messages. * ldns 1.6.12 is required for bugfixes. * ods-ksmutil: Suppress database connection information when no -v flag is given. * ods-enforcerd: Stop multiple instances of the enforcer running by checking for the pidfile at startup. If you want to run multiple instances then a different pidfile will need to be specified with the -P flag. * ods-ksmutil: "zone delete" renames the signconf file; so that if the zone is put back the signer will not pick up the old file. * Signer Engine: Verbosity can now be set via conf.xml, default is 3. Bugfixes: * Bugfix OPENDNSSEC-174: Configure the location for conf.xml with --config or -c when starting the signer. * Bugfix OPENDNSSEC-192: Signer crashed on deleting NSEC3 for a domain that becomes opt-out. * Bugfix OPENDNSSEC-193: Auditor crashed with certain empty non-terminals. * Signer Engine: A file descriptor for sockets with value zero is allowed. * Signer Engine: Only log messages about a full signing queue in debug mode. * Signer Engine: Fix time issues, make sure that the internal serial does not wander off after a failed audit. * Signer Engine: Upgrade ldns to avoid future problems on 32-bit platforms with extra long signature expiration dates. More information in separate announcement. OpenDNSSEC 1.3.4 - 2011-12-09 Bugfixes: * Signer: Use debug instead of warning for drudgers queue being full, also sleep 10ms if it is full to not hog CPU. This increased signing on single core machines by a factor of 2. OpenDNSSEC 1.3.3 - 2011-11-17 Bugfixes: * Auditor: Handle ruby 1.9 differences in ods-kaspcheck. * Auditor: Require dnsruby 1.53 for bugfixes. * Bugfix #262: Drudgers seem to be in a waiting state, but the RRset FIFO queue is full. Do an additional broadcast. * Enforcer: Check HSM connection when waking up from sleep, attempt to reconnect if it is not valid. (r5511 in trunk, ported into the branch due to issues seen when CKR_DEVICE_ERROR returned by HSM.) * libhsm: Added hsm_check_context() to check if the associated sessions are still alive. (Required for the above.) * ods-ksmutil: key import was not setting the retire time. * Signer Engine: Fix a threading issue, that could leave a zone without a task. * Signer Engine: Update the signed zone file if only the $TTL or explicit TTL has been changed. * Signer Engine: Remove the NSEC3PARAM RR when doing NSEC3 to NSEC rollover. * Signer Engine: Deal with carriage returns (dos format) in zone file. * Signer Engine: is PT0S means that refresh equals signtime. * Signer Engine: Defense in depth in signer for duplicate keys. * Signer Engine: Make sure that all required zonelist elements exist, otherwise error. * Signer Engine: Warn the user if the serial is b0rk, and you can not use the serial from the signconf. * Signer Engine: Log Auditor exit code. * Fix a similar bug like #257: Error in ods-signerd, where a corrupted backup file results in an invalid pointer free(). OpenDNSSEC 1.3.2 - 2011-09-13 Bugfixes: * Bugfix #257: Error in ods-signerd, where a corrupted backup file results in an invalid pointer free(). * Signer Engine: Mark that a zone has a valid signer configuration, after recovering the zone from the backup files. OpenDNSSEC 1.3.1 - 2011-09-07 Bugfixes: * Auditor: Fix 'ZSK in use too long' message to handle new signer behaviour. * Bugfix #255: RHEL6 patch to contrib/opendnssec.spec. (Rick van Rein) * Bugfix #256: Make sure argument in "ods-control signer" is not stripped off. * Bugfix #259: ods-ksmutil: Prevent MySQL username or password being interpreted by the shell when running "ods-ksmutil setup". * Bugfix #260: "ods-ksmutil zone list" now handles empty zonelists. * Enforcer: Unsigned comparison resulting in wrong error message. * ods-ksmutil: fixed issue where first ds-seen command run on a zone would work, but return an error code and not send a HUP to the enforcerd. * Signer Engine: A threading issue occasionally puts the default validity on NSEC(3) RRs and the denial validity on other RRs. * Signer Engine: An update command could interrupt the signing process and the zone would get missing signatures. * Signer Engine: Fix an issue where some systems could not copy the zone file. * Zonefetcher: Check inbound serial in transferred file, to prevent redundant zone transfers. OpenDNSSEC 1.3.0 - 2011-07-12 * Include simple-dnskey-mailer-plugin in dist. * Enforcer: Change message about KSK retirement to make it less confusing. Bugfixes: * ods-control: If the Enforcer did not close down, you entered an infinite loop. * Signer Engine: Fix log message typos. * Signer Engine: Fix crash where ods-signer update * Signer Engine: Also replace DNSKEYs if has changed in policy. * Zonefetcher: Sometimes invalid 'Address already in use' occurred. * Bugfix #247: Fixes bug introduced by bugfix #242. OpenDNSSEC 1.3.0rc3 - 2011-06-12 * Do not distribute trang. Bugfixes: * Fix test for java executable and others. * Auditor: Fix delegation checks. * Bugfix #242: Race condition when receiving multiple NOTIFIES for a zone. * ods-kaspcheck: Do not expect resalt in NSEC policy. * Signer Engine: Ifdef a header file. * Signer Engine: The default working directory was not specified. * Signer Engine: Handle stdout console output throttling that would truncate daemon output intermittently. OpenDNSSEC 1.3.0.rc2 - 2011-05-18 * Match the names of the signer pidfile and enforcer pidfile. * Include check for resign < resalt in ods-kaspcheck. Bugfixes: * Bugfix #231: Fix MySQL version check. * ods-ksmutil: Update now sends a HUP to the enforcerd. * Signer Engine: Fix assertion failure if zone was just added. * Signer Engine: Don't hsm_close() on setup error. * Signer Engine: Fix race condition bug when doing a single run. * Signer Engine: In case of failure, also mark zone processed (single run). * Signer Engine: Don't leak backup file descriptor. * signconf.rnc now allows NSEC3 Iterations of 0 OpenDNSSEC 1.3.0rc1 - 2011-04-21 * is enabled for SoftHSM in the default configuration. It improves the performance by only using the private key objects. * Document the tag in conf.xml. * Include check for resign < resalt in ods-kaspcheck. Bugfixes: * Bugfix #221: Segmentation Fault on schedule.c:232 * Enforcer: 'make check' now works. * Enforcer: Fixed some memory leaks in the tests. * Signer Engine: Coverity report fixes some leaks and thread issues. * Signer Engine: Now logs to the correct facility again. OpenDNSSEC 1.3.0b1 - 2011-03-23 * Support for signing the root. Use the zone name "." * Enforcer: Stop import of policy if it is not consistent. * ods-signer: The queue command will now also show what tasks the workers are working on. * Signer Engine: Just warn if occluded zone data was found, don't stop signing process. * Signer Engine: Simpler serial maintenance, reduces the number of conflicts. Less chance to hit a 'cannot update: serial too small' error message. * Signer Engine: Simpler NSEC(3) maintenance. * Signer Engine: Temperate the number of backup files. * Signer Engine: Set number of in conf.xml to get peak performance from HSMs that can handle multiple threads. Bugfixes: * Bugreport #139: ods-auditor fails on root zone. * Bugreport #198: Zone updates ignored? * Replace tab with white-space when writing to syslog. * Signer Engine: Do not block update command while signing. OpenDNSSEC 1.2.1 - 2011-03-18 * ldns 1.6.9 is required for bugfixes. * dnsruby-1.52 required for bugfixes. Bugfixes: * Auditor: 'make check' now works when srcdir != builddir. * Auditor: Include the 'make check' files in the tarball. * Enforcer: Fix the migration script for SQLite. * Enforcer: Increase size of keypairs(id) field in MySQL to allow more than 32767 keys; see MIGRATION for details. * Enforcer: Minor change to NOT_READY_KEY error message. * libhsm: Increase the maximum number of attached HSM:s from 10 to 100. * ods-ksmutil: Send trivial MySQL messages to stdout when exporting zonelist etc. Otherwise the resulting XML needs to be edited by hand. * ods-control: Fix for Bourne shell. * Signer Engine: Prevent race condition when setting up the workers and the command handler. * Signer Engine: Check if the signature exists before recycling it. * Signer Engine: Quit when there are errors in the configuration. * Signer Engine: Enable core dump on failure. * Signer Engine: Explicitly close down log msg with null. * Signer Engine: Backup state after writing output. * Signer Engine: Allow update of serial if internal structure is not initialized. * Signer Engine: NSEC chain could become broken if the predecessor domain of a deleted domain was a glue domain. OpenDNSSEC 1.2.0 - 2011-01-13 Bugfixes: * Enforcer: Fixed a number of build warnings. OpenDNSSEC 1.2.0rc3 - 2010-12-27 * Moved migration instructions to the file MIGRATION Bugfixes: * Bugreport #199: The previous DB schema change made the zone removal broken. * Enforcer: When retiring old KSK, use TTL(ds) and not TTL(ksk). * Enforcer: Minimize the set of DS RRs sent to DelegationSignerSubmitCommand. * Enforcer: Replace tab with a space character in the DNSKEY printed to syslog. * Enforcer: Fixed pontential format string bug. * ods-ksmutil: Log to syslog when ds-seen changes a key to active/standby. * Signer Engine: Don't be smart with RRSIG TTLs, the hsm will set them for you. * Signer Engine: Set notify command for zone when receiving ods-signer update. * Signer Engine: Update TTL of NSEC(3) records if SOA Minimum has changed in KASP. * Signer Engine: Now logs to the correct facility. * Signer Engine: Also remove NSEC records when detecting changes in signconf * Signer Engine: Dropped privileges before starting Zonefetcher. OpenDNSSEC 1.2.0rc2 - 2010-11-24 Bugfixes: * Signer Engine: Use the correct TTL for RRs after the $INCLUDE directive. * Signer Engine: Also create new signature if TTL of RR has changed. * Signer Engine: Drop old NSEC/NSEC3 records. * ods-ksmutil: Fixed some memory leaks. OpenDNSSEC 1.2.0rc1 - 2010-11-17 * New commandline option for the signer: ods-signer running. * Allow connection to different MySQL ports in the Enforcer. * Tone down and explain warning when converting M or Y to seconds * ldns 1.6.7 is required for bugfixes * dnsruby 1.51 is required for bugfixes Bugfixes: * Bugreport #187: ods-control signer start will return non-zero if start up failed (uses ods-signer running). * Narrow glue at the zone cut is allowed, do not consider it as occluded. * Move zone fetcher output to correct input adapter file. * Enforcer shared keys on zones with ShareKeys disabled. * Make names of key states consistent. * Signer Engine file descriptor leak fix on engine.sock. * Set explicit "unlimited" repository capacity to prevent random integer being read. Requires "ods-ksmutil update conf" to be run if using an existing database. * Fix issue with key generation creating too many keys Ticket #194. * Bugreport #189: Auditor did not handle white-space-seperated substrings for base64 text * Bugreport #190: Auditor (and signer) does not handle case correctly * Signer now silence stdout-output from the notify command OpenDNSSEC 1.2.0b1 - 2010-10-18 * A new signer engine, written in c. Zones are maintained in memory, instead of in files on disk. * Signer Engine: Check if the signature exists before recycling it. * Removed the python and python-4suite-xml dependencies. * Remove separate autoconf for libhsm/conf/enforcer. * Add option to disable building the signer. * Signer logs statistics just after outputting a new signed zone. * libhsm will skip processing (and not create) any public keys if the per repository option is set. * Keysharing improved - keys can now exist in different states on each zone that the key is in use for. * Backup prepare/commit/rollback added for 2-step backups without taking the enforcer offline. * Standby keys are now optional (default to 0) and should be considered experimental. Bugfixes: * Fix semantics of refresh value in Signer Engine. * Auditor handles chains of empty nonterminals correctly. * Recalculate salt immediately if the saltlength is changed. * libhsm connected to slot 0 if the token label was not found. An error is now returned instead of connecting to the slot. * Bugreport #102: Removed the obsoleted python-4suite-xml dependency. * Fixed Known Issue: KSK rollover requires manual timing. * Fixed Known Issue: Key rollover and reuse of signatures. * Fixed Known Issue: Issue with sharing keys and adding zones. * Fixed Known Issue: Quicksorter does not allow certain owner names (Quicksorter is removed, signer now reads and sorts the zone). OpenDNSSEC 1.1.3 - 2010-09-10 Bugfixes: * Bugreport #183: Partial zone could get signed if zone transfer failed when using zone_fetcher OpenDNSSEC 1.1.2 - 2010-08-24 * Dnsruby 1.49 now required (for correct zone parsing) * ldns 1.6.6 is required to fix the zone fetcher bug Bugfixes: * ods-control stop did not stopped zone fetcher (bug was introduced in 1.1.0) * Auditor correctly handles chains of empty nonterminals * Zone fetcher can block zone transfers if AXFR once failed. This is a bug in ldns versions 1.6.5 and lower. See KNOWN_ISSUES for more information. * Bugreport #165: Ensure Output SOA serial is always bigger than Input SOA serial. * Bugreport #166: Correct exit value from signer. * Bugreport #167: Zone fetcher now also picks up changes when zonelist is reloaded (thanks Rick van Rein) * Bugreport #168: ods-control with tightened control for the Enforcer * Bugreport #169: Do not include config.h in the distribution * Bugreport #170: Typo in a man page (ods-signer) * Bugreport #172: Correction of some macros in a man page (ods-timing) * Bugreport #173: A man page used a macro that does not exist (ods-ksmutil) OpenDNSSEC 1.1.1 - 2010-07-08 Bugfixes: * Bugreport #127: Large SOA serial numbers were not handled properly by signer * Bugreport #133: Better handling of SOA serial when setting is 'keep' * Bugreport #136: quicksorter could not handle standard bind format SOA rdata * The Auditor could not handle the new way of rolling KSKs * One log message in the Enforcer referred to an old command * The Enforcer forgot to publish certain keys during transition between states OpenDNSSEC 1.1.0 - 2010-05-26 OpenDNSSEC 1.1.0rc3 - 2010-05-15 Bugfixes: * Could not compile quicksorter on FreeBSD. * Bugreport #131: test suite fails in 1.1.0rc2 OpenDNSSEC 1.1.0rc2 - 2010-05-04 Bugfixes: * Fix semantics of refresh value in Signer Engine. OpenDNSSEC 1.1.0rc1 - 2010-04-21 * Partial Auditor added * Dnsruby-1.46 required * Improved error messages when the system runs out of keys * Optimise communication of signconfs for multiple zones sharing keys. Group zones in zonelist.xml by policy to get this benefit. * Bugreport #101: Signer Engine now maintains its own pidfile. * Jitter redefined: now in the range of [-jitter, ..., +jitter] * Optimized sorter: quicksorter (sorter becomes obsolete). * Optimized zone_reader, includes nseccing/nsec3ing (nseccer and nsec3er become obsolete). * Enable database selection using --with-database-backend={sqlite3|mysql} * Enable the EPP-client using --enable-eppclient For sending DS RR to the parent zone (experimental) * Turn NSEC3 OptOut off by default * Install kasp2html XML stylesheet * Add simple kasp2html conversion script * DNSKEY records communicated to an external script if configured * The command 'ods-signer restart' is removed. * Signer Engine now also reuses signatures after a change in NSEC(3) configuration or rolling keys. * Quicksorter defaults to class IN. Bugfixes: * Enforcer: Make sure that we read the correct config file when dropping privs * Enforcer: Prevent int overflow when generating a large number of keys * Enforcer: Fixed a confusion between standby ZSKs and KSKs * Fixed various enable-options in the configure scripts * Respect $DESTDIR for config files * Looked for the database init script in $prefix/share/opendnssec and not datadir. * More proper memory cleanup in parsing zonefetch.xml * Zonefetch.xml now accepts hmac-md5, which is an alias for hmac-md5.sig-alg.reg.int. * Zone fetcher logged wrong zone when NOTIFY received. * Zone fetcher sometimes did not log when signalling signer engine failed. * Fix issue of importing keys into kasp leaving random strings in the retire date. * Fix KSK rollover logic to be proper DoubleDNSKEY * Fix issue with reading repositories from conf.xml * Fix issue with reading policies from kasp.xml * Canonicalize RRs before nseccing zone. * Bugreport #113: zone fetcher started before dropping privileges, so that it can bind to socket. * Signer Engine defaults to working directory if missing. * libhsm: fixed incorrect label length for wildcards (leftmost wildcard label was included in count). OpenDNSSEC 1.0.0 - 2010-02-09 Bugfixes: * Fixed broken path in ods-control OpenDNSSEC 1.0.0rc4 - 2010-02-02 * Added manual pages for ods-auditor(1), ods-control(8), ods-enforcerd(8), ods-signerd(8), ods-signer(8), ods-hsmpseed(1), ods-hsmutil(1), ods-kaspcheck(1), ods-ksmutil(1), ods-timing(5), opendnssec(7). * Move ods-control & ods-signer from PREFIX/bin to PREFIX/sbin. * Dnsruby-1.43 is now required Bugfixes: * Bugreport #89: Signer Engine: bug in logging.c. * Auditor: Had some problems with escaped characters in domain names OpenDNSSEC 1.0.0rc3 - 2010-01-25 * A code review was performed by members of the project group. No serious problem was found. The code review resulted in some polishing of the code. * Dnsruby-1.42 is now required, it fixes issues with TXT and NAPTR record parsing. * ldns 1.6.4 is now required. * Known issues has been moved from NEWS to KNOWN_ISSUES. Bugfixes: * ods-ksmutil: The ksk-roll command did not handle its options correctly * Auditor: Configured zone SOA TTL now used to track pre-published keys, rather than the unsigned zone SOA TTL. * Enforcer: There was a flaw in the implementation of the timing code (it follows an earlier version of the draft and at one point does not add on the safety margin). * Enforcer: MySQL memory leaks fixed. * Signer Engine: When changing policy or rollover a key, the old signed zone was not found, so always resulting in a fresh resign. * Signer Engine: RRsets with varying TTLs on the records where considered different RRsets, the signer engine now eqaulizes those TTLs. OpenDNSSEC 1.0.0rc2 - 2009-12-16 Bugfixes: * Signer Engine: Signer processes could remain open, if they were not close correctly. * ods-ksmutil: Got a segmentation fault, when an HSM was missing in the configuration. Only applied to versions using MySQL. * Zone fetcher: Did not close files before moving them. * Zone fetcher: The serial arithmetic was not correct. * Auditor: It now ignores unrecognized RR types. * Signer Engine: Wrong handling of escaped characters in strings (fixed in ldns trunk) * Set correct permissions on the configuration files. Known issues: * Zone fetcher: When using TSIG, an incorrect MAC can be created if the length of the used secret is 'too long' (longer than the maximum digest length). This problem is in LDNS 1.6.3 and previous versions. This bug is fixed in the upcoming LDNS 1.6.4 release. * Auditor: Some good NAPTR records may fail to verify with dnsruby-1.41. This will be fixed in a future dnsruby release. * TXT RRs: Some TXT RRs with escape characters may fail to parse correctly with dnsruby-1.41 and ldns 1.6.3. This is fixed in the upcoming releases. OpenDNSSEC 1.0.0rc1 - 2009-12-04 * Auditor: dnsruby-1.41 should be used (includes fixes for zero length salt and RFC3597 unknown classes) * Signer Engine: ldns 1.6.3 should be used (includes NSEC3 bugfix and class inheritance when creating signatures) Bugfixes: * Signer Engine: 1.0.0b8 introduced a bug that no signatures where reused. Re-fixed. * Signer Engine: Fix ods-signer start (could hang on MacOSX) * Signer Engine: Mark a zone in progress if in use by one of the tools. Prevents multiple tasks being created for the same zone. * Signer Engine: Dropped records when zone content changed. * Signer Engine: Drop inherited groups and set additional groups when dropping privileges. * Zone fetcher: Clean up empty files if AXFR failed * Zone fetcher: Make syslogging RFC-compliant OpenDNSSEC 1.0.0b9 - 2009-11-27 * ods-ksmutil: update command split so that individual configuration files can be updated separately. * ods-ksmutil: "ds-seen" renamed to "ksk-roll" which is a more accurate description of its effect. (ds-seen will reappear in v1.1) * add contributed .spec file for RPM builds * Signer Engine: verifies signature after creation. Bugfixes: * Signer Engine: Output better information if the HSM fails with the signing. * ods-ksmutil: update zonelist correctly links keys to new zones if key sharing is turned on. * Bugreport #59: Problem starting ods-signer on a 64-bit machine * ods-ksmutil: update zonelist command now correctly adds and deletes zones (and sorts out their keys). OpenDNSSEC 1.0.0b8 - 2009-11-23 * ods-ksmutil: KSK rollover now holds at the point where the new key is made active until the command "ds-seen" is issued. * ods-ksmutil: "database backup" implemented to safely make a copy of the SQLite enforcer database. Bugfixes: * Auditor: Crashed on unknown RR class. * Signer Engine: NSEC3 RR included wrong information in bitmap (fixed in ldns trunk). * Signer Engine: Force a new signed zone if input is reread. Necessary because we cannot recognize if glue or unsigned delegations have been added and/or removed (yet). * Signer Engine: Fix adding duplicate signatures in case of single key is being used as both ZSK and KSK. * Bugreport #46: Vanishing records * KASP Enforcer: Could not handle zones with names longer than 30 characters. OpenDNSSEC 1.0.0b7 - 2009-11-16 * ods-auditor: Dnsruby version 1.40 or later required. * ods-kaspcheck: Checks Enforcer SQLite datastore to ensure writable * Signer Engine: LDNS 1.6.2 is recommended (bugfixes) * The supported RRs are documented on the wiki Bugfixes: * ods-ksmutil: Segmentation fault when missing arguments to "key import" * KASP Enforcer: Improved support for MySQL (experimental) * Signer Engine: DLV is included in NSEC RR (fixed in LDNS 1.6.2) * Signer Engine: Better handling of removed zones * Signer Engine: Correct handling of zero length rdata - RFC3597 style (fixed in LDNS trunk) * Signer Engine: Inherit class of zone to DNSSEC-related RRs OpenDNSSEC 1.0.0b6 - 2009-11-06 * ods-hsmutil now has a command ("purge") to remove ALL keys from a given repository. Bugfixes: * Some minor bugfixes for the auditor * Better detection for MySQL (now requires --enable-mysql to build) * Init PKCS#11 library with CKF_OS_LOCKING_OK * Change config file flag to hsmspeed OpenDNSSEC 1.0.0b5 - 2009-10-31 * Reintroduce MySQL for enforcer back-end on an experimental footing Bugfixes: * Auditor: Fixed TXT parsing. * ods-ksmutil: Database could not be created for first time users. * ods-ksmutil: Set the correct privileges on the database. * Signer Engine: Tweek log levels. * Signer Engine: Fixed segmentation fault with WKS RR (in LDNS trunk). * Signer Engine: Fixed NSAP, IPSECKEY, and SIG parsing (in LDNS trunk). * Signer Engine: Disable multiline parsing when the line is commented out. * Signer Engine: The tools are not hanging any more. Better pipe handling. * Signer Engine: NSEC zone even if only 1 NSEC is needed. * Signer Engine: Don't create NSEC3 records for empty non terminals that lead to glue. * Signer Engine: LDNS can now parse explicit TTLs that are non-numbers (for example 3d2h, in LDNS trunk). * Bugreport #43: ods-signer: The command parser was too strict with white spaces. OpenDNSSEC 1.0.0b4 - 2009-10-23 * Default TTL in case of $TTL or explicit RR TTL becomes the SOA Minimum value (was 3600). * The signer engine will check if another engine is already running before starting. * Startup scripts for Solaris (SMF). * Auditor gives an error if key moves to "in use" without sufficient "prepublished" time. Bugfixes: * Trailing spaces are not part of the domain name/ include file/ ttl in directives. * nsec3er: Print final RRset, even if no NSEC3 was needed at that RRset. * Proper privileges dropping when creating the command socket * Signer sometimes didn't terminate if socket shutdown failed. Known issues: * The Signer Engine fails with broken pipes sometimes. OpenDNSSEC 1.0.0b3 - 2009-10-16 * The auditor now tracks the SOA serial over time * The auditor (dnsruby) supports RSA/SHA256 and RSA/SHA512 Bugfixes: * The LDNS bug that affected SRV records has been fixed in ldns-trunk. * Bugreport #41: Fix for SOA serial 'keep'. * Allow for SOA Serial/TTL/Minimum values of zero. * Correct socket binding of NotifyListen. * Systems with older SQLite had problem rolling keys on a policy. * Auditor now handles SSHFP and NAPTR records correctly (but needs Dnsruby 1.39) * Auditor now handles TTLs in zone file with suffix s, m, h, d, and w. OpenDNSSEC 1.0.0b2 - 2009-10-09 * Added experimental support for RSA/SHA256 and RSA/SHA512 to KASP auditor. Dnsruby version 1.38 or higher required for SHA2 support. * Added experimental support for RSA/SHA256 and RSA/SHA512 to KASP enforcer and the signer engine. * SignerThreads and KeygenInterval has been deprecated (actually removed just before 1.0.0b1). * Added support for RSA/SHA256 and RSA/SHA512 to libhsm. No API changes. Bugfixes: * Bugreport #33 (#35): Output a signed zone if only the SOA record changed. * Zone fetcher did not start correctly * Create the pid / socket directory if it not yet exists, with the correct privileges. * Signer Engine now catches exception if running with incorrect permission. * TCP-support for LDNS on Solaris is fixed in LDNS trunk. Known issues: * LDNS is having problem with SRV records. The main effect is that these records are given non-valid RRSIGs. This is still under investigation. OpenDNSSEC 1.0.0b1 - 2009-10-02 * tag added to automatically delete keys that have been dead for some interval. * Rename all OpenDNSSEC command line tools and daemons to ods-XXX (e.g. ksmutil becomes ods-ksmutil). * kasp_check command added to check the conf.xml and kasp.xml configuration files for sanity and consistency. * communicated and keygend combined to form "ods-enforcerd". * ksmutil command line changes. Most commands have changed slightly, but there are some significant changes (see http://svn.opendnssec.org/docs/command-tools-syntax.txt for details.) * Enforcer database now has a version number. If it differs from the version number in the code (specified via a #define statement), the software will issue an error message and not connect to the database. * "ksmutil list keys" now displays the keytag if the -l flag is passed to it. * "Emergency Keys" renamed to "Standby Keys" as this better reflects their role in OpenDNSSEC. * The behaviour of SOA Serial value 'counter' has changed according to Ticket #31. * The directory "xml" and been renamed to "conf". (This is part of repository clean.) * There are changes to the KASP DB: * Zone fetcher added, that will do AXFR from the master. If want to use your old database, use the following commands to upgrade: sqlite3 < enforcer/utils/migrate_090922_1.sqlite3 sqlite3 < enforcer/utils/migrate_090930_1.sqlite3 sqlite3 < enforcer/utils/migrate_091002_1.sqlite3 Or, to start a new (with loss of information), remove old keys from the HSM and issue the command: ksmutil setup Bugfixes: * Make sure that parenthesis in zonefiles don't concatenate rdata fields. Known issues: * TCP-support for LDNS on Solaris is currently broken due to an issue with SO_RCVTIMEO. The result is that the zonefetcher doesn't work. No other parts of OpenDNSSEC is affected by this bug. There is currently no workaround. OpenDNSSEC 1.0a5 - 2009-09-21 Features: * support %zonefile expansion in the signer engine NotifyCommand Bugfixes: * Read correctly from the kasp.xml * Correctly discover Empty Non-Terminals when reading input zonefile * Don't error on space-only lines in input zonefile OpenDNSSEC 1.0a4 - 2009-09-10 Features: * warn (by sending a message to the log) about: - impending key rollover - Rollover occurrance - when it is safe to remove a DS record * add export of DNSKEY and DS records to ksmutil * add configure option '--disable-auditor' to disable building the auditor * Added tag to kasp.xml; this allows automatic rollovers to be turned off in a policy for either keytype. * Changes to the KASP DB, please apply: If want to use your old DB: sqlite3 < enforcer/utils/migrate_090901_1.sqlite3 Or start fresh (with loss of information. User should remove old keys from the HSM): ksmutil setup Bugfixes: * "signer_engine_cli clear " dont crash on missing files anymore and removes all internal files now * Bugreport #18, #19: Fix segfault at nseccer, nsec3er or finalizer when handling large zones. * Signer Engine starts correctly (problem was python 2.4, not RHEL5). OpenDNSSEC 1.0a3 - 2009-08-26 Features: * ksmutil import key implemented for importing key ID of existing keys * "hsmspeed" will test the speed of the HSM. * "hsmutil test" will test the HSM against OpenDNSSEC. * Changes to the KASP DB, please apply: If want to use your old DB: sqlite3 < enforcer/utils/migrate_090820_1.sqlite3 Or start fresh (with loss of information. User should remove old keys from the HSM): ksmutil setup Bugfixes: * Better display of null backups (i.e. backup required) in ksmutil list * Don't show historical rollovers in ksmutil list * Fix key counting routines so that they all agree * Missing SQLite includes in the Enforcer Known bugs: * Signer Engine not starting correctly in RHEL5. Use "signer_engine -d" for now * "signer_engine_cli clear " crashes on missing files OpenDNSSEC 1.0a2 - 2009-08-14 Features: * conf.xml format changed * Read the default path to kasp.xml from conf.xml * libksm integrated into enforcer (and no longer installed) * Dropping privileges as specified * Option to specify that a key from a specific repository should not be used if it has not been backed up * ksmutil backup done, to signal that the keys are backed up * KASP Auditor should now function properly * A quick start script is available * XSLT to translate KASP into readable text (HTML) * Changes to the KASP DB, please apply: If want to use your old DB: sqlite3 < enforcer/utils/migrate_090812_1.sqlite3 sqlite3 < enforcer/utils/migrate_090813_1.sqlite3 Or start fresh (with loss of information): ksmutil setup Bugfixes: * Signer Engine can now read standard bind format correctly * make install creates an incorrectly named directory * ksmutil addzone defaults to wrong path * SoftHSM links libsofthsm to build directory * libksm install problem when builddir == srcdir * Missing include of header file in SoftHSM * Text about a problem with Botan on some systems. OpenDNSSEC 1.0a1 - 2009-07-30 * Initial release (aka "Technology Preview") opendnssec-1.4.9/KNOWN_ISSUES0000644000175000017500000000475112650165732012537 00000000000000OpenDNSSEC 1.4.0 - Known Restrictions The following are the known problems and/or restrictions of release 1.4.0 of OpenDNSSEC. BUGS: ----- OPENDNSSEC-332: Statistics on average sigs/sec not accurate OPENDNSSEC-437: Problem with invalid signatures on SOA RRset. OPENDNSSEC-104: Incorrect ZSK retire duration calculation. Limitations on Number of Zones ------------------------------ Owing to contention in the key management database, performance is degraded if OpenDNSSEC is used to sign large numbers of zones that do not share common keys. The problem is worse if SQLite is used for the key and signature manager database. As a workaround, we suggest that either the same key is used for all zones, or that the number of zones be limited to about 5,000. This will be addressed in a future release of the software. Issue with rolling from one algorithm to another ------------------------------------------------ The current version will handle key rollovers that also change algorithm just the same as any other key rollover. This is not sufficient; and so rolling between algorithms is broken and should not be done with the current system. Handling of external command calls ---------------------------------- External commands (e.g. NotifyCommand or DelegationSignerSubmitCommand) are called with popen. This can lead to errors with these external scripts not being noticed by OpenDNSSEC. It is therefore recommended that when writing scripts like these that they log enough information for the user to tell independently if they failed. Maximum number of HSMs ---------------------- The datatype of the column storing HSMs in the kasp database is only large enough to store 127 separate HSMs (with a MySQL backend). Quotation marks in strings -------------------------- Enforcer does not remove/handle any quotation marks in the imported strings. This will create a problem when importing the information from e.g. the policy description field into the Enforcer database. Intermittent segmentation faults on FreeBSD 9 amd64 ------------------------------------------------- Segmentation faults in _pthread_mutex_init_calloc_cb () from /lib/libc.so.7 have been intermittently seen when running regression tests on our FreeBSD test server (amd64, FreeBSD 9.0-RELEASE-p3). The segfaults have been seen to originate in the enforcer, the signer and SQLite on different occasions. These appear to be due to a bug in the FreeBSD malloc/pthread implementation and are not due to issues in the OpenDNSSEC code. opendnssec-1.4.9/Makefile.am0000644000175000017500000000222712650165732012655 00000000000000ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/common/config.h.in $(srcdir)/common/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub SUBDIRS = common libhsm enforcer conf tools if ENABLE_SIGNER SUBDIRS += signer endif EXTRA_DIST = $(srcdir)/LICENSE \ $(srcdir)/KNOWN_ISSUES \ $(srcdir)/MIGRATION \ $(srcdir)/README.md \ $(srcdir)/plugins/simple-dnskey-mailer/simple-dnskey-mailer.sh install-data-hook: $(INSTALL) -d $(DESTDIR)$(localstatedir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/tmp $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signconf $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/unsigned $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signed $(INSTALL) -d $(DESTDIR)$(localstatedir)/run $(INSTALL) -d $(DESTDIR)$(localstatedir)/run/opendnssec docs: (cd libhsm; $(MAKE) doxygen) (cd enforcer; $(MAKE) doxygen) (cd signer; $(MAKE) doxygen) opendnssec-1.4.9/tools/0000755000175000017500000000000012650166152012033 500000000000000opendnssec-1.4.9/tools/Makefile.am0000644000175000017500000000030512650165675014016 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = solaris sbin_SCRIPTS = ods-control bin_SCRIPTS = ods-kasp2html man5_MANS = ods-timing.5 man7_MANS = opendnssec.7 man8_MANS = ods-control.8 opendnssec-1.4.9/tools/opendnssec.7.in0000644000175000017500000000752112650165675014627 00000000000000.TH "opendnssec" "7" "February 2010" "OpenDNSSEC" "OpenDNSSEC overview" .SH "NAME" .LP .B OpenDNSSEC \- making DNSSEC easy for DNS administrators .SH "SYNOPSIS" .LP .B ods-control start .LP .B ods-control stop .LP .B ods-ksmutil .RB \fIsubcommand...\fB .LP .B ods-signer .RB [\fIsubcommand...\fB] .SH "DESCRIPTION" .LP OpenDNSSEC is a complete DNSSEC zone signing system which maintains stability and security of signed domains. DNSSEC adds many cryptographic concerns to DNS; OpenDNSSEC automates those to allow current DNS administrators to adopt DNSSEC. .PP Domain signing is done by placing OpenDNSSEC between the place where the zone files are edited and where they are published. The current version of OpenDNSSEC supports files and AXFR to communicate the zone data; effectively, OpenDNSSEC acts as a "bump in the wire" between editing and publishing a zone. .PP OpenDNSSEC has two daemons, which are unitedly started and stopped through the .I ods\-control(8) command. The two daemons in turn invoke other programs to get their work done. .PP One of the daemons is the KASP Enforcer, which enforces policies that define security and timing requirements for each individual zone. Operators tend to interact with the KASP Enforcer a lot, through the .I ods\-ksmutil(1) command. .PP The other daemon is the Signer Engine, which in turn signs the zone content. It retrieves that content from a file or through AXFR, and publishes a signed version of the zone into a file or through AXFR. Direct interaction with the Signer Engine, although not normally necessary, is possible through the .I ods\-signer(8) command. .PP The keys that sign the zones are managed by an independent repository, which is accessed over a PKCS #11 interface. The principle idea of this interface being to unleash access to cryptographic hardware, there are implementations in software. Also, implementations range from open to commercial, and from very simple to highly secure. By default, OpenDNSSEC is configured to run on top of a SoftHSM, but a few other commands exist to test any Hardware Security Module that may sit under the PKCS #11 API. .SH "OPERATIONAL PRACTICES" The approach used by OpenDNSSEC follows the best current practice of two kinds of key per zone: .TP .B KSK\fR or \fBKey Signing Key This key belongs in the apex of a zone, and is referenced in the parent zone (quite possibly a registry) in the form of DS records alongside NS records. These parent references function as trust delegations. The KSK is usually a longer key, and it could harm the efficiency of secure resolvers if all individual resource records were signed with it. This is why it is advisable to use the KSK only to sign the ZSK. In DNS records, the KSK can usually be recognised by having its SEP (Secure Entry Point) flag set. .TP .B ZSK\fR or \fBZone Signing Key This key also belongs in the apex of a zone, and is actually used to sign the resource records in a zone. It is a shorter key for reasons of efficiency, that is rolled over on a fairly regular basis. To detach these rollovers from the parent, the ZSK is not directly trusted by the parent zone, but instead its trust is established by way of a signature by the KSK on the ZSK. .PP OpenDNSSEC is mindful about the period of validity of each key, and will rollover in time to keep the domain signed, with new keys, without any downtime for the secure domain. The only thing that is not standardised, and thus cannot be automated at the moment is the interface between a zone and its parent, so this has to be done manually, or scripted around OpenDNSSEC. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B OpenDNSSEC was made by the OpenDNSSEC project, to be found on .B http://www.opendnssec.org/ opendnssec-1.4.9/tools/ods-kasp2html.in0000644000175000017500000000342512650165732015002 00000000000000#!/bin/sh # # Copyright (c) 2010 Kirei AB. 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 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. # XMLLINT=@XMLLINT@ XSLTPROC=@XSLTPROC@ KASP_SCHEMA=@OPENDNSSEC_DATA_DIR@/kasp.rng KASP_XSL=@OPENDNSSEC_DATA_DIR@/kasp2html.xsl KASP_XML=$1 if [ ! -x "$XMLLINT" ]; then echo "error: xmllint required, but not found" exit 1 fi if [ ! -x "$XSLTPROC" ]; then echo "error: xsltproc required, but not found" exit 1 fi if [ -f "$KASP_XML" ]; then $XMLLINT --noout --relaxng $KASP_SCHEMA $KASP_XML && \ $XSLTPROC $KASP_XSL $KASP_XML else echo "usage: $0 [kasp.xml]" fi opendnssec-1.4.9/tools/ods-control.in0000644000175000017500000001004712650165732014553 00000000000000#!/bin/sh # # Copyright (c) 2009 .SE (The Internet Infrastructure Foundation) # 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 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. # progname="ods-control" configfile="@OPENDNSSEC_CONFIG_FILE@" bindir="@OPENDNSSEC_BIN_DIR@" sbindir="@OPENDNSSEC_SBIN_DIR@" enforcer_pid_file=`${bindir}/ods-getconf -c "${configfile}" //Configuration/Enforcer/PidFile` signer_pid_file=`${bindir}/ods-getconf -c "${configfile}" //Configuration/Signer/PidFile` signer_socket_file=`${bindir}/ods-getconf -c "${configfile}" //Configuration/Signer/SocketFile` [ "$enforcer_pid_file" = "" ] && enforcer_pid_file="@OPENDNSSEC_ENFORCER_PIDFILE@" [ "$signer_pid_file" = "" ] && signer_pid_file="@OPENDNSSEC_SIGNER_PIDFILE@" [ "$signer_socket_file" = "" ] && signer_socket_file="@OPENDNSSEC_SIGNER_SOCKET@" case "$1" in 'ksm') shift "$bindir/ods-ksmutil" $@ ;; 'hsm') shift "$bindir/ods-hsmutil" $@ ;; 'signer') case "$2" in 'start') echo "Starting signer engine..." "$sbindir/ods-signer" start RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ ! -r "$signer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start signer" exit $RETVAL fi done i=0 while [ ! -r "$signer_socket_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start signer" exit $RETVAL fi done sleep 1 "$sbindir/ods-signer" running RETVAL=$? fi exit $RETVAL ;; *) shift "$sbindir/ods-signer" "$@" ;; esac ;; 'enforcer') case "$2" in 'start') echo "Starting enforcer..." "$sbindir/ods-enforcerd" RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ ! -r "$enforcer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not start enforcer" break fi done fi exit $RETVAL ;; 'stop') echo "Stopping enforcer..." if [ -r "$enforcer_pid_file" ]; then kill -TERM `cat "$enforcer_pid_file"` RETVAL=$? if [ $RETVAL = 0 ]; then i=0 while [ -r "$enforcer_pid_file" ]; do sleep 1 i=`expr $i + 1` if [ $i -ge 5 ]; then RETVAL=1 echo "Could not stop enforcer" break fi done fi else echo "Cannot find PID file" RETVAL=1 fi exit $RETVAL ;; 'notify') echo "Notifying enforcer of new database..." if [ -r "$enforcer_pid_file" ]; then kill -HUP `cat "$enforcer_pid_file"` RETVAL=$? else echo "Cannot find PID file" RETVAL=1 fi exit $RETVAL ;; *) echo "usage: $progname enforcer start|stop|notify" ;; esac ;; 'start') "$0" enforcer start RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi "$0" signer start RETVAL=$? exit $RETVAL ;; 'stop') "$0" enforcer stop echo "Stopping signer engine..." "$sbindir/ods-signer" stop ;; *) echo "usage: $progname ksm|hsm|signer|enforcer|start|stop ..." ;; esac opendnssec-1.4.9/tools/ods-timing.5.in0000644000175000017500000000550012650165675014531 00000000000000.TH "ods-timing" "5" "February 2010" OpenDNSSEC "OpenDNSSEC timinig" .SH "NAME" .LP .B ods-timing \- OpenDNSSEC timing specification .SH "SYNOPSIS" .LP .B @OPENDNSSEC_CONFIG_DIR@/conf.xml .br .B @OPENDNSSEC_CONFIG_DIR@/kasp.xml .br .B @OPENDNSSEC_CONFIG_DIR@/zonelist.xml .SH "DESCRIPTION" .LP The configuration files of OpenDNSSEC need to have timing descriptions, notably for periods. These descriptions follow ISO 8601 with exceptions for the duration of a month and a year, as these periods would be allowed to vary if ISO 8601 were strictly adhered to. .PP Durations are represented by the format \fBP[n]Y[n]M[n]DT[n]H[n]M[n]S\fR. In these representations, the \fB[n]\fR is replaced by the value for each of the date and time elements that follow the \fB[n]\fR. Leading zeros are not required. The capital letters \fBP\fR, \fBY\fR, \fBM\fR, \fBW\fR, \fBD\fR, \fBT\fR, \fBH\fR, \fBM\fR and \fBS\fR are designators for each of the date and time elements and are not replaced .TP .B P is the duration designator (historically called "period") placed at the start of the duration representation. .TP .B Y is the year designator that follows the value for the number of years. .TP .B M is the month designator that follows the value for the number of months. .TP .B W is the week designator that follows the value for the number of weeks. .TP .B D is the day designator that follows the value for the number of days. .TP .B T is the time designator that precedes the time components of the representation. .TP .B H is the hour designator that follows the value for the number of hours. .TP .B M is the minute designator that follows the value for the number of minutes. .TP .B S is the second designator that follows the value for the number of seconds. .PP For example, .B P3Y6M4DT12H30M5S represents a duration of "three years, six months, four days, twelve hours, thirty minutes, and five seconds". Date and time elements including their designator may be omitted if their value is zero, and lower order elements may also be omitted for reduced precision. For example, .B P23DT23H and .B P4Y are both acceptable duration representations. .SH "EXCEPTION" .LP A year or month vary in duration depending on the current date. For OpenDNSSEC, we assume fixed values .TP .B One month is assumed to be 31 days. .TP .B One year is assumed to be 365 days. .PP This exception may or may not change in future releases of OpenDNSSEC. The reason for making this exception is to avoid complicating this software in a way that may not meet any practical need. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), opendnssec(7), ISO 8601, .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B OpenDNSSEC was made by the OpenDNSSEC project, to be found on .B http://www.opendnssec.org/ opendnssec-1.4.9/tools/solaris/0000755000175000017500000000000012650166152013507 500000000000000opendnssec-1.4.9/tools/solaris/ods-enforcerd-smf.xml0000644000175000017500000000373412650165675017506 00000000000000 opendnssec-1.4.9/tools/solaris/Makefile.am0000644000175000017500000000066412650165675015502 00000000000000MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub EXTRA_DIST = \ README \ ods-enforcerd-smf.xml \ ods-signerd-smf.xml \ ods-enforcerd.init.in \ ods-signerd.init.in opendnssec-1.4.9/tools/solaris/ods-signerd.init.in0000644000175000017500000000477012650165675017160 00000000000000#!/bin/sh # # Copyright (c) 2009 Nominet UK. 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 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. # # export SOFTHSM_CONF=/etc/softhsm.conf export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@OPENDNSSEC_LIB_DIR@ signer_bin_file="@OPENDNSSEC_SBIN_DIR@/ods-signerd" signer_cli_file="@OPENDNSSEC_SBIN_DIR@/ods-signer" signer_pid_file="@OPENDNSSEC_PID_DIR@/signerd.pid" case "$1" in 'start') # Check program is not running ps -ef | grep '\' | grep -v grep if [ $? -eq 0 ] then echo "signer_engine is already running" exit 0 fi # Start program up if [ -x $signer_bin_file ] then echo "Starting signer engine" $signer_bin_file & fi ;; 'stop') # Stop program if [ -x $signer_cli_file ] then echo "Stopping signer engine" $signer_cli_file stop else if [ -x $signer_pid_file ] then echo "Stopping signer engine via pid_file" kill -TERM `cat $signer_pid_file` else echo "Stopping signer engine via pid" PID=`ps -ef | grep '\' | grep -v grep | awk '{ print $2 }'` if [ ! -z "$PID" ] then kill $PID fi fi fi ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0 opendnssec-1.4.9/tools/solaris/ods-enforcerd.init.in0000644000175000017500000000443612650165675017473 00000000000000#!/bin/sh # # Copyright (c) 2009 Nominet UK. 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 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. # # export SOFTHSM_CONF=/etc/softhsm.conf export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@OPENDNSSEC_LIB_DIR@ enforcer_bin_file="@OPENDNSSEC_SBIN_DIR@/ods-enforcerd" enforcer_pid_file="@OPENDNSSEC_PID_DIR@/enforcerd.pid" case "$1" in 'start') # Check program is not running ps -ef | grep '$enforcer_bin_file' | grep -v grep if [ $? -eq 0 ] then echo "ods-enforcerd is already running" exit 0 fi # Start program up if [ -x $enforcer_bin_file ] then echo "Starting enforcer" $enforcer_bin_file & fi ;; 'stop') # Stop programs if [ -x $enforcer_pid_file ] then echo "Stopping ods-enforcerd via pid_file" kill -TERM `cat $enforcer_pid_file` else PID=`ps -ef | grep '$enforcer_bin_file' | grep -v grep | awk '{ print $2 }'` if [ ! -z "$PID" ] then echo "Stopping ods-enforcerd via pid" kill $PID fi fi ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0 opendnssec-1.4.9/tools/solaris/Makefile.in0000644000175000017500000004000612650165765015505 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = tools/solaris ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = ods-enforcerd.init ods-signerd.init 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 = 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) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/ods-enforcerd.init.in $(srcdir)/ods-signerd.init.in \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ \ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub EXTRA_DIST = \ README \ ods-enforcerd-smf.xml \ ods-signerd-smf.xml \ ods-enforcerd.init.in \ ods-signerd.init.in all: all-am .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 tools/solaris/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/solaris/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): ods-enforcerd.init: $(top_builddir)/config.status $(srcdir)/ods-enforcerd.init.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-signerd.init: $(top_builddir)/config.status $(srcdir)/ods-signerd.init.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(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 installdirs: 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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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-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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 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: opendnssec-1.4.9/tools/solaris/README0000644000175000017500000000223312650165675014320 00000000000000Solaris scripts to control OpenDNSSEC processes: Any package for solaris should probably include something like the following: In the prototype: ... i preremove i postinstall d none /lib/svc/method/opendnssec 0755 root root d none /var/svc/manifest/site/opendnssec 0755 root root d none /lib/svc/method/opendnssec/ods-signerd.init=ods-signerd.init 0555 root root d none /lib/svc/method/opendnssec/ods-enforcerd.init=ods-enforcerd.init 0555 root root f none /var/svc/manifest/site/opendnssec/ods-signerd-smf.xml=ods-signerd-smf.xml 0555 root root f none /var/svc/manifest/site/opendnssec/ods-enforcerd-smf.xml=ods-enforcerd-smf.xml 0555 root root ... In the preremove ... /usr/sbin/svcadm disable enforcer /usr/sbin/svccfg -v delete svc:/site/opendnssec/enforcer:default /usr/sbin/svcadm disable signer /usr/sbin/svccfg -v delete svc:/site/opendnssec/signer:default ... In the postinstall ... /usr/sbin/svccfg -v import /var/svc/manifest/site/opendnssec/ods-signerd-smf.xml /usr/sbin/svccfg -v import /var/svc/manifest/site/opendnssec/ods-enforcerd-smf.xml ... Then you can use: svcadm [enable|disable] signer svcadm [enable|disable] enforcer to control the processes opendnssec-1.4.9/tools/solaris/ods-signerd-smf.xml0000644000175000017500000000372412650165675017171 00000000000000 opendnssec-1.4.9/tools/Makefile.in0000644000175000017500000007743312650165765014047 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = ods-control ods-timing.5 opendnssec.7 \ ods-control.8 ods-kasp2html CONFIG_CLEAN_VPATH_FILES = 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; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) 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 man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man5_MANS) $(man7_MANS) $(man8_MANS) 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 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)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ods-control.8.in \ $(srcdir)/ods-control.in $(srcdir)/ods-kasp2html.in \ $(srcdir)/ods-timing.5.in $(srcdir)/opendnssec.7.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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = solaris sbin_SCRIPTS = ods-control bin_SCRIPTS = ods-kasp2html man5_MANS = ods-timing.5 man7_MANS = opendnssec.7 man8_MANS = ods-control.8 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 tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): ods-control: $(top_builddir)/config.status $(srcdir)/ods-control.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-timing.5: $(top_builddir)/config.status $(srcdir)/ods-timing.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ opendnssec.7: $(top_builddir)/config.status $(srcdir)/opendnssec.7.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-control.8: $(top_builddir)/config.status $(srcdir)/ods-control.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-kasp2html: $(top_builddir)/config.status $(srcdir)/ods-kasp2html.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; 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 \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; 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 \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(man5_MANS) @$(NORMAL_INSTALL) @list1='$(man5_MANS)'; \ list2=''; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || 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 '/\.5[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,^[^5][0-9a-z]*$$,5,;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)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$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)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man7: $(man7_MANS) @$(NORMAL_INSTALL) @list1='$(man7_MANS)'; \ list2=''; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || 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 '/\.7[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,^[^7][0-9a-z]*$$,7,;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)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$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)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS)'; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(man8_MANS) @$(NORMAL_INSTALL) @list1='$(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='$(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) # 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: $(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 $(SCRIPTS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binSCRIPTS install-sbinSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man5 install-man7 install-man8 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: uninstall-binSCRIPTS uninstall-man uninstall-sbinSCRIPTS uninstall-man: uninstall-man5 uninstall-man7 uninstall-man8 .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-binSCRIPTS 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-man5 install-man7 \ install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-sbinSCRIPTS 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 uninstall-binSCRIPTS uninstall-man uninstall-man5 \ uninstall-man7 uninstall-man8 uninstall-sbinSCRIPTS .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: opendnssec-1.4.9/tools/ods-control.8.in0000644000175000017500000000332712650165732014724 00000000000000.TH "ods-control" "8" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-control" .SH "NAME" .LP .B ods\-control \- OpenDNSSEC control utility .SH "SYNOPSIS" .LP .B ods\-control ksm ... .br .B ods\-control hsm ... .br .B ods\-control signer ... .br .B ods\-control start .br .B ods\-control stop .br .B ods\-control enforcer start .br .B ods\-control enforcer stop .br .B ods\-control enforcer notify .SH "DESCRIPTION" .LP ods\-control is a helper utility which gives a combined interface for different command utilities within OpenDNSSEC. It can also start and stop OpenDNSSEC by controlling the two daemons. .SH "OPTIONS" .LP .TP \fBksm\fR The remainder of the command line will be sent to the ods\-ksmutil utility .TP \fBhsm\fR The remainder of the command line will be sent to the ods\-hsmutil utility .TP \fBsigner\fR The remainder of the command line will be sent to the ods\-signer utility .TP \fBstart\fR Will start the two daemons of OpenDNSSEC, ods\-enforcerd and ods\-signerd .TP \fBstop\fR Will stop the two daemons of OpenDNSSEC, ods\-enforcerd and ods\-signerd .TP \fBenforcer start\fR Start the ods\-enforcerd daemon without touching the ods\-signerd and return non-zero on problems .TP \fBenforcer stop\fR Stop the ods\-enforcerd daemon without touching the ods\-signerd and return non-zero on problems .TP \fBenforcer notify\fR Notify the enforcer that its database has been updated and may need further processing by the KASP Enforcer. .SH "SEE ALSO" .LP ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-control was written by Jakob Schlyter as part of the OpenDNSSEC project. opendnssec-1.4.9/signer/0000755000175000017500000000000012650166152012162 500000000000000opendnssec-1.4.9/signer/Makefile.am0000644000175000017500000000045112650165675014147 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src man doxygen: rm -fr $(top_builddir)/signer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-signer" \ SRCDIR=$(top_srcdir)/signer \ OUTPUTDIR=$(top_builddir)/signer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) opendnssec-1.4.9/signer/man/0000755000175000017500000000000012650166152012735 500000000000000opendnssec-1.4.9/signer/man/Makefile.am0000644000175000017500000000014412650165732014713 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in man8_MANS = ods-signer.8 ods-signerd.8 ods-getconf.8 opendnssec-1.4.9/signer/man/ods-getconf.8.in0000644000175000017500000000167512650165732015577 00000000000000.TH "ods-getconf" "8" "May 2014" "OpenDNSSEC" "OpenDNSSEC ods-getconf" .SH "NAME" .B ods\-getconf \- OpenDNSSEC get configuration values .LP .SH "SYNOPSIS" .B ods\-getconf .RB [ \-c .IR FILE ] .RB [ \-h ] .RB [ \-V ] expr .LP .SH "DESCRIPTION" ods\-getconf is part of the OpenDNSSEC software. With this tool, you can extract the value of a configuration option by giving the appropriate expression. For more information, go to .B http://www.opendnssec.org and visit the Documentation page. .LP .SH "OPTIONS" .LP .TP .B \-c\fI FILE Read configuration from file, instead of using the default. .TP .B \-h Show this help. .TP .B \-V Show version and exit. .LP .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-getconf was written by NLnet Labs as part of the OpenDNSSEC project. opendnssec-1.4.9/signer/man/ods-signer.8.in0000644000175000017500000000210512650165732015426 00000000000000.TH "ods-signer" "8" "February 2012" "OpenDNSSEC" "OpenDNSSEC ods-signer" .SH "NAME" .B ods\-signer \- OpenDNSSEC Signer Engine client .LP .SH "SYNOPSIS" .B ods\-signer .RB [ \-h ] .I clear .IR | .I flush | .I queue | .I reload | .I running | .I sign .IR [ \-\-serial ] | .I sign \-\-all | .I start | .I stop | .I update .RB [ \-\-all ] | .I update .IR | .I retransfer .IR | .I verbosity .IR | .I zones .LP .SH "DESCRIPTION" ods\-signer is part of the OpenDNSSEC software. With this tool, you can send commands to the signer engine daemon. For more information, go to .B http://www.opendnssec.org and visit the Documentation page. .LP .SH "OPTIONS" .LP .TP .B \-h Show this help. .P .SH "DIAGNOSTICS" .LP will log all the problems via stderr. .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-signer was written by NLnet Labs as part of the OpenDNSSEC project. opendnssec-1.4.9/signer/man/Makefile.in0000644000175000017500000004541212650165765014741 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = signer/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = ods-getconf.8 ods-signer.8 ods-signerd.8 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 = 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 am__installdirs = "$(DESTDIR)$(man8dir)" NROFF = nroff MANS = $(man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ods-getconf.8.in \ $(srcdir)/ods-signer.8.in $(srcdir)/ods-signerd.8.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in man8_MANS = ods-signer.8 ods-signerd.8 ods-getconf.8 all: all-am .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 signer/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/man/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): ods-getconf.8: $(top_builddir)/config.status $(srcdir)/ods-getconf.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-signer.8: $(top_builddir)/config.status $(srcdir)/ods-signer.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-signerd.8: $(top_builddir)/config.status $(srcdir)/ods-signerd.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man8_MANS) @$(NORMAL_INSTALL) @list1='$(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='$(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) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(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 $(MANS) installdirs: for dir in "$(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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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-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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man8 .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: opendnssec-1.4.9/signer/man/ods-signerd.8.in0000644000175000017500000000231312650165732015573 00000000000000.TH "ods-signerd" "8" "February 2012" "OpenDNSSEC" "OpenDNSSEC ods-signerd" .SH "NAME" .LP .B ods\-signerd \- OpenDNSSEC Signer Engine daemon .SH "SYNOPSIS" .LP .B ods\-signerd .RB [ \-1 ] .RB [ \-c .IR FILE ] .RB [ \-d ] .RB [ \-h ] .RB [ \-i ] .RB [ \-v ] .RB [ \-V ] .P .SH "DESCRIPTION" .LP ods\-signerd is part of the OpenDNSSEC software. It will keep your DNS zones continuous signed. For more information, go to .B http://www.opendnssec.org and visit the Documentation page. .P .SH "OPTIONS" .LP .TP .B \-1 Run signer engine once, then exit (for debugging purposes). .TP .B \-c\fI FILE Read configuration from file, instead of using the default. .TP .B \-d Run daemon in foreground. .TP .B \-h Show this help. .TP .B \-i Print configuration and exit (for debugging purposes). .TP .B \-v Increase verbosity. .TP .B \-V Show version and exit. .P .SH "DIAGNOSTICS" .LP will log all the problems via standard syslog(8). .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-signerd was written by NLnet Labs as part of the OpenDNSSEC project. opendnssec-1.4.9/signer/src/0000755000175000017500000000000012650166152012751 500000000000000opendnssec-1.4.9/signer/src/Makefile.am0000644000175000017500000001572412650165732014741 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBHSM = ${top_builddir}/libhsm/src/lib/libhsm.a LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(top_srcdir)/libhsm/src/lib \ @SSL_INCLUDES@ \ @XML2_INCLUDES@ \ @LDNS_INCLUDES@ signerdir = @libdir@/opendnssec/signer sbin_PROGRAMS = ods-signerd ods-signer bin_PROGRAMS = ods-getconf ods_signerd_SOURCES= ods-signerd.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signerd_LDADD= $(LIBHSM) ods_signerd_LDADD+= $(LIBCOMPAT) ods_signerd_LDADD+= @LDNS_LIBS@ @XML2_LIBS@ @PTHREAD_LIBS@ @RT_LIBS@ @SSL_LIBS@ @C_LIBS@ ods_signer_SOURCES= ods-signer.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signer_LDADD= $(LIBHSM) ods_signer_LDADD+= @LDNS_LIBS@ @XML2_LIBS@ @RT_LIBS@ ods_signer_LDADD+= $(LIBCOMPAT) ods_getconf_SOURCES= ods-getconf.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_getconf_LDADD= $(LIBHSM) ods_getconf_LDADD+= @LDNS_LIBS@ @XML2_LIBS@ @RT_LIBS@ ods_getconf_LDADD+= $(LIBCOMPAT) opendnssec-1.4.9/signer/src/ods-signerd.c0000644000175000017500000001165212650165732015263 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * OpenDNSSEC signer engine daemon. * */ #include "config.h" #include "daemon/engine.h" #include #include #include #define AUTHOR_NAME "Matthijs Mekking" #define COPYRIGHT_STR "Copyright (C) 2008-2010 NLnet Labs OpenDNSSEC" /** * Prints usage. * */ static void usage(FILE* out) { fprintf(out, "Usage: %s [OPTIONS]\n", "ods-signerd"); fprintf(out, "Start the OpenDNSSEC signer engine daemon.\n\n"); fprintf(out, "Supported options:\n"); fprintf(out, " -c | --config Read configuration from file.\n"); fprintf(out, " -d | --no-daemon Do not daemonize the signer " "engine.\n"); fprintf(out, " -1 | --single-run Run once, then exit.\n"); fprintf(out, " -h | --help Show this help and exit.\n"); fprintf(out, " -i | --info Print configuration and exit.\n"); fprintf(out, " -v | --verbose Increase verbosity.\n"); fprintf(out, " -V | --version Show version and exit.\n"); fprintf(out, "\nBSD licensed, see LICENSE in source package for " "details.\n"); fprintf(out, "Version %s. Report bugs to <%s>.\n", PACKAGE_VERSION, PACKAGE_BUGREPORT); } /** * Prints version. * */ static void version(FILE* out) { fprintf(out, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); fprintf(out, "Written by %s.\n\n", AUTHOR_NAME); fprintf(out, "%s. This is free software.\n", COPYRIGHT_STR); fprintf(out, "See source files for more license information\n"); exit(0); } /** * Main. start engine and run it. * */ int main(int argc, char* argv[]) { int c; int options_index = 0; int info = 0; int single_run = 0; int daemonize = 1; int cmdline_verbosity = 0; const char* cfgfile = ODS_SE_CFGFILE; static struct option long_options[] = { {"single-run", no_argument, 0, '1'}, {"config", required_argument, 0, 'c'}, {"no-daemon", no_argument, 0, 'd'}, {"help", no_argument, 0, 'h'}, {"info", no_argument, 0, 'i'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, { 0, 0, 0, 0} }; /* parse the commandline */ while ((c=getopt_long(argc, argv, "1c:dhivV", long_options, &options_index)) != -1) { switch (c) { case '1': single_run = 1; break; case 'c': cfgfile = optarg; break; case 'd': daemonize = 0; break; case 'h': usage(stdout); exit(0); break; case 'i': info = 1; break; case 'v': cmdline_verbosity++; break; case 'V': version(stdout); exit(0); break; default: usage(stderr); exit(2); break; } } argc -= optind; argv += optind; if (argc != 0) { usage(stderr); exit(2); } #ifdef ENFORCER_TIMESHIFT if (getenv("ENFORCER_TIMESHIFT")) { fprintf(stdout, "WARNING: timeshift %s detected, running once only\n", getenv("ENFORCER_TIMESHIFT")); single_run = 1; } else { fprintf(stdout, "DEBUG: timeshift mode enabled, but not set.\n"); } #endif /* ENFORCER_TIMESHIFT */ /* main stuff */ fprintf(stdout, "OpenDNSSEC signer engine version %s\n", PACKAGE_VERSION); engine_start(cfgfile, cmdline_verbosity, daemonize, info, single_run); /* done */ return 0; } opendnssec-1.4.9/signer/src/shared/0000755000175000017500000000000012650166152014217 500000000000000opendnssec-1.4.9/signer/src/shared/hsm.h0000644000175000017500000000536312650165732015111 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Hardware Security Module support. * */ #ifndef SHARED_HSM_H #define SHARED_HSM_H #include "config.h" #include "shared/status.h" #include "signer/keys.h" #include #include #include #include #include /** * Open HSM. * \param[in] filename the configuration filename * \return int hsm status * */ int lhsm_open(const char* filename); /** * Reopen HSM. * \param[in] filename the configuration filename * \return int hsm status * */ int lhsm_reopen(const char* filename); /** * Check the HSM connection, reload engine if necessary. * \param[in] engine signer engine. * */ void lhsm_check_connection(void* engine); /** * Get key from one of the HSMs, store the DNSKEY and HSM key. * \param[in] ctx HSM context * \param[in] owner the zone owner name * \param[in] key_id key credentials * \return ods_status status * */ ods_status lhsm_get_key(hsm_ctx_t* ctx, ldns_rdf* owner, key_type* key_id); /** * Get RRSIG from one of the HSMs, given a RRset and a key. * \param[in] ctx HSM context * \param[in] rrset RRset to be signed * \param[in] key_id key credentials * \param[in] owner owner of the keys * \param[in] inception signature inception * \param[in] expiration signature expiration * \return ldns_rr* RRSIG record * */ ldns_rr* lhsm_sign(hsm_ctx_t* ctx, ldns_rr_list* rrset, key_type* key_id, ldns_rdf* owner, time_t inception, time_t expiration); #endif /* SHARED_HSM_H */ opendnssec-1.4.9/signer/src/shared/allocator.c0000644000175000017500000000705712650165732016277 00000000000000/* * Copyright (c) 2010-2011 NLNet Labs. 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 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. * */ /** * Memory management. * */ #include "config.h" #include "shared/allocator.h" #include "shared/log.h" #include #include static const char* allocator_str = "allocator"; /** * Create allocator. * */ allocator_type* allocator_create(void *(*allocator)(size_t size), void (*deallocator)(void *)) { allocator_type* result = (allocator_type*) allocator(sizeof(allocator_type)); if (!result) { ods_log_error("[%s] failed to create allocator", allocator_str); return NULL; } result->allocator = allocator; result->deallocator = deallocator; return result; } /** * Allocate memory. * */ void* allocator_alloc(allocator_type* allocator, size_t size) { void* result; ods_log_assert(allocator); /* align size */ if (size == 0) { size = 1; } result = allocator->allocator(size); if (!result) { ods_fatal_exit("[%s] allocator failed: out of memory", allocator_str); return NULL; } return result; } /** * Allocate memory and initialize to zero. * */ void* allocator_alloc_zero(allocator_type *allocator, size_t size) { void *result = allocator_alloc(allocator, size); if (!result) { return NULL; } memset(result, 0, size); return result; } /** * Allocate memory and initialize with data. * */ void* allocator_alloc_init(allocator_type *allocator, size_t size, const void *init) { void *result = allocator_alloc(allocator, size); if (!result) { return NULL; } memcpy(result, init, size); return result; } /** * Duplicate string. * */ char* allocator_strdup(allocator_type *allocator, const char *string) { if (!string) { return NULL; } return (char*) allocator_alloc_init(allocator, strlen(string) + 1, string); } /** * Deallocate memory. * */ void allocator_deallocate(allocator_type *allocator, void* data) { ods_log_assert(allocator); if (!data) { return; } allocator->deallocator(data); return; } /** * Cleanup allocator. * */ void allocator_cleanup(allocator_type *allocator) { void (*deallocator)(void *); if (!allocator) { return; } deallocator = allocator->deallocator; deallocator(allocator); return; } opendnssec-1.4.9/signer/src/shared/privdrop.c0000644000175000017500000002150612650165732016157 00000000000000/* * Copyright (c) 2009 Nominet UK. All rights reserved. * * Based heavily on uidswap.c from openssh-5.2p1 * * 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. * */ /** * * Privileges. */ #define _GNU_SOURCE /* defines for setres{g|u}id */ #include "config.h" #include "shared/log.h" #include "shared/privdrop.h" #include "shared/status.h" #include #include #include #include #include #include #include #include #include #include #include #ifndef _SC_GETPW_R_SIZE_MAX #define _SC_GETPW_R_SIZE_MAX 16384 #endif /* _SC_GETPW_R_SIZE_MAX */ #ifndef _SC_GETGR_R_SIZE_MAX #define _SC_GETGR_R_SIZE_MAX 16384 #endif /* _SC_GETGR_R_SIZE_MAX */ static const char* privdrop_str = "privdrop"; /** * Get the user identifier from the username. * */ uid_t privuid(const char* username) { struct passwd pwd; struct passwd* result; long bufsize; char* buf; uid_t uid; int s; uid = geteuid(); if (username) { bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) { bufsize = 16384; /* should be more than enough */ } buf = (char*) calloc(bufsize, sizeof(char)); if (!buf) { ods_log_error("[%s] calloc failed: out of memory?", privdrop_str); return -1; } /* Lookup the user id in /etc/passwd */ s = getpwnam_r(username, &pwd, buf, bufsize, &result); /* LEAK */ if (s) { ods_log_error("[%s] unable to get user id for %s: %s", privdrop_str, username, strerror(s)); } if (result != NULL) { uid = pwd.pw_uid; } free((void*) buf); } else { uid = -1; } return uid; } /** * Get the group identifier from the group name. * */ gid_t privgid(const char *groupname) { struct group grp; struct group* result; long bufsize; char* buf; gid_t gid; int s; gid = getegid(); if (groupname) { bufsize = sysconf(_SC_GETGR_R_SIZE_MAX); if (bufsize == -1) { bufsize = 16384; /* should be more than enough */ } buf = (char*) calloc(bufsize, sizeof(char)); if (!buf) { ods_log_error("[%s] calloc failed: out of memory?", privdrop_str); return -1; } /* Lookup the group id in /etc/group */ s = getgrnam_r(groupname, &grp, buf, bufsize, &result); /* LEAK */ if (s) { ods_log_error("[%s] unable to get group id for %s: %s", privdrop_str, groupname, strerror(s)); } if (result != NULL) { gid = grp.gr_gid; } free((void*) buf); } else { gid = -1; } return gid; } /** * Drop privileges. * */ ods_status privdrop(const char *username, const char *groupname, const char *newroot, uid_t* puid, gid_t* pgid) { int status; uid_t uid, olduid; gid_t gid; long ngroups_max; gid_t *final_groups; int final_group_len = -1; /* Save effective uid/gid */ uid = olduid = geteuid(); gid = getegid(); /* Check if we're going to drop uid */ if (username) { uid = privuid(username); if (uid == (uid_t)-1) { ods_log_error("[%s] user %s does not exist", privdrop_str, username); return ODS_STATUS_PRIVDROP_ERR; } } /* Check if we're going to drop gid */ if (groupname) { gid = privgid(groupname); if (gid == (gid_t)-1) { ods_log_error("[%s] group %s does not exist", privdrop_str, groupname); return ODS_STATUS_PRIVDROP_ERR; } } /* Change root if requested */ if (newroot) { #ifdef HAVE_CHROOT status = chroot(newroot); if (status != 0 || chdir("/") != 0) { ods_log_error("[%s] chroot to %s failed: %.100s", privdrop_str, newroot, strerror(errno)); return ODS_STATUS_CHROOT_ERR; } #else ods_log_error("[%s] chroot to %s failed: !HAVE_CHROOT", privdrop_str, newroot); return ODS_STATUS_CHROOT_ERR; #endif /* HAVE_CHROOT */ } /* Do additional groups first */ if (username != NULL && !olduid) { #ifdef HAVE_INITGROUPS if (initgroups(username, gid) < 0) { ods_log_error("[%s] initgroups failed: %s: %.100s", privdrop_str, username, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } #else ods_log_error("initgroups failed: %s: !HAVE_INITGROUPS", username); return ODS_STATUS_PRIVDROP_ERR; #endif /* HAVE_INITGROUPS */ ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; final_groups = (gid_t *)malloc(ngroups_max *sizeof(gid_t)); if (!final_groups) { return ODS_STATUS_MALLOC_ERR; } #if defined(HAVE_GETGROUPS) && defined(HAVE_SETGROUPS) final_group_len = getgroups(ngroups_max, final_groups); /* If we are root then drop all groups other than the final one */ if (!olduid) { setgroups(final_group_len, final_groups); } #endif /* defined(HAVE_GETGROUPS) && defined(HAVE_SETGROUPS) */ free((void*)final_groups); } else { /* If we are root then drop all groups other than the final one */ #if defined(HAVE_SETGROUPS) if (!olduid) setgroups(1, &(gid)); #endif /* defined(HAVE_SETGROUPS) */ } /* Drop gid? */ if (groupname) { #if defined(HAVE_SETRESGID) && !defined(BROKEN_SETRESGID) status = setresgid(gid, gid, gid); #elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID) status = setregid(gid, gid); #else # ifndef SETEUID_BREAKS_SETUID status = setegid(gid); if (status != 0) { ods_log_error("[%s] setegid() for %s (%lu) failed: %s", privdrop_str, groupname, (unsigned long) gid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } # endif /* SETEUID_BREAKS_SETUID */ status = setgid(gid); #endif if (status != 0) { ods_log_error("[%s] setgid() for %s (%lu) failed: %s", privdrop_str, groupname, (unsigned long) gid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } else { ods_log_debug("[%s] group set to %s (%lu)", privdrop_str, groupname, (unsigned long) gid); } } /* Drop uid? */ if (username) { /* Set the user to drop to if specified; else just set the uid as the real one */ #if defined(HAVE_SETRESUID) && !defined(BROKEN_SETRESUID) status = setresuid(uid, uid, uid); #elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID) status = setreuid(uid, uid); #else # ifndef SETEUID_BREAKS_SETUID status = seteuid(uid); if (status != 0) { ods_log_error("[%s] seteuid() for %s (%lu) failed: %s", privdrop_str, username, (unsigned long) uid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } # endif /* SETEUID_BREAKS_SETUID */ status = setuid(uid); #endif if (status != 0) { ods_log_error("[%s] setuid() for %s (%lu) failed: %s", privdrop_str, username, (unsigned long) uid, strerror(errno)); return ODS_STATUS_PRIVDROP_ERR; } else { ods_log_debug("[%s] user set to %s (%lu)", privdrop_str, username, (unsigned long) uid); } } *puid = uid; *pgid = gid; return ODS_STATUS_OK; } /** * Close privdrop. * */ void privclose(const char* username, const char* groupname) { if (username) { endpwent(); } if (groupname) { endgrent(); } return; } opendnssec-1.4.9/signer/src/shared/allocator.h0000644000175000017500000000611512650165732016276 00000000000000/* * Copyright (c) 2010-2011 NLNet Labs. 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 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. * */ /** * Memory management. * */ #ifndef SHARED_ALLOCATOR_H #define SHARED_ALLOCATOR_H #include "config.h" #include typedef struct allocator_struct allocator_type; struct allocator_struct { void* (*allocator)(size_t); void (*deallocator)(void *); }; /** * Create allocator. * \param[in] allocator function for allocating * \param[in] deallocator function for deallocating * \return allocator_type* allocator */ allocator_type* allocator_create(void *(*allocator)(size_t size), void (*deallocator)(void *)); /** * Allocate memory. * \param[in] allocator the allocator * \param[in] size size to allocate * \return void* pointer to allocated memory */ void* allocator_alloc(allocator_type* allocator, size_t size); /** * Allocate memory and initialize to zero. * \param[in] allocator the allocator * \param[in] size size to allocate * \return void* pointer to allocated memory */ void* allocator_alloc_zero(allocator_type* allocator, size_t size); /** * Allocate memory and initialize with data. * \param[in] allocator the allocator * \param[in] size size to allocate * \param[in] init initialized data * \return void* pointer to allocated memory * */ void* allocator_alloc_init(allocator_type *allocator, size_t size, const void* init); /** * Duplicate string. * \param[in] allocator the allocator * \param[in] string * \return char* duplicated string * */ char* allocator_strdup(allocator_type *allocator, const char *string); /** * Deallocate memory. * \param[in] allocator the allocator * \param[in] data memory to deallocate * */ void allocator_deallocate(allocator_type* allocator, void* data); /** * Cleanup allocator. * \param[in] allocator the allocator * */ void allocator_cleanup(allocator_type* allocator); #endif /* SHARED_ALLOCATOR_H */ opendnssec-1.4.9/signer/src/shared/util.c0000644000175000017500000002540012650165732015264 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * Utility tools. */ #include "config.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include #include #include #include #include #include #include static const char* util_str = "util"; /** * Check if a RR is a DNSSEC RR (RRSIG, NSEC, NSEC3 or NSEC3PARAMS). * */ int util_is_dnssec_rr(ldns_rr* rr) { ldns_rr_type type = 0; if (!rr) { return 0; } type = ldns_rr_get_type(rr); return (type == LDNS_RR_TYPE_RRSIG || type == LDNS_RR_TYPE_NSEC || type == LDNS_RR_TYPE_NSEC3 || type == LDNS_RR_TYPE_NSEC3PARAMS); } /** * Compare SERIALs. * */ int util_serial_gt(uint32_t serial_new, uint32_t serial_old) { return DNS_SERIAL_GT(serial_new, serial_old); } /** * Compare SOA RDATAs. * */ int util_soa_compare_rdata(ldns_rr* rr1, ldns_rr* rr2) { size_t i = 0; size_t rdata_count = SE_SOA_RDATA_MINIMUM; for (i = 0; i <= rdata_count; i++) { if (i != SE_SOA_RDATA_SERIAL && ldns_rdf_compare(ldns_rr_rdf(rr1, i), ldns_rr_rdf(rr2, i)) != 0) { return 1; } } return 0; } /** * Compare SOA RRs. * */ int util_soa_compare(ldns_rr* rr1, ldns_rr* rr2) { size_t rr1_len = 0; size_t rr2_len = 0; size_t offset = 0; if (!rr1 || !rr2) { return 1; } rr1_len = ldns_rr_uncompressed_size(rr1); rr2_len = ldns_rr_uncompressed_size(rr2); if (ldns_dname_compare(ldns_rr_owner(rr1), ldns_rr_owner(rr2)) != 0) { return 1; } if (ldns_rr_get_class(rr1) != ldns_rr_get_class(rr2)) { return 1; } if (ldns_rr_get_type(rr1) != LDNS_RR_TYPE_SOA) { return 1; } if (ldns_rr_get_type(rr1) != ldns_rr_get_type(rr2)) { return 1; } if (offset > rr1_len || offset > rr2_len) { if (rr1_len == rr2_len) { return util_soa_compare_rdata(rr1, rr2); } return 1; } return util_soa_compare_rdata(rr1, rr2); } /** * Compare RRs only on RDATA. * */ ldns_status util_dnssec_rrs_compare(ldns_rr* rr1, ldns_rr* rr2, int* cmp) { ldns_status status = LDNS_STATUS_OK; size_t rr1_len; size_t rr2_len; ldns_buffer* rr1_buf; ldns_buffer* rr2_buf; if (!rr1 || !rr2) { return LDNS_STATUS_ERR; } rr1_len = ldns_rr_uncompressed_size(rr1); rr2_len = ldns_rr_uncompressed_size(rr2); rr1_buf = ldns_buffer_new(rr1_len); rr2_buf = ldns_buffer_new(rr2_len); /* name, class and type should already be equal */ status = ldns_rr2buffer_wire_canonical(rr1_buf, rr1, LDNS_SECTION_ANY); if (status != LDNS_STATUS_OK) { ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); /* critical */ return status; } status = ldns_rr2buffer_wire_canonical(rr2_buf, rr2, LDNS_SECTION_ANY); if (status != LDNS_STATUS_OK) { ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); /* critical */ return status; } *cmp = ldns_rr_compare_wire(rr1_buf, rr2_buf); ldns_buffer_free(rr1_buf); ldns_buffer_free(rr2_buf); return LDNS_STATUS_OK; } /** * A more efficient ldns_dnssec_rrs_add_rr(), get rid of ldns_rr_compare(). * */ ldns_status util_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr) { int cmp = 0; ldns_dnssec_rrs *new_rrs = NULL; ldns_status status = LDNS_STATUS_OK; uint32_t rr_ttl = 0; uint32_t default_ttl = 0; if (!rrs || !rrs->rr || !rr) { return LDNS_STATUS_ERR; } rr_ttl = ldns_rr_ttl(rr); status = util_dnssec_rrs_compare(rrs->rr, rr, &cmp); if (status != LDNS_STATUS_OK) { /* critical */ return status; } if (cmp < 0) { if (rrs->next) { return util_dnssec_rrs_add_rr(rrs->next, rr); } else { new_rrs = ldns_dnssec_rrs_new(); new_rrs->rr = rr; rrs->next = new_rrs; default_ttl = ldns_rr_ttl(rrs->rr); if (rr_ttl < default_ttl) { ldns_rr_set_ttl(rrs->rr, rr_ttl); } else { ldns_rr_set_ttl(new_rrs->rr, default_ttl); } return LDNS_STATUS_OK; } } else if (cmp > 0) { /* put the current old rr in the new next, put the new rr in the current container */ new_rrs = ldns_dnssec_rrs_new(); new_rrs->rr = rrs->rr; new_rrs->next = rrs->next; rrs->rr = rr; rrs->next = new_rrs; default_ttl = ldns_rr_ttl(new_rrs->rr); if (rr_ttl < default_ttl) { ldns_rr_set_ttl(new_rrs->rr, rr_ttl); } else { ldns_rr_set_ttl(rrs->rr, default_ttl); } return LDNS_STATUS_OK; } else { /* should we error on equal? or free memory of rr */ ods_log_warning("[%s] adding duplicate RR?", util_str); return LDNS_STATUS_NO_DATA; } return LDNS_STATUS_OK; } /** * Read process id from file. * */ static pid_t util_read_pidfile(const char* file) { int fd; pid_t pid; char pidbuf[32]; char *t; int l; if ((fd = open(file, O_RDONLY)) == -1) { return -1; } if (((l = read(fd, pidbuf, sizeof(pidbuf)))) == -1) { close(fd); return -1; } close(fd); /* Empty pidfile means no pidfile... */ if (l == 0) { errno = ENOENT; return -1; } pid = (pid_t) strtol(pidbuf, &t, 10); if (*t && *t != '\n') { return -1; } return pid; } /** * Check process id file. * */ int util_check_pidfile(const char* pidfile) { pid_t oldpid; struct stat stat_ret; /** * If the file exists then either we didn't shutdown cleanly or * a signer daemon is already running: in either case shutdown. */ if (stat(pidfile, &stat_ret) != 0) { if (errno != ENOENT) { ods_log_error("[%s] cannot stat pidfile %s: %s", util_str, pidfile, strerror(errno)); } /* else: file does not exist: carry on */ } else { if (S_ISREG(stat_ret.st_mode)) { /** The pidfile exists already */ if ((oldpid = util_read_pidfile(pidfile)) == -1) { /** Consider stale pidfile */ if (errno != ENOENT) { ods_log_error("[%s] cannot read pidfile %s: %s", util_str, pidfile, strerror(errno)); } } else { if (kill(oldpid, 0) == 0 || errno == EPERM) { ods_log_crit("[%s] pidfile %s already exists, " "a process with pid %u is already running. " "If no ods-signerd process is running, a previous " "instance didn't shutdown cleanly, please remove this " "file and try again.", util_str, pidfile, oldpid); return 0; } else { /** Consider state pidfile */ ods_log_warning("[%s] pidfile %s already exists, " "but no process with pid %u is running. " "A previous instance didn't shutdown cleanly, this " "pidfile is stale.", util_str, pidfile, oldpid); } } } } /** All good, carry on */ return 1; } /** * Write process id to file. * */ int util_write_pidfile(const char* pidfile, pid_t pid) { FILE* fd; char pidbuf[32]; size_t result = 0, size = 0; ods_log_assert(pidfile); ods_log_assert(pid); ods_log_debug("[%s] writing pid %lu to pidfile %s", util_str, (unsigned long) pid, pidfile); snprintf(pidbuf, sizeof(pidbuf), "%lu\n", (unsigned long) pid); fd = ods_fopen(pidfile, NULL, "w"); if (!fd) { return -1; } size = strlen(pidbuf); if (size == 0) { result = 1; } else { result = fwrite((const void*) pidbuf, 1, size, fd); } if (result == 0) { ods_log_error("[%s] write to pidfile %s failed: %s", util_str, pidfile, strerror(errno)); } else if (result < size) { ods_log_error("[%s] short write to pidfile %s: disk full?", util_str, pidfile); result = 0; } else { result = 1; } ods_fclose(fd); if (!result) { return -1; } return 0; } /** * Print an LDNS RR, check status. * */ ods_status util_rr_print(FILE* fd, const ldns_rr* rr) { char* result = NULL; ldns_buffer* tmp_buffer = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !rr) { return ODS_STATUS_ASSERT_ERR; } tmp_buffer = ldns_buffer_new(LDNS_MAX_PACKETLEN); if (!tmp_buffer) { return ODS_STATUS_MALLOC_ERR; } if (ldns_rr2buffer_str_fmt(tmp_buffer, NULL, rr) == LDNS_STATUS_OK) { /* export and return string, destroy rest */ result = ldns_buffer2str(tmp_buffer); if (result) { fprintf(fd, "%s", result); status = ODS_STATUS_OK; LDNS_FREE(result); } else { fprintf(fd, "; Unable to convert rr to string\n"); status = ODS_STATUS_FWRITE_ERR; } } else { status = ODS_STATUS_FWRITE_ERR; } ldns_buffer_free(tmp_buffer); return status; } /** * Calculates the size needed to store the result of b64_pton. * */ size_t util_b64_pton_calculate_size(size_t srcsize) { return (((((srcsize + 3) / 4) * 3)) + 1); } opendnssec-1.4.9/signer/src/shared/locks.h0000644000175000017500000001031612650165732015427 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Threading and locking. * */ #ifndef SCHEDULER_LOCKS_H #define SCHEDULER_LOCKS_H #include "config.h" #include "shared/log.h" #include #include #define LOCKRET(func) do { \ int err; \ if ( (err=(func)) != 0) \ ods_log_error("%s at %d could not " #func ": %s", \ __FILE__, __LINE__, strerror(err)); \ } while(0) #if defined(HAVE_PTHREAD) #include /** ods-signerd will crash if the thread stacksize is too small */ #define ODS_MINIMUM_STACKSIZE 524288 /** use pthread mutex for basic lock */ typedef pthread_mutex_t lock_basic_type; /** use pthread cond for basic condition */ typedef pthread_cond_t cond_basic_type; /** small front for pthread init func, NULL is default attrs. */ #define lock_basic_init(lock) LOCKRET(pthread_mutex_init(lock, NULL)) #define lock_basic_destroy(lock) LOCKRET(pthread_mutex_destroy(lock)) #define lock_basic_lock(lock) LOCKRET(pthread_mutex_lock(lock)) #define lock_basic_unlock(lock) LOCKRET(pthread_mutex_unlock(lock)) /** our own alarm clock */ #define lock_basic_set(cond) LOCKRET(pthread_cond_init(cond, NULL)) #define lock_basic_sleep(cond, lock, sleep) LOCKRET(ods_thread_wait(cond, lock, sleep)) #define lock_basic_alarm(cond) LOCKRET(pthread_cond_signal(cond)) #define lock_basic_broadcast(cond) LOCKRET(pthread_cond_broadcast(cond)) #define lock_basic_off(cond) LOCKRET(pthread_cond_destroy(cond)) int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait); /** thread creation */ typedef pthread_t ods_thread_type; /** Pass where to store tread_t in thr. */ #define ods_thread_detach(thr) LOCKRET(pthread_detach(thr)) #define ods_thread_self() pthread_self() #define ods_thread_join(thr) LOCKRET(pthread_join(thr, NULL)) #define ods_thread_kill(thr, sig) LOCKRET(pthread_kill(thr, sig)) int ods_thread_create(pthread_t *thr, void *(*func)(void *), void *arg); int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait); void ods_thread_blocksigs(void); #else /* !HAVE_PTHREAD */ /* we do not have PTHREADS */ #define PTHREADS_DISABLED 1 typedef int lock_basic_type; #define lock_basic_init(lock) /* nop */ #define lock_basic_destroy(lock) /* nop */ #define lock_basic_lock(lock) /* nop */ #define lock_basic_unlock(lock) /* nop */ #define lock_basic_set(cond) /* nop */ #define lock_basic_sleep(cond, lock, sleep) /* nop */ #define lock_basic_alarm(cond) /* nop */ #define lock_basic_broadcast(cond) /* nop */ #define lock_basic_off(cond) /* nop */ typedef pid_t ods_thread_type; #define ods_thread_create(thr, func, arg) ods_thr_fork_create(thr, func, arg) #define ods_thread_detach(thr) /* nop */ #define ods_thread_self() getpid() #define ods_thread_join(thr) ods_thr_fork_wait(thr) void ods_thr_fork_create(ods_thread_type* thr, void* (*func)(void*), void* arg); void ods_thr_fork_wait(ods_thread_type thread); #endif /* HAVE_PTHREAD */ void ods_thread_blocksigs(void); #endif /* SHARED_LOCKS_H */ opendnssec-1.4.9/signer/src/shared/log.c0000644000175000017500000002155212650165732015074 00000000000000/* * Copyright (c) 2009 NLnet Labs. 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 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. * */ /** * Logging. * */ #include "config.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #ifdef HAVE_SYSLOG_H static int logging_to_syslog = 0; #endif /* !HAVE_SYSLOG_H */ #include /* va_start(), va_end() */ #include /* fflush, fprintf(), vsnprintf() */ #include /* exit() */ #include /* strlen() */ static FILE* logfile = NULL; static int log_level = LOG_CRIT; #define CTIME_LENGTH 26 /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) struct syslog_data sdata = SYSLOG_DATA_INIT; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #endif /* TODO: - log_init should have program_name variable - wrap special case logging onto generic one - check if xml-specific logging functions are still neeeded (enforcer) - */ #define MY_PACKAGE_TARNAME "ods-signerd" static const char* log_str = "log"; /** * Initialize logging. * */ void ods_log_init(const char *filename, int use_syslog, int verbosity) { #ifdef HAVE_SYSLOG_H int facility; #endif /* HAVE_SYSLOG_H */ ods_log_verbose("[%s] switching log to %s verbosity %i (log level %i)", log_str, use_syslog?"syslog":(filename&&filename[0]?filename:"stderr"), verbosity, verbosity+2); if (logfile && logfile != stderr) { ods_fclose(logfile); } log_level = verbosity + 2; #ifdef HAVE_SYSLOG_H if(logging_to_syslog) { #ifdef HAVE_CLOSELOG_R closelog_r(&sdata); #else closelog(); #endif logging_to_syslog = 0; } if(use_syslog) { facility = ods_log_get_facility(filename); #ifdef HAVE_OPENLOG_R openlog_r(MY_PACKAGE_TARNAME, LOG_NDELAY, facility, &sdata); #else openlog(MY_PACKAGE_TARNAME, LOG_NDELAY, facility); #endif logging_to_syslog = 1; return; } #endif /* HAVE_SYSLOG_H */ if(filename && filename[0]) { logfile = ods_fopen(filename, NULL, "a"); if (logfile) { ods_log_debug("[%s] new logfile %s", log_str, filename); return; } logfile = stderr; ods_log_warning("[%s] cannot open %s for appending, logging to " "stderr", log_str, filename); } else { logfile = stderr; } return; } /** * Close logging. * */ void ods_log_close(void) { ods_log_debug("[%s] close log", log_str); ods_log_init(NULL, 0, 0); } /** * Get facility by string. * ods_log_get_user * ods_log_get_facility * return error, LOG_*** as a parameter * */ #ifdef HAVE_SYSLOG_H int ods_log_get_facility(const char* facility) { int length; if (!facility) { return LOG_DAEMON; } length = strlen(facility); if (length == 4 && strncasecmp(facility, "KERN", 4) == 0) return LOG_KERN; else if (length == 4 && strncasecmp(facility, "USER", 4) == 0) return LOG_USER; else if (length == 4 && strncasecmp(facility, "MAIL", 4) == 0) return LOG_MAIL; else if (length == 6 && strncasecmp(facility, "DAEMON", 6) == 0) return LOG_DAEMON; else if (length == 4 && strncasecmp(facility, "AUTH", 4) == 0) return LOG_AUTH; else if (length == 3 && strncasecmp(facility, "LPR", 3) == 0) return LOG_LPR; else if (length == 4 && strncasecmp(facility, "NEWS", 4) == 0) return LOG_NEWS; else if (length == 4 && strncasecmp(facility, "UUCP", 4) == 0) return LOG_UUCP; else if (length == 4 && strncasecmp(facility, "CRON", 4) == 0) return LOG_CRON; else if (length == 6 && strncasecmp(facility, "LOCAL0", 6) == 0) return LOG_LOCAL0; else if (length == 6 && strncasecmp(facility, "LOCAL1", 6) == 0) return LOG_LOCAL1; else if (length == 6 && strncasecmp(facility, "LOCAL2", 6) == 0) return LOG_LOCAL2; else if (length == 6 && strncasecmp(facility, "LOCAL3", 6) == 0) return LOG_LOCAL3; else if (length == 6 && strncasecmp(facility, "LOCAL4", 6) == 0) return LOG_LOCAL4; else if (length == 6 && strncasecmp(facility, "LOCAL5", 6) == 0) return LOG_LOCAL5; else if (length == 6 && strncasecmp(facility, "LOCAL6", 6) == 0) return LOG_LOCAL6; else if (length == 6 && strncasecmp(facility, "LOCAL7", 6) == 0) return LOG_LOCAL7; ods_log_warning("[%s] syslog facility %s not supported, logging to " "log_daemon", log_str, facility); return LOG_DAEMON; } #endif /* HAVE_SYSLOG_H */ /** * Get the log level. * */ int ods_log_get_level() { return log_level; } /** * Log message wrapper. * */ static void ods_log_vmsg(int priority, const char* t, const char* s, va_list args) { char message[ODS_SE_MAXLINE]; static char nowstr[CTIME_LENGTH]; time_t now = time_now(); vsnprintf(message, sizeof(message), s, args); #ifdef HAVE_SYSLOG_H if (logging_to_syslog) { #ifdef HAVE_SYSLOG_R syslog_r(priority, &sdata, "%s", message); #else syslog(priority, "%s", message); #endif return; } #endif /* HAVE_SYSLOG_H */ if (!logfile) { return; } (void) ctime_r(&now, nowstr); nowstr[CTIME_LENGTH-2] = '\0'; /* remove trailing linefeed */ fprintf(logfile, "[%s] %s[%i] %s: %s\n", nowstr, MY_PACKAGE_TARNAME, priority, t, message); fflush(logfile); } /** * Heavy debug logging. * */ void ods_log_deeebug(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_DEEEBUG) { ods_log_vmsg(LOG_DEBUG, "debug ", format, args); } va_end(args); } /** * Log debug. * */ void ods_log_debug(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_DEBUG) { ods_log_vmsg(LOG_DEBUG, "debug ", format, args); } va_end(args); } /** * Log verbose. * */ void ods_log_verbose(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_INFO) { ods_log_vmsg(LOG_INFO, "verbose", format, args); } va_end(args); } /** * Log info. * */ void ods_log_info(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_NOTICE) { ods_log_vmsg(LOG_NOTICE, "msg ", format, args); } va_end(args); } /** * Log warning. * */ void ods_log_warning(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_WARNING) { ods_log_vmsg(LOG_WARNING, "warning", format, args); } va_end(args); } /** * Log error. * */ void ods_log_error(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_ERR) { ods_log_vmsg(LOG_ERR, "error ", format, args); } va_end(args); } /** * Log critical. * */ void ods_log_crit(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_CRIT) { ods_log_vmsg(LOG_CRIT, "crit ", format, args); } va_end(args); } /** * Log alert. * */ void ods_log_alert(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_ALERT) { ods_log_vmsg(LOG_ALERT, "alert ", format, args); } va_end(args); } /** * Log emergency and exit. * */ void ods_fatal_exit(const char *format, ...) { va_list args; va_start(args, format); if (log_level >= LOG_CRIT) { ods_log_vmsg(LOG_CRIT, "fatal ", format, args); } va_end(args); abort(); } opendnssec-1.4.9/signer/src/shared/privdrop.h0000644000175000017500000000450612650165732016165 00000000000000/* * Copyright (c) 2009 Nominet UK. 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 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. * */ /** * * Privileges. */ #ifndef SHARED_PRIVDROP_H #define SHARED_PRIVDROP_H #include #include #include "shared/status.h" /** * Get the group identifier from a group name. * \param[in] groupname group name * \return gid_t group identifier * */ gid_t privgid(const char* groupname); /** * Get the user identifier from a username. * \param[in] username username * \return uid_t user identifier * */ uid_t privuid(const char* username); /** * Drop privileges. * \param[in] username drop priviliges to this user * \param[in] groupname drop priviliges to this group * \param[in] newroot make this the new root directory * \param[out] puid user id * \param[out] pgid group id * \return ods_status status. * */ ods_status privdrop(const char *username, const char *groupname, const char *newroot, uid_t* puid, gid_t* pgid); /** * Close privdrop. * \param[in] username username * \param[in] groupname group name * */ void privclose(const char* username, const char* groupname); #endif /* SHARED_PRIVDROP_H */ opendnssec-1.4.9/signer/src/shared/status.c0000644000175000017500000001055312650165732015635 00000000000000/* * Copyright (c) 2009-2011 NLNet Labs. 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 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. * */ /** * * Status. */ #include "config.h" #include "shared/status.h" #include ods_lookup_table ods_status_str[] = { { ODS_STATUS_OK, "All OK" }, { ODS_STATUS_EOF, "End of file" }, { ODS_STATUS_NOTIMPL, "Not implemented"}, { ODS_STATUS_UPTODATE, "Up to date"}, { ODS_STATUS_ASSERT_ERR, "Assertion error"}, { ODS_STATUS_CFG_ERR, "Configuration error"}, { ODS_STATUS_CHDIR_ERR, "Change directory failed"}, { ODS_STATUS_CHROOT_ERR, "Change root failed"}, { ODS_STATUS_CMDHANDLER_ERR, "Command handler error"}, { ODS_STATUS_XFRHANDLER_ERR, "XFR handler error"}, { ODS_STATUS_CONFLICT_ERR, "Conflict detected"}, { ODS_STATUS_ERR, "General error"}, { ODS_STATUS_FOPEN_ERR, "Unable to open file"}, { ODS_STATUS_FSEEK_ERR, "fseek() failed"}, { ODS_STATUS_FORK_ERR, "fork() failed"}, { ODS_STATUS_FREAD_ERR, "Unable to read file"}, { ODS_STATUS_FWRITE_ERR, "Unable to write file"}, { ODS_STATUS_HSM_ERR, "HSM error"}, { ODS_STATUS_INSECURE, "Insecure"}, { ODS_STATUS_MALLOC_ERR, "Memory allocation error"}, { ODS_STATUS_RENAME_ERR, "Unable to rename file"}, { ODS_STATUS_UNLINK_ERR, "Unable to unlink file"}, { ODS_STATUS_SOCK_BIND, "Unable to bind socket"}, { ODS_STATUS_SOCK_FCNTL_NONBLOCK, "Unable to set socket to nonblocking"}, { ODS_STATUS_SOCK_GETADDRINFO, "Unable to retrieve address information"}, { ODS_STATUS_SOCK_LISTEN, "Unable to listen on socket"}, { ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY, "Unable to set socket to v6only"}, { ODS_STATUS_SOCK_SOCKET_UDP, "Unable to create udp socket"}, { ODS_STATUS_SOCK_SOCKET_TCP, "Unable to create tcp socket"}, { ODS_STATUS_ACL_SUBNET_BAD_RANGE, "Bad subnet range"}, { ODS_STATUS_ACL_SUBNET_OUT_RANGE, "Subnet out of range"}, { ODS_STATUS_PARSE_ERR, "Parse error"}, { ODS_STATUS_PRIVDROP_ERR, "Unable to drop privileges"}, { ODS_STATUS_RNG_ERR, "RelaxNG error"}, { ODS_STATUS_SETSID_ERR, "setsid() failed"}, { ODS_STATUS_UNCHANGED, "Status unchanged"}, { ODS_STATUS_WRITE_PIDFILE_ERR, "Unable to write process id to pidfile"}, { ODS_STATUS_XML_ERR, "XML error"}, { ODS_STATUS_XFR_NOT_READY, "Incoming zone transfer not ready"}, { ODS_STATUS_SKIPDNAME, "Failed to skip domain name"}, { ODS_STATUS_BUFAVAIL, "Insufficient space available in buffer"}, { ODS_STATUS_PARSESOA, "Failed to parse SOA RR"}, { ODS_STATUS_REQAXFR, "Got IXFR, but AXFR required"}, { ODS_STATUS_INSERIAL, "Serial mismatch"}, { ODS_STATUS_XFRBADFORM, "XFR bad format"}, { ODS_STATUS_XFRINCOMPLETE, "XFR on disk incomplete (in progress?)"}, { 0, NULL } }; ods_lookup_table* ods_lookup_by_id(ods_lookup_table *table, int id) { while (table->name != NULL) { if (table->id == id) { return table; } table++; } return NULL; } /** * Look up a descriptive text by each status. * */ const char* ods_status2str(ods_status status) { ods_lookup_table *lt; lt = ods_lookup_by_id(ods_status_str, status); if (lt) { return lt->name; } return NULL; } opendnssec-1.4.9/signer/src/shared/util.h0000644000175000017500000000702512650165732015274 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * Utility tools. */ #ifndef UTIL_UTIL_H #define UTIL_UTIL_H #include "config.h" #include "shared/status.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #define SE_SOA_RDATA_SERIAL 2 #define SE_SOA_RDATA_EXPIRE 5 #define SE_SOA_RDATA_MINIMUM 6 /* copycode: This define is taken from BIND9 */ #define DNS_SERIAL_GT(a, b) ((int)(((a) - (b)) & 0xFFFFFFFF) > 0) /** * Check if a RR is a DNSSEC RR (RRSIG, NSEC, NSEC3 or NSEC3PARAMS). * \param[in] rr RR * \return int 1 on true, 0 on false * */ int util_is_dnssec_rr(ldns_rr* rr); /** * Compare SERIALs. * \param serial_new new SERIAL value * \param serial_old old SERIAL value * \return int 0 if the new SERIAL <= old SERIAL, non-zero otherwise * */ int util_serial_gt(uint32_t serial_new, uint32_t serial_old); /** * Compare RRs, ignore SOA SERIAL. * \param[in] rr1 RR * \param[in] rr2 another RR * \return int 0 if equal SOA RRs, 1 otherwise * */ int util_soa_compare(ldns_rr* rr1, ldns_rr* rr2); /** * Compare RRs only on RDATA. * \param[in] rr1 RR * \param[in] rr2 another RR * \param[out] cmp compare value * \return status compare status * */ ldns_status util_dnssec_rrs_compare(ldns_rr* rr1, ldns_rr* rr2, int* cmp); /** * A more efficient ldns_dnssec_rrs_add_rr(), get rid of ldns_rr_compare(). * \param[in] rrs RRset * \param[in] rr to add * \return ldns_status status * */ ldns_status util_dnssec_rrs_add_rr(ldns_dnssec_rrs *rrs, ldns_rr *rr); /** * Check process id file. * \param[in] pidfile pid filename * \return int status (0 if process id in pidfile is running) * */ int util_check_pidfile(const char* pidfile); /** * Write process id to file. * \param[in] pidfile pid filename * \param[in] pid process id * \return int status * */ int util_write_pidfile(const char* pidfile, pid_t pid); /** * Print an LDNS RR, check status. * \param[in] fd file descriptor * \param[in] rr RR * \return ods_status status * */ ods_status util_rr_print(FILE* fd, const ldns_rr* rr); /** * Calculates the size needed to store the result of b64_pton. * \param[in] len strlen * \return size of b64_pton * */ size_t util_b64_pton_calculate_size(size_t srcsize); #endif /* UTIL_UTIL_H */ opendnssec-1.4.9/signer/src/shared/hsm.c0000644000175000017500000001622312650165732015101 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Hardware Security Module support. * */ #include "daemon/engine.h" #include "shared/hsm.h" #include "shared/log.h" static const char* hsm_str = "hsm"; /** * Open HSM. * */ int lhsm_open(const char* filename) { int result = hsm_open(filename, hsm_check_pin); if (result != HSM_OK) { char* error = hsm_get_error(NULL); if (error != NULL) { ods_log_error("[%s] %s", hsm_str, error); free(error); } else { ods_log_crit("[%s] error opening libhsm (errno %i)", hsm_str, result); } /* exit? */ } else { ods_log_info("[%s] libhsm connection opened succesfully", hsm_str); } return result; } /** * Reopen HSM. * */ int lhsm_reopen(const char* filename) { if (hsm_check_context(NULL) != HSM_OK) { ods_log_warning("[%s] idle libhsm connection, trying to reopen", hsm_str); hsm_close(); return lhsm_open(filename); } return HSM_OK; } /** * Clear key cache. * */ static void lhsm_clear_key_cache(key_type* key) { if (!key) { return; } if (key->dnskey) { /* DNSKEY still exists in zone */ key->dnskey = NULL; } if (key->hsmkey) { hsm_key_free(key->hsmkey); key->hsmkey = NULL; } if (key->params) { hsm_sign_params_free(key->params); key->params = NULL; } return; } /** * Check the HSM connection, reload engine if necessary. * */ void lhsm_check_connection(void* engine) { engine_type* e = (engine_type*) engine; if (hsm_check_context(NULL) != HSM_OK) { ods_log_warning("[%s] idle libhsm connection, trying to reopen", hsm_str); engine_stop_drudgers(e); hsm_close(); (void)lhsm_open(e->config->cfg_filename); engine_start_drudgers((engine_type*) engine); } else { ods_log_debug("[%s] libhsm connection ok", hsm_str); } return; } /** * Get key from one of the HSMs. * */ ods_status lhsm_get_key(hsm_ctx_t* ctx, ldns_rdf* owner, key_type* key_id) { char *error = NULL; int retries = 0; if (!owner || !key_id) { ods_log_error("[%s] unable to get key: missing required elements", hsm_str); return ODS_STATUS_ASSERT_ERR; } lhsm_key_start: /* set parameters */ if (!key_id->params) { key_id->params = hsm_sign_params_new(); if (key_id->params) { key_id->params->owner = ldns_rdf_clone(owner); key_id->params->algorithm = key_id->algorithm; key_id->params->flags = key_id->flags; } else { /* could not create params */ error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } ods_log_error("[%s] unable to get key: create params for key %s " "failed", hsm_str, key_id->locator?key_id->locator:"(null)"); return ODS_STATUS_ERR; } } /* lookup key */ if (!key_id->hsmkey) { key_id->hsmkey = hsm_find_key_by_id(ctx, key_id->locator); } if (!key_id->hsmkey) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } /* could not find key */ ods_log_error("[%s] unable to get key: key %s not found", hsm_str, key_id->locator?key_id->locator:"(null)"); return ODS_STATUS_ERR; } /* get dnskey */ if (!key_id->dnskey) { key_id->dnskey = hsm_get_dnskey(ctx, key_id->hsmkey, key_id->params); } if (!key_id->dnskey) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } else if (!retries) { lhsm_clear_key_cache(key_id); retries++; goto lhsm_key_start; } ods_log_error("[%s] unable to get key: hsm failed to create dnskey", hsm_str); return ODS_STATUS_ERR; } key_id->params->keytag = ldns_calc_keytag(key_id->dnskey); return ODS_STATUS_OK; } /** * Get RRSIG from one of the HSMs, given a RRset and a key. * */ ldns_rr* lhsm_sign(hsm_ctx_t* ctx, ldns_rr_list* rrset, key_type* key_id, ldns_rdf* owner, time_t inception, time_t expiration) { char* error = NULL; ldns_rr* result = NULL; hsm_sign_params_t* params = NULL; if (!owner || !key_id || !rrset || !inception || !expiration) { ods_log_error("[%s] unable to sign: missing required elements", hsm_str); return NULL; } ods_log_assert(key_id->dnskey); ods_log_assert(key_id->hsmkey); ods_log_assert(key_id->params); /* adjust parameters */ params = hsm_sign_params_new(); params->owner = ldns_rdf_clone(key_id->params->owner); params->algorithm = key_id->algorithm; params->flags = key_id->flags; params->inception = inception; params->expiration = expiration; params->keytag = key_id->params->keytag; ods_log_deeebug("[%s] sign RRset[%i] with key %s tag %u", hsm_str, ldns_rr_get_type(ldns_rr_list_rr(rrset, 0)), key_id->locator?key_id->locator:"(null)", params->keytag); result = hsm_sign_rrset(ctx, rrset, key_id->hsmkey, params); hsm_sign_params_free(params); if (!result) { error = hsm_get_error(ctx); if (error) { ods_log_error("[%s] %s", hsm_str, error); free((void*)error); } ods_log_crit("[%s] error signing rrset with libhsm", hsm_str); } return result; } opendnssec-1.4.9/signer/src/shared/file.c0000644000175000017500000003377412650165732015243 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * File access. */ #include "config.h" #include "shared/file.h" #include "shared/log.h" #include #include #include #include #include #include #include #include #include #define BUFFER_SIZE (16 * 1024) /* use 16K buffers */ static const char* file_str = "file"; static unsigned int file_count = 0; /** * Convert file mode to readable string. * */ const char* ods_file_mode2str(const char* mode) { if (!mode) { return "no mode"; } if (ods_strcmp(mode, "a") == 0) { return "appending"; } else if (ods_strcmp(mode, "r") == 0) { return "reading"; } else if (ods_strcmp(mode, "w") == 0) { return "writing"; } return "unknown mode"; } /** * Get next char. * */ int ods_fgetc(FILE* fd, unsigned int* line_nr) { int c; ods_log_assert(fd); ods_log_assert(line_nr); c = fgetc(fd); if (c == '\n') { (*line_nr)++; } if (c == EOF && errno != 0) { ods_log_crit("[%s] fgetc() failed, enough memory? (%s)", file_str, strerror(errno)); } return c; } /** * Skip white space. * */ int ods_skip_whitespace(FILE* fd, unsigned int* line_nr) { int c; ods_log_assert(fd); ods_log_assert(line_nr); while ((c=ods_fgetc(fd, line_nr)) != EOF) { if (c == ' ' || c == '\t' || c == '\r') { continue; } return c; } return EOF; } /** * Construct file name. (StrAppend?, snprintf?) * */ char* ods_build_path(const char* file, const char* suffix, int dir, int no_slash) { size_t len_file = 0; size_t len_suffix = 0; size_t len_total = 0; char* openf = NULL; const char* f = "root"; if (file) { if (ods_strcmp(file, ".")) { f = file; } len_file = strlen(f); if (suffix) { len_suffix = strlen(suffix); } len_total = len_suffix + len_file; if (dir) { len_total++; } if (len_total > 0) { openf = (char*) malloc(sizeof(char)*(len_total + 1)); if (!openf) { ods_log_crit("[%s] build path failed: malloc failed", file_str); return NULL; } strncpy(openf, f, len_file); openf[len_file] = '\0'; if (no_slash) { size_t i = 0; for (i=0; i 0) { openf = (char*) malloc(sizeof(char)*(len_total + 1)); if (!openf) { ods_log_error("[%s] unable to open file %s%s%s for %s: malloc() " "failed", file_str, (dir?dir:""), (dir?"/":""), (file?file:"(null)"), ods_file_mode2str(mode)); return NULL; } if (dir) { strncpy(openf, dir, len_dir); openf[len_dir] = '\0'; if (file) { strncat(openf, file, len_file); } } else if (file) { strncpy(openf, file, len_file); } openf[len_total] = '\0'; if (len_file) { fd = fopen(openf, mode); if (!fd) { ods_log_debug("[%s] unable to open file %s for %s: %s", file_str, openf, ods_file_mode2str(mode), strerror(errno)); } else { file_count++; ods_log_debug("[%s] openfile %s count %u", file_str, openf, file_count); } } free((void*) openf); } return fd; } /** * Close a file. * */ void ods_fclose(FILE* fd) { if (fd) { file_count--; fclose(fd); } return; } /** * Write to file descriptor. * */ ssize_t ods_writen(int fd, const void* vptr, size_t n) { size_t nleft; ssize_t nwritten; const char* ptr; ptr = vptr; nleft = n; while (nleft > 0) { if ((nwritten = write(fd, ptr, nleft)) <= 0) { if (nwritten < 0 && errno == EINTR) { nwritten = 0; /* and call write again */ } else { return -1; /* error */ } } nleft -= nwritten; ptr += nwritten; } return n; } /** * Get file last modified. * */ time_t ods_file_lastmodified(const char* file) { int ret; struct stat buf; FILE* fd; ods_log_assert(file); if ((fd = ods_fopen(file, NULL, "r")) != NULL) { ret = stat(file, &buf); if (ret == -1) { ods_log_warning("[%s] unable to stat file %s: %s", file_str, file, strerror(errno)); } ods_fclose(fd); return buf.st_mtime; } else { ods_log_debug("[%s] unable to stat file %s: ods_fopen() failed", file_str, file); } return 0; } /** * Compare strings. * */ int ods_strcmp(const char* s1, const char* s2) { if (!s1 && !s2) { return 0; } else if (!s1) { return -1; } else if (!s2) { return 1; } else if (strlen(s1) != strlen(s2)) { if (strncmp(s1, s2, strlen(s1)) == 0) { return strlen(s1) - strlen(s2); } } return strncmp(s1, s2, strlen(s1)); } /** * Compare a string lowercased * */ int ods_strlowercmp(const char* str1, const char* str2) { while (str1 && str2 && *str1 != '\0' && *str2 != '\0') { if (tolower((int)*str1) != tolower((int)*str2)) { if (tolower((int)*str1) < tolower((int)*str2)) { return -1; } return 1; } str1++; str2++; } if (str1 && str2) { if (*str1 == *str2) { return 0; } else if (*str1 == '\0') { return -1; } } else if (!str1 && !str2) { return 0; } else if (!str1 && str2) { return -1; } return 1; } /** * Replace a substring in string. * */ const char* ods_replace(const char *str, const char *oldstr, const char *newstr) { char* buffer = NULL; char* ch = NULL; size_t part1_len = 0; size_t part2_len = 0; size_t part3_len = 0; if (!str) { return NULL; } if (!oldstr || !newstr) { return str; } if (!(ch = strstr(str, oldstr))) { buffer = strdup(str); return buffer; } part1_len = ch-str; part2_len = strlen(newstr); part3_len = strlen(ch+strlen(oldstr)); buffer = calloc(part1_len+part2_len+part3_len+1, sizeof(char)); if (!buffer) { return NULL; } if (part1_len) { strncpy(buffer, str, part1_len); buffer[part1_len] = '\0'; if (part2_len) { strncat(buffer, str, part2_len); buffer[part1_len+part2_len] = '\0'; } } else { strncpy(buffer, newstr, part2_len); buffer[part2_len] = '\0'; } if (part3_len) { strncat(buffer, ch+strlen(oldstr), part3_len); buffer[part1_len+part2_len+part3_len] = '\0'; } buffer[ch-str] = '\0'; snprintf(buffer+(ch-str), SYSTEM_MAXLEN, "%s%s", newstr, ch+strlen(oldstr)); return buffer; } /** * File copy. * */ ods_status ods_file_copy(const char* file1, const char* file2, long startpos, int append) { char buf[BUFFER_SIZE]; int fin = 0; int fout = 0; int read_size = 0; if (!file1 || !file2) { return ODS_STATUS_ASSERT_ERR; } if ((fin = open(file1, O_RDONLY|O_NONBLOCK)) < 0) { return ODS_STATUS_FOPEN_ERR; } if (append) { fout = open(file2, O_WRONLY|O_APPEND|O_CREAT, 0666); } else { fout = open(file2, O_WRONLY|O_TRUNC|O_CREAT, 0666); } if (fout < 0) { close(fin); return ODS_STATUS_FOPEN_ERR; } ods_log_debug("[%s] lseek file %s pos %ld", file_str, file1, startpos); if (lseek(fin, startpos, SEEK_SET) < 0) { close(fin); close(fout); return ODS_STATUS_FSEEK_ERR; } while (1) { read_size = read(fin, buf, sizeof(buf)); if (read_size == 0) { break; } if (read_size < 0) { ods_log_error("[%s] read file %s error %s", file_str, file1, strerror(errno)); close(fin); close(fout); return ODS_STATUS_FREAD_ERR; } if (write(fout, buf, (unsigned int) read_size) < 0) { ods_log_error("[%s] write file %s error %s", file_str, file1, strerror(errno)); close(fin); close(fout); return ODS_STATUS_FWRITE_ERR; } } close(fin); close(fout); return ODS_STATUS_OK; } /** * Get directory part of filename. * */ char* ods_dir_name(const char* file) { int l = strlen(file); char* dir = NULL; ods_log_assert(file); /* find seperator */ while (l>0 && strncmp(file + (l-1), "/", 1) != 0) { l--; } /* now strip off (multiple seperators) */ while (l>0 && strncmp(file + (l-1), "/", 1) == 0) { l--; } if (l) { dir = (char*) calloc(l+1, sizeof(char)); if (dir) { dir = strncpy(dir, file, l); } return dir; } return NULL; } /** * (Create) and change ownership of directories * */ void ods_chown(const char* file, uid_t uid, gid_t gid, int getdir) { char* dir = NULL; if (!file) { ods_log_warning("[%s] no filename given for chown()", file_str); return; } if (!getdir) { ods_log_debug("[%s] create and chown %s with user=%ld group=%ld", file_str, file, (signed long) uid, (signed long) gid); if (chown(file, uid, gid) != 0) { ods_log_error("[%s] chown() %s failed: %s", file_str, file, strerror(errno)); } } else if ((dir = ods_dir_name(file)) != NULL) { ods_log_debug("[%s] create and chown %s with user=%ld group=%ld", file_str, dir, (signed long) uid, (signed long) gid); if (chown(dir, uid, gid) != 0) { ods_log_error("[%s] chown() %s failed: %s", file_str, dir, strerror(errno)); } free((void*) dir); } else { ods_log_warning("[%s] use of relative path: %s", file_str, file); } return; } /** * Remove leading and trailing whitespace. * */ void ods_str_trim(char* str) { int i = strlen(str), nl = 0; /* trailing */ while (i>0) { --i; if (str[i] == '\n') { nl = 1; } if (str[i] == ' ' || str[i] == '\t' || str[i] == '\n') { str[i] = '\0'; } else { break; } } if (nl) { str[++i] = '\n'; } /* leading */ i = 0; while (str[i] == ' ' || str[i] == '\t') { i++; } while (*(str+i) != '\0') { *str = *(str+i); str++; } *str = '\0'; return; } /** * Add a string to a list of strings. Taken from ods-enforcer. * */ void ods_str_list_add(char*** list, char* str) { char** old = NULL; size_t count = 0; if (*list) { for (count=0; (*list)[count]; ++count) { ; } old = *list; *list = (char**) calloc(sizeof(char*), count+2); if (!*list) { ods_fatal_exit("[%s] fatal ods_str_list_add(): calloc() failed", file_str); } if (old) { memcpy(*list, old, count * sizeof(char*)); } free(old); (*list)[count] = str; (*list)[count+1] = NULL; } else { /** List is NULL, allocate new */ *list = calloc(sizeof(char*), 2); if (!*list) { ods_fatal_exit("[%s] fatal ods_str_list_add(): calloc() failed", file_str); } (*list)[0] = str; } return; } opendnssec-1.4.9/signer/src/shared/duration.h0000644000175000017500000000735012650165732016145 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * Durations. */ #ifndef UTIL_DURATION_H #define UTIL_DURATION_H #include "config.h" #include "shared/allocator.h" #include #include /** * Duration. * */ typedef struct duration_struct duration_type; struct duration_struct { allocator_type* allocator; time_t years; time_t months; time_t weeks; time_t days; time_t hours; time_t minutes; time_t seconds; }; /** * Create a new 'instant' duration. * \return duration_type* created duration * */ duration_type* duration_create(void); /** * Compare durations. * \param[in] d1 one duration * \param[in] d2 another duration * \return int 0 if equal, -1 if d1 < d2, 1 if d2 < d1 * */ int duration_compare(duration_type* d1, duration_type* d2); /** * Create a duration from string. * \param[in] str string-format duration * \return duration_type* created duration * */ duration_type* duration_create_from_string(const char* str); /** * Convert a duration to a string. * \param[in] duration duration to be converted * \return char* string-format duration * */ char* duration2string(duration_type* duration); /** * Convert a duration to a time. * \param[in] duration duration to be converted * \return time_t time-format duration * */ time_t duration2time(duration_type* duration); /** * Return a random time. * \param[in] mod modulo * \return time_t random time * */ time_t ods_rand(time_t mod); /** * Return the shortest time. * \param[in] a one time * \param[in] b another time * \return time_t the shortest time * */ time_t time_minimum(time_t a, time_t b); /** * Return the longest time. * \param[in] a one time * \param[in] b another time * \return time_t the shortest time * */ time_t time_maximum(time_t a, time_t b); /** * Convert time into string. * \param[in] n time * \param[in] s string * */ void time_itoa(time_t n, char* s); /** * Return time in datestamp. * \param[in] tt time * \param[in] format stamp format * \param[out] str store string * \return uint32_t integer based datestamp. * */ uint32_t time_datestamp(time_t tt, const char* format, char** str); /** * Return the time since Epoch, measured in seconds. * If the timeshift is enabled, return the environment variable. * \return time_t now (or timeshift). * */ time_t time_now(void); /** * Clean up duration. * \param[in] duration duration to be cleaned up * */ void duration_cleanup(duration_type* duration); #endif /* UTIL_DURATION_H */ opendnssec-1.4.9/signer/src/shared/status.h0000644000175000017500000000635512650165732015647 00000000000000/* * Copyright (c) 2010-2011 NLNet Labs. 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 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. * */ /** * * Status. */ #ifndef UTIL_STATUS_H #define UTIL_STATUS_H #include "config.h" enum ods_enum_status { ODS_STATUS_OK, ODS_STATUS_EOF, ODS_STATUS_NOTIMPL, ODS_STATUS_UPTODATE, ODS_STATUS_ASSERT_ERR, ODS_STATUS_CFG_ERR, ODS_STATUS_CHDIR_ERR, ODS_STATUS_CHROOT_ERR, ODS_STATUS_CMDHANDLER_ERR, ODS_STATUS_XFRHANDLER_ERR, ODS_STATUS_CONFLICT_ERR, ODS_STATUS_ERR, ODS_STATUS_FOPEN_ERR, ODS_STATUS_FSEEK_ERR, ODS_STATUS_FORK_ERR, ODS_STATUS_FREAD_ERR, ODS_STATUS_FWRITE_ERR, ODS_STATUS_HSM_ERR, ODS_STATUS_INSECURE, ODS_STATUS_MALLOC_ERR, ODS_STATUS_RENAME_ERR, ODS_STATUS_UNLINK_ERR, ODS_STATUS_SOCK_BIND, ODS_STATUS_SOCK_FCNTL_NONBLOCK, ODS_STATUS_SOCK_GETADDRINFO, ODS_STATUS_SOCK_LISTEN, ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY, ODS_STATUS_SOCK_SOCKET_UDP, ODS_STATUS_SOCK_SOCKET_TCP, ODS_STATUS_ACL_SUBNET_BAD_RANGE, ODS_STATUS_ACL_SUBNET_OUT_RANGE, ODS_STATUS_PARSE_ERR, ODS_STATUS_PRIVDROP_ERR, ODS_STATUS_RNG_ERR, ODS_STATUS_SETSID_ERR, ODS_STATUS_UNCHANGED, ODS_STATUS_WRITE_PIDFILE_ERR, ODS_STATUS_XML_ERR, ODS_STATUS_XFR_NOT_READY, ODS_STATUS_SKIPDNAME, ODS_STATUS_BUFAVAIL, ODS_STATUS_PARSESOA, ODS_STATUS_REQAXFR, ODS_STATUS_INSERIAL, ODS_STATUS_XFRBADFORM, ODS_STATUS_XFRINCOMPLETE }; typedef enum ods_enum_status ods_status; typedef struct ods_struct_lookup_table ods_lookup_table; struct ods_struct_lookup_table { int id; const char* name; }; extern ods_lookup_table ods_status_str[]; /** * Look up item in table. * \param[in] table table * \param[in] id identifier * */ ods_lookup_table* ods_lookup_by_id(ods_lookup_table *table, int id); /** * Look up a descriptive text by each status. * \param[in] status status identifierr * \return const char* corresponding descriptive text * */ const char *ods_status2str(ods_status status); #endif /* UTIL_STATUS_H */ opendnssec-1.4.9/signer/src/shared/locks.c0000644000175000017500000001262412650165732015426 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Threading and locking. * */ #include "config.h" #include "shared/locks.h" #include "shared/log.h" #include #include /* sigfillset(), sigprocmask() */ #include /* strerror() */ #ifdef HAVE_SYS_TIME_H #include /* gettimeofday() */ #endif #ifdef HAVE_TIME_H #include /* gettimeofday() */ #endif static const char* lock_str = "lock"; #if !defined(HAVE_PTHREAD) #include /* waitpid() */ #include /* getpid(), waitpid() */ #include /* fork(), getpid() */ /** * No threading available: fork a new process. * This means no shared data structure, and no locking. * Only the main thread ever returns. Exits on errors. * @param thr: the location where to store the thread-id. * @param func: function body of the thread. Return value of func is lost. * @param arg: user argument to func. */ void ods_thr_fork_create(ods_thread_type* thr, void* (*func)(void*), void* arg) { pid_t pid = fork(); switch (pid) { case 0: /* child */ *thr = (ods_thread_type)getpid(); (void)(*func)(arg); exit(0); case -1: /* error */ ods_fatal_exit("[%s] unable to fork thread: %s", lock_str, strerror(errno)); default: /* main */ *thr = (ods_thread_type)pid; return; } return; } /** * There is no threading. Wait for a process to terminate. * Note that ub_thread_t is defined as pid_t. * @param thread: the process id to wait for. */ void ods_thr_fork_wait(ods_thread_type thread) { int status = 0; if (waitpid((pid_t)thread, &status, 0) == -1) { ods_log_error("[%s] waitpid(%d): %s", lock_str, (int)thread, strerror(errno)); } if (status != 0) { ods_log_warning("[%s] process %d abnormal exit with status %d", lock_str, (int)thread, status); } return; } #else /* defined(HAVE_PTHREAD) */ int ods_thread_create(pthread_t *thr, void *(*func)(void *), void *arg) { int ret, attr_set; pthread_attr_t attr; size_t stacksize; attr_set = ( !pthread_attr_init(&attr) && !pthread_attr_getstacksize(&attr, &stacksize) && stacksize < ODS_MINIMUM_STACKSIZE && !pthread_attr_setstacksize(&attr, ODS_MINIMUM_STACKSIZE) ); ret = pthread_create(thr, attr_set?&attr:NULL, func, arg); if (attr_set) (void) pthread_attr_destroy(&attr); if ( ret != 0) { ods_log_error("%s at %d could not pthread_create(thr, &attr, func, arg): %s", __FILE__, __LINE__, strerror(ret)); } return ret; } int ods_thread_wait(cond_basic_type* cond, lock_basic_type* lock, time_t wait) { struct timespec ts; int ret = 0; /* If timeshift is enabled, we don't care about threads. No need * to take the timeshift into account here */ #ifndef HAVE_CLOCK_GETTIME struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { ods_log_error("[%s] clock_gettime() error: %s", lock_str, strerror(errno)); return 1; } ts.tv_sec = tv.tv_sec; ts.tv_nsec = (tv.tv_usec/1000); #else /* HAVE_CLOCK_GETTIME */ if (clock_gettime(CLOCK_REALTIME, &ts) < 0) { ods_log_error("[%s] clock_gettime() error: %s", lock_str, strerror(errno)); return 1; } #endif /* !HAVE_CLOCK_GETTIME */ if (wait > 0) { ts.tv_sec = ts.tv_sec + wait; ret = pthread_cond_timedwait(cond, lock, &ts); } else { ret = pthread_cond_wait(cond, lock); } if (ret == ETIMEDOUT) { return 0; } return ret; } #endif /* defined(HAVE_PTHREAD) */ void ods_thread_blocksigs(void) { #ifdef HAVE_PTHREAD int err = 0; #endif sigset_t sigset; sigfillset(&sigset); #ifdef HAVE_PTHREAD if((err=pthread_sigmask(SIG_SETMASK, &sigset, NULL))) ods_fatal_exit("[%s] pthread_sigmask: %s", lock_str, strerror(err)); #else /* !HAVE_PTHREAD */ /* have nothing, do single process signal mask */ if(sigprocmask(SIG_SETMASK, &sigset, NULL) != 0) ods_fatal_exit("[%s] sigprocmask: %s", lock_str, strerror(errno)); #endif /* HAVE_PTHREAD */ } opendnssec-1.4.9/signer/src/shared/log.h0000644000175000017500000001006012650165732015071 00000000000000/* * Copyright (c) 2009 NLnet Labs. 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 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. * */ /** * Log wrapper. * */ #ifndef SHARED_LOG_H #define SHARED_LOG_H #include "config.h" #include #include #ifdef HAVE_SYSLOG_H #include /* strncasecmp() */ #include /* openlog(), closelog(), syslog() */ #else /* !HAVE_SYSLOG_H */ #define LOG_EMERG 0 /* ods_fatal_exit */ #define LOG_ALERT 1 /* ods_log_alert */ #define LOG_CRIT 2 /* ods_log_crit */ #define LOG_ERR 3 /* ods_log_error */ #define LOG_WARNING 4 /* ods_log_warning */ #define LOG_NOTICE 5 /* ods_log_info */ #define LOG_INFO 6 /* ods_log_verbose */ #define LOG_DEBUG 7 /* ods_log_debug */ #endif /* HAVE_SYSLOG_H */ #define LOG_DEEEBUG 8 /* ods_log_deeebug */ /** * Initialize logging. * \param[in] filename logfile, stderr if NULL. * \param[in] use_syslog: use syslog(3) and ingore filename * \param[in] verbosity: log level * */ void ods_log_init(const char *filename, int use_syslog, int verbosity); /** * Close logging. * */ void ods_log_close(void); /** * Get the facility by string. * \param[in] facility string based facility * \return int facility * */ int ods_log_get_facility(const char* facility); /** * Get the log level. * \return int log_level * */ int ods_log_get_level(); /** * Heavy debug loggin. * \param[in] format printf-style format string, arguments follow * */ void ods_log_deeebug(const char *format, ...); /** * Log debug. * \param[in] format printf-style format string, arguments follow * */ void ods_log_debug(const char *format, ...); /** * Log verbose. * \param[in] format printf-style format string, arguments follow * */ void ods_log_verbose(const char *format, ...); /** * Log informational messages. * \param[in] format printf-style format string, arguments follow * */ void ods_log_info(const char *format, ...); /** * Log warnings. * \param[in] format printf-style format string, arguments follow * */ void ods_log_warning(const char *format, ...); /** * Log errors. * \param[in] format printf-style format string, arguments follow * */ void ods_log_error(const char *format, ...); /** * Log criticals. * \param[in] format printf-style format string, arguments follow * */ void ods_log_crit(const char *format, ...); /** * Log alerts. * \param[in] format printf-style format string, arguments follow * */ void ods_log_alert(const char *format, ...); /** * Log critical errors and exit. * \param[in] format printf-style format string, arguments follow * */ void ods_fatal_exit(const char *format, ...); /** * Log assertion. * */ #define ODS_LOG_DEBUG 1 #ifdef ODS_LOG_DEBUG #define ods_log_assert(x) \ do { if(!(x)) \ ods_fatal_exit("%s:%d: %s: assertion %s failed", \ __FILE__, __LINE__, __func__, #x); \ } while(0); #else #define ods_log_assert(x) #endif #endif /* SHARED_LOG_H */ opendnssec-1.4.9/signer/src/shared/file.h0000644000175000017500000001142312650165732015233 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * File access wrapper. */ #ifndef SHARED_FILE_H #define SHARED_FILE_H #include "config.h" #include "shared/status.h" #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #define SYSTEM_MAXLEN 1024 /** * Convert file mode to readable string. * \param[in] mode file mode * \return const char* string * */ const char* ods_file_mode2str(const char* mode); /** * Get next character. * \param[in] fd file descriptor * \param[in] line_nr line number * \return int next character. * */ int ods_fgetc(FILE* fd, unsigned int* line_nr); /** * Skip white space. * \param[in] fd file descriptor * \param[in] line_nr line number * \return int first encountered non-whitespace character * */ int ods_skip_whitespace(FILE* fd, unsigned int* line_nr); /** * Construct file or directory name. * \param[in] file filename without extension * \param[in] suffix extension. * \param[in] dir directory or not * \param[in] no_slash no forward slashes and such characters allowed * \return char* concatenation of file and suffix * */ char* ods_build_path(const char* file, const char* suffix, int dir, int no_slash); /** * Open a file. * \param[in] file filename. * \param[in] dir directory. * \param[in] mode file mode * \return FILE* file descriptor * */ FILE* ods_fopen(const char* file, const char* dir, const char* mode); /** * Close a file. * \param[in] fd the file descriptor * */ void ods_fclose(FILE* fd); /** * Write to file descriptor. * \param[in] fd file descriptor * \param[in] vptr pointer to data * \param[in] n size of data * */ ssize_t ods_writen(int fd, const void* vptr, size_t n); /** * Get file status. * \param[in] file file name * \return time_t last modified * */ time_t ods_file_lastmodified(const char* file); /** * Compare strings. * \param[in] s1 one string * \param[in] s2 another string * \return <0, 0 or >0 * */ int ods_strcmp(const char* s1, const char* s2); /** * Compare strings lowercased. * \param[in] s1 one string * \param[in] s2 another string * \return -1, 0 or 1 * */ int ods_strlowercmp(const char* s1, const char* s2); /** * Replace a substring in string. * \param[in] str The string * \param[in] oldstr old substring * \param[in] newstr new substring * \return char* the substituted string. * */ const char* ods_replace(const char *str, const char *oldstr, const char *newstr); /** * Get directory part of filename. * \param[in] file file name * \return char* directory part * */ char* ods_dir_name(const char* file); /** * Copy file. * \param[in] file1 from file name * \param[in] file2 to file name * \param[in] startpos starting file position in file1 * \param[in] append whether to append or do a regular copy * \return ods_status * */ ods_status ods_file_copy(const char* file1, const char* file2, long startpos, int append); /** * (Create) and change ownership of directories. * \param[in] file file name * \param[in] uid user id * \param[in] gid group id * \param[in] getdir fetch directory part * */ void ods_chown(const char* file, uid_t uid, gid_t gid, int getdir); /** * Remove leading and trailing whitespace. * \param[in] str string to trim * */ void ods_str_trim(char* str); /** * Add a string to a list of strings. Taken from ods-enforcer. * \param[out] list string list * \param[in] str string to add * */ void ods_str_list_add(char*** list, char* str); #endif /* SHARED_FILE_H */ opendnssec-1.4.9/signer/src/shared/duration.c0000644000175000017500000003366112650165732016144 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * Durations. */ #include "shared/allocator.h" #include "shared/duration.h" #include "shared/log.h" #include #include #include #include static const char* duration_str = "duration"; /** * Create a new 'instant' duration. * */ duration_type* duration_create(void) { duration_type* duration; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] cannot create: no allocator available", duration_str); return NULL; } duration = (duration_type*) allocator_alloc(allocator, sizeof(duration_type)); if (!duration) { ods_log_error("[%s] cannot create: allocator failed", duration_str); allocator_cleanup(allocator); return NULL; } duration->allocator = allocator; duration->years = 0; duration->months = 0; duration->weeks = 0; duration->days = 0; duration->hours = 0; duration->minutes = 0; duration->seconds = 0; return duration; } /** * Compare durations. * */ int duration_compare(duration_type* d1, duration_type* d2) { if (!d1 && !d2) { return 0; } if (!d1 || !d2) { return d1?-1:1; } if (d1->years != d2->years) { return d1->years - d2->years; } if (d1->months != d2->months) { return d1->months - d2->months; } if (d1->weeks != d2->weeks) { return d1->weeks - d2->weeks; } if (d1->days != d2->days) { return d1->days - d2->days; } if (d1->hours != d2->hours) { return d1->hours - d2->hours; } if (d1->minutes != d2->minutes) { return d1->minutes - d2->minutes; } if (d1->seconds != d2->seconds) { return d1->seconds - d2->seconds; } return 0; } /** * Create a duration from string. * */ duration_type* duration_create_from_string(const char* str) { duration_type* duration = duration_create(); char* P, *X, *T, *W; int not_weeks = 0; if (!duration) { ods_log_error("[%s] cannot create from string %s: create failed", duration_str, str); return NULL; } if (!str) { return duration; } P = strchr(str, 'P'); if (!P) { ods_log_error("[%s] cannot create from string %s: P not found", duration_str, str); duration_cleanup(duration); return NULL; } T = strchr(str, 'T'); X = strchr(str, 'Y'); if (X) { duration->years = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'M'); if (X && (!T || (size_t) (X-P) < (size_t) (T-P))) { duration->months = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'D'); if (X) { duration->days = atoi(str+1); str = X; not_weeks = 1; } if (T) { str = T; not_weeks = 1; } X = strchr(str, 'H'); if (X && T) { duration->hours = atoi(str+1); str = X; not_weeks = 1; } X = strrchr(str, 'M'); if (X && T && (size_t) (X-P) > (size_t) (T-P)) { duration->minutes = atoi(str+1); str = X; not_weeks = 1; } X = strchr(str, 'S'); if (X && T) { duration->seconds = atoi(str+1); str = X; not_weeks = 1; } W = strchr(str, 'W'); if (W) { if (not_weeks) { ods_log_error("[%s] cannot create from string: parse error", duration_str, P); duration_cleanup(duration); return NULL; } else { duration->weeks = atoi(str+1); str = W; } } return duration; } /** * Get the number of digits in a number. * */ static size_t digits_in_number(time_t duration) { uint32_t period = (uint32_t) duration; size_t count = 0; if (!period) { return 1; } while (period > 0) { count++; period /= 10; } return count; } /** * Convert a duration to a string. * */ char* duration2string(duration_type* duration) { char* str = NULL, *num = NULL; size_t count = 2; int T = 0, D = 0; if (!duration) { return NULL; } if (duration->years > 0) { count = count + 1 + digits_in_number(duration->years); D = 1; } if (duration->months > 0) { count = count + 1 + digits_in_number(duration->months); D = 1; } if (duration->weeks > 0) { count = count + 1 + digits_in_number(duration->weeks); D = 1; } if (duration->days > 0) { count = count + 1 + digits_in_number(duration->days); D = 1; } if (duration->hours > 0) { count = count + 1 + digits_in_number(duration->hours); T = 1; } if (duration->minutes > 0) { count = count + 1 + digits_in_number(duration->minutes); T = 1; } if (duration->seconds > 0 || (!D && !duration->hours && !duration->minutes)) { count = count + 1 + digits_in_number(duration->seconds); T = 1; } if (T) { count++; } str = (char*) calloc(count, sizeof(char)); str[0] = 'P'; str[1] = '\0'; if (duration->years > 0) { count = digits_in_number(duration->years); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uY", (uint32_t) duration->years); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->months > 0) { count = digits_in_number(duration->months); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uM", (uint32_t) duration->months); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->weeks > 0) { count = digits_in_number(duration->weeks); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uW", (uint32_t) duration->weeks); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->days > 0) { count = digits_in_number(duration->days); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uD", (uint32_t) duration->days); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (T) { str = strncat(str, "T", 1); } if (duration->hours > 0) { count = digits_in_number(duration->hours); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uH", (uint32_t) duration->hours); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->minutes > 0) { count = digits_in_number(duration->minutes); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uM", (uint32_t) duration->minutes); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } if (duration->seconds > 0 || (!D && !duration->hours && !duration->minutes)) { count = digits_in_number(duration->seconds); num = (char*) calloc(count+2, sizeof(char)); if (num) { snprintf(num, count+2, "%uS", (uint32_t) duration->seconds); str = strncat(str, num, count+2); free((void*) num); } else { goto duration2string_num_calloc_failed; } } return str; duration2string_num_calloc_failed: ods_log_error("[%s] cannot create string: malloc error", duration_str); free((void*) str); return NULL; } /** * Convert a duration to a time. * */ time_t duration2time(duration_type* duration) { time_t period = 0; char* dstr = NULL; if (duration) { period += (duration->seconds); period += (duration->minutes)*60; period += (duration->hours)*3600; period += (duration->days)*86400; period += (duration->weeks)*86400*7; period += (duration->months)*86400*31; period += (duration->years)*86400*365; if (duration->months || duration->years) { /* [TODO] calculate correct number of days in this month/year */ dstr = duration2string(duration); ods_log_warning("[%s] converting duration %s to approximate value", duration_str, dstr?dstr:"(null)"); free((void*) dstr); } } return period; } /** * Return the shortest time. * */ time_t time_minimum(time_t a, time_t b) { return (a < b ? a : b); } /** * Return the longest time. * */ time_t time_maximum(time_t a, time_t b) { return (a > b ? a : b); } /** * Return a random time. * */ time_t ods_rand(time_t mod) { #ifdef HAVE_ARC4RANDOM_UNIFORM return (time_t) (arc4random_uniform((uint32_t) mod+1)); #elif HAVE_ARC4RANDOM return (time_t) (arc4random() % (unsigned) mod+1); #else return (time_t) (random() % (unsigned) mod+1); #endif } #ifdef ENFORCER_TIMESHIFT /* Number of days per month (except for February in leap years). */ static const int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static int is_leap_year(int year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } static int leap_days(int y1, int y2) { --y1; --y2; return (y2/4 - y1/4) - (y2/100 - y1/100) + (y2/400 - y1/400); } /* * Code taken from NSD 3.2.5, which is * code adapted from Python 2.4.1 sources (Lib/calendar.py). */ static time_t mktime_from_utc(const struct tm *tm) { int year = 1900 + tm->tm_year; time_t days = 365 * ((time_t) (year - 1970)) + ((time_t) leap_days(1970, year)); time_t hours; time_t minutes; time_t seconds; int i; for (i = 0; i < tm->tm_mon; ++i) { days += mdays[i]; } if (tm->tm_mon > 1 && is_leap_year(year)) { ++days; } days += tm->tm_mday - 1; hours = days * 24 + tm->tm_hour; minutes = hours * 60 + tm->tm_min; seconds = minutes * 60 + tm->tm_sec; return seconds; } /** * Convert time in string format into seconds. * */ static time_t timeshift2time(const char *time) { /* convert a string in format YYMMDDHHMMSS to time_t */ struct tm tm; time_t timeshift = 0; /* Try to scan the time... */ if (strptime(time, "%Y%m%d%H%M%S", &tm)) { timeshift = mktime_from_utc(&tm); } return timeshift; } #endif /** * Return the time since Epoch, measured in seconds. * */ time_t time_now(void) { #ifdef ENFORCER_TIMESHIFT const char* env = getenv("ENFORCER_TIMESHIFT"); if (env) { return timeshift2time(env); } else #endif /* ENFORCER_TIMESHIFT */ return time(NULL); } /** * copycode: This code is based on the EXAMPLE in the strftime manual. * */ uint32_t time_datestamp(time_t tt, const char* format, char** str) { time_t t; struct tm *tmp; uint32_t ut = 0; char outstr[32]; if (tt) { t = tt; } else { t = time_now(); } tmp = localtime(&t); if (tmp == NULL) { ods_log_error("[%s] time_datestamp: localtime() failed", duration_str); return 0; } if (strftime(outstr, sizeof(outstr), format, tmp) == 0) { ods_log_error("[%s] time_datestamp: strftime() failed", duration_str); return 0; } ut = (uint32_t) strtoul(outstr, NULL, 10); if (str) { *str = strdup(outstr); } return ut; } static void time_itoa_reverse(char* s) { int i, j; char c; for (i = 0, j = strlen(s)-1; i 0); /* delete it */ s[i] = '\0'; time_itoa_reverse(s); return; } /** * Clean up duration. * */ void duration_cleanup(duration_type* duration) { allocator_type* allocator; if (!duration) { return; } allocator = duration->allocator; allocator_deallocate(allocator, (void*) duration); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/signer/0000755000175000017500000000000012650166152014240 500000000000000opendnssec-1.4.9/signer/src/signer/keys.c0000644000175000017500000002061712650165732015310 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signing keys. * */ #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/keys.h" #include "signer/signconf.h" static const char* key_str = "keys"; /** * Create a new key list. * */ keylist_type* keylist_create(void* sc) { signconf_type* signconf = (signconf_type*) sc; keylist_type* kl = NULL; if (!signconf || !signconf->allocator) { return NULL; } kl = (keylist_type*) allocator_alloc(signconf->allocator, sizeof(keylist_type)); if (!kl) { ods_log_error("[%s] create list failed: allocator_alloc() failed", key_str); return NULL; } kl->sc = sc; kl->count = 0; kl->keys = NULL; return kl; } /** * Lookup a key in the key list by locator. * */ key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator) { uint16_t i = 0; if (!kl || !locator || kl->count <= 0) { return NULL; } for (i=0; i < kl->count; i++) { if (&kl->keys[i] && kl->keys[i].locator) { if (ods_strcmp(kl->keys[i].locator, locator) == 0) { return &kl->keys[i]; } } } return NULL; } /** * Lookup a key in the key list by dnskey. * */ key_type* keylist_lookup_by_dnskey(keylist_type* kl, ldns_rr* dnskey) { uint16_t i = 0; if (!kl || !dnskey || kl->count <= 0) { return NULL; } for (i=0; i < kl->count; i++) { if (&kl->keys[i] && kl->keys[i].dnskey) { if (ldns_rr_compare(kl->keys[i].dnskey, dnskey) == 0) { return &kl->keys[i]; } } } return NULL; } /** * Push a key to the key list. * */ key_type* keylist_push(keylist_type* kl, const char* locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk, int rfc5011) { key_type* keys_old = NULL; signconf_type* sc = NULL; ods_log_assert(kl); ods_log_assert(locator); ods_log_debug("[%s] add locator %s", key_str, locator); sc = (signconf_type*) kl->sc; keys_old = kl->keys; kl->keys = (key_type*) allocator_alloc(sc->allocator, (kl->count + 1) * sizeof(key_type)); if (!kl->keys) { ods_fatal_exit("[%s] unable to add key: allocator_alloc() failed", key_str); } if (keys_old) { memcpy(kl->keys, keys_old, (kl->count) * sizeof(key_type)); } allocator_deallocate(sc->allocator, (void*) keys_old); kl->count++; kl->keys[kl->count -1].locator = locator; kl->keys[kl->count -1].algorithm = algorithm; kl->keys[kl->count -1].flags = flags; kl->keys[kl->count -1].publish = publish; kl->keys[kl->count -1].ksk = ksk; kl->keys[kl->count -1].zsk = zsk; kl->keys[kl->count -1].rfc5011 = rfc5011; kl->keys[kl->count -1].dnskey = NULL; kl->keys[kl->count -1].hsmkey = NULL; kl->keys[kl->count -1].params = NULL; return &kl->keys[kl->count -1]; } /** * Print key. * */ static void key_print(FILE* fd, key_type* key) { if (!fd || !key) { return; } fprintf(fd, "\t\t\t\n"); fprintf(fd, "\t\t\t\t%u\n", key->flags); fprintf(fd, "\t\t\t\t%u\n", key->algorithm); if (key->locator) { fprintf(fd, "\t\t\t\t%s\n", key->locator); } if (key->ksk) { fprintf(fd, "\t\t\t\t\n"); } if (key->zsk) { fprintf(fd, "\t\t\t\t\n"); } if (key->publish) { fprintf(fd, "\t\t\t\t\n"); } if (key->rfc5011) { fprintf(fd, "\t\t\t\t\n"); } fprintf(fd, "\t\t\t\n"); fprintf(fd, "\n"); return; } /** * Log key. * */ static void key_log(key_type* key, const char* name) { if (!key) { return; } ods_log_debug("[%s] zone %s key: LOCATOR[%s] FLAGS[%u] ALGORITHM[%u] " "KSK[%i] ZSK[%i] PUBLISH[%i] RFC5011[%i]", key_str, name?name:"(null)", key->locator, key->flags, key->algorithm, key->ksk, key->zsk, key->publish, key->rfc5011); return; } /** * Print key list. * */ void keylist_print(FILE* fd, keylist_type* kl) { uint16_t i = 0; if (!fd || !kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_print(fd, &kl->keys[i]); } return; } /** * Log key list. * */ void keylist_log(keylist_type* kl, const char* name) { uint16_t i = 0; if (!kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_log(&kl->keys[i], name); } return; } /** * Clean up key. * */ static void key_delfunc(key_type* key) { if (!key) { return; } /* ldns_rr_free(key->dnskey); */ hsm_key_free(key->hsmkey); hsm_sign_params_free(key->params); free((void*) key->locator); return; } /** * Clean up key list. * */ void keylist_cleanup(keylist_type* kl) { uint16_t i = 0; signconf_type* sc = NULL; if (!kl) { return; } for (i=0; i < kl->count; i++) { key_delfunc(&kl->keys[i]); } sc = (signconf_type*) kl->sc; allocator_deallocate(sc->allocator, (void*) kl->keys); allocator_deallocate(sc->allocator, (void*) kl); } /** * Backup key. * */ static void key_backup(FILE* fd, key_type* key, const char* version) { if (!fd || !key) { return; } fprintf(fd, ";;Key: locator %s algorithm %u flags %u publish %i ksk %i " "zsk %i rfc5011 %i\n", key->locator, (unsigned) key->algorithm, (unsigned) key->flags, key->publish, key->ksk, key->zsk, key->rfc5011); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { if (key->dnskey) { (void)util_rr_print(fd, key->dnskey); } fprintf(fd, ";;Keydone\n"); } return; } /** * Recover key from backup. * */ key_type* key_recover2(FILE* fd, keylist_type* kl) { const char* locator = NULL; uint8_t algorithm = 0; uint32_t flags = 0; int publish = 0; int ksk = 0; int zsk = 0; int rfc5011 = 0; ods_log_assert(fd); if (!backup_read_check_str(fd, "locator") || !backup_read_str(fd, &locator) || !backup_read_check_str(fd, "algorithm") || !backup_read_uint8_t(fd, &algorithm) || !backup_read_check_str(fd, "flags") || !backup_read_uint32_t(fd, &flags) || !backup_read_check_str(fd, "publish") || !backup_read_int(fd, &publish) || !backup_read_check_str(fd, "ksk") || !backup_read_int(fd, &ksk) || !backup_read_check_str(fd, "zsk") || !backup_read_int(fd, &zsk) || !backup_read_check_str(fd, "rfc5011") || !backup_read_int(fd, &rfc5011)) { if (locator) { free((void*)locator); locator = NULL; } return NULL; } /* key ok */ return keylist_push(kl, locator, algorithm, flags, publish, ksk, zsk, rfc5011); } /** * Backup key list. * */ void keylist_backup(FILE* fd, keylist_type* kl, const char* version) { uint16_t i = 0; if (!fd || !kl || kl->count <= 0) { return; } for (i=0; i < kl->count; i++) { key_backup(fd, &kl->keys[i], version); } return; } opendnssec-1.4.9/signer/src/signer/backup.h0000644000175000017500000001023512650165732015602 00000000000000/* * Copyright (c) 2006-2010 NLNet Labs. 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 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. * */ /** * Recover from backup. * */ #ifndef SIGNER_BACKUP_H #define SIGNER_BACKUP_H #include "config.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/status.h" #include /** * Read token from backup file. * \param[in] in input file descriptor * \return char* read token * */ char* backup_read_token(FILE* in); /** * Read and match a string from backup file. * \param[in] in input file descriptor * \param[in] str string to match * \return 1 if string was read and matched, 0 otherwise * */ int backup_read_check_str(FILE* in, const char* str); /** * Read a string from backup file. * \param[in] in input file descriptor * \param[out] string storage * \return int 1 on success, 0 otherwise * */ int backup_read_str(FILE* in, const char** str); /** * Read time from backup file. * \param[in] in input file descriptor * \param[out] v time_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_time_t(FILE* in, time_t* v); /** * Read duration from backup file. * \param[in] in input file descriptor * \param[out] v duration storage * \return int 1 on success, 0 otherwise * */ int backup_read_duration(FILE* in, duration_type** v); /** * Read rr type from backup file. * \param[in] in input file descriptor * \param[out] v rr type storage * \return int 1 on success, 0 otherwise * */ int backup_read_rr_type(FILE* in, ldns_rr_type* v); /** * Read integer from backup file. * \param[in] in input file descriptor * \param[out] v integer storage * \return int 1 on success, 0 otherwise * */ int backup_read_int(FILE* in, int* v); /** * Read size type from backup file. * \param[in] in input file descriptor * \param[out] v integer storage * \return int 1 on success, 0 otherwise * */ int backup_read_size_t(FILE* in, size_t* v); /** * Read 8bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint8_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint8_t(FILE* in, uint8_t* v); /** * Read 16bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint16_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint16_t(FILE* in, uint16_t* v); /** * Read 32bit unsigned integer from backup file. * \param[in] in input file descriptor * \param[out] v uint32_t storage * \return int 1 on success, 0 otherwise * */ int backup_read_uint32_t(FILE* in, uint32_t* v); /** * Read namedb from backup file. * \param[in] in input file descriptor * \param[in] zone zone reference * \return ods_status status * */ ods_status backup_read_namedb(FILE* in, void* zone); /** * Read ixfr journal from file. * \param[in] in input file descriptor * \param[in] zone zone reference * \return ods_status status * */ ods_status backup_read_ixfr(FILE* in, void* zone); #endif /* SIGNER_BACKUP_H */ opendnssec-1.4.9/signer/src/signer/zone.c0000644000175000017500000011027312650165732015306 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone. * */ #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/zone.h" #include "wire/netio.h" #include static const char* zone_str = "zone"; /** * Create a new zone. * */ zone_type* zone_create(char* name, ldns_rr_class klass) { allocator_type* allocator = NULL; zone_type* zone = NULL; if (!name || !klass) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create zone %s: allocator_create() " "failed", zone_str, name); return NULL; } zone = (zone_type*) allocator_alloc(allocator, sizeof(zone_type)); if (!zone) { ods_log_error("[%s] unable to create zone %s: allocator_alloc()", "failed", zone_str, name); allocator_cleanup(allocator); return NULL; } zone->allocator = allocator; /* [start] PS 9218653: Drop trailing dot in domain name */ if (strlen(name) > 1 && name[strlen(name)-1] == '.') { name[strlen(name)-1] = '\0'; } /* [end] PS 9218653 */ zone->name = allocator_strdup(allocator, name); if (!zone->name) { ods_log_error("[%s] unable to create zone %s: allocator_strdup() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->klass = klass; zone->default_ttl = 3600; /* TODO: configure --default-ttl option? */ zone->apex = ldns_dname_new_frm_str(name); /* check zone->apex? */ zone->notify_command = NULL; zone->notify_ns = NULL; zone->notify_args = NULL; zone->policy_name = NULL; zone->signconf_filename = NULL; zone->adinbound = NULL; zone->adoutbound = NULL; zone->zl_status = ZONE_ZL_OK; zone->task = NULL; zone->xfrd = NULL; zone->notify = NULL; zone->db = namedb_create((void*)zone); if (!zone->db) { ods_log_error("[%s] unable to create zone %s: namedb_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->ixfr = ixfr_create((void*)zone); if (!zone->ixfr) { ods_log_error("[%s] unable to create zone %s: ixfr_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->signconf = signconf_create(); if (!zone->signconf) { ods_log_error("[%s] unable to create zone %s: signconf_create() " "failed", zone_str, name); zone_cleanup(zone); return NULL; } zone->stats = stats_create(); lock_basic_init(&zone->zone_lock); lock_basic_init(&zone->xfr_lock); return zone; } /** * Load signer configuration for zone. * */ ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf) { ods_status status = ODS_STATUS_OK; signconf_type* signconf = NULL; char* datestamp = NULL; if (!zone || !zone->name || !zone->signconf) { return ODS_STATUS_ASSERT_ERR; } if (!zone->signconf_filename) { ods_log_warning("[%s] zone %s has no signconf filename, treat as " "insecure?", zone_str, zone->name); return ODS_STATUS_INSECURE; } status = signconf_update(&signconf, zone->signconf_filename, zone->signconf->last_modified); if (status == ODS_STATUS_OK) { if (!signconf) { /* this is unexpected */ ods_log_alert("[%s] unable to load signconf for zone %s: signconf " "status ok but no signconf stored", zone_str, zone->name); return ODS_STATUS_ASSERT_ERR; } (void)time_datestamp(signconf->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] zone %s signconf file %s is modified since %s", zone_str, zone->name, zone->signconf_filename, datestamp?datestamp:"Unknown"); free((void*)datestamp); *new_signconf = signconf; } else if (status == ODS_STATUS_UNCHANGED) { (void)time_datestamp(zone->signconf->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_verbose("[%s] zone %s signconf file %s is unchanged since " "%s", zone_str, zone->name, zone->signconf_filename, datestamp?datestamp:"Unknown"); free((void*)datestamp); } else { ods_log_error("[%s] unable to load signconf for zone %s: signconf %s " "%s", zone_str, zone->name, zone->signconf_filename, ods_status2str(status)); } return status; } /** * Reschedule task for zone. * */ ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq, task_id what) { task_type* task = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(taskq); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->task); ods_log_debug("[%s] reschedule task for zone %s", zone_str, zone->name); lock_basic_lock(&taskq->schedule_lock); task = unschedule_task(taskq, (task_type*) zone->task); if (task != NULL) { if (task->what != what) { task->halted = task->what; task->halted_when = task->when; task->interrupt = what; } /** Only reschedule if what to do is lower than what was scheduled. */ if (task->what > what) { task->what = what; } task->when = time_now(); status = schedule_task(taskq, task, 0); } else { /* task not queued, being worked on? */ ods_log_verbose("[%s] unable to reschedule task for zone %s now: " "task is not queued (task will be rescheduled when it is put " "back on the queue)", zone_str, zone->name); task = (task_type*) zone->task; task->interrupt = what; /* task->halted(_when) set by worker */ } lock_basic_unlock(&taskq->schedule_lock); zone->task = task; return status; } /** * Publish the keys as indicated by the signer configuration. * */ ods_status zone_publish_dnskeys(zone_type* zone) { hsm_ctx_t* ctx = NULL; uint32_t ttl = 0; uint16_t i = 0; ods_status status = ODS_STATUS_OK; rrset_type* rrset = NULL; rr_type* dnskey = NULL; if (!zone || !zone->db || !zone->signconf || !zone->signconf->keys) { return ODS_STATUS_ASSERT_ERR; } ods_log_assert(zone->name); /* hsm access */ ctx = hsm_create_context(); if (ctx == NULL) { ods_log_error("[%s] unable to publish keys for zone %s: " "error creating libhsm context", zone_str, zone->name); return ODS_STATUS_HSM_ERR; } /* dnskey ttl */ ttl = zone->default_ttl; if (zone->signconf->dnskey_ttl) { ttl = (uint32_t) duration2time(zone->signconf->dnskey_ttl); } /* publish keys */ for (i=0; i < zone->signconf->keys->count; i++) { if (!zone->signconf->keys->keys[i].publish) { continue; } if (!zone->signconf->keys->keys[i].dnskey) { /* get dnskey */ status = lhsm_get_key(ctx, zone->apex, &zone->signconf->keys->keys[i]); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish dnskeys for zone %s: " "error creating dnskey", zone_str, zone->name); break; } } ods_log_assert(zone->signconf->keys->keys[i].dnskey); ldns_rr_set_ttl(zone->signconf->keys->keys[i].dnskey, ttl); ldns_rr_set_class(zone->signconf->keys->keys[i].dnskey, zone->klass); status = zone_add_rr(zone, zone->signconf->keys->keys[i].dnskey, 0); if (status == ODS_STATUS_UNCHANGED) { /* rr already exists, adjust pointer */ rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_DNSKEY); ods_log_assert(rrset); dnskey = rrset_lookup_rr(rrset, zone->signconf->keys->keys[i].dnskey); ods_log_assert(dnskey); if (dnskey->rr != zone->signconf->keys->keys[i].dnskey) { ldns_rr_free(zone->signconf->keys->keys[i].dnskey); } zone->signconf->keys->keys[i].dnskey = dnskey->rr; status = ODS_STATUS_OK; } else if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish dnskeys for zone %s: " "error adding dnskey", zone_str, zone->name); break; } } /* done */ hsm_destroy_context(ctx); return status; } /** * Unlink DNSKEY RRs. * */ void zone_rollback_dnskeys(zone_type* zone) { uint16_t i = 0; rrset_type* rrset = NULL; rr_type* dnskey = NULL; if (!zone || !zone->signconf || !zone->signconf->keys) { return; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_DNSKEY); /* unlink dnskey rrs */ for (i=0; i < zone->signconf->keys->count; i++) { if (rrset && zone->signconf->keys->keys[i].dnskey) { dnskey = rrset_lookup_rr(rrset, zone->signconf->keys->keys[i].dnskey); if (dnskey && !dnskey->exists && dnskey->rr == zone->signconf->keys->keys[i].dnskey) { zone->signconf->keys->keys[i].dnskey = NULL; } } } /* done */ return; } /** * Publish the NSEC3 parameters as indicated by the signer configuration. * */ ods_status zone_publish_nsec3param(zone_type* zone) { rrset_type* rrset = NULL; rr_type* n3prr = NULL; ldns_rr* rr = NULL; ods_status status = ODS_STATUS_OK; if (!zone || !zone->name || !zone->db || !zone->signconf) { return ODS_STATUS_ASSERT_ERR; } if (!zone->signconf->nsec3params) { /* NSEC */ ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC); return ODS_STATUS_OK; } if (!zone->signconf->nsec3params->rr) { uint32_t paramttl = (uint32_t) duration2time(zone->signconf->nsec3param_ttl); rr = ldns_rr_new_frm_type(LDNS_RR_TYPE_NSEC3PARAMS); if (!rr) { ods_log_error("[%s] unable to publish nsec3params for zone %s: " "error creating rr (%s)", zone_str, zone->name, ods_status2str(status)); return ODS_STATUS_MALLOC_ERR; } ldns_rr_set_class(rr, zone->klass); ldns_rr_set_ttl(rr, paramttl); ldns_rr_set_owner(rr, ldns_rdf_clone(zone->apex)); ldns_nsec3_add_param_rdfs(rr, zone->signconf->nsec3params->algorithm, 0, zone->signconf->nsec3params->iterations, zone->signconf->nsec3params->salt_len, zone->signconf->nsec3params->salt_data); /** * Always set bit 7 of the flags to zero, * according to rfc5155 section 11 */ ldns_set_bit(ldns_rdf_data(ldns_rr_rdf(rr, 1)), 7, 0); zone->signconf->nsec3params->rr = rr; } ods_log_assert(zone->signconf->nsec3params->rr); status = zone_add_rr(zone, zone->signconf->nsec3params->rr, 0); if (status == ODS_STATUS_UNCHANGED) { /* rr already exists, adjust pointer */ rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_NSEC3PARAMS); ods_log_assert(rrset); n3prr = rrset_lookup_rr(rrset, zone->signconf->nsec3params->rr); ods_log_assert(n3prr); if (n3prr->rr != zone->signconf->nsec3params->rr) { ldns_rr_free(zone->signconf->nsec3params->rr); } zone->signconf->nsec3params->rr = n3prr->rr; status = ODS_STATUS_OK; } else if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to publish nsec3params for zone %s: " "error adding nsec3params (%s)", zone_str, zone->name, ods_status2str(status)); } return status; } /** * Unlink NSEC3PARAM RR. * */ void zone_rollback_nsec3param(zone_type* zone) { rrset_type* rrset = NULL; rr_type* n3prr = NULL; if (!zone || !zone->signconf || !zone->signconf->nsec3params) { return; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_NSEC3PARAMS); if (rrset && zone->signconf->nsec3params->rr) { n3prr = rrset_lookup_rr(rrset, zone->signconf->nsec3params->rr); if (n3prr && !n3prr->exists && n3prr->rr == zone->signconf->nsec3params->rr) { zone->signconf->nsec3params->rr = NULL; } } return; } /** * Prepare keys for signing. * */ ods_status zone_prepare_keys(zone_type* zone) { hsm_ctx_t* ctx = NULL; uint16_t i = 0; ods_status status = ODS_STATUS_OK; if (!zone || !zone->db || !zone->signconf || !zone->signconf->keys) { return ODS_STATUS_ASSERT_ERR; } ods_log_assert(zone->name); /* hsm access */ ctx = hsm_create_context(); if (ctx == NULL) { ods_log_error("[%s] unable to prepare signing keys for zone %s: " "error creating libhsm context", zone_str, zone->name); return ODS_STATUS_HSM_ERR; } /* prepare keys */ for (i=0; i < zone->signconf->keys->count; i++) { /* get dnskey */ status = lhsm_get_key(ctx, zone->apex, &zone->signconf->keys->keys[i]); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to prepare signing keys for zone %s: " "error getting dnskey", zone_str, zone->name); break; } ods_log_assert(zone->signconf->keys->keys[i].dnskey); ods_log_assert(zone->signconf->keys->keys[i].hsmkey); ods_log_assert(zone->signconf->keys->keys[i].params); } /* done */ hsm_destroy_context(ctx); return status; } /** * Update serial. * */ ods_status zone_update_serial(zone_type* zone) { ods_status status = ODS_STATUS_OK; rrset_type* rrset = NULL; rr_type* soa = NULL; ldns_rr* rr = NULL; ldns_rdf* soa_rdata = NULL; ods_log_assert(zone); ods_log_assert(zone->apex); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); if (zone->db->serial_updated) { /* already done, unmark and return ok */ ods_log_debug("[%s] zone %s soa serial already up to date", zone_str, zone->name); zone->db->serial_updated = 0; return ODS_STATUS_OK; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); if (!rrset || !rrset->rrs || !rrset->rrs[0].rr) { ods_log_error("[%s] unable to update zone %s soa serial: failed to " "find soa rrset", zone_str, zone->name); return ODS_STATUS_ERR; } ods_log_assert(rrset); ods_log_assert(rrset->rrs); ods_log_assert(rrset->rrs[0].rr); rr = ldns_rr_clone(rrset->rrs[0].rr); if (!rr) { ods_log_error("[%s] unable to update zone %s soa serial: failed to " "clone soa rr", zone_str, zone->name); return ODS_STATUS_ERR; } status = namedb_update_serial(zone->db, zone->name, zone->signconf->soa_serial, zone->db->inbserial); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to update zone %s soa serial: %s", zone_str, zone->name, ods_status2str(status)); if (status == ODS_STATUS_CONFLICT_ERR) { ods_log_error("[%s] If this is the result of a key rollover, " "please increment the serial in the unsigned zone %s", zone_str, zone->name); } ldns_rr_free(rr); return status; } ods_log_verbose("[%s] zone %s set soa serial to %u", zone_str, zone->name, zone->db->intserial); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, zone->db->intserial), SE_SOA_RDATA_SERIAL); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to update zone %s soa serial: failed to " "replace soa serial rdata", zone_str, zone->name); ldns_rr_free(rr); return ODS_STATUS_ERR; } soa = rrset_add_rr(rrset, rr); ods_log_assert(soa); rrset_diff(rrset, 0, 0); zone->db->serial_updated = 0; return ODS_STATUS_OK; } /** * Lookup RRset. * */ rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner, ldns_rr_type type) { domain_type* domain = NULL; if (!zone || !owner || !type) { return NULL; } domain = namedb_lookup_domain(zone->db, owner); if (!domain) { return NULL; } return domain_lookup_rrset(domain, type); } /** * Add RR. * */ ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats) { domain_type* domain = NULL; rrset_type* rrset = NULL; rr_type* record = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* If we already have this RR, return ODS_STATUS_UNCHANGED */ domain = namedb_lookup_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { domain = namedb_add_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to add domain", zone_str, zone->name); return ODS_STATUS_ERR; } if (ldns_dname_compare(domain->dname, zone->apex) == 0) { domain->is_apex = 1; } else { status = namedb_domain_entize(zone->db, domain, zone->apex); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to entize domain", zone_str, zone->name); return ODS_STATUS_ERR; } } } rrset = domain_lookup_rrset(domain, ldns_rr_get_type(rr)); if (!rrset) { rrset = rrset_create(domain->zone, ldns_rr_get_type(rr)); if (!rrset) { ods_log_error("[%s] unable to add RR to zone %s: " "failed to add RRset", zone_str, zone->name); return ODS_STATUS_ERR; } domain_add_rrset(domain, rrset); } record = rrset_lookup_rr(rrset, rr); if (record) { record->is_added = 1; /* already exists, just mark added */ record->is_removed = 0; /* unset is_removed */ if (ldns_rr_ttl(rr) != ldns_rr_ttl(record->rr)) { ldns_rr_set_ttl(record->rr, ldns_rr_ttl(rr)); rrset->needs_signing = 1; } return ODS_STATUS_UNCHANGED; } else { record = rrset_add_rr(rrset, rr); ods_log_assert(record); ods_log_assert(record->rr); ods_log_assert(record->is_added); } /* update stats */ if (do_stats && zone->stats) { zone->stats->sort_count += 1; } return ODS_STATUS_OK; } /** * Delete RR. * */ ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats) { domain_type* domain = NULL; rrset_type* rrset = NULL; rr_type* record = NULL; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); domain = namedb_lookup_domain(zone->db, ldns_rr_owner(rr)); if (!domain) { ods_log_warning("[%s] unable to delete RR from zone %s: " "domain not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } rrset = domain_lookup_rrset(domain, ldns_rr_get_type(rr)); if (!rrset) { ods_log_warning("[%s] unable to delete RR from zone %s: " "RRset not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } record = rrset_lookup_rr(rrset, rr); if (!record) { ods_log_error("[%s] unable to delete RR from zone %s: " "RR not found", zone_str, zone->name); return ODS_STATUS_UNCHANGED; } record->is_removed = 1; record->is_added = 0; /* unset is_added */ /* update stats */ if (do_stats && zone->stats) { zone->stats->sort_count -= 1; } return ODS_STATUS_OK; } /** * Merge zones. * */ void zone_merge(zone_type* z1, zone_type* z2) { const char* str; adapter_type* adtmp = NULL; if (!z1 || !z2) { return; } /* policy name */ if (ods_strcmp(z2->policy_name, z1->policy_name) != 0) { if (z2->policy_name) { str = strdup(z2->policy_name); if (!str) { ods_log_error("[%s] failed to merge policy %s name to zone " "%s", zone_str, z2->policy_name, z1->name); } else { free((void*)z1->policy_name); z1->policy_name = str; z1->zl_status = ZONE_ZL_UPDATED; } } else { free((void*)z1->policy_name); z1->policy_name = NULL; z1->zl_status = ZONE_ZL_UPDATED; } } /* signconf filename */ if (ods_strcmp(z2->signconf_filename, z1->signconf_filename) != 0) { if (z2->signconf_filename) { str = strdup(z2->signconf_filename); if (!str) { ods_log_error("[%s] failed to merge signconf filename %s to " "zone %s", zone_str, z2->policy_name, z1->name); } else { free((void*)z1->signconf_filename); z1->signconf_filename = str; z1->zl_status = ZONE_ZL_UPDATED; } } else { free((void*)z1->signconf_filename); z1->signconf_filename = NULL; z1->zl_status = ZONE_ZL_UPDATED; } } /* adapters */ if (adapter_compare(z2->adinbound, z1->adinbound) != 0) { adtmp = z2->adinbound; z2->adinbound = z1->adinbound; z1->adinbound = adtmp; adtmp = NULL; } if (adapter_compare(z2->adoutbound, z1->adoutbound) != 0) { adtmp = z2->adoutbound; z2->adoutbound = z1->adoutbound; z1->adoutbound = adtmp; adtmp = NULL; } return; } /** * Clean up zone. * */ void zone_cleanup(zone_type* zone) { allocator_type* allocator; lock_basic_type zone_lock; lock_basic_type xfr_lock; if (!zone) { return; } allocator = zone->allocator; zone_lock = zone->zone_lock; xfr_lock = zone->xfr_lock; ldns_rdf_deep_free(zone->apex); adapter_cleanup(zone->adinbound); adapter_cleanup(zone->adoutbound); namedb_cleanup(zone->db); ixfr_cleanup(zone->ixfr); xfrd_cleanup(zone->xfrd, 1); notify_cleanup(zone->notify); signconf_cleanup(zone->signconf); stats_cleanup(zone->stats); allocator_deallocate(allocator, (void*) zone->notify_command); allocator_deallocate(allocator, (void*) zone->notify_args); allocator_deallocate(allocator, (void*) zone->policy_name); allocator_deallocate(allocator, (void*) zone->signconf_filename); allocator_deallocate(allocator, (void*) zone->name); allocator_deallocate(allocator, (void*) zone); allocator_cleanup(allocator); lock_basic_destroy(&xfr_lock); lock_basic_destroy(&zone_lock); return; } /** * Recover zone from backup. * */ ods_status zone_recover2(zone_type* zone) { char* filename = NULL; FILE* fd = NULL; const char* token = NULL; time_t when = 0; task_type* task = NULL; ods_status status = ODS_STATUS_OK; /* zone part */ int klass = 0; uint32_t inbound = 0, internal = 0, outbound = 0; /* signconf part */ time_t lastmod = 0; /* nsec3params part */ const char* salt = NULL; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); ods_log_assert(zone->db); filename = ods_build_path(zone->name, ".backup2", 0, 1); if (!filename) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(filename, NULL, "r"); if (fd) { /* start recovery */ if (!backup_read_check_str(fd, ODS_SE_FILE_MAGIC_V3)) { ods_log_error("[%s] corrupted backup file zone %s: read magic " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, ";;Time:") | !backup_read_time_t(fd, &when)) { ods_log_error("[%s] corrupted backup file zone %s: read time " "error", zone_str, zone->name); goto recover_error2; } /* zone stuff */ if (!backup_read_check_str(fd, ";;Zone:") | !backup_read_check_str(fd, "name") | !backup_read_check_str(fd, zone->name)) { ods_log_error("[%s] corrupted backup file zone %s: read name " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, "class") | !backup_read_int(fd, &klass)) { ods_log_error("[%s] corrupted backup file zone %s: read class " "error", zone_str, zone->name); goto recover_error2; } if (!backup_read_check_str(fd, "inbound") | !backup_read_uint32_t(fd, &inbound) | !backup_read_check_str(fd, "internal") | !backup_read_uint32_t(fd, &internal) | !backup_read_check_str(fd, "outbound") | !backup_read_uint32_t(fd, &outbound)) { ods_log_error("[%s] corrupted backup file zone %s: read serial " "error", zone_str, zone->name); goto recover_error2; } zone->klass = (ldns_rr_class) klass; zone->db->inbserial = inbound; zone->db->intserial = internal; zone->db->outserial = outbound; /* signconf part */ if (!backup_read_check_str(fd, ";;Signconf:") | !backup_read_check_str(fd, "lastmod") | !backup_read_time_t(fd, &lastmod) | !backup_read_check_str(fd, "maxzonettl") | !backup_read_check_str(fd, "0") | !backup_read_check_str(fd, "resign") | !backup_read_duration(fd, &zone->signconf->sig_resign_interval) | !backup_read_check_str(fd, "refresh") | !backup_read_duration(fd, &zone->signconf->sig_refresh_interval) | !backup_read_check_str(fd, "valid") | !backup_read_duration(fd, &zone->signconf->sig_validity_default) | !backup_read_check_str(fd, "denial") | !backup_read_duration(fd,&zone->signconf->sig_validity_denial) | !backup_read_check_str(fd, "jitter") | !backup_read_duration(fd, &zone->signconf->sig_jitter) | !backup_read_check_str(fd, "offset") | !backup_read_duration(fd, &zone->signconf->sig_inception_offset) | !backup_read_check_str(fd, "nsec") | !backup_read_rr_type(fd, &zone->signconf->nsec_type) | !backup_read_check_str(fd, "dnskeyttl") | !backup_read_duration(fd, &zone->signconf->dnskey_ttl) | !backup_read_check_str(fd, "soattl") | !backup_read_duration(fd, &zone->signconf->soa_ttl) | !backup_read_check_str(fd, "soamin") | !backup_read_duration(fd, &zone->signconf->soa_min) | !backup_read_check_str(fd, "serial") | !backup_read_str(fd, &zone->signconf->soa_serial)) { ods_log_error("[%s] corrupted backup file zone %s: read signconf " "error", zone_str, zone->name); goto recover_error2; } /* nsec3params part */ if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3) { if (!backup_read_check_str(fd, ";;Nsec3parameters:") | !backup_read_check_str(fd, "salt") | !backup_read_str(fd, &salt) | !backup_read_check_str(fd, "algorithm") | !backup_read_uint32_t(fd, &zone->signconf->nsec3_algo) | !backup_read_check_str(fd, "optout") | !backup_read_int(fd, &zone->signconf->nsec3_optout) | !backup_read_check_str(fd, "iterations") | !backup_read_uint32_t(fd, &zone->signconf->nsec3_iterations)) { ods_log_error("[%s] corrupted backup file zone %s: read " "nsec3parameters error", zone_str, zone->name); goto recover_error2; } zone->signconf->nsec3_salt = allocator_strdup( zone->signconf->allocator, salt); free((void*) salt); salt = NULL; zone->signconf->nsec3params = nsec3params_create( (void*) zone->signconf, (uint8_t) zone->signconf->nsec3_algo, (uint8_t) zone->signconf->nsec3_optout, (uint16_t) zone->signconf->nsec3_iterations, zone->signconf->nsec3_salt); if (!zone->signconf->nsec3params) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "create nsec3param", zone_str, zone->name); goto recover_error2; } } zone->signconf->last_modified = lastmod; zone->default_ttl = (uint32_t) duration2time(zone->signconf->soa_min); /* keys part */ zone->signconf->keys = keylist_create((void*) zone->signconf); while (backup_read_str(fd, &token)) { if (ods_strcmp(token, ";;Key:") == 0) { if (!key_recover2(fd, zone->signconf->keys)) { ods_log_error("[%s] corrupted backup file zone %s: read " "key error", zone_str, zone->name); goto recover_error2; } } else if (ods_strcmp(token, ";;") == 0) { /* keylist done */ free((void*) token); token = NULL; break; } else { /* keylist corrupted */ goto recover_error2; } free((void*) token); token = NULL; } /* publish dnskeys */ status = zone_publish_dnskeys(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "publish dnskeys (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* publish nsec3param */ status = zone_publish_nsec3param(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "publish nsec3param (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* publish other records */ status = backup_read_namedb(fd, zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] corrupted backup file zone %s: unable to " "read resource records (%s)", zone_str, zone->name, ods_status2str(status)); goto recover_error2; } /* task */ task = task_create(TASK_SIGN, when, (void*) zone); if (!task) { ods_log_error("[%s] failed to restore zone %s: unable to " "create task", zone_str, zone->name); goto recover_error2; } zone->task = (void*) task; free((void*)filename); ods_fclose(fd); zone->db->is_initialized = 1; zone->db->have_serial = 1; /* journal */ filename = ods_build_path(zone->name, ".ixfr", 0, 1); if (filename) { fd = ods_fopen(filename, NULL, "r"); } if (fd) { status = backup_read_ixfr(fd, zone); if (status != ODS_STATUS_OK) { ods_log_warning("[%s] corrupted journal file zone %s, " "skipping (%s)", zone_str, zone->name, ods_status2str(status)); (void)unlink(filename); ixfr_cleanup(zone->ixfr); zone->ixfr = ixfr_create((void*)zone); } } lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_purge(zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); /* all ok */ free((void*)filename); if (fd) { ods_fclose(fd); } if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } return ODS_STATUS_OK; } return ODS_STATUS_UNCHANGED; recover_error2: free((void*)filename); ods_fclose(fd); /* signconf cleanup */ free((void*)salt); salt = NULL; signconf_cleanup(zone->signconf); zone->signconf = signconf_create(); ods_log_assert(zone->signconf); /* namedb cleanup */ namedb_cleanup(zone->db); zone->db = namedb_create((void*)zone); ods_log_assert(zone->db); /* stats reset */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } return ODS_STATUS_ERR; } /** * Backup zone. * */ ods_status zone_backup2(zone_type* zone) { char* filename = NULL; char* tmpfile = NULL; FILE* fd = NULL; task_type* task = NULL; int ret = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); ods_log_assert(zone->task); tmpfile = ods_build_path(zone->name, ".backup2.tmp", 0, 1); filename = ods_build_path(zone->name, ".backup2", 0, 1); if (!tmpfile || !filename) { free(tmpfile); free(filename); return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(tmpfile, NULL, "w"); if (fd) { fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); task = (task_type*) zone->task; fprintf(fd, ";;Time: %u\n", (unsigned) task->when); /** Backup zone */ fprintf(fd, ";;Zone: name %s class %i inbound %u internal %u " "outbound %u\n", zone->name, (int) zone->klass, (unsigned) zone->db->inbserial, (unsigned) zone->db->intserial, (unsigned) zone->db->outserial); /** Backup signconf */ signconf_backup(fd, zone->signconf, ODS_SE_FILE_MAGIC_V3); /** Backup NSEC3 parameters */ if (zone->signconf->nsec3params) { nsec3params_backup(fd, zone->signconf->nsec3_algo, zone->signconf->nsec3_optout, zone->signconf->nsec3_iterations, zone->signconf->nsec3_salt, zone->signconf->nsec3params->rr, ODS_SE_FILE_MAGIC_V3); } /** Backup keylist */ keylist_backup(fd, zone->signconf->keys, ODS_SE_FILE_MAGIC_V3); fprintf(fd, ";;\n"); /** Backup domains and stuff */ namedb_backup2(fd, zone->db); /** Done */ fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); ods_fclose(fd); ret = rename(tmpfile, filename); if (ret != 0) { ods_log_error("[%s] unable to rename zone %s backup %s to %s: %s", zone_str, zone->name, tmpfile, filename, strerror(errno)); status = ODS_STATUS_RENAME_ERR; } } else { status = ODS_STATUS_FOPEN_ERR; } free((void*) tmpfile); free((void*) filename); return status; } opendnssec-1.4.9/signer/src/signer/tools.h0000644000175000017500000000371412650165732015501 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone signing tools. * */ #ifndef SIGNER_TOOLS_H #define SIGNER_TOOLS_H #include "config.h" #include "daemon/engine.h" #include "shared/status.h" #include "signer/zone.h" /** * Load zone signconf. * \param[in] zone zone * \return ods_status status * */ ods_status tools_signconf(zone_type* zone); /** * Read zone from input adapter. * \param[in] zone zone * \return ods_status status * */ ods_status tools_input(zone_type* zone); /** * Write zone to output adapter. * \param[in] zone zone * \param[in] engine signer engine * \return ods_status status * */ ods_status tools_output(zone_type* zone, engine_type* engine); #endif /* SIGNER_TOOLS_H */ opendnssec-1.4.9/signer/src/signer/tools.c0000644000175000017500000002243112650165732015471 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone signing tools. * */ #include "config.h" #include "daemon/dnshandler.h" #include "adapter/adapter.h" #include "shared/log.h" #include "signer/tools.h" #include "signer/zone.h" #include #include #include #include static const char* tools_str = "tools"; /** * Load zone signconf. * */ ods_status tools_signconf(zone_type* zone) { ods_status status = ODS_STATUS_OK; signconf_type* new_signconf = NULL; ods_log_assert(zone); ods_log_assert(zone->name); status = zone_load_signconf(zone, &new_signconf); if (status == ODS_STATUS_OK) { ods_log_assert(new_signconf); /* Denial of Existence Rollover? */ if (signconf_compare_denial(zone->signconf, new_signconf) == TASK_NSECIFY) { /** * Or NSEC -> NSEC3, or NSEC3 -> NSEC, or NSEC3 params changed. * All NSEC(3)s become invalid. */ namedb_wipe_denial(zone->db); namedb_cleanup_denials(zone->db); namedb_init_denials(zone->db); } /* all ok, switch signer configuration */ signconf_cleanup(zone->signconf); ods_log_debug("[%s] zone %s switch to new signconf", tools_str, zone->name); zone->signconf = new_signconf; signconf_log(zone->signconf, zone->name); zone->default_ttl = (uint32_t) duration2time(zone->signconf->soa_min); } else if (status != ODS_STATUS_UNCHANGED) { ods_log_error("[%s] unable to load signconf for zone %s: %s", tools_str, zone->name, ods_status2str(status)); } return status; } /** * Read zone from input adapter. * */ ods_status tools_input(zone_type* zone) { ods_status status = ODS_STATUS_OK; time_t start = 0; time_t end = 0; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adinbound); ods_log_assert(zone->signconf); /* Key Rollover? */ status = zone_publish_dnskeys(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read zone %s: failed to " "publish dnskeys (%s)", tools_str, zone->name, ods_status2str(status)); zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); return status; } /* Denial of Existence Rollover? */ status = zone_publish_nsec3param(zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read zone %s: failed to " "publish nsec3param (%s)", tools_str, zone->name, ods_status2str(status)); zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); return status; } if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->sort_done = 0; zone->stats->sort_count = 0; zone->stats->sort_time = 0; lock_basic_unlock(&zone->stats->stats_lock); } /* Input Adapter */ start = time(NULL); status = adapter_read((void*)zone); if (status != ODS_STATUS_OK && status != ODS_STATUS_UNCHANGED) { if (status == ODS_STATUS_XFRINCOMPLETE) { ods_log_info("[%s] read zone %s: xfr in progress", tools_str, zone->name); } else { ods_log_error("[%s] unable to read zone %s: adapter failed (%s)", tools_str, zone->name, ods_status2str(status)); } zone_rollback_dnskeys(zone); zone_rollback_nsec3param(zone); namedb_rollback(zone->db, 0); } end = time(NULL); if ((status == ODS_STATUS_OK || status == ODS_STATUS_UNCHANGED) && zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->start_time = start; zone->stats->sort_time = (end-start); zone->stats->sort_done = 1; lock_basic_unlock(&zone->stats->stats_lock); } return status; } /** * Close file descriptors. * */ static void ods_closeall(int fd) { int fdlimit = sysconf(_SC_OPEN_MAX); while (fd < fdlimit) { close(fd++); } return; } /** * Write zone to output adapter. * */ ods_status tools_output(zone_type* zone, engine_type* engine) { ods_status status = ODS_STATUS_OK; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(zone); ods_log_assert(zone->db); ods_log_assert(zone->name); ods_log_assert(zone->signconf); ods_log_assert(zone->adoutbound); /* prepare */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (zone->stats->sort_done == 0 && (zone->stats->sig_count <= zone->stats->sig_soa_count)) { ods_log_verbose("[%s] skip write zone %s serial %u (zone not " "changed)", tools_str, zone->name?zone->name:"(null)", zone->db->intserial); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); zone->db->intserial = zone->db->outserial; return ODS_STATUS_OK; } lock_basic_unlock(&zone->stats->stats_lock); } /* Output Adapter */ status = adapter_write((void*)zone); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to write zone %s: adapter failed (%s)", tools_str, zone->name, ods_status2str(status)); return status; } zone->db->outserial = zone->db->intserial; zone->db->is_initialized = 1; zone->db->have_serial = 1; lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_purge(zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); /* kick the nameserver */ if (zone->notify_ns) { int status; pid_t pid, wpid; ods_log_verbose("[%s] notify nameserver: %s", tools_str, zone->notify_ns); /** fork */ switch ((pid = fork())) { case -1: /* error */ ods_log_error("[%s] notify nameserver failed: unable to fork " "(%s)", tools_str, strerror(errno)); return ODS_STATUS_FORK_ERR; case 0: /* child */ /** close fds */ ods_closeall(0); /** execv */ execvp(zone->notify_ns, zone->notify_args); /** error */ ods_log_error("[%s] notify nameserver failed: execv() failed " "(%s)", tools_str, strerror(errno)); exit(1); break; default: /* parent */ ods_log_debug("[%s] notify nameserver process forked", tools_str); /** wait for completion */ while((wpid = waitpid(pid, &status, 0)) <= 0) { if (errno != EINTR) { break; } } if (wpid == -1) { ods_log_error("[%s] notify nameserver failed: waitpid() ", "failed (%s)", tools_str, strerror(errno)); } else if (!WIFEXITED(status)) { ods_log_error("[%s] notify nameserver failed: notify ", "command did not terminate normally", tools_str); } else { ods_log_verbose("[%s] notify nameserver ok", tools_str); } break; } } /* log stats */ if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->end_time = time(NULL); ods_log_debug("[%s] log stats for zone %s serial %u", tools_str, zone->name?zone->name:"(null)", (unsigned) zone->db->outserial); stats_log(zone->stats, zone->name, zone->db->outserial, zone->signconf->nsec_type); stats_clear(zone->stats); lock_basic_unlock(&zone->stats->stats_lock); } if (engine->dnshandler) { ods_log_debug("[%s] forward a notify", tools_str); dnshandler_fwd_notify(engine->dnshandler, (uint8_t*) ODS_SE_NOTIFY_CMD, strlen(ODS_SE_NOTIFY_CMD)); } return status; } opendnssec-1.4.9/signer/src/signer/domain.c0000644000175000017500000003763412650165732015613 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Domain. * */ #include "config.h" #include "shared/log.h" #include "signer/backup.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/ixfr.h" #include "signer/zone.h" static const char* dname_str = "domain"; /** * Log domain name. * */ void log_dname(ldns_rdf *rdf, const char* pre, int level) { char* str = NULL; if (ods_log_get_level() < level) { return; } str = ldns_rdf2str(rdf); if (!str) { return; } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: %s", dname_str, pre?pre:"", str); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: %s", dname_str, pre?pre:"", str); } else { ods_log_deeebug("[%s] %s: %s", dname_str, pre?pre:"", str); } free((void*)str); return; } /** * Create domain. * */ domain_type* domain_create(void* zoneptr, ldns_rdf* dname) { domain_type* domain = NULL; zone_type* zone = (zone_type*) zoneptr; if (!dname || !zoneptr) { return NULL; } domain = (domain_type*) allocator_alloc( zone->allocator, sizeof(domain_type)); if (!domain) { ods_log_error("[%s] unable to create domain: allocator_alloc() " "failed", dname_str); return NULL; } domain->dname = ldns_rdf_clone(dname); if (!domain->dname) { ods_log_error("[%s] unable to create domain: ldns_rdf_clone() " "failed", dname_str); allocator_deallocate(zone->allocator, domain); return NULL; } domain->zone = zoneptr; domain->denial = NULL; /* no reference yet */ domain->node = NULL; /* not in db yet */ domain->rrsets = NULL; domain->parent = NULL; domain->is_apex = 0; domain->is_new = 0; return domain; } /** * Count the number of RRsets at this domain. * */ size_t domain_count_rrset(domain_type* domain) { rrset_type* rrset = NULL; size_t count = 0; if (!domain) { return 0; } rrset = domain->rrsets; while (rrset) { count++; /* rr_count may be zero */ rrset = rrset->next; } return count; } /** * Count the number of RRsets at this domain with RRs that have is_added. * */ size_t domain_count_rrset_is_added(domain_type* domain) { rrset_type* rrset = NULL; size_t count = 0; if (!domain) { return 0; } rrset = domain->rrsets; while (rrset) { if (rrset_count_rr_is_added(rrset)) { count++; } rrset = rrset->next; } return count; } /** * Look up RRset at this domain. * */ rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype) { rrset_type* rrset = NULL; if (!domain || !domain->rrsets || !rrtype) { return NULL; } rrset = domain->rrsets; while (rrset && rrset->rrtype != rrtype) { rrset = rrset->next; } return rrset; } /** * Add RRset to domain. * */ void domain_add_rrset(domain_type* domain, rrset_type* rrset) { rrset_type** p = NULL; denial_type* denial = NULL; ods_log_assert(domain); ods_log_assert(rrset); if (!domain->rrsets) { domain->rrsets = rrset; } else { p = &domain->rrsets; while(*p) { p = &((*p)->next); } *p = rrset; rrset->next = NULL; } log_rrset(domain->dname, rrset->rrtype, "+RRSET", LOG_DEEEBUG); rrset->domain = (void*) domain; if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return; } /** * Delete RRset from domain. * */ rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype) { rrset_type* cur = NULL; denial_type* denial = NULL; if (!domain || !rrtype) { return NULL; } if (!domain->rrsets) { ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } if (domain->rrsets->rrtype == rrtype) { cur = domain->rrsets; domain->rrsets = cur->next; cur->domain = NULL; cur->next = NULL; log_rrset(domain->dname, rrtype, "-RRSET", LOG_DEEEBUG); if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return cur; } cur = domain->rrsets; while (cur) { if (!cur->next) { ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } ods_log_assert(cur->next); if (cur->next->rrtype != rrtype) { cur = cur->next; } else { ods_log_assert(cur->next->rrtype == rrtype); cur->next = cur->next->next; cur = cur->next; cur->domain = NULL; cur->next = NULL; log_rrset(domain->dname, rrtype, "-RRSET", LOG_DEEEBUG); if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } return cur; } } ods_log_error("[%s] unable to delete RRset: RRset with RRtype %s " "does not exist", dname_str, rrset_type2str(rrtype)); return NULL; } /** * Apply differences at domain. * */ void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming) { denial_type* denial = NULL; rrset_type* rrset = NULL; rrset_type* prev_rrset = NULL; if (!domain) { return; } rrset = domain->rrsets; while (rrset) { if (rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS || rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { /* always do full diff on NSEC3PARAMS | DNSKEY RRset */ rrset_diff(rrset, 0, more_coming); } else { rrset_diff(rrset, is_ixfr, more_coming); } if (rrset->rr_count <= 0) { /* delete entire rrset */ if (!prev_rrset) { domain->rrsets = rrset->next; } else { prev_rrset->next = rrset->next; } rrset->next = NULL; log_rrset(domain->dname, rrset->rrtype, "-RRSET", LOG_DEEEBUG); rrset_cleanup(rrset); if (!prev_rrset) { rrset = domain->rrsets; } else { rrset = prev_rrset->next; } if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 1; } } else { /* just go to next rrset */ prev_rrset = rrset; rrset = rrset->next; } } return; } /** * Rollback differences at domain. * */ void domain_rollback(domain_type* domain, int keepsc) { denial_type* denial = NULL; rrset_type* rrset = NULL; rrset_type* prev_rrset = NULL; ldns_rr* del_rr = NULL; int del_rrset = 0; uint16_t i = 0; if (!domain) { return; } rrset = domain->rrsets; while (rrset) { if (keepsc) { /* skip rollback for NSEC3PARAM and DNSKEY RRset */ if (rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS || rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { prev_rrset = rrset; rrset = rrset->next; continue; } } /* walk rrs */ for (i=0; i < rrset->rr_count; i++) { rrset->rrs[i].is_added = 0; rrset->rrs[i].is_removed = 0; if (!rrset->rrs[i].exists) { /* can we delete the RRset? */ if(rrset->rr_count == 1) { del_rrset = 1; } del_rr = rrset->rrs[i].rr; rrset_del_rr(rrset, i); ldns_rr_free(del_rr); del_rr = NULL; i--; } } /* next rrset */ if (del_rrset) { /* delete entire rrset */ if (!prev_rrset) { domain->rrsets = rrset->next; } else { prev_rrset->next = rrset->next; } rrset->next = NULL; log_rrset(domain->dname, rrset->rrtype, "-RRSET", LOG_DEEEBUG); rrset_cleanup(rrset); if (!prev_rrset) { rrset = domain->rrsets; } else { rrset = prev_rrset->next; } if (domain->denial) { denial = (denial_type*) domain->denial; denial->bitmap_changed = 0; } del_rrset = 0; } else { /* just go to next rrset */ prev_rrset = rrset; rrset = rrset->next; } } return; } /** * Check whether a domain is an empty non-terminal to unsigned delegation. * */ int domain_ent2unsignedns(domain_type* domain) { ldns_rbnode_t* n = LDNS_RBTREE_NULL; domain_type* d = NULL; ods_log_assert(domain); if (domain->rrsets) { return 0; /* not an empty non-terminal */ } n = ldns_rbtree_next(domain->node); while (n && n != LDNS_RBTREE_NULL) { d = (domain_type*) n->data; if (!ldns_dname_is_subdomain(d->dname, domain->dname)) { break; } if (d->rrsets) { if (domain_is_delegpt(d) != LDNS_RR_TYPE_NS && domain_is_occluded(d) == LDNS_RR_TYPE_SOA) { /* domain has signed delegation/auth */ return 0; } } /* maybe there is data at the next domain */ n = ldns_rbtree_next(n); } return 1; } /** * Check whether the domain is a delegation point. * */ ldns_rr_type domain_is_delegpt(domain_type* domain) { ods_log_assert(domain); if (domain->is_apex) { return LDNS_RR_TYPE_SOA; } if (domain_lookup_rrset(domain, LDNS_RR_TYPE_NS)) { if (domain_lookup_rrset(domain, LDNS_RR_TYPE_DS)) { /* Signed delegation */ return LDNS_RR_TYPE_DS; } else { /* Unsigned delegation */ return LDNS_RR_TYPE_NS; } } /* Authoritative */ return LDNS_RR_TYPE_SOA; } /** * Check whether the domain is occluded. * */ ldns_rr_type domain_is_occluded(domain_type* domain) { domain_type* parent = NULL; ods_log_assert(domain); if (domain->is_apex) { return LDNS_RR_TYPE_SOA; } parent = domain->parent; while (parent && !parent->is_apex) { if (domain_lookup_rrset(parent, LDNS_RR_TYPE_NS)) { /* Glue / Empty non-terminal to Glue */ return LDNS_RR_TYPE_A; } if (domain_lookup_rrset(parent, LDNS_RR_TYPE_DNAME)) { /* Occluded data / Empty non-terminal to Occluded data */ return LDNS_RR_TYPE_DNAME; } parent = parent->parent; } /* Authoritative or delegation */ return LDNS_RR_TYPE_SOA; } /** * Print domain. * */ void domain_print(FILE* fd, domain_type* domain, ods_status* status) { char* str = NULL; rrset_type* rrset = NULL; rrset_type* soa_rrset = NULL; rrset_type* cname_rrset = NULL; if (!domain || !fd) { if (status) { ods_log_crit("[%s] unable to print domain: domain or fd missing", dname_str); *status = ODS_STATUS_ASSERT_ERR; } return; } /* empty non-terminal? */ if (!domain->rrsets) { str = ldns_rdf2str(domain->dname); fprintf(fd, ";;Empty non-terminal %s\n", str); free((void*)str); /* Denial of Existence */ if (domain->denial) { denial_print(fd, (denial_type*) domain->denial, status); } return; } /* no other data may accompany a CNAME */ cname_rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_CNAME); if (cname_rrset) { rrset_print(fd, cname_rrset, 0, status); } else { /* if SOA, print soa first */ if (domain->is_apex) { soa_rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_SOA); if (soa_rrset) { rrset_print(fd, soa_rrset, 0, status); if (status && *status != ODS_STATUS_OK) { return; } } } /* print other RRsets */ rrset = domain->rrsets; while (rrset) { /* skip SOA RRset */ if (rrset->rrtype != LDNS_RR_TYPE_SOA) { rrset_print(fd, rrset, 0, status); } if (status && *status != ODS_STATUS_OK) { ods_log_crit("[%s] failed to print one or more RRsets: %s", dname_str, ods_status2str(*status)); return; } rrset = rrset->next; } } /* Denial of Existence */ if (domain->denial) { denial_print(fd, (denial_type*) domain->denial, status); } return; } /** * Clean up domain. * */ void domain_cleanup(domain_type* domain) { zone_type* zone = NULL; if (!domain) { return; } zone = (zone_type*) domain->zone; ldns_rdf_deep_free(domain->dname); rrset_cleanup(domain->rrsets); allocator_deallocate(zone->allocator, (void*)domain); return; } /** * Backup domain. * */ void domain_backup2(FILE* fd, domain_type* domain, int sigs) { rrset_type* rrset = NULL; if (!domain || !fd) { return; } /* if SOA, print soa first */ if (domain->is_apex) { rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_SOA); if (rrset) { if (sigs) { rrset_backup2(fd, rrset); } else { rrset_print(fd, rrset, 1, NULL); } } } rrset = domain->rrsets; while (rrset) { /* skip SOA RRset */ if (rrset->rrtype != LDNS_RR_TYPE_SOA) { if (sigs) { rrset_backup2(fd, rrset); } else { rrset_print(fd, rrset, 1, NULL); } } rrset = rrset->next; } return; } opendnssec-1.4.9/signer/src/signer/keys.h0000644000175000017500000001013312650165732015305 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signing keys. * */ #ifndef SIGNER_KEYS_H #define SIGNER_KEYS_H #include "shared/allocator.h" #include "shared/status.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include /** * Key. * */ typedef struct key_struct key_type; struct key_struct { ldns_rr* dnskey; hsm_key_t* hsmkey; hsm_sign_params_t* params; const char* locator; uint8_t algorithm; uint32_t flags; int publish; int ksk; int zsk; int rfc5011; }; /** * Key list. * */ typedef struct keylist_struct keylist_type; struct keylist_struct { void* sc; key_type* keys; size_t count; }; /** * Create a new key list. * \param[in] sc signer configuration reference * \return keylist_type* key list * */ keylist_type* keylist_create(void* sc); /** * Lookup a key in the key list by locator. * \param[in] kl key list * \param[in] locator key locator * \return key_type* key if it exists, NULL otherwise * */ key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator); /** * Lookup a key in the key list by dnskey. * \param[in] kl key list * \param[in] dnskey dnskey * \return key_type* key if it exists, NULL otherwise * */ key_type* keylist_lookup_by_dnskey(keylist_type* kl, ldns_rr* dnskey); /** * Push a key to the keylist. * \param[in] kl key list * \param[in] locator string that identifies location of key * \param[in] algorithm DNSKEY algorithm field value * \param[in] flags DNSKEY flags field value * \param[in] publish if true, publish key as a DNSKEY * \param[in] ksk if true, sign DNSKEY RRset with this key * \param[in] zsk if true, sign all but DNSKEY RRset with this key * \param[in] rfc5011 if true, key will use 5011 style revocation * \return key_type* key * */ key_type* keylist_push(keylist_type* kl, const char* locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk, int rfc5011); /** * Print key list. * \param[in] fd file descriptor * \param[in] kl key list to print * */ void keylist_print(FILE* fd, keylist_type* kl); /** * Log key list. * \param[in] kl key list to print * \param[in] name zone name * */ void keylist_log(keylist_type* kl, const char* name); /** * Clean up key list. * \param[in] kl key list to clean up * */ void keylist_cleanup(keylist_type* kl); /** * Recover key from backup. * \param[in] fd file descriptor of key backup file * \param[in] kl key list to print * \return key_type* key * */ key_type* key_recover2(FILE* fd, keylist_type* kl); /** * Backup key list. * \param[in] fd file descriptor * \param[in] kl key list to print * \param[in] version version string * */ void keylist_backup(FILE* fd, keylist_type* kl, const char* version); #endif /* SIGNER_KEYS_H */ opendnssec-1.4.9/signer/src/signer/ixfr.h0000644000175000017500000000512712650165732015311 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Domain name database. * */ #ifndef SIGNER_IXFR_H #define SIGNER_IXFR_H #include "config.h" #include "shared/locks.h" #include #define IXFR_MAX_PARTS 3 /** * Part of IXFR Journal. * */ typedef struct part_struct part_type; struct part_struct { ldns_rr* soamin; ldns_rr_list* min; ldns_rr* soaplus; ldns_rr_list* plus; }; /** * IXFR Journal. * */ typedef struct ixfr_struct ixfr_type; struct ixfr_struct { void* zone; part_type* part[IXFR_MAX_PARTS]; lock_basic_type ixfr_lock; }; /** * Create a new ixfr journal. * \param[in] zone zone reference * \return ixfr_type* ixfr * */ ixfr_type* ixfr_create(void* zone); /** * Add +RR to ixfr journal. * \param[in] ixfr journal * \param[in] rr +RR * */ void ixfr_add_rr(ixfr_type* ixfr, ldns_rr* rr); /** * Add -RR to ixfr journal. * \param[in] ixfr journal * \param[in] rr -RR * */ void ixfr_del_rr(ixfr_type* ixfr, ldns_rr* rr); /** * Print the ixfr journal. * \param[in] fd file descriptor * \param[in] ixfr journal * */ void ixfr_print(FILE* fd, ixfr_type* ixfr); /** * Purge the ixfr journal. * \param[in] ixfr journal * */ void ixfr_purge(ixfr_type* ixfr); /** * Cleanup the ixfr journal. * \param[in] ixfr journal * */ void ixfr_cleanup(ixfr_type* ixfr); #endif /* SIGNER_IXFR_H */ opendnssec-1.4.9/signer/src/signer/signconf.h0000644000175000017500000001017712650165732016150 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer configuration. * */ #ifndef SIGNER_SIGNCONF_H #define SIGNER_SIGNCONF_H #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/duration.h" #include "signer/keys.h" #include "signer/nsec3params.h" #include #include /** * Signer Configuration. * */ typedef struct signconf_struct signconf_type; struct signconf_struct { /* Zone */ const char* name; allocator_type* allocator; /* Signatures */ duration_type* sig_resign_interval; duration_type* sig_refresh_interval; duration_type* sig_validity_default; duration_type* sig_validity_denial; duration_type* sig_jitter; duration_type* sig_inception_offset; /* Denial of existence */ duration_type* nsec3param_ttl; ldns_rr_type nsec_type; int nsec3_optout; uint32_t nsec3_algo; uint32_t nsec3_iterations; const char* nsec3_salt; nsec3params_type* nsec3params; /* Keys */ duration_type* dnskey_ttl; keylist_type* keys; /* Source of authority */ duration_type* soa_ttl; duration_type* soa_min; const char* soa_serial; /* Other useful information */ const char* filename; time_t last_modified; }; /** * Create a new signer configuration with the 'empty' settings. * \return signconf_type* signer configuration * */ signconf_type* signconf_create(void); /** * Update signer configuration. * \param[out] signconf signer configuration * \param[in] scfile signer configuration file name * \param[in] last_modified last known modification * \return ods_status status * */ ods_status signconf_update(signconf_type** signconf, const char* scfile, time_t last_modified); /** * Backup signer configuration. * \param[in] fd file descriptor * \param[in] sc signer configuration settings * \param[in] version version string * */ void signconf_backup(FILE* fd, signconf_type* sc, const char* version); /** * Check signer configuration. * \param signconf signer configuration * \return ods_status status * */ ods_status signconf_check(signconf_type* signconf); /** * Compare signer configurations on denial of existence material. * \param[in] a a signer configuration * \param[in] b another signer configuration * \return task_id what task needs to be scheduled * */ task_id signconf_compare_denial(signconf_type* a, signconf_type* b); /** * Print signer configuration. * \param[in] out file descriptor * \param[in] sc signconf to print * \param[in] name zone name * */ void signconf_print(FILE* out, signconf_type* sc, const char* name); /** * Log signer configuration. * \param[in] sc signconf to log * \param[in] name zone name * */ void signconf_log(signconf_type* sc, const char* name); /** * Clean up signer configuration. * \param[in] sc signconf to cleanup * */ void signconf_cleanup(signconf_type* sc); #endif /* SIGNER_SIGNCONF_H */ opendnssec-1.4.9/signer/src/signer/rrset.h0000644000175000017500000001166612650165732015505 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * RRset. * */ #ifndef SIGNER_RRSET_H #define SIGNER_RRSET_H #include "config.h" #include "shared/status.h" #include "signer/stats.h" #include #include /** * RRSIG. * */ typedef struct rrsig_struct rrsig_type; struct rrsig_struct { ldns_rr* rr; void* owner; const char* key_locator; uint32_t key_flags; }; /** * RR. * */ typedef struct rr_struct rr_type; struct rr_struct { ldns_rr* rr; void* owner; unsigned exists : 1; unsigned is_added : 1; unsigned is_removed : 1; }; /** * RRset. * */ typedef struct rrset_struct rrset_type; struct rrset_struct { rrset_type* next; void* zone; void* domain; ldns_rr_type rrtype; rr_type* rrs; rrsig_type* rrsigs; size_t rr_count; size_t rrsig_count; unsigned needs_signing : 1; }; /** * Log RR. * \param[in] rr RR * \param[in] pre log message * \param[in] level log level * */ void log_rr(ldns_rr* rr, const char* pre, int level); /** * Log RRset. * \param[in] dname domain name * \param[in] type RRtype * \param[in] pre log message * \param[in] level log level * */ void log_rrset(ldns_rdf* dname, ldns_rr_type type, const char* pre, int level); /** * Get the string-format of RRtype. * \param[in] type RRtype * \return const char* string-format of RRtype * */ const char* rrset_type2str(ldns_rr_type type); /** * Create RRset. * \param[in] zoneptr zone reference * \param[in] type RRtype * \return rrset_type* RRset * */ rrset_type* rrset_create(void* zoneptr, ldns_rr_type type); /** * Lookup RR in RRset. * \param[in] rrset RRset * \param[in] rr RR * \return rr_type* RR if found * */ rr_type* rrset_lookup_rr(rrset_type* rrset, ldns_rr* rr); /** * Count the number of RRs in this RRset that have is_added. * \param[in] rrset RRset * \return size_t number of RRs * */ size_t rrset_count_rr_is_added(rrset_type* rrset); /** * Add RR to RRset. * \param[in] rrset RRset * \param[in] rr RR * \return rr_type* added RR * */ rr_type* rrset_add_rr(rrset_type* rrset, ldns_rr* rr); /** * Delete RR from RRset. * \param[in] rrset RRset * \param[in] rrnum position of RR * */ void rrset_del_rr(rrset_type* rrset, uint16_t rrnum); /** * Add RRSIG to RRset. * \param[in] rrset RRset * \param[in] rr RRSIG * \param[in] locator key locator * \param[in] flags key flags * \return rr_type* added RRSIG * */ rrsig_type* rrset_add_rrsig(rrset_type* rrset, ldns_rr* rr, const char* locator, uint32_t flags); /** * Delete RRSIG from RRset. * \param[in] rrset RRset * \param[in] rrnum position of RRSIG * */ void rrset_del_rrsig(rrset_type* rrset, uint16_t rrnum); /** * Apply differences at RRset. * \param[in] rrset RRset * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void rrset_diff(rrset_type* rrset, unsigned is_ixfr, unsigned more_coming); /** * Sign RRset. * \param[in] ctx HSM context * \param[in] rrset RRset * \param[in] signtime time when the zone is being signed * \return ods_status status * */ ods_status rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, time_t signtime); /** * Print RRset. * \param[in] fd file descriptor * \param[in] rrset RRset to be printed * \param[in] skip_rrsigs if true, don't print RRSIG records * \param[out] status status * */ void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs, ods_status* status); /** * Clean up RRset. * \param[in] rrset RRset to be cleaned up * */ void rrset_cleanup(rrset_type* rrset); /** * Backup RRset. * \param[in] fd file descriptor * \param[in] rrset RRset * */ void rrset_backup2(FILE* fd, rrset_type* rrset); #endif /* SIGNER_RRSET_H */ opendnssec-1.4.9/signer/src/signer/namedb.h0000644000175000017500000001264412650165732015571 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Domain name database. * */ #ifndef SIGNER_NAMEDB_H #define SIGNER_NAMEDB_H #include "config.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/nsec3params.h" #include /** * Domain name database. * */ typedef struct namedb_struct namedb_type; struct namedb_struct { void* zone; ldns_rbtree_t* domains; ldns_rbtree_t* denials; uint32_t inbserial; uint32_t intserial; uint32_t outserial; uint32_t altserial; unsigned is_initialized : 1; unsigned is_processed : 1; unsigned serial_updated : 1; unsigned force_serial : 1; unsigned have_serial : 1; }; /** * Initialize denial of existence chain. * \param[in] db namedb * */ void namedb_init_denials(namedb_type* db); /** * Create a new namedb. * \param[in] zone zone reference * \return namedb_type* namedb * */ namedb_type* namedb_create(void* zone); /** * Determine new SOA SERIAL. * \param[in] db namedb * \param[in] zone_name zone name * \param[in] format format from signer configuration * \param[in] inbound_serial inbound serial * \return ods_status status * */ ods_status namedb_update_serial(namedb_type* db, const char* zone_name, const char* format, uint32_t inbound_serial); /** * Add empty non-terminals for domain. * \param[in] db namedb * \param[in] domain domain * \param[in] apex apex domain name * \return ods_status status * */ ods_status namedb_domain_entize(namedb_type* db, domain_type* domain, ldns_rdf* apex); /** * Look up domain. * \param[in] db namedb * \param[in] dname domain name * \return domain_type* domain, if found * */ domain_type* namedb_lookup_domain(namedb_type* db, ldns_rdf* dname); /** * Add domain to namedb. * \param[in] db namedb * \param[in] dname domain name * \return domain_type* added domain * */ domain_type* namedb_add_domain(namedb_type* db, ldns_rdf* dname); /** * Delete domain from namedb * \param[in] db namedb * \param[in] domain domain * \return domain_type* deleted domain * */ domain_type* namedb_del_domain(namedb_type* db, domain_type* domain); /** * Lookup denial. * \param[in] db namedb * \param[in] dname domain name * \return denial_type* denial, if found * */ denial_type* namedb_lookup_denial(namedb_type* db, ldns_rdf* dname); /** * Add denial to namedb. * \param[in] db namedb * \param[in] dname domain name * \param[in] n3p NSEC3 parameters, NULL if we do NSEC * \return denial_type* added denial * */ denial_type* namedb_add_denial(namedb_type* db, ldns_rdf* dname, nsec3params_type* n3p); /** * Delete denial from namedb * \param[in] db namedb * \param[in] denial denial * \return denial_type* deleted denial * */ denial_type* namedb_del_denial(namedb_type* db, denial_type* denial); /** * Examine updates to namedb. * \param[in] db namedb * \return ods_status status * */ ods_status namedb_examine(namedb_type* db); /** * Apply differences in db. * \param[in] db namedb * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void namedb_diff(namedb_type* db, unsigned is_ixfr, unsigned more_coming); /** * Rollback differences in db. * \param[in] db namedb * \param[in] keepsc keep RRs that did not came from the adapter. * */ void namedb_rollback(namedb_type* db, unsigned keepsc); /** * Nsecify db. * \param[in] db namedb * \param[out] num_added number of NSEC RRs added * */ void namedb_nsecify(namedb_type* db, uint32_t* num_added); /** * Export db to file. * \param[in] fd file descriptor * \param[in] namedb namedb * \param[out] status status * */ void namedb_export(FILE* fd, namedb_type* db, ods_status* status); /** * Wipe out all NSEC(3) RRsets. * \param[in] db namedb * */ void namedb_wipe_denial(namedb_type* db); /** * Clean up denial of existence chain. * \param[in] db namedb * */ void namedb_cleanup_denials(namedb_type* db); /** * Clean up namedb. * \param[in] namedb namedb * */ void namedb_cleanup(namedb_type* db); /** * Backup namedb. * \param[in] fd output file descriptor * \param[in] zd zone data * */ void namedb_backup2(FILE* fd, namedb_type* db); #endif /* SIGNER_NAMEDB_H */ opendnssec-1.4.9/signer/src/signer/signconf.c0000644000175000017500000004617112650165732016146 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer configuration. * */ #include "parser/signconfparser.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/signconf.h" static const char* sc_str = "signconf"; /** * Create a new signer configuration with the 'empty' settings. * */ signconf_type* signconf_create(void) { signconf_type* sc = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create signconf: allocator_create() " " failed", sc_str); return NULL; } sc = (signconf_type*) allocator_alloc(allocator, sizeof(signconf_type)); if (!sc) { ods_log_error("[%s] unable to create signconf: allocator_alloc() " " failed", sc_str); allocator_cleanup(allocator); return NULL; } sc->allocator = allocator; sc->filename = NULL; /* Signatures */ sc->sig_resign_interval = NULL; sc->sig_refresh_interval = NULL; sc->sig_validity_default = NULL; sc->sig_validity_denial = NULL; sc->sig_jitter = NULL; sc->sig_inception_offset = NULL; /* Denial of existence */ sc->nsec3param_ttl = NULL; sc->nsec_type = 0; sc->nsec3_optout = 0; sc->nsec3_algo = 0; sc->nsec3_iterations = 0; sc->nsec3_salt = NULL; sc->nsec3params = NULL; /* Keys */ sc->dnskey_ttl = NULL; sc->keys = NULL; /* Source of authority */ sc->soa_ttl = NULL; sc->soa_min = NULL; sc->soa_serial = NULL; /* Other useful information */ sc->last_modified = 0; return sc; } /** * Read signer configuration. * */ static ods_status signconf_read(signconf_type* signconf, const char* scfile) { const char* rngfile = ODS_SE_RNGDIR "/signconf.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!scfile || !signconf) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read signconf file %s", sc_str, scfile); status = parse_file_check(scfile, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read signconf: parse error in " "file %s (%s)", sc_str, scfile, ods_status2str(status)); return status; } fd = ods_fopen(scfile, NULL, "r"); if (fd) { signconf->filename = allocator_strdup(signconf->allocator, scfile); signconf->sig_resign_interval = parse_sc_sig_resign_interval(scfile); signconf->sig_refresh_interval = parse_sc_sig_refresh_interval(scfile); signconf->sig_validity_default = parse_sc_sig_validity_default(scfile); signconf->sig_validity_denial = parse_sc_sig_validity_denial(scfile); signconf->sig_jitter = parse_sc_sig_jitter(scfile); signconf->sig_inception_offset = parse_sc_sig_inception_offset(scfile); signconf->nsec_type = parse_sc_nsec_type(scfile); if (signconf->nsec_type == LDNS_RR_TYPE_NSEC3) { signconf->nsec3param_ttl = parse_sc_nsec3param_ttl(scfile); signconf->nsec3_optout = parse_sc_nsec3_optout(scfile); signconf->nsec3_algo = parse_sc_nsec3_algorithm(scfile); signconf->nsec3_iterations = parse_sc_nsec3_iterations(scfile); signconf->nsec3_salt = parse_sc_nsec3_salt(signconf->allocator, scfile); signconf->nsec3params = nsec3params_create((void*) signconf, (uint8_t) signconf->nsec3_algo, (uint8_t) signconf->nsec3_optout, (uint16_t)signconf->nsec3_iterations, signconf->nsec3_salt); if (!signconf->nsec3params) { ods_log_error("[%s] unable to read signconf %s: " "nsec3params_create() failed", sc_str, scfile); ods_fclose(fd); return ODS_STATUS_MALLOC_ERR; } } signconf->keys = parse_sc_keys((void*) signconf, scfile); signconf->dnskey_ttl = parse_sc_dnskey_ttl(scfile); signconf->soa_ttl = parse_sc_soa_ttl(scfile); signconf->soa_min = parse_sc_soa_min(scfile); signconf->soa_serial = parse_sc_soa_serial(signconf->allocator, scfile); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read signconf: failed to open file %s", sc_str, scfile); return ODS_STATUS_ERR; } /** * Update signer configuration. * */ ods_status signconf_update(signconf_type** signconf, const char* scfile, time_t last_modified) { signconf_type* new_sc = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!scfile || !signconf) { return ODS_STATUS_UNCHANGED; } /* is the file updated? */ st_mtime = ods_file_lastmodified(scfile); if (st_mtime <= last_modified) { return ODS_STATUS_UNCHANGED; } /* if so, read the new signer configuration */ new_sc = signconf_create(); if (!new_sc) { ods_log_error("[%s] unable to update signconf: signconf_create() " "failed", sc_str); return ODS_STATUS_ERR; } status = signconf_read(new_sc, scfile); if (status == ODS_STATUS_OK) { new_sc->last_modified = st_mtime; if (signconf_check(new_sc) != ODS_STATUS_OK) { ods_log_error("[%s] unable to update signconf: signconf %s has " "errors", sc_str, scfile); signconf_cleanup(new_sc); return ODS_STATUS_CFG_ERR; } *signconf = new_sc; } else { ods_log_error("[%s] unable to update signconf: failed to read file " "%s (%s)", sc_str, scfile, ods_status2str(status)); signconf_cleanup(new_sc); } return status; } /** * Backup duration. * */ static void signconf_backup_duration(FILE* fd, const char* opt, duration_type* duration) { char* str = duration2string(duration); fprintf(fd, "%s %s ", opt, str); free((void*) str?str:"(null)"); return; } /** * Backup signconf values. * */ void signconf_backup(FILE* fd, signconf_type* sc, const char* version) { if (!fd || !sc) { return; } fprintf(fd, ";;Signconf: lastmod %u ", (unsigned) sc->last_modified); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) && strcmp(version, ODS_SE_FILE_MAGIC_V1)) { /* version 3 and up */ fprintf(fd, "maxzonettl 0 "); /* prepare for enforcer ng */ } signconf_backup_duration(fd, "resign", sc->sig_resign_interval); signconf_backup_duration(fd, "refresh", sc->sig_refresh_interval); signconf_backup_duration(fd, "valid", sc->sig_validity_default); signconf_backup_duration(fd, "denial", sc->sig_validity_denial); signconf_backup_duration(fd, "jitter", sc->sig_jitter); signconf_backup_duration(fd, "offset", sc->sig_inception_offset); fprintf(fd, "nsec %u ", (unsigned) sc->nsec_type); signconf_backup_duration(fd, "dnskeyttl", sc->dnskey_ttl); signconf_backup_duration(fd, "soattl", sc->soa_ttl); signconf_backup_duration(fd, "soamin", sc->soa_min); fprintf(fd, "serial %s ", sc->soa_serial?sc->soa_serial:"(null)"); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { fprintf(fd, "audit 0"); } fprintf(fd, "\n"); return; } /** * Check the SOA/Serial type. * */ static int signconf_soa_serial_check(const char* serial) { if (!serial) { return 1; } if (strlen(serial) == 4 && strncmp(serial, "keep", 4) == 0) { return 0; } if (strlen(serial) == 7 && strncmp(serial, "counter", 7) == 0) { return 0; } if (strlen(serial) == 8 && strncmp(serial, "unixtime", 8) == 0) { return 0; } if (strlen(serial) == 11 && strncmp(serial, "datecounter", 11) == 0) { return 0; } return 1; } /** * Check signer configuration settings. * */ ods_status signconf_check(signconf_type* sc) { ods_status status = ODS_STATUS_OK; if (!sc->sig_resign_interval) { ods_log_error("[%s] check failed: no signature resign interval found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_refresh_interval) { ods_log_error("[%s] check failed: no signature resign interval found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_validity_default) { ods_log_error("[%s] check failed: no signature default validity found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_validity_denial) { ods_log_error("[%s] check failed: no signature denial validity found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_jitter) { ods_log_error("[%s] check failed: no signature jitter found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->sig_inception_offset) { ods_log_error("[%s] check failed: no signature inception offset found", sc_str); status = ODS_STATUS_CFG_ERR; } if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { if (sc->nsec3_algo != LDNS_SHA1) { ods_log_error("[%s] check failed: invalid nsec3 algorithm", sc_str); status = ODS_STATUS_CFG_ERR; } /* iterations */ /* salt */ /* optout */ } else if (sc->nsec_type != LDNS_RR_TYPE_NSEC) { ods_log_error("[%s] check failed: wrong nsec type %i", sc_str, sc->nsec_type); status = ODS_STATUS_CFG_ERR; } if (!sc->keys || sc->keys->count == 0) { ods_log_error("[%s] check failed: no keys found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->dnskey_ttl) { ods_log_error("[%s] check failed: no dnskey ttl found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_ttl) { ods_log_error("[%s] check failed: no soa ttl found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_min) { ods_log_error("[%s] check failed: no soa minimum found", sc_str); status = ODS_STATUS_CFG_ERR; } if (!sc->soa_serial) { ods_log_error("[%s] check failed: no soa serial type found", sc_str); status = ODS_STATUS_CFG_ERR; } else if (signconf_soa_serial_check(sc->soa_serial) != 0) { ods_log_error("[%s] check failed: wrong soa serial type %s", sc_str, sc->soa_serial); status = ODS_STATUS_CFG_ERR; } return status; } /** * Compare signer configurations on denial of existence material. * */ task_id signconf_compare_denial(signconf_type* a, signconf_type* b) { task_id new_task = TASK_NONE; if (!a || !b) { return TASK_NONE; } ods_log_assert(a); ods_log_assert(b); if (duration_compare(a->soa_min, b->soa_min)) { new_task = TASK_NSECIFY; } else if (a->nsec_type != b->nsec_type) { new_task = TASK_NSECIFY; } else if (a->nsec_type == LDNS_RR_TYPE_NSEC3) { if ((ods_strcmp(a->nsec3_salt, b->nsec3_salt) != 0) || (a->nsec3_algo != b->nsec3_algo) || (a->nsec3_iterations != b->nsec3_iterations) || (a->nsec3_optout != b->nsec3_optout)) { new_task = TASK_NSECIFY; } else if (duration_compare(a->nsec3param_ttl, b->nsec3param_ttl)) { new_task = TASK_READ; } } return new_task; } /** * Print sign configuration. * */ void signconf_print(FILE* out, signconf_type* sc, const char* name) { char* s = NULL; fprintf(out, "\n"); if (sc) { fprintf(out, "\n"); fprintf(out, "\t\n", name?name:"(null)"); /* Signatures */ fprintf(out, "\t\t\n"); s = duration2string(sc->sig_resign_interval); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_refresh_interval); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t\n"); s = duration2string(sc->sig_validity_default); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_validity_denial); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t\n"); s = duration2string(sc->sig_jitter); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->sig_inception_offset); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* Denial */ fprintf(out, "\t\t\n"); if (sc->nsec_type == LDNS_RR_TYPE_NSEC) { fprintf(out, "\t\t\t\n"); } else if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { fprintf(out, "\t\t\t\n"); if (sc->nsec3param_ttl) { s = duration2string(sc->nsec3param_ttl); fprintf(out, "\t\t\t\t%s\n", s?s:"(null)"); free((void*)s); } if (sc->nsec3_optout) { fprintf(out, "\t\t\t\t\n"); } fprintf(out, "\t\t\t\t\n"); fprintf(out, "\t\t\t\t\t%i\n", sc->nsec3_algo); fprintf(out, "\t\t\t\t\t%i\n", sc->nsec3_iterations); fprintf(out, "\t\t\t\t\t%s\n", sc->nsec3_salt?sc->nsec3_salt:"(null)"); fprintf(out, "\t\t\t\t\n"); fprintf(out, "\t\t\t\n"); } fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* Keys */ fprintf(out, "\t\t\n"); s = duration2string(sc->dnskey_ttl); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\n"); keylist_print(out, sc->keys); fprintf(out, "\t\t\n"); fprintf(out, "\n"); /* SOA */ fprintf(out, "\t\t\n"); s = duration2string(sc->soa_ttl); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); s = duration2string(sc->soa_min); fprintf(out, "\t\t\t%s\n", s?s:"(null)"); free((void*)s); fprintf(out, "\t\t\t%s\n", sc->soa_serial?sc->soa_serial:"(null)"); fprintf(out, "\t\t\n"); fprintf(out, "\n"); fprintf(out, "\t\n"); fprintf(out, "\n"); } return; } /** * Log sign configuration. * */ void signconf_log(signconf_type* sc, const char* name) { char* resign = NULL; char* refresh = NULL; char* validity = NULL; char* denial = NULL; char* jitter = NULL; char* offset = NULL; char* dnskeyttl = NULL; char* soattl = NULL; char* soamin = NULL; char* paramttl = NULL; if (sc) { resign = duration2string(sc->sig_resign_interval); refresh = duration2string(sc->sig_refresh_interval); validity = duration2string(sc->sig_validity_default); denial = duration2string(sc->sig_validity_denial); jitter = duration2string(sc->sig_jitter); offset = duration2string(sc->sig_inception_offset); dnskeyttl = duration2string(sc->dnskey_ttl); paramttl = duration2string(sc->nsec3param_ttl); soattl = duration2string(sc->soa_ttl); soamin = duration2string(sc->soa_min); /* signconf */ ods_log_info("[%s] zone %s signconf: RESIGN[%s] REFRESH[%s] " "VALIDITY[%s] DENIAL[%s] JITTER[%s] OFFSET[%s] NSEC[%i] " "DNSKEYTTL[%s] SOATTL[%s] MINIMUM[%s] SERIAL[%s]", sc_str, name?name:"(null)", resign?resign:"(null)", refresh?refresh:"(null)", validity?validity:"(null)", denial?denial:"(null)", jitter?jitter:"(null)", offset?offset:"(null)", (int) sc->nsec_type, dnskeyttl?dnskeyttl:"(null)", soattl?soattl:"(null)", soamin?soamin:"(null)", sc->soa_serial?sc->soa_serial:"(null)"); /* nsec3 parameters */ if (sc->nsec_type == LDNS_RR_TYPE_NSEC3) { ods_log_debug("[%s] zone %s nsec3: PARAMTTL[%s] OPTOUT[%i] " "ALGORITHM[%u] ITERATIONS[%u] SALT[%s]", sc_str, name?name:"(null)", paramttl?paramttl:"PT0S", sc->nsec3_optout, sc->nsec3_algo, sc->nsec3_iterations, sc->nsec3_salt?sc->nsec3_salt:"(null)"); } /* keys */ keylist_log(sc->keys, name); /* cleanup */ free((void*)resign); free((void*)refresh); free((void*)validity); free((void*)denial); free((void*)jitter); free((void*)offset); free((void*)dnskeyttl); free((void*)paramttl); free((void*)soattl); free((void*)soamin); } return; } /** * Clean up signer configuration. * */ void signconf_cleanup(signconf_type* sc) { allocator_type* allocator = NULL; if (!sc) { return; } duration_cleanup(sc->sig_resign_interval); duration_cleanup(sc->sig_refresh_interval); duration_cleanup(sc->sig_validity_default); duration_cleanup(sc->sig_validity_denial); duration_cleanup(sc->sig_jitter); duration_cleanup(sc->sig_inception_offset); duration_cleanup(sc->dnskey_ttl); duration_cleanup(sc->soa_ttl); duration_cleanup(sc->soa_min); keylist_cleanup(sc->keys); nsec3params_cleanup(sc->nsec3params); allocator = sc->allocator; allocator_deallocate(allocator, (void*) sc->filename); allocator_deallocate(allocator, (void*) sc->nsec3_salt); allocator_deallocate(allocator, (void*) sc->soa_serial); allocator_deallocate(allocator, (void*) sc); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/signer/nsec3params.h0000644000175000017500000000652712650165732016565 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * NSEC3 Parameters. * */ #ifndef SIGNER_NSEC3PARAMS_H #define SIGNER_NSEC3PARAMS_H #include "config.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * NSEC3 Parameters structure. */ typedef struct nsec3params_struct nsec3params_type; struct nsec3params_struct { void* sc; uint8_t algorithm; uint8_t flags; uint16_t iterations; uint8_t salt_len; uint8_t* salt_data; ldns_rr* rr; }; /** * Create NSEC3 salt. * \param[in] salt_str the salt in string format * \param[out] salt_len lenght of the salt data * \param[out] salt salt in raw data format * \return ods_status status * */ ods_status nsec3params_create_salt(const char* salt_str, uint8_t* salt_len, uint8_t** salt); /** * Create new NSEC3 parameters. * \param[in] sc signer configuration reference * \param[in] algo algorithm * \param[in] flags flags, Opt-Out or Opt-In * \param[in] iter number of iterations * \param[in] salt salt * \return nsec3params_type* the created nsec3params * */ nsec3params_type* nsec3params_create(void* sc, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt); /** * Backup NSEC3 parameters. * \param[in] fd file descriptor * \param[in] algo algorithm * \param[in] flags glags, Opt-Out or Opt-In * \param[in] iter number of iterations * \param[in] salt salt * \param[in] rr NSEC3PARAM RR * \param[in] version version string * */ void nsec3params_backup(FILE* fd, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt, ldns_rr* rr, const char* version); /** * Convert salt to string. * \param[in] nsec3params NSEC3 parameters * \return const char* str salt in string format * */ const char* nsec3params_salt2str(nsec3params_type* nsec3params); /** * Clean up the NSEC3 parameters. * \param[in] nsec3params the nsec3param to be deleted * */ void nsec3params_cleanup(nsec3params_type* nsec3params); #endif /* SIGNER_NSEC3PARAMS_H */ opendnssec-1.4.9/signer/src/signer/zonelist.c0000644000175000017500000003052212650165732016200 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * The zonelist and all. */ #include "config.h" #include "parser/confparser.h" #include "parser/zonelistparser.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zone.h" #include "signer/zonelist.h" #include #include static const char* zl_str = "zonelist"; /** * Compare two zones. * */ static int zone_compare(const void* a, const void* b) { zone_type* x = (zone_type*)a; zone_type* y = (zone_type*)b; ods_log_assert(x); ods_log_assert(y); if (x->klass != y->klass) { if (x->klass < y->klass) { return -1; } return 1; } return ldns_dname_compare(x->apex, y->apex); } /** * Create a new zone list. * */ zonelist_type* zonelist_create(allocator_type* allocator) { zonelist_type* zlist = NULL; if (allocator) { zlist = (zonelist_type*) allocator_alloc(allocator, sizeof(zonelist_type)); } if (!zlist) { ods_log_error("[%s] unable to create zonelist: allocator_alloc() " "failed", zl_str); return NULL; } zlist->allocator = allocator; zlist->zones = ldns_rbtree_create(zone_compare); if (!zlist->zones) { ods_log_error("[%s] unable to create zonelist: ldns_rbtree_create() " "failed", zl_str); allocator_deallocate(allocator, (void*) zlist); return NULL; } zlist->last_modified = 0; lock_basic_init(&zlist->zl_lock); return zlist; } /** * Read a zonelist file. * */ static ods_status zonelist_read(zonelist_type* zl, const char* zlfile) { const char* rngfile = ODS_SE_RNGDIR "/zonelist.rng"; ods_status status = ODS_STATUS_OK; ods_log_assert(zlfile); ods_log_verbose("[%s] read file %s", zl_str, zlfile); status = parse_file_check(zlfile, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read file: parse error in %s", zl_str, zlfile); return status; } return parse_zonelist_zones((struct zonelist_struct*) zl, zlfile); } /** * Convert a zone to a tree node. * */ static ldns_rbnode_t* zone2node(zone_type* zone) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = zone; node->data = zone; return node; } /** * Lookup zone. * */ static zone_type* zonelist_lookup_zone(zonelist_type* zonelist, zone_type* zone) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (zonelist && zonelist->zones && zone) { node = ldns_rbtree_search(zonelist->zones, zone); if (node) { return (zone_type*) node->data; } } return NULL; } /** * Lookup zone by name. * */ zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist, const char* name, ldns_rr_class klass) { zone_type* zone = NULL; zone_type* result = NULL; if (zonelist && zonelist->zones && name && klass) { zone = zone_create((char*) name, klass); if (!zone) { ods_log_error("[%s] unable to lookup zone %s: " "zone_create() failed", zl_str, name); /* result stays NULL */ } else { result = zonelist_lookup_zone(zonelist, zone); zone_cleanup(zone); } } return result; } /** * Lookup zone by dname. * */ zone_type* zonelist_lookup_zone_by_dname(zonelist_type* zonelist, ldns_rdf* dname, ldns_rr_class klass) { char* name = NULL; zone_type* result = NULL; if (zonelist && zonelist->zones && dname && klass) { name = ldns_rdf2str(dname); result = zonelist_lookup_zone_by_name(zonelist, name, klass); free((void*)name); } return result; } /** * Add zone. * */ zone_type* zonelist_add_zone(zonelist_type* zlist, zone_type* zone) { ldns_rbnode_t* new_node = NULL; if (!zone) { return NULL; } if (!zlist || !zlist->zones) { zone_cleanup(zone); return NULL; } /* look up */ if (zonelist_lookup_zone(zlist, zone) != NULL) { ods_log_warning("[%s] unable to add zone %s: already present", zl_str, zone->name); zone_cleanup(zone); return NULL; } /* add */ new_node = zone2node(zone); if (ldns_rbtree_insert(zlist->zones, new_node) == NULL) { ods_log_error("[%s] unable to add zone %s: ldns_rbtree_insert() " "failed", zl_str, zone->name); free((void*) new_node); zone_cleanup(zone); return NULL; } zone->zl_status = ZONE_ZL_ADDED; zlist->just_added++; return zone; } /** * Delete zone. * */ zone_type* zonelist_del_zone(zonelist_type* zlist, zone_type* zone) { ldns_rbnode_t* old_node = LDNS_RBTREE_NULL; if (!zone) { return NULL; } if (!zlist || !zlist->zones) { goto zone_not_present; } old_node = ldns_rbtree_delete(zlist->zones, zone); if (!old_node) { goto zone_not_present; } free((void*) old_node); return zone; zone_not_present: ods_log_warning("[%s] unable to delete zone %s: not present", zl_str, zone->name); return zone; } /** * Merge zone lists. * */ static void zonelist_merge(zonelist_type* zl1, zonelist_type* zl2) { zone_type* z1 = NULL; zone_type* z2 = NULL; ldns_rbnode_t* n1 = LDNS_RBTREE_NULL; ldns_rbnode_t* n2 = LDNS_RBTREE_NULL; int ret = 0; ods_log_assert(zl1); ods_log_assert(zl2); ods_log_assert(zl1->zones); ods_log_assert(zl2->zones); ods_log_debug("[%s] merge two zone lists", zl_str); n1 = ldns_rbtree_first(zl1->zones); n2 = ldns_rbtree_first(zl2->zones); while (n2 && n2 != LDNS_RBTREE_NULL) { z2 = (zone_type*) n2->data; if (n1 && n1 != LDNS_RBTREE_NULL) { z1 = (zone_type*) n1->data; } else { z1 = NULL; } if (!z2) { /* no more zones to merge into zl1 */ return; } else if (!z1) { /* just add remaining zones from zl2 */ z2 = zonelist_add_zone(zl1, z2); if (!z2) { ods_log_crit("[%s] merge failed: z2 not added", zl_str); return; } n2 = ldns_rbtree_next(n2); } else { /* compare the zones z1 and z2 */ ret = zone_compare(z1, z2); if (ret < 0) { /* remove zone z1, it is not present in the new list zl2 */ z1->zl_status = ZONE_ZL_REMOVED; zl1->just_removed++; n1 = ldns_rbtree_next(n1); } else if (ret > 0) { /* add the new zone z2 */ z2 = zonelist_add_zone(zl1, z2); if (!z2) { ods_log_crit("[%s] merge failed: z2 not added", zl_str); return; } n2 = ldns_rbtree_next(n2); } else { /* just update zone z1 */ n1 = ldns_rbtree_next(n1); n2 = ldns_rbtree_next(n2); zone_merge(z1, z2); zone_cleanup(z2); if (z1->zl_status == ZONE_ZL_UPDATED) { zl1->just_updated++; } z1->zl_status = ZONE_ZL_UPDATED; } } } /* remove remaining zones from z1 */ while (n1 && n1 != LDNS_RBTREE_NULL) { z1 = (zone_type*) n1->data; z1->zl_status = ZONE_ZL_REMOVED; zl1->just_removed++; n1 = ldns_rbtree_next(n1); } zl1->last_modified = zl2->last_modified; return; } /** * Update zone list. * */ ods_status zonelist_update(zonelist_type* zl, const char* zlfile) { zonelist_type* new_zlist = NULL; allocator_type* tmp_alloc = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; char* datestamp = NULL; ods_log_debug("[%s] update zone list", zl_str); if (!zl|| !zl->zones || !zlfile) { return ODS_STATUS_ASSERT_ERR; } /* is the file updated? */ st_mtime = ods_file_lastmodified(zlfile); if (st_mtime <= zl->last_modified) { (void)time_datestamp(zl->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] zonelist file %s is unchanged since %s", zl_str, zlfile, datestamp?datestamp:"Unknown"); free((void*)datestamp); return ODS_STATUS_UNCHANGED; } /* create new zonelist */ tmp_alloc = allocator_create(malloc, free); if (!tmp_alloc) { return ODS_STATUS_MALLOC_ERR; } new_zlist = zonelist_create(tmp_alloc); if (!new_zlist) { ods_log_error("[%s] unable to update zonelist: zonelist_create() " "failed", zl_str); allocator_cleanup(tmp_alloc); return ODS_STATUS_ERR; } /* read zonelist */ status = zonelist_read(new_zlist, zlfile); if (status == ODS_STATUS_OK) { zl->just_removed = 0; zl->just_added = 0; zl->just_updated = 0; new_zlist->last_modified = st_mtime; zonelist_merge(zl, new_zlist); (void)time_datestamp(zl->last_modified, "%Y-%m-%d %T", &datestamp); ods_log_debug("[%s] file %s is modified since %s", zl_str, zlfile, datestamp?datestamp:"Unknown"); free((void*)datestamp); } else { ods_log_error("[%s] unable to update zonelist: read file %s failed " "(%s)", zl_str, zlfile, ods_status2str(status)); } zonelist_free(new_zlist); allocator_cleanup(tmp_alloc); return status; } /** * Internal zone cleanup function. * */ static void zone_delfunc(ldns_rbnode_t* elem) { zone_type* zone; if (elem && elem != LDNS_RBTREE_NULL) { zone = (zone_type*) elem->data; zone_delfunc(elem->left); zone_delfunc(elem->right); ods_log_deeebug("[%s] cleanup zone %s", zl_str, zone->name); zone_cleanup(zone); free((void*)elem); } return; } /** * Internal node cleanup function. * */ static void node_delfunc(ldns_rbnode_t* elem) { if (elem && elem != LDNS_RBTREE_NULL) { node_delfunc(elem->left); node_delfunc(elem->right); free((void*)elem); } return; } /** * Clean up a zonelist. * */ void zonelist_cleanup(zonelist_type* zl) { allocator_type* allocator; lock_basic_type zl_lock; if (!zl) { return; } ods_log_debug("[%s] cleanup zonelist", zl_str); if (zl->zones) { zone_delfunc(zl->zones->root); ldns_rbtree_free(zl->zones); zl->zones = NULL; } allocator = zl->allocator; zl_lock = zl->zl_lock; allocator_deallocate(allocator, (void*) zl); lock_basic_destroy(&zl_lock); return; } /** * Free zonelist. * */ void zonelist_free(zonelist_type* zl) { allocator_type* allocator; lock_basic_type zl_lock; if (!zl) { return; } if (zl->zones) { node_delfunc(zl->zones->root); ldns_rbtree_free(zl->zones); zl->zones = NULL; } allocator = zl->allocator; zl_lock = zl->zl_lock; allocator_deallocate(allocator, (void*) zl); lock_basic_destroy(&zl_lock); return; } opendnssec-1.4.9/signer/src/signer/backup.c0000644000175000017500000004306112650165732015600 00000000000000/* * Copyright (c) 2006-2010 NLNet Labs. 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 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. * */ /** * Recover from backup. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adutil.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/zone.h" #include static const char* backup_str = "backup"; /** * Read token from backup file. * */ char* backup_read_token(FILE* in) { static char buf[4000]; buf[sizeof(buf)-1]=0; while (1) { if (fscanf(in, "%3990s", buf) != 1) { return 0; } if (buf[0] != '#') { return buf; } if (!fgets(buf, sizeof(buf), in)) { return 0; } } return 0; } /** * Read and match a string from backup file. * */ int backup_read_check_str(FILE* in, const char* str) { char *p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read check string \'%s\'", backup_str, str); return 0; } if (ods_strcmp(p, str) != 0) { ods_log_debug("[%s] \'%s\' does not match \'%s\'", backup_str, p, str); return 0; } return 1; } /** * Read a string from backup file. * */ int backup_read_str(FILE* in, const char** str) { char *p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read string", backup_str); return 0; } *str = strdup(p); return 1; } /** * Read time from backup file. * */ int backup_read_time_t(FILE* in, time_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read time", backup_str); return 0; } *v=atol(p); return 1; } /** * Read duration from backup file. * */ int backup_read_duration(FILE* in, duration_type** v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read duration", backup_str); return 0; } *v=duration_create_from_string((const char*) p); return 1; } /** * Read rr type from backup file. * */ int backup_read_rr_type(FILE* in, ldns_rr_type* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read rr type", backup_str); return 0; } *v=(ldns_rr_type) atoi(p); return 1; } /** * Read integer from backup file. * */ int backup_read_int(FILE* in, int* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read integer", backup_str); return 0; } *v=atoi(p); return 1; } /** * Read size type from backup file. * */ int backup_read_size_t(FILE* in, size_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read size_t", backup_str); return 0; } *v=(size_t)atoi(p); return 1; } /** * Read 8bit unsigned integer from backup file. * */ int backup_read_uint8_t(FILE* in, uint8_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint8_t", backup_str); return 0; } *v= (uint8_t)atoi(p); return 1; } /** * Read 16bit unsigned integer from backup file. * */ int backup_read_uint16_t(FILE* in, uint16_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint16_t", backup_str); return 0; } *v= (uint16_t)atoi(p); return 1; } /** * Read 32bit unsigned integer from backup file. * */ int backup_read_uint32_t(FILE* in, uint32_t* v) { char* p = backup_read_token(in); if (!p) { ods_log_debug("[%s] cannot read uint32_t", backup_str); return 0; } *v= (uint32_t)atol(p); return 1; } /** * Read the next RR from the backup file. * */ static ldns_rr* backup_read_rr(FILE* in, zone_type* zone, char* line, ldns_rdf** orig, ldns_rdf** prev, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; int len = 0; backup_read_line: len = adutil_readline_frm_file(in, line, l, 1); if (len >= 0) { switch (line[0]) { case ';': /* done */ *status = LDNS_STATUS_OK; return NULL; break; case '\n': case '\0': goto backup_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: *status = ldns_rr_new_frm_str(&rr, line, zone->default_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto backup_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR #%i (%s): %s", backup_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Get locator from string. * */ static char* replace_space_with_nul(char* str) { int i = 0; if (!str) { return NULL; } i = strlen(str); while (i>0) { --i; if (str[i] == ' ') { str[i] = '\0'; } } return strdup(str); } /** * Read namedb from backup file. * */ ods_status backup_read_namedb(FILE* in, void* zone) { zone_type* z = (zone_type*) zone; denial_type* denial = NULL; rrset_type* rrset = NULL; ods_status result = ODS_STATUS_OK; ldns_rr_type type_covered; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; char* str = NULL; char* locator = NULL; uint32_t flags = 0; unsigned int l = 0; ods_log_assert(in); ods_log_assert(z); /* $ORIGIN */ dname = adapi_get_origin(z); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } /* read RRs */ ods_log_debug("[%s] read RRs %s", backup_str, z->name); while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } /* add to the database */ result = adapi_add_rr(z, rr, 1); if (result == ODS_STATUS_UNCHANGED) { ods_log_debug("[%s] skipping RR #%i (duplicate): %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error adding RR #%i: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; goto backup_namedb_done; } } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } namedb_diff(z->db, 0, 0); /* read NSEC(3)s */ ods_log_debug("[%s] read NSEC(3)s %s", backup_str, z->name); l = 0; while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading NSEC(3) #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_NSEC && ldns_rr_get_type(rr) != LDNS_RR_TYPE_NSEC3) { ods_log_error("[%s] error NSEC(3) #%i is not NSEC(3): %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } /* add to the denial chain */ denial = namedb_lookup_denial(z->db, ldns_rr_owner(rr)); if (!denial) { ods_log_error("[%s] error adding NSEC(3) #%i: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } denial_add_rr(denial, rr); } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading NSEC(3) #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } /* read RRSIGs */ ods_log_debug("[%s] read RRSIGs %s", backup_str, z->name); l = 0; while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_namedb_done; } if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_RRSIG) { ods_log_error("[%s] error RRSIG #%i is not RRSIG: %s", backup_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } /* read locator and flags */ str = strstr(line, "flags"); if (str) { flags = (uint32_t) atoi(str+6); } str = strstr(line, "locator"); if (str) { locator = replace_space_with_nul(str+8); } /* add signatures */ type_covered = ldns_rdf2rr_type(ldns_rr_rrsig_typecovered(rr)); if (type_covered == LDNS_RR_TYPE_NSEC || type_covered == LDNS_RR_TYPE_NSEC3) { denial = namedb_lookup_denial(z->db, ldns_rr_owner(rr)); if (!denial) { ods_log_error("[%s] error restoring RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } rrset = denial->rrset; } else { rrset = zone_lookup_rrset(z, ldns_rr_owner(rr), type_covered); } if (!rrset || !rrset_add_rrsig(rrset, rr, locator, flags)) { ods_log_error("[%s] error restoring RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_namedb_done; } else { rrset->needs_signing = 0; } } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RRSIG #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } backup_namedb_done: if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } return result; } /** * Read ixfr journal from file. * * */ ods_status backup_read_ixfr(FILE* in, void* zone) { zone_type* z = (zone_type*) zone; ods_status result = ODS_STATUS_OK; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; uint32_t serial = 0; unsigned l = 0; unsigned first_soa = 0; unsigned del_mode = 0; ods_log_assert(in); ods_log_assert(z); /* $ORIGIN */ dname = adapi_get_origin(z); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", backup_str); return ODS_STATUS_ERR; } /* read RRs */ while ((rr = backup_read_rr(in, z, line, &orig, &prev, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; goto backup_ixfr_done; } if (first_soa == 2) { ods_log_error("[%s] bad ixfr journal: trailing RRs after final " "SOA", backup_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_ixfr_done; } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { serial = ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); if (!first_soa) { ods_log_debug("[%s] ixfr first SOA: %s", backup_str, ldns_rr2str(rr)); /* first SOA */ ldns_rr_free(rr); rr = NULL; if (z->db->outserial != serial) { ods_log_error("[%s] bad ixfr journal: first SOA wrong " "serial (was %u, expected %u)", backup_str, serial, z->db->outserial); result = ODS_STATUS_ERR; goto backup_ixfr_done; } first_soa = 1; continue; } ods_log_assert(first_soa); if (!del_mode) { if (z->db->outserial == serial) { /* final SOA */ ods_log_debug("[%s] ixfr final SOA: %s", backup_str, ldns_rr2str(rr)); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; first_soa = 2; continue; } else { ods_log_debug("[%s] new part SOA: %s", backup_str, ldns_rr2str(rr)); lock_basic_lock(&z->ixfr->ixfr_lock); ixfr_purge(z->ixfr); lock_basic_unlock(&z->ixfr->ixfr_lock); } } else { ods_log_debug("[%s] second part SOA: %s", backup_str, ldns_rr2str(rr)); } del_mode = !del_mode; } /* ixfr add or del rr */ if (!first_soa) { ods_log_error("[%s] bad ixfr journal: first RR not SOA", backup_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; goto backup_ixfr_done; } ods_log_assert(first_soa); lock_basic_lock(&z->ixfr->ixfr_lock); if (del_mode) { ods_log_deeebug("[%s] -IXFR: %s", backup_str, ldns_rr2str(rr)); ixfr_del_rr(z->ixfr, rr); } else { ods_log_deeebug("[%s] +IXFR: %s", backup_str, ldns_rr2str(rr)); ixfr_add_rr(z->ixfr, rr); } lock_basic_unlock(&z->ixfr->ixfr_lock); } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR #%i (%s): %s", backup_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } backup_ixfr_done: if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } return result; } opendnssec-1.4.9/signer/src/signer/zonelist.h0000644000175000017500000000642412650165732016211 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * * The zonelist and all. */ #ifndef SIGNER_ZONELIST_H #define SIGNER_ZONELIST_H #include "shared/allocator.h" #include "shared/locks.h" #include "signer/zone.h" #include #include #include /** * Zone list * */ typedef struct zonelist_struct zonelist_type; struct zonelist_struct { allocator_type* allocator; ldns_rbtree_t* zones; time_t last_modified; int just_added; int just_updated; int just_removed; lock_basic_type zl_lock; }; /** * Create zone list. * \param[in] allocator memory allocator * \return zonelist_type* created zone list * */ zonelist_type* zonelist_create(allocator_type* allocator); /** * Lookup zone by name and class. * \param[in] zl zone list * \param[in] name zone name * \param[in] klass zone class * \return zone_type* found zone * */ zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist, const char* name, ldns_rr_class klass); /** * Lookup zone by dname and class. * \param[in] zl zone list * \param[in] dname zone domain name * \param[in] klass zone class * \return zone_type* found zone * */ zone_type* zonelist_lookup_zone_by_dname(zonelist_type* zonelist, ldns_rdf* dname, ldns_rr_class klass); /** * Add zone. * \param[in] zl zone list * \param[in] zone zone * \return zone_type* added zone * */ zone_type* zonelist_add_zone(zonelist_type* zl, zone_type* zone); /** * Delete zone. * \param[in] zl zone list * \param[in] zone zone * \return zone_type* deleted zone * */ zone_type* zonelist_del_zone(zonelist_type* zlist, zone_type* zone); /** * Update zonelist. * \param[in] zl zone list * \param[in] zlfile zone list filename * \return ods_status status * */ ods_status zonelist_update(zonelist_type* zl, const char* zlfile); /** * Clean up zone list. * \param[in] zl zone list * */ void zonelist_cleanup(zonelist_type* zl); /** * Free zone list. * \param[in] zl zone list * */ void zonelist_free(zonelist_type* zl); #endif /* SIGNER_ZONELIST_H */ opendnssec-1.4.9/signer/src/signer/stats.h0000644000175000017500000000523412650165732015476 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer statistics. * */ #ifndef SIGNER_STATS_H #define SIGNER_STATS_H #include "shared/locks.h" #include #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * Statistics structure. */ typedef struct stats_struct stats_type; struct stats_struct { int32_t sort_count; time_t sort_time; int sort_done; int32_t nsec_count; time_t nsec_time; int32_t sig_count; int32_t sig_soa_count; int32_t sig_reuse; time_t sig_time; time_t audit_time; time_t start_time; time_t end_time; lock_basic_type stats_lock; }; /** * Initialize statistics. * \return the initialized stats; * */ stats_type* stats_create(void); /** * Log statistics. * \param[in] stats statistics * \param[in] name zone name * \param[in] serial serial * \param[in] nsec_type NSEC or NSEC3 * */ void stats_log(stats_type* stats, const char* name, uint32_t serial, ldns_rr_type nsec_type); /** * Clear statistics. * \param[in] stats statistics to be cleared * */ void stats_clear(stats_type* stats); /** * Clean up statistics. * \param[in] stats statistics to be deleted * */ void stats_cleanup(stats_type* stats); #endif /* SIGNER_STATS_H */ opendnssec-1.4.9/signer/src/signer/stats.c0000644000175000017500000000571312650165732015473 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer statistics. * */ #include "shared/log.h" #include "signer/stats.h" /** * Initialize statistics. * */ stats_type* stats_create(void) { stats_type* stats = (stats_type*) malloc(sizeof(stats_type)); stats_clear(stats); lock_basic_init(&stats->stats_lock); return stats; } /** * Clear statistics. * */ void stats_clear(stats_type* stats) { ods_log_assert(stats); stats->sort_count = 0; stats->sort_time = 0; stats->sort_done = 0; stats->nsec_count = 0; stats->nsec_time = 0; stats->sig_count = 0; stats->sig_soa_count = 0; stats->sig_reuse = 0; stats->sig_time = 0; stats->start_time = 0; stats->end_time = 0; } /** * Log statistics. * */ void stats_log(stats_type* stats, const char* name, uint32_t serial, ldns_rr_type nsec_type) { uint32_t avsign = 0; if (!stats) { return; } ods_log_assert(stats); if (stats->sig_time) { avsign = (uint32_t) (stats->sig_count/stats->sig_time); } ods_log_info("[STATS] %s %u RR[count=%d time=%u(sec)] " "NSEC%s[count=%d time=%u(sec)] " "RRSIG[new=%d reused=%d time=%u(sec) avg=%u(sig/sec)] " "TOTAL[time=%u(sec)] ", name?name:"(null)", (unsigned) serial, stats->sort_count, stats->sort_time, nsec_type==LDNS_RR_TYPE_NSEC3?"3":"", stats->nsec_count, stats->nsec_time, stats->sig_count, stats->sig_reuse, stats->sig_time, avsign, (uint32_t) (stats->end_time - stats->start_time)); return; } /** * Clean up statistics. * */ void stats_cleanup(stats_type* stats) { lock_basic_destroy(&stats->stats_lock); free((void*) stats); return; } opendnssec-1.4.9/signer/src/signer/ixfr.c0000644000175000017500000001740712650165732015310 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * IXFR Journal. * */ #include "config.h" #include "shared/util.h" #include "signer/ixfr.h" #include "signer/rrset.h" #include "signer/zone.h" static const char* ixfr_str = "journal"; /** * Create a part of ixfr journal. * */ static part_type* part_create(allocator_type* allocator) { part_type* part = NULL; ods_log_assert(allocator); part = (part_type*) allocator_alloc(allocator, sizeof(part_type)); if (!part) { ods_log_error("[%s] unable to create ixfr part: " "allocator_alloc() failed", ixfr_str); return NULL; } part->soaplus = NULL; part->soamin = NULL; part->plus = ldns_rr_list_new(); if (!part->plus) { ods_log_error("[%s] unable to create ixfr part: " "ldns_rr_list_new() failed", ixfr_str); allocator_deallocate(allocator, (void*) part); return NULL; } part->min = ldns_rr_list_new(); if (!part->min) { ods_log_error("[%s] unable to create ixfr part: " "ldns_rr_list_new() failed", ixfr_str); ldns_rr_list_free(part->plus); allocator_deallocate(allocator, (void*) part); return NULL; } return part; } /** * Clean up a part of ixfr journal. * */ static void part_cleanup(allocator_type* allocator, part_type* part) { if (!part || !allocator) { return; } ldns_rr_list_deep_free(part->min); ldns_rr_list_free(part->plus); allocator_deallocate(allocator, (void*) part); return; } /** * Create a new ixfr journal. * */ ixfr_type* ixfr_create(void* zone) { size_t i = 0; ixfr_type* xfr = NULL; zone_type* z = (zone_type*) zone; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->allocator); xfr = (ixfr_type*) allocator_alloc(z->allocator, sizeof(ixfr_type)); if (!xfr) { ods_log_error("[%s] unable to create ixfr for zone %s: " "allocator_alloc() failed", ixfr_str, z->name); return NULL; } for (i=0; i < IXFR_MAX_PARTS; i++) { xfr->part[i] = NULL; } xfr->zone = zone; lock_basic_init(&xfr->ixfr_lock); return xfr; } /** * Add +RR to ixfr journal. * */ void ixfr_add_rr(ixfr_type* ixfr, ldns_rr* rr) { zone_type* zone = NULL; if (!ixfr || !rr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_initialized) { /* no ixfr yet */ return; } ods_log_assert(ixfr->part[0]); ods_log_assert(ixfr->part[0]->plus); if (!ldns_rr_list_push_rr(ixfr->part[0]->plus, rr)) { ods_fatal_exit("[%s] fatal unable to +RR: ldns_rr_list_push_rr() failed", ixfr_str); } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { ixfr->part[0]->soaplus = rr; } return; } /** * Add -RR to ixfr journal. * */ void ixfr_del_rr(ixfr_type* ixfr, ldns_rr* rr) { zone_type* zone = NULL; if (!ixfr || !rr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_initialized) { /* no ixfr yet */ return; } ods_log_assert(ixfr->part[0]); ods_log_assert(ixfr->part[0]->min); if (!ldns_rr_list_push_rr(ixfr->part[0]->min, rr)) { ods_fatal_exit("[%s] fatal unable to -RR: ldns_rr_list_push_rr() failed", ixfr_str); } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { ixfr->part[0]->soamin = rr; } return; } /** * Print all RRs in list, except SOA RRs. * */ static int part_rr_list_print_nonsoa(FILE* fd, ldns_rr_list* list) { size_t i = 0; int error = 0; if (!list || !fd) { return 1; } for (i = 0; i < ldns_rr_list_rr_count(list); i++) { if (ldns_rr_get_type(ldns_rr_list_rr(list, i)) != LDNS_RR_TYPE_SOA) { if (util_rr_print(fd, ldns_rr_list_rr(list, i)) != ODS_STATUS_OK) { error = 1; } } } return error; } /** * Print part of the ixfr journal. * */ static void part_print(FILE* fd, ixfr_type* ixfr, size_t i) { zone_type* zone = NULL; part_type* part = NULL; int error = 0; if (!ixfr || !fd) { return; } zone = (zone_type*) ixfr->zone; part = ixfr->part[i]; if (!part) { return; } ods_log_assert(part->min); ods_log_assert(part->plus); ods_log_assert(part->soamin); ods_log_assert(part->soaplus); if (util_rr_print(fd, part->soamin) != ODS_STATUS_OK) { zone->adoutbound->error = 1; } error = part_rr_list_print_nonsoa(fd, part->min); if (error) { zone->adoutbound->error = 1; } if (util_rr_print(fd, part->soaplus) != ODS_STATUS_OK) { zone->adoutbound->error = 1; } error = part_rr_list_print_nonsoa(fd, part->plus); if (error) { zone->adoutbound->error = 1; } return; } /** * Print the ixfr journal. * */ void ixfr_print(FILE* fd, ixfr_type* ixfr) { int i = 0; if (!ixfr || !fd) { return; } ods_log_debug("[%s] print ixfr", ixfr_str); for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { ods_log_deeebug("[%s] print ixfr part #%d", ixfr_str, i); part_print(fd, ixfr, i); } return; } /** * Purge the ixfr journal. * */ void ixfr_purge(ixfr_type* ixfr) { int i = 0; zone_type* zone = NULL; if (!ixfr) { return; } zone = (zone_type*) ixfr->zone; ods_log_assert(zone); ods_log_assert(zone->allocator); ods_log_debug("[%s] purge ixfr for zone %s", ixfr_str, zone->name); for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { if (i == (IXFR_MAX_PARTS - 1)) { part_cleanup(zone->allocator, ixfr->part[i]); ixfr->part[i] = NULL; } else { ixfr->part[i+1] = ixfr->part[i]; ixfr->part[i] = NULL; } } ixfr->part[0] = part_create(zone->allocator); if (!ixfr->part[0]) { ods_fatal_exit("[%s] fatal unable to purge ixfr for zone %s: " "part_create() failed", ixfr_str, zone->name); } return; } /** * Cleanup the ixfr journal. * */ void ixfr_cleanup(ixfr_type* ixfr) { int i = 0; zone_type* z = NULL; lock_basic_type ixfr_lock; if (!ixfr) { return; } z = (zone_type*) ixfr->zone; ixfr_lock = ixfr->ixfr_lock; for (i = IXFR_MAX_PARTS - 1; i >= 0; i--) { part_cleanup(z->allocator, ixfr->part[i]); } allocator_deallocate(z->allocator, (void*) ixfr); lock_basic_destroy(&ixfr_lock); return; } opendnssec-1.4.9/signer/src/signer/namedb.c0000644000175000017500000010026012650165732015554 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Domain name database. * */ #include "config.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/namedb.h" #include "signer/zone.h" const char* db_str = "namedb"; /** * Convert a domain to a tree node. * */ static ldns_rbnode_t* domain2node(domain_type* domain) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = domain->dname; node->data = domain; return node; } /** * Convert a denial to a tree node. * */ static ldns_rbnode_t* denial2node(denial_type* denial) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (!node) { return NULL; } node->key = denial->dname; node->data = denial; return node; } /** * Compare domains. * */ static int domain_compare(const void* a, const void* b) { ldns_rdf* x = (ldns_rdf*)a; ldns_rdf* y = (ldns_rdf*)b; return ldns_dname_compare(x, y); } /** * Initialize denials. * */ void namedb_init_denials(namedb_type* db) { if (db) { db->denials = ldns_rbtree_create(domain_compare); } return; } /** * Initialize domains. * */ static void namedb_init_domains(namedb_type* db) { if (db) { db->domains = ldns_rbtree_create(domain_compare); } return; } /** * Create a new namedb. * */ namedb_type* namedb_create(void* zone) { namedb_type* db = NULL; zone_type* z = (zone_type*) zone; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->allocator); db = (namedb_type*) allocator_alloc(z->allocator, sizeof(namedb_type)); if (!db) { ods_log_error("[%s] unable to create namedb for zone %s: " "allocator_alloc() failed", db_str, z->name); return NULL; } db->zone = zone; namedb_init_domains(db); if (!db->domains) { ods_log_error("[%s] unable to create namedb for zone %s: " "init domains failed", db_str, z->name); namedb_cleanup(db); return NULL; } namedb_init_denials(db); if (!db->denials) { ods_log_error("[%s] unable to create namedb for zone %s: " "init denials failed", db_str, z->name); namedb_cleanup(db); return NULL; } db->inbserial = 0; db->intserial = 0; db->outserial = 0; db->altserial = 0; db->is_initialized = 0; db->have_serial = 0; db->is_processed = 0; db->serial_updated = 0; db->force_serial = 0; return db; } /** * Internal lookup domain function. * */ static void* namedb_domain_search(ldns_rbtree_t* tree, ldns_rdf* dname) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (!tree || !dname) { return NULL; } node = ldns_rbtree_search(tree, dname); if (node && node != LDNS_RBTREE_NULL) { return (void*) node->data; } return NULL; } static uint32_t max(uint32_t a, uint32_t b) { return (aoutserial, inbound_serial); if (!db->have_serial) { prev = inbound_serial; } ods_log_debug("[%s] zone %s update serial: format=%s in=%u internal=%u " "out=%u now=%u", db_str, zone_name, format, db->inbserial, db->intserial, db->outserial, (uint32_t) time_now()); if (db->force_serial) { soa = db->altserial; if (!util_serial_gt(soa, prev)) { ods_log_warning("[%s] zone %s unable to enforce serial: %u does not " " increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); soa = prev + 1; } else { ods_log_info("[%s] zone %s enforcing serial %u", db_str, zone_name, soa); } db->force_serial = 0; } else if (ods_strcmp(format, "unixtime") == 0) { soa = (uint32_t) time_now(); if (!util_serial_gt(soa, prev)) { if (!db->have_serial) { ods_log_warning("[%s] zone %s unable to use unixtime as serial: " "%u does not increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); } soa = prev + 1; } } else if (ods_strcmp(format, "datecounter") == 0) { soa = (uint32_t) time_datestamp(0, "%Y%m%d", NULL) * 100; if (!util_serial_gt(soa, prev)) { if (!db->have_serial) { ods_log_warning("[%s] zone %s unable to use datecounter as " "serial: %u does not increase %u. Serial set to %u", db_str, zone_name, soa, prev, (prev+1)); } soa = prev + 1; } } else if (ods_strcmp(format, "counter") == 0) { soa = inbound_serial + 1; if (db->have_serial && !util_serial_gt(soa, prev)) { soa = prev + 1; } } else if (ods_strcmp(format, "keep") == 0) { prev = db->outserial; soa = inbound_serial; if (db->have_serial && !util_serial_gt(soa, prev)) { ods_log_error("[%s] zone %s cannot keep SOA SERIAL from input zone " " (%u): previous output SOA SERIAL is %u", db_str, zone_name, soa, prev); return ODS_STATUS_CONFLICT_ERR; } } else { ods_log_error("[%s] zone %s unknown serial type %s", db_str, zone_name, format); return ODS_STATUS_ERR; } /* serial is stored in 32 bits */ update = soa - prev; if (update > 0x7FFFFFFF) { update = 0x7FFFFFFF; } if (!db->have_serial) { db->intserial = soa; } else { db->intserial = prev + update; /* automatically does % 2^32 */ } ods_log_debug("[%s] zone %s update serial: %u + %u = %u", db_str, zone_name, prev, update, db->intserial); return ODS_STATUS_OK; } /** * Add empty non-terminals for domain. * */ ods_status namedb_domain_entize(namedb_type* db, domain_type* domain, ldns_rdf* apex) { ldns_rdf* parent_rdf = NULL; domain_type* parent_domain = NULL; ods_log_assert(apex); ods_log_assert(domain); ods_log_assert(domain->dname); ods_log_assert(db); ods_log_assert(db->domains); if (domain->parent) { /* domain already has parent */ return ODS_STATUS_OK; } while (domain && ldns_dname_is_subdomain(domain->dname, apex) && ldns_dname_compare(domain->dname, apex) != 0) { /** * RFC5155: * 4. If the difference in number of labels between the apex and * the original owner name is greater than 1, additional NSEC3 * RRs need to be added for every empty non-terminal between * the apex and the original owner name. */ parent_rdf = ldns_dname_left_chop(domain->dname); if (!parent_rdf) { ods_log_error("[%s] unable to entize domain: left chop failed", db_str); return ODS_STATUS_ERR; } parent_domain = namedb_lookup_domain(db, parent_rdf); if (!parent_domain) { parent_domain = namedb_add_domain(db, parent_rdf); ldns_rdf_deep_free(parent_rdf); if (!parent_domain) { ods_log_error("[%s] unable to entize domain: failed to add " "parent domain", db_str); return ODS_STATUS_ERR; } domain->parent = parent_domain; /* continue with the parent domain */ domain = parent_domain; } else { ldns_rdf_deep_free(parent_rdf); domain->parent = parent_domain; /* domain has parent, entize done */ domain = NULL; } } return ODS_STATUS_OK; } /** * Lookup domain. * */ domain_type* namedb_lookup_domain(namedb_type* db, ldns_rdf* dname) { if (!db) { return NULL; } return (domain_type*) namedb_domain_search(db->domains, dname); } /** * Add domain to namedb. * */ domain_type* namedb_add_domain(namedb_type* db, ldns_rdf* dname) { domain_type* domain = NULL; ldns_rbnode_t* new_node = LDNS_RBTREE_NULL; if (!dname || !db || !db->domains) { return NULL; } domain = domain_create(db->zone, dname); if (!domain) { ods_log_error("[%s] unable to add domain: domain_create() failed", db_str); return NULL; } new_node = domain2node(domain); if (!new_node) { ods_log_error("[%s] unable to add domain: domain2node() failed", db_str); return NULL; } if (ldns_rbtree_insert(db->domains, new_node) == NULL) { ods_log_error("[%s] unable to add domain: already present", db_str); log_dname(domain->dname, "ERR +DOMAIN", LOG_ERR); domain_cleanup(domain); free((void*)new_node); return NULL; } domain = (domain_type*) new_node->data; domain->node = new_node; domain->is_new = 1; log_dname(domain->dname, "+DOMAIN", LOG_DEEEBUG); return domain; } /** * Delete domain from namedb * */ domain_type* namedb_del_domain(namedb_type* db, domain_type* domain) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; if (!domain || !db || !db->domains) { ods_log_error("[%s] unable to delete domain: !db || !domain", db_str); return NULL; } if (domain->rrsets || domain->denial) { ods_log_error("[%s] unable to delete domain: domain in use", db_str); log_dname(domain->dname, "ERR -DOMAIN", LOG_ERR); return NULL; } node = ldns_rbtree_delete(db->domains, (const void*)domain->dname); if (node) { ods_log_assert(domain->node == node); ods_log_assert(!domain->rrsets); ods_log_assert(!domain->denial); free((void*)node); domain->node = NULL; log_dname(domain->dname, "-DOMAIN", LOG_DEEEBUG); return domain; } ods_log_error("[%s] unable to delete domain: not found", db_str); log_dname(domain->dname, "ERR -DOMAIN", LOG_ERR); return NULL; } /** * Lookup denial. * */ denial_type* namedb_lookup_denial(namedb_type* db, ldns_rdf* dname) { if (!db) { return NULL; } return (denial_type*) namedb_domain_search(db->denials, dname); } /** * See if a domain is an empty terminal * */ static int domain_is_empty_terminal(domain_type* domain) { ldns_rbnode_t* n = LDNS_RBTREE_NULL; domain_type* d = NULL; ods_log_assert(domain); if (domain->is_apex) { return 0; } if (domain->rrsets) { return 0; } n = ldns_rbtree_next(domain->node); if (n) { d = (domain_type*) n->data; } /* if it has children domains, do not delete it */ if(d && ldns_dname_is_subdomain(d->dname, domain->dname)) { return 0; } return 1; } /** * See if a domain can be deleted * */ static int domain_can_be_deleted(domain_type* domain) { ods_log_assert(domain); return (domain_is_empty_terminal(domain) && !domain->denial); } /** * Add NSEC data point. * */ static void namedb_add_nsec_trigger(namedb_type* db, domain_type* domain) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(!domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A) { return; /* don't do occluded/glue domain */ } if (!domain->rrsets) { return; /* don't do empty domain */ } /* ok, nsecify this domain */ denial = namedb_add_denial(db, domain->dname, NULL); ods_log_assert(denial); denial->domain = (void*) domain; domain->denial = (void*) denial; domain->is_new = 0; return; } /** * Add NSEC3 data point. * */ static void namedb_add_nsec3_trigger(namedb_type* db, domain_type* domain, nsec3params_type* n3p) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(n3p); ods_log_assert(domain); ods_log_assert(!domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A) { return; /* don't do occluded/glue domain */ } /* Opt-Out? */ if (n3p->flags) { dstatus = domain_is_delegpt(domain); /* If Opt-Out is being used, owner names of unsigned delegations MAY be excluded. */ if (dstatus == LDNS_RR_TYPE_NS) { return; } } /* ok, nsecify3 this domain */ denial = namedb_add_denial(db, domain->dname, n3p); ods_log_assert(denial); denial->domain = (void*) domain; domain->denial = (void*) denial; domain->is_new = 0; return; } /** * See if denials need to be added. * */ static void namedb_add_denial_trigger(namedb_type* db, domain_type* domain) { zone_type* zone = NULL; ods_log_assert(db); ods_log_assert(domain); if (!domain->denial) { zone = (void*) domain->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC) { namedb_add_nsec_trigger(db, domain); } else { ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3); namedb_add_nsec3_trigger(db, domain, zone->signconf->nsec3params); } } return; } /** * Delete NSEC data point. * */ static void namedb_del_nsec_trigger(namedb_type* db, domain_type* domain) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A || domain_is_empty_terminal(domain) || !domain->rrsets) { /* domain has become occluded/glue or empty non-terminal*/ denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } return; } /** * Delete NSEC3 data point. * */ static void namedb_del_nsec3_trigger(namedb_type* db, domain_type* domain, nsec3params_type* n3p) { ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; denial_type* denial = NULL; ods_log_assert(db); ods_log_assert(n3p); ods_log_assert(domain); ods_log_assert(domain->denial); dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_DNAME || dstatus == LDNS_RR_TYPE_A || domain_is_empty_terminal(domain)) { /* domain has become occluded/glue */ denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } else if (n3p->flags) { dstatus = domain_is_delegpt(domain); /* If Opt-Out is being used, owner names of unsigned delegations MAY be excluded. */ if (dstatus == LDNS_RR_TYPE_NS) { denial_diff((denial_type*) domain->denial); denial = namedb_del_denial(db, domain->denial); denial_cleanup(denial); domain->denial = NULL; } } return; } /** * See if domains/denials can be deleted. * */ static int namedb_del_denial_trigger(namedb_type* db, domain_type* domain, int rollback) { domain_type* parent = NULL; zone_type* zone = NULL; unsigned is_deleted = 0; ods_log_assert(db); ods_log_assert(domain); ods_log_assert(domain->dname); zone = (void*) domain->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); while(domain) { if (!rollback) { if (domain->denial) { if (zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC) { namedb_del_nsec_trigger(db, domain); } else { ods_log_assert(zone->signconf->nsec_type == LDNS_RR_TYPE_NSEC3); namedb_del_nsec3_trigger(db, domain, zone->signconf->nsec3params); } } } parent = domain->parent; if (domain_can_be_deleted(domain)) { /* -DOMAIN */ domain = namedb_del_domain(db, domain); domain_cleanup(domain); is_deleted = 1; } /* continue with parent */ domain = parent; } return is_deleted; } /** * Hash domain name. * */ static ldns_rdf* dname_hash(ldns_rdf* dname, ldns_rdf* apex, nsec3params_type* nsec3params) { ldns_rdf* hashed_ownername = NULL; ldns_rdf* hashed_label = NULL; ods_log_assert(dname); ods_log_assert(apex); ods_log_assert(nsec3params); /** * The owner name of the NSEC3 RR is the hash of the original owner * name, prepended as a single label to the zone name. */ hashed_label = ldns_nsec3_hash_name(dname, nsec3params->algorithm, nsec3params->iterations, nsec3params->salt_len, nsec3params->salt_data); if (!hashed_label) { return NULL; } hashed_ownername = ldns_dname_cat_clone((const ldns_rdf*) hashed_label, (const ldns_rdf*) apex); if (!hashed_ownername) { return NULL; } ldns_rdf_deep_free(hashed_label); return hashed_ownername; } /** * Add denial to namedb. * */ denial_type* namedb_add_denial(namedb_type* db, ldns_rdf* dname, nsec3params_type* n3p) { zone_type* z = NULL; ldns_rbnode_t* new_node = LDNS_RBTREE_NULL; ldns_rbnode_t* pnode = LDNS_RBTREE_NULL; ldns_rdf* owner = NULL; denial_type* denial = NULL; denial_type* pdenial = NULL; ods_log_assert(db); ods_log_assert(db->denials); ods_log_assert(dname); /* nsec or nsec3 */ if (n3p) { z = (zone_type*) db->zone; owner = dname_hash(dname, z->apex, n3p); } else { owner = ldns_rdf_clone(dname); } if (!owner) { ods_log_error("[%s] unable to add denial: create owner failed", db_str); return NULL; } denial = denial_create(db->zone, owner); if (!denial) { ods_log_error("[%s] unable to add denial: denial_create() failed", db_str); return NULL; } new_node = denial2node(denial); if (!new_node) { ods_log_error("[%s] unable to add denial: denial2node() failed", db_str); return NULL; } if (!ldns_rbtree_insert(db->denials, new_node)) { ods_log_error("[%s] unable to add denial: already present", db_str); log_dname(denial->dname, "ERR +DENIAL", LOG_ERR); denial_cleanup(denial); free((void*)new_node); return NULL; } /* denial of existence data point added */ denial = (denial_type*) new_node->data; denial->node = new_node; denial->nxt_changed = 1; pnode = ldns_rbtree_previous(new_node); if (!pnode || pnode == LDNS_RBTREE_NULL) { pnode = ldns_rbtree_last(db->denials); } ods_log_assert(pnode); pdenial = (denial_type*) pnode->data; ods_log_assert(pdenial); pdenial->nxt_changed = 1; log_dname(denial->dname, "+DENIAL", LOG_DEEEBUG); return denial; } /** * Delete denial from namedb * */ denial_type* namedb_del_denial(namedb_type* db, denial_type* denial) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; ldns_rbnode_t* pnode = LDNS_RBTREE_NULL; denial_type* pdenial = NULL; if (!denial || !db || !db->denials) { return NULL; } if (denial->rrset && denial->rrset->rr_count) { ods_log_error("[%s] unable to delete denial: denial in use [#%u]", db_str, denial->rrset->rr_count); log_dname(denial->dname, "ERR -DENIAL", LOG_ERR); return NULL; } pnode = ldns_rbtree_previous(denial->node); if (!pnode || pnode == LDNS_RBTREE_NULL) { pnode = ldns_rbtree_last(db->denials); } ods_log_assert(pnode); pdenial = (denial_type*) pnode->data; ods_log_assert(pdenial); node = ldns_rbtree_delete(db->denials, (const void*)denial->dname); if (!node) { ods_log_error("[%s] unable to delete denial: not found", db_str); log_dname(denial->dname, "ERR -DENIAL", LOG_ERR); return NULL; } ods_log_assert(denial->node == node); pdenial->nxt_changed = 1; free((void*)node); denial->domain = NULL; denial->node = NULL; log_dname(denial->dname, "-DENIAL", LOG_DEEEBUG); return denial; } /** * Apply differences in db. * */ void namedb_diff(namedb_type* db, unsigned is_ixfr, unsigned more_coming) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!db || !db->domains) { return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); domain_diff(domain, is_ixfr, more_coming); } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); if (!namedb_del_denial_trigger(db, domain, 0)) { /* del_denial did not delete domain */ namedb_add_denial_trigger(db, domain); } } return; } /** * Rollback differences in db. * */ void namedb_rollback(namedb_type* db, unsigned keepsc) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!db || !db->domains) { return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; node = ldns_rbtree_next(node); domain_rollback(domain, keepsc); (void) namedb_del_denial_trigger(db, domain, 1); } return; } /** * Nsecify db. * */ void namedb_nsecify(namedb_type* db, uint32_t* num_added) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; ldns_rbnode_t* nxt_node = LDNS_RBTREE_NULL; denial_type* denial = NULL; denial_type* nxt = NULL; uint32_t nsec_added = 0; ods_log_assert(db); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; nxt_node = ldns_rbtree_next(node); if (!nxt_node || nxt_node == LDNS_RBTREE_NULL) { nxt_node = ldns_rbtree_first(db->denials); } nxt = (denial_type*) nxt_node->data; denial_nsecify(denial, nxt, &nsec_added); node = ldns_rbtree_next(node); } if (num_added) { *num_added = nsec_added; } return; } /** * Examine updates to db. * */ ods_status namedb_examine(namedb_type* db) { ods_status status = ODS_STATUS_OK; ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; rrset_type* rrset = NULL; int soa_seen = 0; /* ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rr_type delegpt = LDNS_RR_TYPE_FIRST; */ if (!db || !db->domains) { /* no db, no error */ return ODS_STATUS_OK; } if (db->domains->root != LDNS_RBTREE_NULL) { node = ldns_rbtree_first(db->domains); } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_CNAME); if (rrset) { /* Thou shall not have other data next to CNAME */ if (domain_count_rrset_is_added(domain) > 1 && rrset_count_rr_is_added(rrset) > 0) { log_rrset(domain->dname, rrset->rrtype, "CNAME and other data at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } /* Thou shall have at most one CNAME per name */ if (rrset_count_rr_is_added(rrset) > 1) { log_rrset(domain->dname, rrset->rrtype, "multiple CNAMEs at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_DNAME); if (rrset) { /* Thou shall have at most one DNAME per name */ if (rrset_count_rr_is_added(rrset) > 1) { log_rrset(domain->dname, rrset->rrtype, "multiple DNAMEs at the same name", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } if (!soa_seen && domain->is_apex) { rrset = domain_lookup_rrset(domain, LDNS_RR_TYPE_SOA); if (rrset) { /* Thou shall have one and only one SOA */ if (rrset_count_rr_is_added(rrset) != 1) { log_rrset(domain->dname, rrset->rrtype, "Wrong number of SOA records, should be 1", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } else { log_rrset(domain->dname, LDNS_RR_TYPE_SOA, "missing SOA RRset", LOG_ERR); return ODS_STATUS_CONFLICT_ERR; } } /* dstatus = domain_is_occluded(domain); delegpt = domain_is_delegpt(domain); */ /* Thou shall not have occluded data in your zone file */ node = ldns_rbtree_next(node); } return status; } /** * Wipe out all NSEC RRsets. * */ void namedb_wipe_denial(namedb_type* db) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; denial_type* denial = NULL; zone_type* zone = NULL; size_t i = 0; if (db && db->denials) { zone = (zone_type*) db->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] wipe denial of existence space zone %s", db_str, zone->name); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (!denial->rrset) { node = ldns_rbtree_next(node); continue; } for (i=0; i < denial->rrset->rr_count; i++) { if (denial->rrset->rrs[i].exists) { /* ixfr -RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, denial->rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } denial->rrset->rrs[i].exists = 0; rrset_del_rr(denial->rrset, i); i--; } for (i=0; i < denial->rrset->rrsig_count; i++) { /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, denial->rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(denial->rrset, i); i--; } rrset_cleanup(denial->rrset); denial->rrset = NULL; node = ldns_rbtree_next(node); } } return; } /** * Export db to file. * */ void namedb_export(FILE* fd, namedb_type* db, ods_status* status) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; if (!fd || !db || !db->domains) { if (status) { ods_log_error("[%s] unable to export namedb: file descriptor " "or name database missing", db_str); *status = ODS_STATUS_ASSERT_ERR; } return; } node = ldns_rbtree_first(db->domains); if (!node || node == LDNS_RBTREE_NULL) { fprintf(fd, "; empty zone\n"); if (status) { *status = ODS_STATUS_OK; } return; } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; if (domain) { domain_print(fd, domain, status); } node = ldns_rbtree_next(node); } return; } /** * Clean up domains in namedb. * */ static void domain_delfunc(ldns_rbnode_t* elem) { domain_type* domain = NULL; if (elem && elem != LDNS_RBTREE_NULL) { domain = (domain_type*) elem->data; domain_delfunc(elem->left); domain_delfunc(elem->right); domain_cleanup(domain); free((void*)elem); } return; } /** * Clean up denials. * */ static void denial_delfunc(ldns_rbnode_t* elem) { denial_type* denial = NULL; domain_type* domain = NULL; if (elem && elem != LDNS_RBTREE_NULL) { denial = (denial_type*) elem->data; denial_delfunc(elem->left); denial_delfunc(elem->right); domain = (domain_type*) denial->domain; if (domain) { domain->denial = NULL; } denial_cleanup(denial); free((void*)elem); } return; } /** * Clean up domains. * */ static void namedb_cleanup_domains(namedb_type* db) { if (db && db->domains) { domain_delfunc(db->domains->root); ldns_rbtree_free(db->domains); db->domains = NULL; } return; } /** * Clean up denials. * */ void namedb_cleanup_denials(namedb_type* db) { if (db && db->denials) { denial_delfunc(db->denials->root); ldns_rbtree_free(db->denials); db->denials = NULL; } return; } /** * Clean up namedb. * */ void namedb_cleanup(namedb_type* db) { zone_type* z = NULL; if (!db) { return; } z = (zone_type*) db->zone; if (!z || !z->allocator) { return; } namedb_cleanup_denials(db); namedb_cleanup_domains(db); allocator_deallocate(z->allocator, (void*) db); return; } /** * Backup namedb. * */ void namedb_backup2(FILE* fd, namedb_type* db) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; denial_type* denial = NULL; if (!fd || !db) { return; } node = ldns_rbtree_first(db->domains); while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; domain_backup2(fd, domain, 0); node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (denial->rrset) { rrset_print(fd, denial->rrset, 1, NULL); } node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); /* signatures */ node = ldns_rbtree_first(db->domains); while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; domain_backup2(fd, domain, 1); node = ldns_rbtree_next(node); } node = ldns_rbtree_first(db->denials); while (node && node != LDNS_RBTREE_NULL) { denial = (denial_type*) node->data; if (denial->rrset) { rrset_backup2(fd, denial->rrset); } node = ldns_rbtree_next(node); } fprintf(fd, ";\n"); return; } opendnssec-1.4.9/signer/src/signer/denial.h0000644000175000017500000000612212650165732015571 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Denial of Existence. * */ #ifndef SIGNER_DENIAL_H #define SIGNER_DENIAL_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "signer/nsec3params.h" #include "signer/rrset.h" #include #include /** * Denial of Existence data point. * */ typedef struct denial_struct denial_type; struct denial_struct { void* zone; void* domain; ldns_rbnode_t* node; ldns_rdf* dname; rrset_type* rrset; unsigned bitmap_changed : 1; unsigned nxt_changed : 1; }; /** * Create new Denial of Existence data point. * \param[in] zoneptr zone reference * \param[in] dname owner name * \return denial_type* denial of existence data point * */ denial_type* denial_create(void* zoneptr, ldns_rdf* dname); /** * Apply differences at denial. * \param[in] denial Denial of Existence data point * */ void denial_diff(denial_type* denial); /** * Add NSEC(3) to the Denial of Existence data point. * \param[in] denial Denial of Existence data point * \param[in] rr NSEC(3) resource record * */ void denial_add_rr(denial_type* denial, ldns_rr* rr); /** * Nsecify Denial of Existence data point. * \param[in] denial Denial of Existence data point * \param[in] nxt next Denial of Existence data point * \param[out] num_added number of RRs added * */ void denial_nsecify(denial_type* denial, denial_type* nxt, uint32_t* num_added); /** * Print Denial of Existence data point. * \param[in] fd file descriptor * \param[in] denial denial of existence data point * \param[out] status status * */ void denial_print(FILE* fd, denial_type* denial, ods_status* status); /** * Cleanup Denial of Existence data point. * \param[in] denial denial of existence data point * */ void denial_cleanup(denial_type* denial); #endif /* SIGNER_DENIAL_H */ opendnssec-1.4.9/signer/src/signer/nsec3params.c0000644000175000017500000001450512650165732016553 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * NSEC3 Parameters. * */ #include "shared/allocator.h" #include "shared/log.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/nsec3params.h" #include "signer/signconf.h" #include #include #include #include static const char* nsec3_str = "nsec3"; /** * Create NSEC3 salt. * */ ods_status nsec3params_create_salt(const char* salt_str, uint8_t* salt_len, uint8_t** salt) { uint8_t c; uint8_t* salt_tmp; if (!salt_str) { *salt_len = 0; *salt = NULL; return ODS_STATUS_OK; } *salt_len = (uint8_t) strlen(salt_str); if (*salt_len == 1 && salt_str[0] == '-') { *salt_len = 0; *salt = NULL; return ODS_STATUS_OK; } else if (*salt_len % 2 != 0) { ods_log_error("[%s] invalid salt %s", nsec3_str, salt_str); *salt = NULL; return ODS_STATUS_ERR; } /* construct salt data */ salt_tmp = (uint8_t*) calloc(*salt_len / 2, sizeof(uint8_t)); if (!salt_tmp) { ods_log_error("[%s] construct salt data for %s failed", nsec3_str, salt_str); *salt = NULL; return ODS_STATUS_MALLOC_ERR; } for (c = 0; c < *salt_len; c += 2) { if (isxdigit((int) salt_str[c]) && isxdigit((int) salt_str[c+1])) { salt_tmp[c/2] = (uint8_t) ldns_hexdigit_to_int(salt_str[c]) * 16 + ldns_hexdigit_to_int(salt_str[c+1]); } else { ods_log_error("[%s] invalid salt %s", nsec3_str, salt_str); free((void*)salt_tmp); *salt = NULL; return ODS_STATUS_ERR; } } *salt_len = *salt_len / 2; /* update length */ *salt = salt_tmp; return ODS_STATUS_OK; } /** * Create new NSEC3 parameters. * */ nsec3params_type* nsec3params_create(void* sc, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt) { nsec3params_type* nsec3params = NULL; signconf_type* signconf = (signconf_type*) sc; uint8_t salt_len; /* calculate salt len */ uint8_t* salt_data; /* calculate salt data */ if (!sc) { return NULL; } nsec3params = (nsec3params_type*) allocator_alloc(signconf->allocator, sizeof(nsec3params_type)); if (!nsec3params) { ods_log_error("[%s] unable to create: allocator_alloc() failed", nsec3_str); return NULL; } nsec3params->sc = sc; nsec3params->algorithm = algo; nsec3params->flags = flags; nsec3params->iterations = iter; /* construct the salt from the string */ if (nsec3params_create_salt(salt, &salt_len, &salt_data) != 0) { ods_log_error("[%s] unable to create: create salt failed", nsec3_str); allocator_deallocate(signconf->allocator, (void*)nsec3params); return NULL; } nsec3params->salt_len = salt_len; nsec3params->salt_data = salt_data; nsec3params->rr = NULL; return nsec3params; } /** * Backup NSEC3 parameters. * */ void nsec3params_backup(FILE* fd, uint8_t algo, uint8_t flags, uint16_t iter, const char* salt, ldns_rr* rr, const char* version) { if (!fd) { return; } fprintf(fd, ";;Nsec3parameters: salt %s algorithm %u optout %u " "iterations %u\n", salt?salt:"-", (unsigned) algo, (unsigned) flags, (unsigned) iter); if (strcmp(version, ODS_SE_FILE_MAGIC_V2) == 0) { if (rr) { (void)util_rr_print(fd, rr); } fprintf(fd, ";;Nsec3done\n"); fprintf(fd, ";;\n"); } return; } /** * Convert salt to string. * */ const char* nsec3params_salt2str(nsec3params_type* nsec3params) { uint8_t *data; uint8_t salt_length = 0; uint8_t salt_pos = 0; int written = 0; char* str = NULL; ldns_buffer* buffer = NULL; salt_length = nsec3params->salt_len; data = nsec3params->salt_data; /* from now there are variable length entries so remember pos */ if (salt_length == 0) { buffer = ldns_buffer_new(2); written = ldns_buffer_printf(buffer, "-"); } else { buffer = ldns_buffer_new(salt_pos+1); for (salt_pos = 0; salt_pos < salt_length; salt_pos++) { written = ldns_buffer_printf(buffer, "%02x", data[salt_pos]); } } if (ldns_buffer_status(buffer) == LDNS_STATUS_OK) { str = ldns_buffer2str(buffer); } else if (written) { ods_log_error("[%s] unable to convert nsec3 salt to string: %s", nsec3_str, ldns_get_errorstr_by_id(ldns_buffer_status(buffer))); } else { ods_log_error("[%s] unable to convert nsec3 salt to string: zero " "bytes written", nsec3_str); } ldns_buffer_free(buffer); return (const char*) str; } /** * Clean up NSEC3 parameters. * */ void nsec3params_cleanup(nsec3params_type* nsec3params) { signconf_type* sc = NULL; if (!nsec3params) { return; } sc = (signconf_type*) nsec3params->sc; allocator_deallocate(sc->allocator, (void*) nsec3params->salt_data); allocator_deallocate(sc->allocator, (void*) nsec3params); return; } opendnssec-1.4.9/signer/src/signer/domain.h0000644000175000017500000001220312650165732015601 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Domain. * */ #ifndef SIGNER_DOMAIN_H #define SIGNER_DOMAIN_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "signer/rrset.h" #include #include #define SE_NSEC_RDATA_NXT 0 #define SE_NSEC_RDATA_BITMAP 1 #define SE_NSEC3_RDATA_NSEC3PARAMS 4 #define SE_NSEC3_RDATA_NXT 4 #define SE_NSEC3_RDATA_BITMAP 5 /** * Domain. * */ typedef struct domain_struct domain_type; struct domain_struct { void* zone; void* denial; ldns_rbnode_t* node; ldns_rdf* dname; domain_type* parent; rrset_type* rrsets; unsigned is_new : 1; unsigned is_apex : 1; /* apex */ }; /** * Log domain name. * \param[in] rdf domain name * \param[in] pre log message * \param[in] level log level * */ void log_dname(ldns_rdf* rdf, const char* pre, int level); /** * Create domain. * \param[in] zoneptr zone reference * \param[in] dname owner name * \return domain_type* domain * */ domain_type* domain_create(void* zoneptr, ldns_rdf* dname); /** * Count the number of RRsets at this domain. * \param[in] domain domain * \return size_t number of RRsets * */ size_t domain_count_rrset(domain_type* domain); /** * Count the number of RRsets at this domain with RRs that have is_added. * \param[in] domain domain * \return size_t number of RRsets * */ size_t domain_count_rrset_is_added(domain_type* domain); /** * Look up RRset at this domain. * \param[in] domain the domain * \param[in] rrtype RRtype * \return rrset_type* RRset, if found * */ rrset_type* domain_lookup_rrset(domain_type* domain, ldns_rr_type rrtype); /** * Add RRset to domain. * \param[in] domain domain * \param[in] rrset RRset * */ void domain_add_rrset(domain_type* domain, rrset_type* rrset); /** * Delete RRset from domain. * \param[in] domain domain * \param[in] rrtype RRtype of RRset * \return rrset_type* deleted RRset * */ rrset_type* domain_del_rrset(domain_type* domain, ldns_rr_type rrtype); /** * Apply differences at domain. * \param[in] domain domain * \param[in] is_ixfr true if incremental change * \param[in] more_coming more transactions possible * */ void domain_diff(domain_type* domain, unsigned is_ixfr, unsigned more_coming); /** * Rollback differences at domain. * \param[in] domain domain * \param[in] keepsc keep RRs that did not came from the adapter * */ void domain_rollback(domain_type* domain, int keepsc); /** * Check whether a domain is an empty non-terminal to an unsigned delegation. * \param[in] domain domain * \return int yes or no * */ int domain_ent2unsignedns(domain_type* domain); /** * Check whether a domain is a delegation, regardless of parent. * \param[in] domain domain * \return ldns_rr_type RRtype that hints whether the domain is occluded. * LDNS_RR_TYPE_NS Unsigned delegation * LDNS_RR_TYPE_DS Signed delegation * LDNS_RR_TYPE_SOA Authoritative data (or signed delegation) * */ ldns_rr_type domain_is_delegpt(domain_type* domain); /** * Check whether the domain is occluded. * \param[in] domain domain * \return ldns_rr_type RRtype that hints whether the domain is occluded. * LDNS_RR_TYPE_DNAME Occluded * LDNS_RR_TYPE_A Glue * LDNS_RR_TYPE_SOA Authoritative data or delegation * */ ldns_rr_type domain_is_occluded(domain_type* domain); /** * Print domain. * \param[in] fd file descriptor * \param[in] domain domain * \param[out] status status * */ void domain_print(FILE* fd, domain_type* domain, ods_status* status); /** * Clean up domain. * \param[in] domain domain to cleanup * */ void domain_cleanup(domain_type* domain); /** * Backup domain. * \param[in] fd file descriptor * \param[in] domain domain * \param[in] sigs do RRSIGS if true, otherwise do RRset * */ void domain_backup2(FILE* fd, domain_type* domain, int sigs); #endif /* SIGNER_DOMAIN_H */ opendnssec-1.4.9/signer/src/signer/rrset.c0000644000175000017500000006411612650165732015476 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * RRset. * */ #include "config.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/log.h" #include "shared/util.h" #include "signer/rrset.h" #include "signer/zone.h" static const char* rrset_str = "rrset"; /** * Log RR. * */ void log_rr(ldns_rr* rr, const char* pre, int level) { char* str = NULL; size_t i = 0; if (ods_log_get_level() < level) { return; } str = ldns_rr2str(rr); if (!str) { ods_log_error("[%s] %s: Error converting RR to string", rrset_str, pre?pre:""); return; } str[(strlen(str))-1] = '\0'; /* replace tabs with white space */ for (i=0; i < strlen(str); i++) { if (str[i] == '\t') { str[i] = ' '; } } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: %s", rrset_str, pre?pre:"", str); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: %s", rrset_str, pre?pre:"", str); } else { ods_log_deeebug("[%s] %s: %s", rrset_str, pre?pre:"", str); } free((void*)str); return; } /** * Log RRset. * */ void log_rrset(ldns_rdf* dname, ldns_rr_type type, const char* pre, int level) { char* str = NULL; size_t i = 0; if (ods_log_get_level() < level) { return; } str = ldns_rdf2str(dname); if (!str) { return; } str[(strlen(str))-1] = '\0'; /* replace tabs with white space */ for (i=0; i < strlen(str); i++) { if (str[i] == '\t') { str[i] = ' '; } } if (level == LOG_EMERG) { ods_fatal_exit("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_ALERT) { ods_log_alert("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_CRIT) { ods_log_crit("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_ERR) { ods_log_error("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_WARNING) { ods_log_warning("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_NOTICE) { ods_log_info("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_INFO) { ods_log_verbose("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_DEBUG) { ods_log_debug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else if (level == LOG_DEEEBUG) { ods_log_deeebug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } else { ods_log_deeebug("[%s] %s: <%s,%s>", rrset_str, pre?pre:"", str, rrset_type2str(type)); } free((void*)str); return; } /** * Get the string-format of RRtype. * */ const char* rrset_type2str(ldns_rr_type type) { if (type == LDNS_RR_TYPE_IXFR) { return "IXFR"; } else if (type == LDNS_RR_TYPE_AXFR) { return "AXFR"; } else if (type == LDNS_RR_TYPE_MAILB) { return "MAILB"; } else if (type == LDNS_RR_TYPE_MAILA) { return "MAILA"; } else if (type == LDNS_RR_TYPE_ANY) { return "ANY"; } else { const ldns_rr_descriptor* descriptor = ldns_rr_descript(type); if (descriptor && descriptor->_name) { return descriptor->_name; } } return "TYPE???"; } /** * Create RRset. * */ rrset_type* rrset_create(void* zoneptr, ldns_rr_type type) { zone_type* zone = (zone_type*) zoneptr; rrset_type* rrset = NULL; if (!type || !zoneptr) { return NULL; } rrset = (rrset_type*) allocator_alloc( zone->allocator, sizeof(rrset_type)); if (!rrset) { ods_log_error("[%s] unable to create RRset %u: allocator_alloc() " "failed", rrset_str, (unsigned) type); return NULL; } rrset->next = NULL; rrset->rrs = NULL; rrset->rrsigs = NULL; rrset->domain = NULL; rrset->zone = zoneptr; rrset->rrtype = type; rrset->rr_count = 0; rrset->rrsig_count = 0; rrset->needs_signing = 0; return rrset; } /** * Lookup RR in RRset. * */ rr_type* rrset_lookup_rr(rrset_type* rrset, ldns_rr* rr) { ldns_status lstatus = LDNS_STATUS_OK; int cmp = 0; size_t i = 0; if (!rrset || !rr || rrset->rr_count <= 0) { return NULL; } for (i=0; i < rrset->rr_count; i++) { lstatus = util_dnssec_rrs_compare(rrset->rrs[i].rr, rr, &cmp); if (lstatus != LDNS_STATUS_OK) { ods_log_error("[%s] unable to lookup RR: compare failed (%s)", rrset_str, ldns_get_errorstr_by_id(lstatus)); return NULL; } if (!cmp) { /* equal */ return &rrset->rrs[i]; } } return NULL; } /** * Count the number of RRs in this RRset that have is_added. * */ size_t rrset_count_rr_is_added(rrset_type* rrset) { size_t i = 0; size_t count = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].is_added) { count++; } } return count; } /** * Add RR to RRset. * */ rr_type* rrset_add_rr(rrset_type* rrset, ldns_rr* rr) { rr_type* rrs_old = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rr); ods_log_assert(rrset->rrtype == ldns_rr_get_type(rr)); zone = (zone_type*) rrset->zone; rrs_old = rrset->rrs; rrset->rrs = (rr_type*) allocator_alloc(zone->allocator, (rrset->rr_count + 1) * sizeof(rr_type)); if (!rrset->rrs) { ods_fatal_exit("[%s] fatal unable to add RR: allocator_alloc() failed", rrset_str); } if (rrs_old) { memcpy(rrset->rrs, rrs_old, (rrset->rr_count) * sizeof(rr_type)); } allocator_deallocate(zone->allocator, (void*) rrs_old); rrset->rr_count++; rrset->rrs[rrset->rr_count - 1].owner = rrset->domain; rrset->rrs[rrset->rr_count - 1].rr = rr; rrset->rrs[rrset->rr_count - 1].exists = 0; rrset->rrs[rrset->rr_count - 1].is_added = 1; rrset->rrs[rrset->rr_count - 1].is_removed = 0; rrset->needs_signing = 1; log_rr(rr, "+RR", LOG_DEEEBUG); return &rrset->rrs[rrset->rr_count -1]; } /** * Delete RR from RRset. * */ void rrset_del_rr(rrset_type* rrset, uint16_t rrnum) { rr_type* rrs_orig = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rrnum < rrset->rr_count); zone = (zone_type*) rrset->zone; log_rr(rrset->rrs[rrnum].rr, "-RR", LOG_DEEEBUG); rrset->rrs[rrnum].owner = NULL; rrset->rrs[rrnum].rr = NULL; while (rrnum < rrset->rr_count-1) { rrset->rrs[rrnum] = rrset->rrs[rrnum+1]; rrnum++; } memset(&rrset->rrs[rrset->rr_count-1], 0, sizeof(rr_type)); rrs_orig = rrset->rrs; rrset->rrs = (rr_type*) allocator_alloc(zone->allocator, (rrset->rr_count - 1) * sizeof(rr_type)); if(!rrset->rrs) { ods_fatal_exit("[%s] fatal unable to delete RR: allocator_alloc() failed", rrset_str); } memcpy(rrset->rrs, rrs_orig, (rrset->rr_count -1) * sizeof(rr_type)); allocator_deallocate(zone->allocator, (void*) rrs_orig); rrset->rr_count--; rrset->needs_signing = 1; return; } /** * Apply differences at RRset. * */ void rrset_diff(rrset_type* rrset, unsigned is_ixfr, unsigned more_coming) { zone_type* zone = NULL; uint16_t i = 0; uint8_t del_sigs = 0; if (!rrset) { return; } zone = (zone_type*) rrset->zone; for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].is_added) { if (!rrset->rrs[i].exists) { /* ixfr +RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_add_rr(zone->ixfr, rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); del_sigs = 1; } rrset->rrs[i].exists = 1; if ((rrset->rrtype == LDNS_RR_TYPE_DNSKEY || rrset->rrtype == LDNS_RR_TYPE_NSEC3PARAMS) && more_coming) { continue; } rrset->rrs[i].is_added = 0; } else if (!is_ixfr || rrset->rrs[i].is_removed) { if (rrset->rrs[i].exists) { /* ixfr -RR */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } rrset->rrs[i].exists = 0; rrset_del_rr(rrset, i); del_sigs = 1; i--; } } if (del_sigs) { for (i=0; i < rrset->rrsig_count; i++) { /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(rrset, i); i--; } } return; } /** * Add RRSIG to RRset. * */ rrsig_type* rrset_add_rrsig(rrset_type* rrset, ldns_rr* rr, const char* locator, uint32_t flags) { rrsig_type* rrsigs_old = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rr); ods_log_assert(ldns_rr_get_type(rr) == LDNS_RR_TYPE_RRSIG); zone = (zone_type*) rrset->zone; rrsigs_old = rrset->rrsigs; rrset->rrsigs = (rrsig_type*) allocator_alloc(zone->allocator, (rrset->rrsig_count + 1) * sizeof(rrsig_type)); if (!rrset->rrsigs) { ods_fatal_exit("[%s] fatal unable to add RRSIG: allocator_alloc() failed", rrset_str); } if (rrsigs_old) { memcpy(rrset->rrsigs, rrsigs_old, (rrset->rrsig_count) * sizeof(rrsig_type)); } allocator_deallocate(zone->allocator, (void*) rrsigs_old); rrset->rrsig_count++; rrset->rrsigs[rrset->rrsig_count - 1].owner = rrset->domain; rrset->rrsigs[rrset->rrsig_count - 1].rr = rr; rrset->rrsigs[rrset->rrsig_count - 1].key_locator = locator; rrset->rrsigs[rrset->rrsig_count - 1].key_flags = flags; log_rr(rr, "+RRSIG", LOG_DEEEBUG); return &rrset->rrsigs[rrset->rrsig_count -1]; } /** * Delete RRSIG from RRset. * */ void rrset_del_rrsig(rrset_type* rrset, uint16_t rrnum) { rrsig_type* rrsigs_orig = NULL; zone_type* zone = NULL; ods_log_assert(rrset); ods_log_assert(rrnum < rrset->rrsig_count); zone = (zone_type*) rrset->zone; log_rr(rrset->rrsigs[rrnum].rr, "-RRSIG", LOG_DEEEBUG); rrset->rrsigs[rrnum].owner = NULL; rrset->rrsigs[rrnum].rr = NULL; allocator_deallocate(zone->allocator, (void*)rrset->rrsigs[rrnum].key_locator); rrset->rrsigs[rrnum].key_locator = NULL; while (rrnum < rrset->rrsig_count-1) { rrset->rrsigs[rrnum] = rrset->rrsigs[rrnum+1]; rrnum++; } memset(&rrset->rrsigs[rrset->rrsig_count-1], 0, sizeof(rrsig_type)); rrsigs_orig = rrset->rrsigs; rrset->rrsigs = (rrsig_type*) allocator_alloc(zone->allocator, (rrset->rrsig_count - 1) * sizeof(rrsig_type)); if(!rrset->rrsigs) { ods_fatal_exit("[%s] fatal unable to delete RRSIG: allocator_alloc() failed", rrset_str); } memcpy(rrset->rrsigs, rrsigs_orig, (rrset->rrsig_count -1) * sizeof(rrsig_type)); allocator_deallocate(zone->allocator, (void*) rrsigs_orig); rrset->rrsig_count--; return; } /** * Recycle signatures from RRset and drop unreusable signatures. * */ static uint32_t rrset_recycle(rrset_type* rrset, time_t signtime, ldns_rr_type dstatus, ldns_rr_type delegpt) { uint32_t refresh = 0; uint32_t expiration = 0; uint32_t inception = 0; uint32_t reusedsigs = 0; unsigned drop_sig = 0; size_t i = 0; key_type* key = NULL; zone_type* zone = NULL; if (!rrset) { return 0; } zone = (zone_type*) rrset->zone; /* Calculate the Refresh Window = Signing time + Refresh */ if (zone->signconf && zone->signconf->sig_refresh_interval) { refresh = (uint32_t) (signtime + duration2time(zone->signconf->sig_refresh_interval)); } /* Check every signature if it matches the recycling logic. */ for (i=0; i < rrset->rrsig_count; i++) { drop_sig = 0; /* 0. Skip delegation, glue and occluded RRsets */ if (dstatus != LDNS_RR_TYPE_SOA || (delegpt != LDNS_RR_TYPE_SOA && rrset->rrtype != LDNS_RR_TYPE_DS)) { drop_sig = 1; goto recycle_drop_sig; } ods_log_assert(dstatus == LDNS_RR_TYPE_SOA || (delegpt == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_DS)); /* 1. If the RRset has changed, drop all signatures */ /* 2. If Refresh is disabled, drop all signatures */ if (rrset->needs_signing || refresh <= (uint32_t) signtime) { drop_sig = 1; goto recycle_drop_sig; } /* 3. Expiration - Refresh has passed */ expiration = ldns_rdf2native_int32( ldns_rr_rrsig_expiration(rrset->rrsigs[i].rr)); if (expiration < refresh) { drop_sig = 1; goto recycle_drop_sig; } /* 4. Inception has not yet passed */ inception = ldns_rdf2native_int32( ldns_rr_rrsig_inception(rrset->rrsigs[i].rr)); if (inception > (uint32_t) signtime) { drop_sig = 1; goto recycle_drop_sig; } /* 5. Corresponding key is dead (key is locator+flags) */ key = keylist_lookup_by_locator(zone->signconf->keys, rrset->rrsigs[i].key_locator); if (!key || key->flags != rrset->rrsigs[i].key_flags) { drop_sig = 1; } recycle_drop_sig: if (drop_sig) { /* A rule mismatched, refresh signature */ /* ixfr -RRSIG */ lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_del_rr(zone->ixfr, rrset->rrsigs[i].rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_del_rrsig(rrset, i); i--; } else { /* All rules ok, recycle signature */ reusedsigs += 1; } } return reusedsigs; } /** * Is the RRset signed with this algorithm? * */ static int rrset_sigalgo(rrset_type* rrset, uint8_t algorithm) { size_t i = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rrsig_count; i++) { if (algorithm == ldns_rdf2native_int8( ldns_rr_rrsig_algorithm(rrset->rrsigs[i].rr))) { return 1; } } return 0; } /** * Is the RRset signed with this locator? * */ static int rrset_siglocator(rrset_type* rrset, const char* locator) { size_t i = 0; if (!rrset) { return 0; } for (i=0; i < rrset->rrsig_count; i++) { if (!ods_strcmp(locator, rrset->rrsigs[i].key_locator)) { return 1; } } return 0; } /** * Transmogrify the RRset to a RRlist. * */ static ldns_rr_list* rrset2rrlist(rrset_type* rrset) { ldns_rr_list* rr_list = NULL; int ret = 0; size_t i = 0; rr_list = ldns_rr_list_new(); for (i=0; i < rrset->rr_count; i++) { if (!rrset->rrs[i].exists) { log_rr(rrset->rrs[i].rr, "RR does not exist", LOG_WARNING); continue; } /* clone if you want to keep the original format in the signed zone */ ldns_rr2canonical(rrset->rrs[i].rr); ret = (int) ldns_rr_list_push_rr(rr_list, rrset->rrs[i].rr); if (!ret) { ldns_rr_list_free(rr_list); return NULL; } if (rrset->rrtype == LDNS_RR_TYPE_CNAME || rrset->rrtype == LDNS_RR_TYPE_DNAME) { /* singleton types */ return rr_list; } } ldns_rr_list_sort(rr_list); return rr_list; } /** * Calculate the signature validation period. * */ static void rrset_sigvalid_period(signconf_type* sc, ldns_rr_type rrtype, time_t signtime, time_t* inception, time_t* expiration) { time_t jitter = 0; time_t offset = 0; time_t validity = 0; time_t random_jitter = 0; if (!sc || !rrtype || !signtime) { return; } jitter = duration2time(sc->sig_jitter); if (jitter) { random_jitter = ods_rand(jitter*2); } offset = duration2time(sc->sig_inception_offset); if (rrtype == LDNS_RR_TYPE_NSEC || rrtype == LDNS_RR_TYPE_NSEC3) { validity = duration2time(sc->sig_validity_denial); } else { validity = duration2time(sc->sig_validity_default); } *inception = signtime - offset; *expiration = (signtime + validity + random_jitter) - jitter; return; } /** * Sign RRset. * */ ods_status rrset_sign(hsm_ctx_t* ctx, rrset_type* rrset, time_t signtime) { zone_type* zone = NULL; uint32_t newsigs = 0; uint32_t reusedsigs = 0; ldns_rr* rrsig = NULL; ldns_rr_list* rr_list = NULL; rrsig_type* signature = NULL; const char* locator = NULL; time_t inception = 0; time_t expiration = 0; size_t i = 0; domain_type* domain = NULL; ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rr_type delegpt = LDNS_RR_TYPE_FIRST; ods_log_assert(ctx); ods_log_assert(rrset); zone = (zone_type*) rrset->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); /* Recycle signatures */ if (rrset->rrtype == LDNS_RR_TYPE_NSEC || rrset->rrtype == LDNS_RR_TYPE_NSEC3) { dstatus = LDNS_RR_TYPE_SOA; delegpt = LDNS_RR_TYPE_SOA; } else { domain = (domain_type*) rrset->domain; dstatus = domain_is_occluded(domain); delegpt = domain_is_delegpt(domain); } reusedsigs = rrset_recycle(rrset, signtime, dstatus, delegpt); rrset->needs_signing = 0; ods_log_assert(rrset->rrs); ods_log_assert(rrset->rrs[0].rr); /* Skip delegation, glue and occluded RRsets */ if (dstatus != LDNS_RR_TYPE_SOA) { log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "skip signing occluded RRset", LOG_DEEEBUG); return ODS_STATUS_OK; } if (delegpt != LDNS_RR_TYPE_SOA && rrset->rrtype != LDNS_RR_TYPE_DS) { log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "skip signing delegation RRset", LOG_DEEEBUG); return ODS_STATUS_OK; } log_rrset(ldns_rr_owner(rrset->rrs[0].rr), rrset->rrtype, "sign RRset", LOG_DEEEBUG); ods_log_assert(dstatus == LDNS_RR_TYPE_SOA || (delegpt == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_DS)); /* Transmogrify rrset */ rr_list = rrset2rrlist(rrset); if (!rr_list) { ods_log_error("[%s] unable to sign RRset[%i]: rrset2rrlist() failed", rrset_str, rrset->rrtype); return ODS_STATUS_MALLOC_ERR; } if (ldns_rr_list_rr_count(rr_list) <= 0) { /* Empty RRset, no signatures needed */ ldns_rr_list_free(rr_list); return ODS_STATUS_OK; } /* Calculate signature validity */ rrset_sigvalid_period(zone->signconf, rrset->rrtype, signtime, &inception, &expiration); /* Walk keys */ for (i=0; i < zone->signconf->keys->count; i++) { /* If not ZSK don't sign other RRsets */ if (!zone->signconf->keys->keys[i].zsk && rrset->rrtype != LDNS_RR_TYPE_DNSKEY) { continue; } /* If not KSK don't sign DNSKEY RRset */ if (!zone->signconf->keys->keys[i].ksk && rrset->rrtype == LDNS_RR_TYPE_DNSKEY) { continue; } /* Additional rules for signatures */ if (rrset_siglocator(rrset, zone->signconf->keys->keys[i].locator)) { continue; } if (rrset->rrtype != LDNS_RR_TYPE_DNSKEY && rrset_sigalgo(rrset, zone->signconf->keys->keys[i].algorithm)) { continue; } /** * currently, there is no rule that the number of signatures * over this RRset equals the number of active keys. */ /* Sign the RRset with this key */ ods_log_deeebug("[%s] signing RRset[%i] with key %s", rrset_str, rrset->rrtype, zone->signconf->keys->keys[i].locator); rrsig = lhsm_sign(ctx, rr_list, &zone->signconf->keys->keys[i], zone->apex, inception, expiration); if (!rrsig) { ods_log_crit("[%s] unable to sign RRset[%i]: lhsm_sign() failed", rrset_str, rrset->rrtype); ldns_rr_list_free(rr_list); return ODS_STATUS_HSM_ERR; } /* Add signature */ locator = allocator_strdup(zone->allocator, zone->signconf->keys->keys[i].locator); signature = rrset_add_rrsig(rrset, rrsig, locator, zone->signconf->keys->keys[i].flags); newsigs++; /* ixfr +RRSIG */ ods_log_assert(signature->rr); lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_add_rr(zone->ixfr, signature->rr); lock_basic_unlock(&zone->ixfr->ixfr_lock); } /* RRset signing completed */ ldns_rr_list_free(rr_list); lock_basic_lock(&zone->stats->stats_lock); if (rrset->rrtype == LDNS_RR_TYPE_SOA) { zone->stats->sig_soa_count += newsigs; } zone->stats->sig_count += newsigs; zone->stats->sig_reuse += reusedsigs; lock_basic_unlock(&zone->stats->stats_lock); return ODS_STATUS_OK; } /** * Print RRset. * */ void rrset_print(FILE* fd, rrset_type* rrset, int skip_rrsigs, ods_status* status) { uint16_t i = 0; ods_status result = ODS_STATUS_OK; if (!rrset || !fd) { ods_log_crit("[%s] unable to print RRset: rrset or fd missing", rrset_str); if (status) { *status = ODS_STATUS_ASSERT_ERR; } return; } for (i=0; i < rrset->rr_count; i++) { if (rrset->rrs[i].exists) { result = util_rr_print(fd, rrset->rrs[i].rr); if (rrset->rrtype == LDNS_RR_TYPE_CNAME || rrset->rrtype == LDNS_RR_TYPE_DNAME) { /* singleton types */ break; } if (result != ODS_STATUS_OK) { zone_type* zone = (zone_type*) rrset->zone; log_rrset(ldns_rr_owner(rrset->rrs[i].rr), rrset->rrtype, "error printing RRset", LOG_CRIT); zone->adoutbound->error = 1; break; } } } if (! (skip_rrsigs || !rrset->rrsig_count)) { for (i=0; i < rrset->rrsig_count; i++) { result = util_rr_print(fd, rrset->rrsigs[i].rr); if (result != ODS_STATUS_OK) { zone_type* zone = (zone_type*) rrset->zone; log_rrset(ldns_rr_owner(rrset->rrs[i].rr), rrset->rrtype, "error printing RRset", LOG_CRIT); zone->adoutbound->error = 1; break; } } } if (status) { *status = result; } return; } /** * Clean up RRset. * */ void rrset_cleanup(rrset_type* rrset) { uint16_t i = 0; zone_type* zone = NULL; if (!rrset) { return; } rrset_cleanup(rrset->next); rrset->next = NULL; rrset->domain = NULL; zone = (zone_type*) rrset->zone; for (i=0; i < rrset->rr_count; i++) { ldns_rr_free(rrset->rrs[i].rr); rrset->rrs[i].owner = NULL; } for (i=0; i < rrset->rrsig_count; i++) { allocator_deallocate(zone->allocator, (void*)rrset->rrsigs[i].key_locator); ldns_rr_free(rrset->rrsigs[i].rr); rrset->rrsigs[i].owner = NULL; } allocator_deallocate(zone->allocator, (void*) rrset->rrs); allocator_deallocate(zone->allocator, (void*) rrset->rrsigs); allocator_deallocate(zone->allocator, (void*) rrset); return; } /** * Backup RRset. * */ void rrset_backup2(FILE* fd, rrset_type* rrset) { char* str = NULL; uint16_t i = 0; if (!rrset || !fd) { return; } for (i=0; i < rrset->rrsig_count; i++) { str = ldns_rr2str(rrset->rrsigs[i].rr); if (!str) { continue; } str[(strlen(str))-1] = '\0'; fprintf(fd, "%s; {locator %s flags %u}\n", str, rrset->rrsigs[i].key_locator, rrset->rrsigs[i].key_flags); free((void*)str); } return; } opendnssec-1.4.9/signer/src/signer/zone.h0000644000175000017500000001464112650165732015315 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone. * */ #ifndef SIGNER_ZONE_H #define SIGNER_ZONE_H #include "config.h" #include "adapter/adapter.h" #include "scheduler/schedule.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "signer/ixfr.h" #include "signer/namedb.h" #include "signer/signconf.h" #include "signer/stats.h" #include "wire/buffer.h" #include "wire/notify.h" #include "wire/xfrd.h" #include struct schedule_struct; enum zone_zl_status_enum { ZONE_ZL_OK = 0, ZONE_ZL_ADDED, ZONE_ZL_UPDATED, ZONE_ZL_REMOVED }; typedef enum zone_zl_status_enum zone_zl_status; /** * Zone. * */ typedef struct zone_struct zone_type; struct zone_struct { allocator_type* allocator; /* memory allocator */ ldns_rdf* apex; /* wire format zone name */ ldns_rr_class klass; /* class */ uint32_t default_ttl; /* ttl */ /* from conf.xml */ char *notify_command; /* placeholder for the whole notify command */ const char* notify_ns; /* master name server reload command */ char** notify_args; /* reload command arguments */ /* from zonelist.xml */ const char* name; /* string format zone name */ const char* policy_name; /* policy identifier */ const char* signconf_filename; /* signconf filename */ zone_zl_status zl_status; /* zonelist status */ /* adapters */ adapter_type* adinbound; /* inbound adapter */ adapter_type* adoutbound; /* outbound adapter */ /* from signconf.xml */ signconf_type* signconf; /* signer configuration values */ /* zone data */ namedb_type* db; ixfr_type* ixfr; /* zone transfers */ xfrd_type* xfrd; notify_type* notify; /* worker variables */ void* task; /* next assigned task */ /* statistics */ stats_type* stats; lock_basic_type zone_lock; lock_basic_type xfr_lock; }; /** * Create a new zone. * \param[in] name zone name * \param[in] klass zone class * \return zone_type* zone * */ zone_type* zone_create(char* name, ldns_rr_class klass); /** * Load signer configuration for zone. * \param[in] zone zone * \param[out] new_signconf new signer configuration * \return ods_status status * ODS_STATUS_OK: new signer configuration loaded * ODS_STATUS_UNCHANGED: signer configuration has not changed * other: signer configuration not loaded, error occurred * */ ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf); /** * Reschedule task for zone. * \param[in] zone zone * \param[in] taskq task queue * \param[in] what new task identifier * \return ods_status status * */ ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq, task_id what); /** * Publish the keys as indicated by the signer configuration. * \param[in] zone zone * \return ods_status status * */ ods_status zone_publish_dnskeys(zone_type* zone); /** * Unlink DNSKEY RRs. * \param[in] zone zone * */ void zone_rollback_dnskeys(zone_type* zone); /** * Publish the NSEC3 parameters as indicated by the signer configuration. * \param[in] zone zone * \return ods_status status * */ ods_status zone_publish_nsec3param(zone_type* zone); /** * Unlink NSEC3PARAM RR. * \param[in] zone zone * */ void zone_rollback_nsec3param(zone_type* zone); /** * Prepare keys for signing. * \param[in] zone zone * \return ods_status status * */ ods_status zone_prepare_keys(zone_type* zone); /** * Update serial. * \param[in] zone zone * \return ods_status status * */ ods_status zone_update_serial(zone_type* zone); /** * Lookup RRset. * \param[in] zone zone * \param[in] owner RRset owner * \param[in] type RRtype * \return rrset_type* RRset, if found * */ rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner, ldns_rr_type type); /** * Add RR. * \param[in] zone zone * \param[in] rr rr * \param[in] do_stats true if we need to maintain statistics * \return ods_status status * ODS_STATUS_OK: rr to be added to zone * ODS_STATUS_UNCHANGED: rr not added to zone, rr already exists * other: rr not added to zone, error occurred * */ ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats); /** * Delete RR. * \param[in] zone zone * \param[in] rr rr * \param[in] do_stats true if we need to maintain statistics * \return ods_status status * ODS_STATUS_OK: rr to be removed from zone * ODS_STATUS_UNCHANGED: rr not removed from zone, rr does not exist * other: rr not removed from zone, error occurred * */ ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats); /** * Merge zones. Values that are merged: * - policy name * - signconf filename * - input and output adapter * * \param[in] z1 zone * \param[in] z2 zone with new values * */ void zone_merge(zone_type* z1, zone_type* z2); /** * Clean up zone. * \param[in] zone zone * */ void zone_cleanup(zone_type* zone); /** * Backup zone. * \param[in] zone corresponding zone * \return ods_status status * */ ods_status zone_backup2(zone_type* zone); /** * Recover zone from backup. * \param[in] zone corresponding zone * */ ods_status zone_recover2(zone_type* zone); #endif /* SIGNER_ZONE_H */ opendnssec-1.4.9/signer/src/signer/denial.c0000644000175000017500000002406612650165732015573 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Denial of Existence. * */ #include "config.h" #include "shared/log.h" #include "signer/denial.h" #include "signer/domain.h" #include "signer/zone.h" #define SE_MAX_RRTYPE_COUNT 65536 static const char* denial_str = "denial"; /** * Create new Denial of Existence data point. * */ denial_type* denial_create(void* zoneptr, ldns_rdf* dname) { denial_type* denial = NULL; zone_type* zone = (zone_type*) zoneptr; if (!dname || !zoneptr) { return NULL; } denial = (denial_type*) allocator_alloc( zone->allocator, sizeof(denial_type)); if (!denial) { ods_log_error("[%s] unable to create denial: allocator_alloc() " "failed", denial_str); return NULL; } denial->dname = dname; denial->zone = zoneptr; denial->domain = NULL; /* no back reference yet */ denial->node = NULL; /* not in db yet */ denial->rrset = NULL; denial->bitmap_changed = 0; denial->nxt_changed = 0; return denial; } /** * Create NSEC(3) Type Bitmaps Field. * */ static void denial_create_bitmap(denial_type* denial, ldns_rr_type types[], size_t* types_count) { domain_type* domain = NULL; rrset_type* rrset = NULL; ods_log_assert(denial); ods_log_assert(denial->domain); domain = (domain_type*) denial->domain; rrset = domain->rrsets; while (rrset) { ldns_rr_type dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_SOA) { /* Authoritative or delegation */ dstatus = domain_is_delegpt(domain); if (dstatus == LDNS_RR_TYPE_SOA || rrset->rrtype == LDNS_RR_TYPE_NS || rrset->rrtype == LDNS_RR_TYPE_DS) { types[*types_count] = rrset->rrtype; *types_count = *types_count + 1; } } rrset = rrset->next; } return; } /** * Create NSEC3 Next Hashed Owner Name Field. * */ static ldns_rdf* denial_create_nsec3_nxt(ldns_rdf* nxt) { ldns_status status = LDNS_STATUS_OK; ldns_rdf* next_owner_label = NULL; ldns_rdf* next_owner_rdf = NULL; char* next_owner_string = NULL; ods_log_assert(nxt); next_owner_label = ldns_dname_label(nxt, 0); if (!next_owner_label) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_dname_label() failed", denial_str); return NULL; } next_owner_string = ldns_rdf2str(next_owner_label); if (!next_owner_string) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_rdf2str() failed", denial_str); ldns_rdf_deep_free(next_owner_label); return NULL; } if (next_owner_string[strlen(next_owner_string)-1] == '.') { next_owner_string[strlen(next_owner_string)-1] = '\0'; } status = ldns_str2rdf_b32_ext(&next_owner_rdf, next_owner_string); if (status != LDNS_STATUS_OK) { ods_log_alert("[%s] unable to create NSEC3 Next: " "ldns_str2rdf_b32_ext() failed", denial_str); } free((void*)next_owner_string); ldns_rdf_deep_free(next_owner_label); return next_owner_rdf; } /** * Create NSEC(3) RR. * */ static ldns_rr* denial_create_nsec(denial_type* denial, denial_type* nxt, uint32_t ttl, ldns_rr_class klass, nsec3params_type* n3p) { ldns_rr* nsec_rr = NULL; ldns_rr_type rrtype = LDNS_RR_TYPE_NSEC; ldns_rr_type dstatus = LDNS_RR_TYPE_FIRST; ldns_rdf* rdf = NULL; domain_type* domain = NULL; ldns_rr_type types[SE_MAX_RRTYPE_COUNT]; size_t types_count = 0; int i = 0; ods_log_assert(denial); ods_log_assert(denial->dname); ods_log_assert(nxt); ods_log_assert(nxt->dname); nsec_rr = ldns_rr_new(); if (!nsec_rr) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_rr_new() failed", denial_str); return NULL; } /* RRtype */ if (n3p) { rrtype = LDNS_RR_TYPE_NSEC3; } ldns_rr_set_type(nsec_rr, rrtype); /* owner */ rdf = ldns_rdf_clone(denial->dname); if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_rdf_clone(owner) failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_set_owner(nsec_rr, rdf); /* NSEC3 parameters */ if (n3p) { /* set all to NULL first, then call nsec3_add_param_rdfs. */ for (i=0; i < SE_NSEC3_RDATA_NSEC3PARAMS; i++) { ldns_rr_push_rdf(nsec_rr, NULL); } ldns_nsec3_add_param_rdfs(nsec_rr, n3p->algorithm, n3p->flags, n3p->iterations, n3p->salt_len, n3p->salt_data); } /* NXT */ if (n3p) { rdf = denial_create_nsec3_nxt(nxt->dname); } else { rdf = ldns_rdf_clone(nxt->dname); } if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "create next field failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_push_rdf(nsec_rr, rdf); /* Type Bit Maps */ denial_create_bitmap(denial, types, &types_count); if (n3p) { domain = (domain_type*) denial->domain; dstatus = domain_is_occluded(domain); if (dstatus == LDNS_RR_TYPE_SOA) { dstatus = domain_is_delegpt(domain); if (dstatus != LDNS_RR_TYPE_NS && domain->rrsets) { /* Authoritative domain, not empty: add RRSIGs */ types[types_count] = LDNS_RR_TYPE_RRSIG; types_count++; } } /* and don't add NSEC3 type... */ } else { types[types_count] = LDNS_RR_TYPE_RRSIG; types_count++; types[types_count] = LDNS_RR_TYPE_NSEC; types_count++; } rdf = ldns_dnssec_create_nsec_bitmap(types, types_count, rrtype); if (!rdf) { ods_log_alert("[%s] unable to create NSEC(3) RR: " "ldns_dnssec_create_nsec_bitmap() failed", denial_str); ldns_rr_free(nsec_rr); return NULL; } ldns_rr_push_rdf(nsec_rr, rdf); ldns_rr_set_ttl(nsec_rr, ttl); ldns_rr_set_class(nsec_rr, klass); return nsec_rr; } /** * Apply differences at denial. * */ void denial_diff(denial_type* denial) { if (denial && denial->rrset) { rrset_diff(denial->rrset, 0, 0); } return; } /** * Add NSEC(3) to the Denial of Existence data point. * */ void denial_add_rr(denial_type* denial, ldns_rr* rr) { rr_type* record = NULL; zone_type* zone = NULL; ods_log_assert(denial); ods_log_assert(rr); zone = (zone_type*) denial->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (!denial->rrset) { if (zone->signconf->nsec3params) { denial->rrset = rrset_create(denial->zone, LDNS_RR_TYPE_NSEC3); } else { denial->rrset = rrset_create(denial->zone, LDNS_RR_TYPE_NSEC); } if (!denial->rrset) { ods_fatal_exit("[%s] unable to nsecify: rrset_create() failed", denial_str); } } ods_log_assert(denial->rrset); record = rrset_add_rr(denial->rrset, rr); ods_log_assert(record); ods_log_assert(record->rr); record->owner = (void*) denial; denial_diff(denial); denial->bitmap_changed = 0; denial->nxt_changed = 0; return; } /** * Nsecify Denial of Existence data point. * */ void denial_nsecify(denial_type* denial, denial_type* nxt, uint32_t* num_added) { ldns_rr* nsec_rr = NULL; zone_type* zone = NULL; ods_log_assert(denial); ods_log_assert(nxt); zone = (zone_type*) denial->zone; ods_log_assert(zone); ods_log_assert(zone->signconf); if (denial->nxt_changed || denial->bitmap_changed) { /* create new NSEC(3) rr */ nsec_rr = denial_create_nsec(denial, nxt, zone->default_ttl, zone->klass, zone->signconf->nsec3params); if (!nsec_rr) { ods_fatal_exit("[%s] unable to nsecify: denial_create_nsec() " "failed", denial_str); } denial_add_rr(denial, nsec_rr); if (num_added) { (*num_added)++; } } return; } /** * Print Denial of Existence data point. * */ void denial_print(FILE* fd, denial_type* denial, ods_status* status) { if (!denial || !fd) { if (status) { ods_log_crit("[%s] unable to print denial: denial of fd missing", denial_str); *status = ODS_STATUS_ASSERT_ERR; } return; } if (denial->rrset) { rrset_print(fd, denial->rrset, 0, status); } return; } /** * Cleanup Denial of Existence data point. * */ void denial_cleanup(denial_type* denial) { zone_type* zone = NULL; if (!denial) { return; } zone = (zone_type*) denial->zone; ldns_rdf_deep_free(denial->dname); rrset_cleanup(denial->rrset); allocator_deallocate(zone->allocator, (void*) denial); return; } opendnssec-1.4.9/signer/src/adapter/0000755000175000017500000000000012650166152014371 500000000000000opendnssec-1.4.9/signer/src/adapter/adutil.c0000644000175000017500000001361712650165732015752 00000000000000/* * Copyright (c) 2009-2011 NLNet Labs. 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 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. * */ /** * * Adapter utilities. */ #include "config.h" #include "adapter/adutil.h" #include "shared/file.h" #include "shared/log.h" #include static const char* adapter_str = "adapter"; /** * Lookup SOA RR. * */ ldns_rr* adutil_lookup_soa_rr(FILE* fd) { ldns_rr *cur_rr = NULL; char line[SE_ADFILE_MAXLINE]; ldns_status status = LDNS_STATUS_OK; int line_len = 0; unsigned int l = 0; while (line_len >= 0) { line_len = adutil_readline_frm_file(fd, (char*) line, &l, 0); adutil_rtrim_line(line, &line_len); if (line_len > 0) { if (line[0] != ';') { status = ldns_rr_new_frm_str(&cur_rr, line, 0, NULL, NULL); if (status == LDNS_STATUS_OK) { if (ldns_rr_get_type(cur_rr) == LDNS_RR_TYPE_SOA) { return cur_rr; } else { ldns_rr_free(cur_rr); cur_rr = NULL; } } } } } return NULL; } /** * Read one line from zone file. * */ int adutil_readline_frm_file(FILE* fd, char* line, unsigned int* l, int keep_comments) { int i = 0; int li = 0; int in_string = 0; int depth = 0; int comments = 0; int c = 0; int lc = 0; for (i = 0; i < SE_ADFILE_MAXLINE; i++) { c = ods_fgetc(fd, l); if (comments) { while (c != EOF && (char)c != '\n') { c = ods_fgetc(fd, l); } } if (c == EOF) { if (depth != 0) { ods_log_error("[%s] read line: bracket mismatch discovered at " "line %i, missing ')'", adapter_str, l&&*l?*l:0); } if (li > 0) { line[li] = '\0'; return li; } else { return -1; } } else if ((char)c == '"' && (char)lc != '\\') { in_string = 1 - in_string; /* swap status */ line[li] = (char)c; li++; } else if ((char)c == '(') { if (in_string) { line[li] = (char)c; li++; } else if ((char)lc != '\\') { depth++; line[li] = ' '; li++; } else { line[li] = (char)c; li++; } } else if ((char)c == ')') { if (in_string) { line[li] = (char)c; li++; } else if ((char)lc != '\\') { if (depth < 1) { ods_log_error("[%s] read line: bracket mismatch " "discovered at line %i, missing '('", adapter_str, l&&*l?*l:0); line[li] = '\0'; return li; } depth--; line[li] = ' '; li++; } else { line[li] = (char)c; li++; } } else if ((char)c == ';') { if (in_string) { line[li] = (char)c; li++; } else if ((char)lc != '\\' && !keep_comments) { comments = 1; } else { line[li] = (char)c; li++; } } else if ((char)c == '\n' && (char)lc != '\\') { comments = 0; /* if no depth issue, we are done */ if (depth == 0) { break; } line[li] = ' '; li++; } else { line[li] = (char)c; li++; } /* continue with line */ lc = c; } /* done */ if (depth != 0) { ods_log_error("[%s] read line: bracket mismatch discovered at line %i," " missing ')'", adapter_str, l&&*l?*l:0); return li; } line[li] = '\0'; return li; } /* * Trim trailing whitespace. * */ void adutil_rtrim_line(char* line, int* line_len) { int i = strlen(line), nl = 0; int trimmed = 0; while (i>0) { --i; if (line[i] == '\n') { nl = 1; } if (line[i] == ' ' || line[i] == '\t' || line[i] == '\n') { line[i] = '\0'; trimmed++; } else { break; } } if (nl) { line[++i] = '\n'; } *line_len -= trimmed; return; } /** * Check for white space. * */ int adutil_whitespace_line(char* line, int line_len) { int i; for (i = 0; i < line_len; i++) { if (!isspace((int)line[i])) { return 0; } } return 1; } opendnssec-1.4.9/signer/src/adapter/adfile.h0000644000175000017500000000362512650165732015717 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * File Adapters. * */ #ifndef ADAPTER_ADFILE_H #define ADAPTER_ADFILE_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include /** * File adapter. * */ /** NULL */ /** * Read zone from input file adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status adfile_read(void* zone); /** * Write zone to output file adapter. * \param[in] zone zone reference * \param[in] filename write to this specific file * \return ods_status status * */ ods_status adfile_write(void* zone, const char* filename); #endif /* ADAPTER_ADFILE_H */ opendnssec-1.4.9/signer/src/adapter/adfile.c0000644000175000017500000003045612650165732015714 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * File Adapters. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adapter.h" #include "adapter/adfile.h" #include "adapter/adutil.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include #include #include static const char* adapter_str = "adapter"; static ods_status adfile_read_file(FILE* fd, zone_type* zone); /** * Read the next RR from zone file. * */ static ldns_rr* adfile_read_rr(FILE* fd, zone_type* zone, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; ldns_rdf* tmp = NULL; FILE* fd_include = NULL; int len = 0; ods_status s = ODS_STATUS_OK; uint32_t new_ttl = 0; const char *endptr; /* unused */ int offset = 0; adfile_read_line: if (ttl) { new_ttl = *ttl; } len = adutil_readline_frm_file(fd, line, l, 0); adutil_rtrim_line(line, &len); if (len >= 0) { switch (line[0]) { /* directive */ case '$': if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((int)line[7])) { /* copy from ldns */ if (*orig) { ldns_rdf_deep_free(*orig); *orig = NULL; } offset = 8; while (isspace((int)line[offset])) { offset++; } tmp = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, line + offset); if (!tmp) { /* could not parse what next to $ORIGIN */ *status = LDNS_STATUS_SYNTAX_DNAME_ERR; return NULL; } *orig = tmp; /* end copy from ldns */ goto adfile_read_line; /* perhaps next line is rr */ break; } else if (strncmp(line, "$TTL", 4) == 0 && isspace((int)line[4])) { /* override default ttl */ offset = 5; while (isspace((int)line[offset])) { offset++; } if (ttl) { *ttl = ldns_str2period(line + offset, &endptr); new_ttl = *ttl; } goto adfile_read_line; /* perhaps next line is rr */ break; } else if (strncmp(line, "$INCLUDE", 8) == 0 && isspace((int)line[8])) { /* dive into this file */ offset = 9; while (isspace((int)line[offset])) { offset++; } fd_include = ods_fopen(line + offset, NULL, "r"); if (fd_include) { s = adfile_read_file(fd_include, zone); ods_fclose(fd_include); } else { ods_log_error("[%s] unable to open include file %s", adapter_str, (line+offset)); *status = LDNS_STATUS_SYNTAX_ERR; return NULL; } if (s != ODS_STATUS_OK) { *status = LDNS_STATUS_SYNTAX_ERR; ods_log_error("[%s] error in include file %s", adapter_str, (line+offset)); return NULL; } /* restore current ttl */ if (ttl) { *ttl = new_ttl; } goto adfile_read_line; /* perhaps next line is rr */ break; } goto adfile_read_rr; /* this can be an owner name */ break; /* comments, empty lines */ case ';': case '\n': goto adfile_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: adfile_read_rr: if (adutil_whitespace_line(line, len)) { goto adfile_read_line; /* perhaps next line is rr */ break; } *status = ldns_rr_new_frm_str(&rr, line, new_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto adfile_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR at line %i (%s): %s", adapter_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); while (len >= 0) { len = adutil_readline_frm_file(fd, line, l, 0); } if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Read zone file. * */ static ods_status adfile_read_file(FILE* fd, zone_type* zone) { ods_status result = ODS_STATUS_OK; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; uint32_t ttl = 0; uint32_t new_serial = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned int line_update_interval = 100000; unsigned int line_update = line_update_interval; unsigned int l = 0; ods_log_assert(fd); ods_log_assert(zone); /* $ORIGIN */ dname = adapi_get_origin(zone); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } /* $TTL */ ttl = adapi_get_ttl(zone); /* read RRs */ while ((rr = adfile_read_rr(fd, zone, line, &orig, &prev, &ttl, &status, &l)) != NULL) { /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; break; } /* debug update */ if (l > line_update) { ods_log_debug("[%s] ...at line %i: %s", adapter_str, l, line); line_update += line_update_interval; } /* SOA? */ if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { new_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); } /* add to the database */ result = adapi_add_rr(zone, rr, 0); if (result == ODS_STATUS_UNCHANGED) { ods_log_debug("[%s] skipping RR at line %i (duplicate): %s", adapter_str, l, line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error adding RR at line %i: %s", adapter_str, l, line); ldns_rr_free(rr); rr = NULL; break; } } /* and done */ if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } /* input zone ok, set inbound serial and apply differences */ if (result == ODS_STATUS_OK) { result = namedb_examine(zone->db); if (result != ODS_STATUS_OK) { ods_log_error("[%s] unable to read file: zonefile contains errors", adapter_str); return result; } adapi_set_serial(zone, new_serial); } return result; } /** * Read zone from zonefile. * */ ods_status adfile_read(void* zone) { FILE* fd = NULL; zone_type* adzone = (zone_type*) zone; ods_status status = ODS_STATUS_OK; if (!adzone || !adzone->adinbound || !adzone->adinbound->configstr) { ods_log_error("[%s] unable to read file: no input adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } fd = ods_fopen(adzone->adinbound->configstr, NULL, "r"); if (!fd) { return ODS_STATUS_FOPEN_ERR; } status = adfile_read_file(fd, adzone); ods_fclose(fd); if (status == ODS_STATUS_OK) { adapi_trans_full(zone, 0); } return status; } /** * Write zonefile. * */ ods_status adfile_write(void* zone, const char* filename) { FILE* fd = NULL; char* tmpname = NULL; zone_type* adzone = (zone_type*) zone; ods_status status = ODS_STATUS_OK; /* [start] sanity parameter checking */ if (!adzone || !adzone->adoutbound) { ods_log_error("[%s] unable to write file: no output adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } if (!filename) { ods_log_error("[%s] unable to write file: no filename given", adapter_str); return ODS_STATUS_ASSERT_ERR; } /* [end] sanity parameter checking */ /* [start] write zone */ tmpname = ods_build_path(filename, ".tmp", 0, 0); if (!tmpname) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(tmpname, NULL, "w"); if (fd) { status = adapi_printzone(fd, adzone); ods_fclose(fd); if (status == ODS_STATUS_OK) { if (adzone->adoutbound->error) { ods_log_error("[%s] unable to write zone %s file %s: one or " "more RR print failed", adapter_str, adzone->name, filename); /* clear error */ adzone->adoutbound->error = 0; status = ODS_STATUS_FWRITE_ERR; } } } else { status = ODS_STATUS_FOPEN_ERR; } if (status == ODS_STATUS_OK) { if (rename((const char*) tmpname, filename) != 0) { ods_log_error("[%s] unable to write file: failed to rename %s " "to %s (%s)", adapter_str, tmpname, filename, strerror(errno)); status = ODS_STATUS_RENAME_ERR; } } free(tmpname); /* [end] write zone */ return status; } opendnssec-1.4.9/signer/src/adapter/addns.h0000644000175000017500000000733312650165732015564 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * DNS Adapters. * */ #ifndef ADAPTER_ADDNS_H #define ADAPTER_ADDNS_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/acl.h" #include "wire/tsig.h" #include #include #include /** * DNS input adapter. * */ typedef struct dnsin_struct dnsin_type; struct dnsin_struct { allocator_type* allocator; acl_type* request_xfr; acl_type* allow_notify; tsig_type* tsig; time_t last_modified; }; /** * DNS output adapter. * */ typedef struct dnsout_struct dnsout_type; struct dnsout_struct { allocator_type* allocator; acl_type* provide_xfr; acl_type* do_notify; tsig_type* tsig; time_t last_modified; }; /** * Create DNS input adapter. * \return dnsin_type* DNS input adapter * */ dnsin_type* dnsin_create(void); /** * Create DNS output adapter. * \return dnsout_type* DNS output adapter * */ dnsout_type* dnsout_create(void); /** * Update DNS input adapter. * \param[out] addns DNS input adapter * \param[in] filename filename * \param[out] last_mod last modified * \return ods_status status * */ ods_status dnsin_update(dnsin_type** addns, const char* filename, time_t* last_mod); /** * Update DNS output adapter. * \param[out] addns DNS output adapter * \param[in] filename filename * \param[out] last_mod last modified * \return ods_status status * */ ods_status dnsout_update(dnsout_type** addns, const char* filename, time_t* last_mod); /** * Read the next RR from zone file. * \param[in] fd file descriptor * \param[in] line read line * \param[in] orig origin * \param[in] prev previous name * \param[in] ttl default ttl * \param[in] status status * \param[out] l line count * \return ldns_rr* RR * */ ldns_rr* addns_read_rr(FILE* fd, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l); /** * Read zone from DNS input adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status addns_read(void* zone); /** * Write zone to DNS output adapter. * \param[in] zone zone reference * \return ods_status status * */ ods_status addns_write(void* zone); /** * Clean up DNS input adapter. * \param[in] addns DNS input adapter * */ void dnsin_cleanup(dnsin_type* addns); /** * Clean up DNS output adapter. * \param[in] addns DNS output adapter * */ void dnsout_cleanup(dnsout_type* addns); #endif /* ADAPTER_ADDNS_H */ opendnssec-1.4.9/signer/src/adapter/adutil.h0000644000175000017500000000446112650165732015754 00000000000000/* * Copyright (c) 2009-2011 NLNet Labs. 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 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. * */ /** * * Adapter utilities. */ #ifndef ADAPTER_ADUTIL_H #define ADAPTER_ADUTIL_H #include "config.h" #include #include #define SE_ADFILE_MAXLINE 65535 /** * Lookup SOA RR. * \param[in] fd file descriptor * \return ldns_rr* SOA RR * */ ldns_rr* adutil_lookup_soa_rr(FILE* fd); /** * Read one line from file. * \param[in] fd file descriptor of zonefile * \param[out] line the one line * \param[out] l keeps track of line numbers * \param[in] keep_comments if true, keep comments * \return int number of characters read * */ int adutil_readline_frm_file(FILE* fd, char* line, unsigned int* l, int keep_comments); /* * Trim trailing whitespace. * \param[in] line line to be trimmed * \param[out] line_len maintain line length * */ void adutil_rtrim_line(char* line, int* line_len); /** * Check for white space. * \param[in] line line to be checked * \param[in] line_len line length * */ int adutil_whitespace_line(char* line, int line_len); #endif /* ADAPTER_ADUTIL_H */ opendnssec-1.4.9/signer/src/adapter/adapter.h0000644000175000017500000000572312650165732016114 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Inbound and Outbound Adapters. * */ #ifndef ADAPTER_ADAPTER_H #define ADAPTER_ADAPTER_H #include "config.h" #include "adapter/addns.h" #include "adapter/adfile.h" #include "shared/allocator.h" #include "shared/status.h" #include /** Adapter mode. */ enum adapter_mode_enum { ADAPTER_FILE = 1, ADAPTER_DNS }; typedef enum adapter_mode_enum adapter_mode; /** * Adapter. * */ typedef struct adapter_struct adapter_type; struct adapter_struct { allocator_type* allocator; adapter_mode type; time_t config_last_modified; const char* configstr; void* config; unsigned inbound : 1; unsigned error : 1; }; /** * Create new adapter. * \param[in] str configuration string * \param[in] type type of adapter * \param[in] in inbound or not (thus outbound) * \return adapter_type* created adapter * */ adapter_type* adapter_create(const char* str, adapter_mode type, unsigned in); /** * Load configuration. * \param[in] adapter adapter * \return ods_status status * */ ods_status adapter_load_config(adapter_type* adapter); /** * Compare adapters. * \param[in] a1 adapter 1 * \param[in] a2 adapter 2 * \return int 0 on equal, -1 if a1 < a2, 1 if a1 > a2 * */ int adapter_compare(adapter_type* a1, adapter_type* a2); /** * Read zone from input adapter. * \param[in] zone zone * \return ods_status status * */ ods_status adapter_read(void* zone); /** * Write zone to output adapter. * \param[in] zone zone * \return ods_status status * */ ods_status adapter_write(void* zone); /** * Clean up adapter. * \param[in] adapter adapter to cleanup * */ void adapter_cleanup(adapter_type* adapter); #endif /* ADAPTER_ADAPTER_H */ opendnssec-1.4.9/signer/src/adapter/addns.c0000644000175000017500000007316012650165732015560 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * DNS Adapters. * */ #include "config.h" #include "adapter/adapi.h" #include "adapter/adapter.h" #include "adapter/addns.h" #include "adapter/adutil.h" #include "parser/addnsparser.h" #include "parser/confparser.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include "wire/notify.h" #include "wire/xfrd.h" #include #include #include static const char* adapter_str = "adapter"; static ods_status addns_read_pkt(FILE* fd, zone_type* zone); static ods_status addns_read_file(FILE* fd, zone_type* zone); /** * Read the next RR from zone file. * */ ldns_rr* addns_read_rr(FILE* fd, char* line, ldns_rdf** orig, ldns_rdf** prev, uint32_t* ttl, ldns_status* status, unsigned int* l) { ldns_rr* rr = NULL; int len = 0; uint32_t new_ttl = 0; addns_read_line: if (ttl) { new_ttl = *ttl; } len = adutil_readline_frm_file(fd, line, l, 1); adutil_rtrim_line(line, &len); if (len >= 0) { switch (line[0]) { /* no directives */ /* comments, empty lines */ case ';': case '\n': if (ods_strcmp(";;ENDPACKET", line) == 0) { /* end of pkt */ *status = LDNS_STATUS_OK; return NULL; } if (ods_strcmp(";;BEGINPACKET", line) == 0) { /* begin packet but previous not ended, rollback */ *status = LDNS_STATUS_OK; return NULL; } goto addns_read_line; /* perhaps next line is rr */ break; /* let's hope its a RR */ default: if (adutil_whitespace_line(line, len)) { goto addns_read_line; /* perhaps next line is rr */ break; } *status = ldns_rr_new_frm_str(&rr, line, new_ttl, *orig, prev); if (*status == LDNS_STATUS_OK) { return rr; } else if (*status == LDNS_STATUS_SYNTAX_EMPTY) { if (rr) { ldns_rr_free(rr); rr = NULL; } *status = LDNS_STATUS_OK; goto addns_read_line; /* perhaps next line is rr */ break; } else { ods_log_error("[%s] error parsing RR at line %i (%s): %s", adapter_str, l&&*l?*l:0, ldns_get_errorstr_by_id(*status), line); while (len >= 0) { len = adutil_readline_frm_file(fd, line, l, 0); } if (rr) { ldns_rr_free(rr); rr = NULL; } return NULL; } break; } } /* -1, EOF */ *status = LDNS_STATUS_OK; return NULL; } /** * Read pkt from file. * */ static ods_status addns_read_pkt(FILE* fd, zone_type* zone) { ldns_rr* rr = NULL; long startpos = 0; long fpos = 0; int len = 0; uint32_t new_serial = 0; uint32_t old_serial = 0; uint32_t tmp_serial = 0; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; ldns_rdf* dname = NULL; uint32_t ttl = 0; size_t rr_count = 0; ods_status result = ODS_STATUS_OK; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned is_axfr = 0; unsigned del_mode = 0; unsigned soa_seen = 0; unsigned line_update_interval = 100000; unsigned line_update = line_update_interval; unsigned l = 0; char* xfrd; char* fin; char* fout; ods_log_assert(fd); ods_log_assert(zone); ods_log_assert(zone->name); fpos = ftell(fd); len = adutil_readline_frm_file(fd, line, &l, 1); if (len < 0) { /* -1 EOF */ return ODS_STATUS_EOF; } adutil_rtrim_line(line, &len); if (ods_strcmp(";;BEGINPACKET", line) != 0) { ods_log_error("[%s] bogus xfrd file zone %s, missing ;;BEGINPACKET (was %s)", adapter_str, zone->name, line); return ODS_STATUS_ERR; } startpos = fpos; fpos = ftell(fd); begin_pkt: rr_count = 0; is_axfr = 0; del_mode = 0; soa_seen = 0; /* $ORIGIN */ dname = adapi_get_origin(zone); if (!dname) { ods_log_error("[%s] error getting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } orig = ldns_rdf_clone(dname); if (!orig) { ods_log_error("[%s] error setting default value for $ORIGIN", adapter_str); return ODS_STATUS_ERR; } /* $TTL */ ttl = adapi_get_ttl(zone); /* read RRs */ while ((rr = addns_read_rr(fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { /* update file position */ fpos = ftell(fd); /* check status */ if (status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; break; } /* debug update */ if (l > line_update) { ods_log_debug("[%s] ...at line %i: %s", adapter_str, l, line); line_update += line_update_interval; } /* first RR: check if SOA and correct zone & serialno */ if (rr_count == 0) { rr_count++; if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad xfr, first rr is not soa", adapter_str); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } soa_seen++; if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex)) { ods_log_error("[%s] bad xfr, soa dname not equal to zone " "dname %s", adapter_str, zone->name); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); old_serial = adapi_get_serial(zone); /** * Do we need to make this check? It is already done by xfrd. * By not doing this check, retransfers will be taken into account. * if (!util_serial_gt(tmp_serial, old_serial) && zone->db->is_initialized) { ods_log_info("[%s] zone %s is already up to date, have " "serial %u, got serial %u", adapter_str, zone->name, old_serial, tmp_serial); new_serial = tmp_serial; ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_UPTODATE; while (len >= 0) { len = adutil_readline_frm_file(fd, line, &l, 1); if (len && ods_strcmp(";;ENDPACKET", line) == 0) { startpos = 0; break; } } break; } * **/ ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } /* second RR: if not soa, this is an AXFR */ if (rr_count == 1) { if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_verbose("[%s] detected axfr serial=%u for zone %s", adapter_str, tmp_serial, zone->name); new_serial = tmp_serial; is_axfr = 1; del_mode = 0; } else { ods_log_verbose("[%s] detected ixfr serial=%u for zone %s", adapter_str, tmp_serial, zone->name); if (!util_serial_gt(tmp_serial, old_serial) && zone->db->is_initialized) { ods_log_error("[%s] bad ixfr for zone %s, bad start serial %u", adapter_str, zone->name, tmp_serial); result = ODS_STATUS_ERR; } new_serial = tmp_serial; tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); ldns_rr_free(rr); rr = NULL; rr_count++; if (tmp_serial < new_serial) { del_mode = 1; result = ODS_STATUS_OK; continue; } else { ods_log_error("[%s] bad ixfr for zone %s, bad soa serial %u", adapter_str, zone->name, tmp_serial); result = ODS_STATUS_ERR; break; } } } /* soa means swap */ rr_count++; if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { if (!is_axfr) { tmp_serial = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); if (tmp_serial <= new_serial) { if (tmp_serial == new_serial) { soa_seen++; } del_mode = !del_mode; ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else { ods_log_assert(tmp_serial > new_serial); ods_log_error("[%s] bad xfr for zone %s, bad soa serial", adapter_str, zone->name); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_ERR; break; } } else { /* for axfr */ soa_seen++; } } /* [add to/remove from] the zone */ if (!is_axfr && del_mode) { ods_log_deeebug("[%s] delete RR #%i at line %i: %s", adapter_str, rr_count, l, line); result = adapi_del_rr(zone, rr, 0); ldns_rr_free(rr); rr = NULL; } else { ods_log_deeebug("[%s] add RR #%i at line %i: %s", adapter_str, rr_count, l, line); result = adapi_add_rr(zone, rr, 0); } if (result == ODS_STATUS_UNCHANGED) { ods_log_deeebug("[%s] skipping RR at line %i (%s): %s", adapter_str, l, del_mode?"not found":"duplicate", line); ldns_rr_free(rr); rr = NULL; result = ODS_STATUS_OK; continue; } else if (result != ODS_STATUS_OK) { ods_log_error("[%s] error %s RR at line %i: %s", adapter_str, del_mode?"deleting":"adding", l, line); ldns_rr_free(rr); rr = NULL; break; } } /* and done */ if (orig) { ldns_rdf_deep_free(orig); orig = NULL; } if (prev) { ldns_rdf_deep_free(prev); prev = NULL; } /* check again */ if (ods_strcmp(";;ENDPACKET", line) == 0) { ods_log_verbose("[%s] xfr zone %s on disk complete, commit to db", adapter_str, zone->name); startpos = 0; } else { ods_log_warning("[%s] xfr zone %s on disk incomplete, rollback", adapter_str, zone->name); namedb_rollback(zone->db, 1); if (ods_strcmp(";;BEGINPACKET", line) == 0) { result = ODS_STATUS_OK; startpos = fpos; goto begin_pkt; } else { result = ODS_STATUS_XFRINCOMPLETE; } } /* otherwise EOF */ if (result == ODS_STATUS_OK && status != LDNS_STATUS_OK) { ods_log_error("[%s] error reading RR at line %i (%s): %s", adapter_str, l, ldns_get_errorstr_by_id(status), line); result = ODS_STATUS_ERR; } /* check the number of SOAs seen */ if (result == ODS_STATUS_OK) { if ((is_axfr && soa_seen != 2) || (!is_axfr && soa_seen != 3)) { ods_log_error("[%s] bad %s, wrong number of SOAs (%u)", adapter_str, is_axfr?"axfr":"ixfr", soa_seen); result = ODS_STATUS_ERR; } } /* input zone ok, set inbound serial and apply differences */ if (result == ODS_STATUS_OK) { adapi_set_serial(zone, new_serial); if (is_axfr) { adapi_trans_full(zone, 1); } else { adapi_trans_diff(zone, 1); } } if (result == ODS_STATUS_UPTODATE) { /* do a transaction for DNSKEY and NSEC3PARAM */ adapi_trans_diff(zone, 1); result = ODS_STATUS_OK; } if (result == ODS_STATUS_XFRINCOMPLETE) { /** we have to restore the incomplete zone transfer: * xfrd = (xfrd.tmp + startpos) . (xfrd) */ xfrd = ods_build_path(zone->name, ".xfrd", 0, 1); fin = ods_build_path(zone->name, ".xfrd.tmp", 0, 1); fout = ods_build_path(zone->name, ".xfrd.bak", 0, 1); if (!xfrd || !fin || !fout) { return ODS_STATUS_MALLOC_ERR; } ods_log_debug("[%s] restore xfrd zone %s xfrd %s fin %s fout %s", adapter_str, zone->name, xfrd, fin, fout); result = ods_file_copy(fin, fout, startpos, 0); if (result != ODS_STATUS_OK) { ods_log_crit("[%s] unable to restore incomple xfr zone %s: %s", adapter_str, zone->name, ods_status2str(result)); } else { lock_basic_lock(&zone->xfrd->rw_lock); if (ods_file_lastmodified(xfrd)) { result = ods_file_copy(xfrd, fout, 0, 1); if (result != ODS_STATUS_OK) { ods_log_crit("[%s] unable to restore xfrd zone %s: %s", adapter_str, zone->name, ods_status2str(result)); } else if (rename(fout, xfrd) != 0) { result = ODS_STATUS_RENAME_ERR; ods_log_crit("[%s] unable to restore xfrd zone %s: %s", adapter_str, zone->name, ods_status2str(result)); } } else if (rename(fout, xfrd) != 0) { result = ODS_STATUS_RENAME_ERR; ods_log_crit("[%s] unable to restore xfrd zone %s: %s", adapter_str, zone->name, ods_status2str(result)); } lock_basic_unlock(&zone->xfrd->rw_lock); } free((void*) xfrd); free((void*) fin); free((void*) fout); result = ODS_STATUS_XFRINCOMPLETE; } return result; } /** * Read pkt from file. * */ static ods_status addns_read_file(FILE* fd, zone_type* zone) { ods_status status = ODS_STATUS_OK; while (status == ODS_STATUS_OK) { status = addns_read_pkt(fd, zone); if (status == ODS_STATUS_OK) { lock_basic_lock(&zone->xfrd->serial_lock); zone->xfrd->serial_xfr = adapi_get_serial(zone); zone->xfrd->serial_xfr_acquired = zone->xfrd->serial_disk_acquired; lock_basic_unlock(&zone->xfrd->serial_lock); } } if (status == ODS_STATUS_EOF) { status = ODS_STATUS_OK; } return status; } /** * Create DNS input adapter. * */ dnsin_type* dnsin_create(void) { dnsin_type* addns = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create dnsin: allocator_create() " " failed", adapter_str); return NULL; } addns = (dnsin_type*) allocator_alloc(allocator, sizeof(dnsin_type)); if (!addns) { ods_log_error("[%s] unable to create dnsin: allocator_alloc() " " failed", adapter_str); allocator_cleanup(allocator); return NULL; } addns->allocator = allocator; addns->request_xfr = NULL; addns->allow_notify = NULL; addns->tsig = NULL; return addns; } /** * Create DNS output adapter. * */ dnsout_type* dnsout_create(void) { dnsout_type* addns = NULL; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create dnsout: allocator_create() " " failed", adapter_str); return NULL; } addns = (dnsout_type*) allocator_alloc(allocator, sizeof(dnsout_type)); if (!addns) { ods_log_error("[%s] unable to create dnsout: allocator_alloc() " " failed", adapter_str); allocator_cleanup(allocator); return NULL; } addns->allocator = allocator; addns->provide_xfr = NULL; addns->do_notify = NULL; addns->tsig = NULL; return addns; } /** * Read DNS input adapter. * */ static ods_status dnsin_read(dnsin_type* addns, const char* filename) { const char* rngfile = ODS_SE_RNGDIR "/addns.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!filename || !addns) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read dnsin file %s", adapter_str, filename); status = parse_file_check(filename, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read dnsin: parse error in " "file %s (%s)", adapter_str, filename, ods_status2str(status)); return status; } fd = ods_fopen(filename, NULL, "r"); if (fd) { addns->tsig = parse_addns_tsig(addns->allocator, filename); addns->request_xfr = parse_addns_request_xfr(addns->allocator, filename, addns->tsig); addns->allow_notify = parse_addns_allow_notify(addns->allocator, filename, addns->tsig); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read dnsout: failed to open file %s", adapter_str, filename); return ODS_STATUS_ERR; } /** * Update DNS input adapter. * */ ods_status dnsin_update(dnsin_type** addns, const char* filename, time_t* last_mod) { dnsin_type* new_addns = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!filename || !addns || !last_mod) { return ODS_STATUS_UNCHANGED; } /* read the new signer configuration */ new_addns = dnsin_create(); if (!new_addns) { ods_log_error("[%s] unable to update dnsin: dnsin_create() " "failed", adapter_str); return ODS_STATUS_ERR; } status = dnsin_read(new_addns, filename); if (status == ODS_STATUS_OK) { *addns = new_addns; *last_mod = st_mtime; } else { ods_log_error("[%s] unable to update dnsin: dnsin_read(%s) " "failed (%s)", adapter_str, filename, ods_status2str(status)); dnsin_cleanup(new_addns); } return status; } /** * Read DNS output adapter. * */ static ods_status dnsout_read(dnsout_type* addns, const char* filename) { const char* rngfile = ODS_SE_RNGDIR "/addns.rng"; ods_status status = ODS_STATUS_OK; FILE* fd = NULL; if (!filename || !addns) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] read dnsout file %s", adapter_str, filename); status = parse_file_check(filename, rngfile); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to read dnsout: parse error in " "file %s (%s)", adapter_str, filename, ods_status2str(status)); return status; } fd = ods_fopen(filename, NULL, "r"); if (fd) { addns->tsig = parse_addns_tsig(addns->allocator, filename); addns->provide_xfr = parse_addns_provide_xfr(addns->allocator, filename, addns->tsig); addns->do_notify = parse_addns_do_notify(addns->allocator, filename, addns->tsig); ods_fclose(fd); return ODS_STATUS_OK; } ods_log_error("[%s] unable to read dnsout: failed to open file %s", adapter_str, filename); return ODS_STATUS_ERR; } /** * Update DNS output adapter. * */ ods_status dnsout_update(dnsout_type** addns, const char* filename, time_t* last_mod) { dnsout_type* new_addns = NULL; time_t st_mtime = 0; ods_status status = ODS_STATUS_OK; if (!filename || !addns || !last_mod) { return ODS_STATUS_UNCHANGED; } /* read the new signer configuration */ new_addns = dnsout_create(); if (!new_addns) { ods_log_error("[%s] unable to update dnsout: dnsout_create() " "failed", adapter_str); return ODS_STATUS_ERR; } status = dnsout_read(new_addns, filename); if (status == ODS_STATUS_OK) { *addns = new_addns; *last_mod = st_mtime; } else { ods_log_error("[%s] unable to update dnsout: dnsout_read(%s) " "failed (%s)", adapter_str, filename, ods_status2str(status)); dnsout_cleanup(new_addns); } return status; } /** * Send notifies. * */ static void dnsout_send_notify(void* zone) { zone_type* z = (zone_type*) zone; rrset_type* rrset = NULL; ldns_rr* soa = NULL; if (!z->notify) { ods_log_error("[%s] unable to send notify for zone %s: no notify " "handler", adapter_str, z->name); return; } ods_log_assert(z->adoutbound); ods_log_assert(z->adoutbound->config); ods_log_assert(z->adoutbound->type == ADAPTER_DNS); ods_log_assert(z->db); ods_log_assert(z->name); ods_log_debug("[%s] enable notify for zone %s serial %u", adapter_str, z->name, z->db->intserial); rrset = zone_lookup_rrset(z, z->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); soa = ldns_rr_clone(rrset->rrs[0].rr); notify_enable(z->notify, soa); return; } /** * Read zone from DNS Input Adapter. * */ ods_status addns_read(void* zone) { zone_type* z = (zone_type*) zone; ods_status status = ODS_STATUS_OK; char* xfrfile = NULL; char* file = NULL; FILE* fd = NULL; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->xfrd); ods_log_assert(z->db); ods_log_assert(z->adinbound); ods_log_assert(z->adinbound->type == ADAPTER_DNS); lock_basic_lock(&z->xfrd->rw_lock); lock_basic_lock(&z->xfrd->serial_lock); /* did we already store a new zone transfer on disk? */ if (!z->xfrd->serial_disk_acquired || z->xfrd->serial_disk_acquired <= z->xfrd->serial_xfr_acquired) { if (!z->xfrd->serial_disk_acquired) { lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); return ODS_STATUS_XFR_NOT_READY; } lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); /* do a transaction for DNSKEY and NSEC3PARAM */ adapi_trans_diff(z, 0); ods_log_verbose("[%s] no new xfr ready for zone %s", adapter_str, z->name); return ODS_STATUS_UNCHANGED; } /* copy zone transfers */ xfrfile = ods_build_path(z->name, ".xfrd", 0, 1); file = ods_build_path(z->name, ".xfrd.tmp", 0, 1); if (!xfrfile || !file) { free(xfrfile); free(file); lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); ods_log_error("[%s] unable to build paths to xfrd files", adapter_str); return ODS_STATUS_MALLOC_ERR; } if (rename(xfrfile, file) != 0) { lock_basic_unlock(&z->xfrd->serial_lock); lock_basic_unlock(&z->xfrd->rw_lock); ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, xfrfile, file, strerror(errno)); free((void*) xfrfile); free((void*) file); return ODS_STATUS_RENAME_ERR; } lock_basic_unlock(&z->xfrd->serial_lock); /* open copy of zone transfers to read */ fd = ods_fopen(file, NULL, "r"); free((void*) xfrfile); if (!fd) { lock_basic_unlock(&z->xfrd->rw_lock); free((void*) file); return ODS_STATUS_FOPEN_ERR; } lock_basic_unlock(&z->xfrd->rw_lock); status = addns_read_file(fd, z); if (status == ODS_STATUS_OK) { /* clean up copy of zone transfer */ if (unlink((const char*) file) != 0) { ods_log_error("[%s] unable to unlink zone transfer copy file %s: " " %s", adapter_str, strerror(errno)); /* should be no issue */ } } free((void*) file); ods_fclose(fd); return status; } /** * Write to DNS Output Adapter. * */ ods_status addns_write(void* zone) { FILE* fd = NULL; char* atmpfile = NULL; char* axfrfile = NULL; char* itmpfile = NULL; char* ixfrfile = NULL; zone_type* z = (zone_type*) zone; int ret = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(z); ods_log_assert(z->name); ods_log_assert(z->adoutbound); ods_log_assert(z->adoutbound->type == ADAPTER_DNS); atmpfile = ods_build_path(z->name, ".axfr.tmp", 0, 1); if (!atmpfile) { return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(atmpfile, NULL, "w"); if (!fd) { free((void*) atmpfile); return ODS_STATUS_FOPEN_ERR; } status = adapi_printaxfr(fd, z); ods_fclose(fd); if (status != ODS_STATUS_OK) { free((void*) atmpfile); return status; } if (z->db->is_initialized) { itmpfile = ods_build_path(z->name, ".ixfr.tmp", 0, 1); if (!itmpfile) { free((void*) atmpfile); return ODS_STATUS_MALLOC_ERR; } fd = ods_fopen(itmpfile, NULL, "w"); if (!fd) { free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_FOPEN_ERR; } status = adapi_printixfr(fd, z); ods_fclose(fd); if (status != ODS_STATUS_OK) { free((void*) atmpfile); free((void*) itmpfile); return status; } } if (status == ODS_STATUS_OK) { if (z->adoutbound->error) { ods_log_error("[%s] unable to write zone %s axfr: one or " "more RR print failed", adapter_str, z->name); /* clear error */ z->adoutbound->error = 0; free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_FWRITE_ERR; } } /* lock and move */ axfrfile = ods_build_path(z->name, ".axfr", 0, 1); if (!axfrfile) { free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_MALLOC_ERR; } lock_basic_lock(&z->xfr_lock); ret = rename(atmpfile, axfrfile); if (ret != 0) { ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, atmpfile, axfrfile, strerror(errno)); lock_basic_unlock(&z->xfr_lock); free((void*) atmpfile); free((void*) axfrfile); free((void*) itmpfile); return ODS_STATUS_RENAME_ERR; } free((void*) axfrfile); free((void*) atmpfile); axfrfile = NULL; atmpfile = NULL; if (z->db->is_initialized) { ixfrfile = ods_build_path(z->name, ".ixfr", 0, 1); if (!ixfrfile) { free((void*) axfrfile); free((void*) atmpfile); free((void*) itmpfile); return ODS_STATUS_MALLOC_ERR; } ret = rename(itmpfile, ixfrfile); if (ret != 0) { ods_log_error("[%s] unable to rename file %s to %s: %s", adapter_str, itmpfile, ixfrfile, strerror(errno)); lock_basic_unlock(&z->xfr_lock); free((void*) itmpfile); free((void*) ixfrfile); return ODS_STATUS_RENAME_ERR; } free((void*) ixfrfile); } free((void*) itmpfile); lock_basic_unlock(&z->xfr_lock); dnsout_send_notify(zone); return ODS_STATUS_OK; } /** * Clean up DNS input adapter. * */ void dnsin_cleanup(dnsin_type* addns) { allocator_type* allocator = NULL; if (!addns) { return; } allocator = addns->allocator; acl_cleanup(addns->request_xfr, allocator); acl_cleanup(addns->allow_notify, allocator); tsig_cleanup(addns->tsig, allocator); allocator_deallocate(allocator, (void*) addns); allocator_cleanup(allocator); return; } /** * Clean up DNS output adapter. * */ void dnsout_cleanup(dnsout_type* addns) { allocator_type* allocator = NULL; if (!addns) { return; } allocator = addns->allocator; acl_cleanup(addns->provide_xfr, allocator); acl_cleanup(addns->do_notify, allocator); tsig_cleanup(addns->tsig, allocator); allocator_deallocate(allocator, (void*) addns); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/adapter/adapter.c0000644000175000017500000002043112650165732016100 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Inbound and Outbound Adapters. * */ #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zone.h" #include static const char* adapter_str = "adapter"; /** * Create a new adapter. * */ adapter_type* adapter_create(const char* str, adapter_mode type, unsigned in) { adapter_type* adapter = NULL; allocator_type* allocator = NULL; allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create adapter: allocator_create() " "failed", adapter_str); return NULL; } adapter = (adapter_type*) allocator_alloc(allocator, sizeof(adapter_type)); if (!adapter) { ods_log_error("[%s] unable to create adapter: allocator_alloc() " "failed", adapter_str); allocator_cleanup(allocator); return NULL; } adapter->allocator = allocator; adapter->type = type; adapter->inbound = in; adapter->error = 0; adapter->config = NULL; adapter->config_last_modified = 0; adapter->configstr = allocator_strdup(allocator, str); if (!adapter->configstr) { ods_log_error("[%s] unable to create adapter: allocator_strdup() " "failed", adapter_str); adapter_cleanup(adapter); return NULL; } /* type specific */ switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: if (adapter->inbound) { adapter->config = (void*) dnsin_create(); if (!adapter->config) { ods_log_error("[%s] unable to create adapter: " "dnsin_create() failed", adapter_str); adapter_cleanup(adapter); return NULL; } } else { adapter->config = (void*) dnsout_create(); if (!adapter->config) { ods_log_error("[%s] unable to create adapter: " "dnsout_create() failed", adapter_str); adapter_cleanup(adapter); return NULL; } } break; default: break; } return adapter; } /** * Load ACL. * */ ods_status adapter_load_config(adapter_type* adapter) { dnsin_type* dnsin = NULL; dnsout_type* dnsout = NULL; ods_status status = ODS_STATUS_OK; if (!adapter || !adapter->configstr) { return ODS_STATUS_ASSERT_ERR; } /* type specific */ switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: ods_log_assert(adapter->config); if (adapter->inbound) { status = dnsin_update(&dnsin, adapter->configstr, &adapter->config_last_modified); if (status == ODS_STATUS_OK) { ods_log_assert(dnsin); dnsin_cleanup((dnsin_type*) adapter->config); adapter->config = (void*) dnsin; } else if (status != ODS_STATUS_UNCHANGED) { return status; } return ODS_STATUS_OK; } else { /* outbound */ status = dnsout_update(&dnsout, adapter->configstr, &adapter->config_last_modified); if (status == ODS_STATUS_OK) { ods_log_assert(dnsout); dnsout_cleanup((dnsout_type*) adapter->config); adapter->config = (void*) dnsout; } else if (status != ODS_STATUS_UNCHANGED) { return status; } } break; default: break; } return ODS_STATUS_OK; } /* * Read zone from input adapter. * */ ods_status adapter_read(void* zone) { zone_type* adzone = (zone_type*) zone; if (!adzone || !adzone->adinbound) { ods_log_error("[%s] unable to read zone: no input adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } ods_log_assert(adzone->adinbound->configstr); switch (adzone->adinbound->type) { case ADAPTER_FILE: ods_log_verbose("[%s] read zone %s from file input adapter %s", adapter_str, adzone->name, adzone->adinbound->configstr); return adfile_read(zone); case ADAPTER_DNS: ods_log_verbose("[%s] read zone %s from dns input adapter %s", adapter_str, adzone->name, adzone->adinbound->configstr); return addns_read(zone); default: ods_log_error("[%s] unable to read zone %s from adapter: unknown " "adapter", adapter_str, adzone->name); return ODS_STATUS_ERR; } /* not reached */ return ODS_STATUS_ERR; } /** * Write zone to output adapter. * */ ods_status adapter_write(void* zone) { zone_type* adzone = (zone_type*) zone; if (!adzone || !adzone->db || !adzone->adoutbound) { ods_log_error("[%s] unable to write zone: no output adapter", adapter_str); return ODS_STATUS_ASSERT_ERR; } ods_log_assert(adzone->name); ods_log_assert(adzone->adoutbound->configstr); switch(adzone->adoutbound->type) { case ADAPTER_FILE: ods_log_verbose("[%s] write zone %s serial %u to output file " "adapter %s", adapter_str, adzone->name, adzone->db->intserial, adzone->adoutbound->configstr); return adfile_write(zone, adzone->adoutbound->configstr); case ADAPTER_DNS: return addns_write(zone); default: ods_log_error("[%s] unable to write zone %s to adapter: unknown " "adapter", adapter_str, adzone->name); return ODS_STATUS_ERR; } /* not reached */ return ODS_STATUS_ERR; } /** * Compare adapters. * */ int adapter_compare(adapter_type* a1, adapter_type* a2) { if (!a1 && !a2) { return 0; } else if (!a1) { return -1; } else if (!a2) { return 1; } else if (a1->inbound != a2->inbound) { return a1->inbound - a2->inbound; } else if (a1->type != a2->type) { return a1->type - a2->type; } return ods_strcmp(a1->configstr, a2->configstr); } /** * Clean up adapter. * */ void adapter_cleanup(adapter_type* adapter) { allocator_type* allocator = NULL; if (!adapter) { return; } allocator = adapter->allocator; allocator_deallocate(allocator, (void*) adapter->configstr); switch(adapter->type) { case ADAPTER_FILE: break; case ADAPTER_DNS: if (adapter->inbound) { dnsin_cleanup((dnsin_type*) adapter->config); } else { /* outbound */ dnsout_cleanup((dnsout_type*) adapter->config); } break; default: break; } allocator_deallocate(allocator, (void*) adapter); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/adapter/adapi.h0000644000175000017500000000661312650165732015551 00000000000000/* * Copyright (c) 2009-2011 NLNet Labs. 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 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. * */ /** * * Adapter API. */ #ifndef ADAPTER_ADAPI_H #define ADAPTER_ADAPI_H #include "config.h" #include "shared/status.h" #include "signer/zone.h" #include /** * Get the inbound serial. * \param[in] zone zone * \return uint32_t inbound serial * */ uint32_t adapi_get_serial(zone_type* zone); /** * Set the inbound serial. * \param[in] zone zone * \param[in] serial inbound serial * */ void adapi_set_serial(zone_type* zone, uint32_t serial); /** * Get origin. * \param[in] zone zone * \return ldns_rdf* origin * */ ldns_rdf* adapi_get_origin(zone_type* zone); /** * Get class. * \param[in] zone zone * \return ldns_rr_class class * */ ldns_rr_class adapi_get_class(zone_type* zone); /** * Get ttl. * \param[in] zone zone * \return uint32_t ttl * */ uint32_t adapi_get_ttl(zone_type* zone); /* * Do full zone transaction. * \param[in] zone zone * \param[in] more_coming more transactions are possible * */ void adapi_trans_full(zone_type* zone, unsigned more_coming); /* * Do incremental zone transaction. * \param[in] zone zone * \param[in] more_coming more transactions are possible * */ void adapi_trans_diff(zone_type* zone, unsigned more_coming); /** * Add RR. * \param[in] zone zone * \param[in] rr RR * \param[in] backup from backup * \return ods_status status * */ ods_status adapi_add_rr(zone_type* zone, ldns_rr* rr, int backup); /** * Delete RR. * \param[in] zone zone * \param[in] rr RR * \param[in] backup from backup * \return ods_status status * */ ods_status adapi_del_rr(zone_type* zone, ldns_rr* rr, int backup); /** * Print zonefile. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printzone(FILE* fd, zone_type* zone); /** * Print axfr. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printaxfr(FILE* fd, zone_type* zone); /** * Print ixfr. * \param[in] fd file descriptor * \param[in] zone zone * \return ods_status status * */ ods_status adapi_printixfr(FILE* fd, zone_type* zone); #endif /* ADAPTER_ADAPI_H */ opendnssec-1.4.9/signer/src/adapter/adapi.c0000644000175000017500000002650512650165732015546 00000000000000/* * Copyright (c) 2009-2011 NLNet Labs. 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 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. * */ /** * * Adapter API. */ #include "config.h" #include "adapter/adapi.h" #include "shared/duration.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zone.h" #include static const char* adapi_str = "adapter"; /** * Get the inbound serial. * */ uint32_t adapi_get_serial(zone_type* zone) { if (!zone || !zone->db) { return 0; } return zone->db->inbserial; } /** * Set the inbound serial. * */ void adapi_set_serial(zone_type* zone, uint32_t serial) { if (!zone || !zone->db) { return; } zone->db->inbserial = serial; return; } /** * Get origin. * */ ldns_rdf* adapi_get_origin(zone_type* zone) { if (!zone) { return NULL; } return zone->apex; } /** * Get class. * */ ldns_rr_class adapi_get_class(zone_type* zone) { if (!zone) { return LDNS_RR_CLASS_IN; } return zone->klass; } /** * Get ttl. * */ uint32_t adapi_get_ttl(zone_type* zone) { if (!zone) { return 0; } return zone->default_ttl; } /* * Do full zone transaction. * */ void adapi_trans_full(zone_type* zone, unsigned more_coming) { time_t start = 0; time_t end = 0; uint32_t num_added = 0; if (!zone || !zone->db) { return; } namedb_diff(zone->db, 0, more_coming); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->nsec_time = 0; zone->stats->nsec_count = 0; lock_basic_unlock(&zone->stats->stats_lock); } start = time(NULL); /* nsecify(3) */ namedb_nsecify(zone->db, &num_added); end = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->nsec_time = (end-start); zone->stats->nsec_count = num_added; lock_basic_unlock(&zone->stats->stats_lock); } return; } /* * Do incremental zone transaction. * */ void adapi_trans_diff(zone_type* zone, unsigned more_coming) { time_t start = 0; time_t end = 0; uint32_t num_added = 0; if (!zone || !zone->db) { return; } namedb_diff(zone->db, 1, more_coming); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->nsec_time = 0; zone->stats->nsec_count = 0; lock_basic_unlock(&zone->stats->stats_lock); } start = time(NULL); /* nsecify(3) */ namedb_nsecify(zone->db, &num_added); end = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->nsec_time = (end-start); zone->stats->nsec_count = num_added; lock_basic_unlock(&zone->stats->stats_lock); } return; } /** * Process SOA. * */ static ods_status adapi_process_soa(zone_type* zone, ldns_rr* rr, int add, int backup) { uint32_t tmp = 0; ldns_rdf* soa_rdata = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); if (backup) { /* no need to do processing */ return ODS_STATUS_OK; } if (zone->signconf->soa_ttl) { tmp = (uint32_t) duration2time(zone->signconf->soa_ttl); ods_log_verbose("[%s] zone %s set soa ttl to %u", adapi_str, zone->name, tmp); ldns_rr_set_ttl(rr, tmp); } if (zone->signconf->soa_min) { tmp = (uint32_t) duration2time(zone->signconf->soa_min); ods_log_verbose("[%s] zone %s set soa minimum to %u", adapi_str, zone->name, tmp); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, tmp), SE_SOA_RDATA_MINIMUM); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to %s soa to zone %s: failed to replace " "soa minimum rdata", adapi_str, add?"add":"delete", zone->name); return ODS_STATUS_ASSERT_ERR; } } if (!add) { /* we are done */ return ODS_STATUS_OK; } tmp = ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); status = namedb_update_serial(zone->db, zone->name, zone->signconf->soa_serial, tmp); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to add soa to zone %s: failed to replace " "soa serial rdata (%s)", adapi_str, zone->name, ods_status2str(status)); if (status == ODS_STATUS_CONFLICT_ERR) { ods_log_error("[%s] If this is the result of a key rollover, " "please increment the serial in the unsigned zone %s", adapi_str, zone->name); } return status; } ods_log_verbose("[%s] zone %s set soa serial to %u", adapi_str, zone->name, zone->db->intserial); soa_rdata = ldns_rr_set_rdf(rr, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, zone->db->intserial), SE_SOA_RDATA_SERIAL); if (soa_rdata) { ldns_rdf_deep_free(soa_rdata); soa_rdata = NULL; } else { ods_log_error("[%s] unable to add soa to zone %s: failed to replace " "soa serial rdata", adapi_str, zone->name); return ODS_STATUS_ERR; } zone->db->serial_updated = 1; return ODS_STATUS_OK; } /** * Process DNSKEY. * */ static void adapi_process_dnskey(zone_type* zone, ldns_rr* rr) { uint32_t tmp = 0; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->signconf); tmp = (uint32_t) duration2time(zone->signconf->dnskey_ttl); ods_log_verbose("[%s] zone %s set dnskey ttl to %u", adapi_str, zone->name, tmp); ldns_rr_set_ttl(rr, tmp); return; } /** * Process RR. * */ static ods_status adapi_process_rr(zone_type* zone, ldns_rr* rr, int add, int backup) { ods_status status = ODS_STATUS_OK; ods_log_assert(rr); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* We only support IN class */ if (ldns_rr_get_class(rr) != LDNS_RR_CLASS_IN) { ods_log_warning("[%s] only class in is supported, changing class " "to in"); ldns_rr_set_class(rr, LDNS_RR_CLASS_IN); } /* RR processing */ if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex)) { ods_log_error("[%s] unable to %s rr to zone: soa record has " "invalid owner name", adapi_str, add?"add":"delete"); return ODS_STATUS_ERR; } status = adapi_process_soa(zone, rr, add, backup); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to %s rr: failed to process soa " "record", adapi_str, add?"add":"delete"); return status; } } else { if (ldns_dname_compare(ldns_rr_owner(rr), zone->apex) && !ldns_dname_is_subdomain(ldns_rr_owner(rr), zone->apex)) { ods_log_warning("[%s] zone %s contains out-of-zone data, " "skipping", adapi_str, zone->name); return ODS_STATUS_UNCHANGED; } else if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_DNSKEY) { adapi_process_dnskey(zone, rr); } else if (util_is_dnssec_rr(rr) && !backup) { ods_log_warning("[%s] zone %s contains dnssec data (type=%u), " "skipping", adapi_str, zone->name, (unsigned) ldns_rr_get_type(rr)); return ODS_STATUS_UNCHANGED; } } /* TODO: DNAME and CNAME checks */ /* TODO: NS and DS checks */ if (add) { return zone_add_rr(zone, rr, 1); } else { return zone_del_rr(zone, rr, 1); } /* not reached */ return ODS_STATUS_ERR; } /** * Add RR. * */ ods_status adapi_add_rr(zone_type* zone, ldns_rr* rr, int backup) { return adapi_process_rr(zone, rr, 1, backup); } /** * Delete RR. * */ ods_status adapi_del_rr(zone_type* zone, ldns_rr* rr, int backup) { return adapi_process_rr(zone, rr, 0, backup); } /** * Print zone. * */ ods_status adapi_printzone(FILE* fd, zone_type* zone) { ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db) { ods_log_error("[%s] unable to print zone: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } namedb_export(fd, zone->db, &status); return status; } /** * Print axfr. * */ ods_status adapi_printaxfr(FILE* fd, zone_type* zone) { rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db) { ods_log_error("[%s] unable to print axfr: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } namedb_export(fd, zone->db, &status); if (status == ODS_STATUS_OK) { rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); rrset_print(fd, rrset, 1, &status); } return status; } /** * Print ixfr. * */ ods_status adapi_printixfr(FILE* fd, zone_type* zone) { rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; if (!fd || !zone || !zone->db || !zone->ixfr) { ods_log_error("[%s] unable to print ixfr: file descriptor, zone or " "name database missing", adapi_str); return ODS_STATUS_ASSERT_ERR; } if (!zone->db->is_initialized) { /* no ixfr yet */ return ODS_STATUS_OK; } rrset = zone_lookup_rrset(zone, zone->apex, LDNS_RR_TYPE_SOA); ods_log_assert(rrset); rrset_print(fd, rrset, 1, &status); if (status != ODS_STATUS_OK) { return status; } lock_basic_lock(&zone->ixfr->ixfr_lock); ixfr_print(fd, zone->ixfr); lock_basic_unlock(&zone->ixfr->ixfr_lock); rrset_print(fd, rrset, 1, &status); return status; } opendnssec-1.4.9/signer/src/scheduler/0000755000175000017500000000000012650166152014727 500000000000000opendnssec-1.4.9/signer/src/scheduler/schedule.h0000644000175000017500000000752312650165732016626 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Task scheduling. * */ #ifndef SCHEDULER_SCHEDULE_H #define SCHEDULER_SCHEDULE_H #include "config.h" #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include /** * Task schedule. */ typedef struct schedule_struct schedule_type; struct schedule_struct { allocator_type* allocator; ldns_rbtree_t* tasks; int flushcount; int loading; /* to determine backoff */ lock_basic_type schedule_lock; }; /** * Create new schedule. * \param[in] allocator memory allocator * \return schedule_type* created schedule * */ schedule_type* schedule_create(allocator_type* allocator); /** * Flush schedule. * \param[in] schedule schedule to be flushed * \param[in] override override task * */ void schedule_flush(schedule_type* schedule, task_id override); /** * Look up task. * \param[in] schedule schedule * \param[in] task task * \return task_type* task, if found * */ task_type* schedule_lookup_task(schedule_type* schedule, task_type* task); /** * Schedule task. * \param[in] schedule schedule * \param[in] task task * \param[in] log add entry in log for this * \return ods_status status * */ ods_status schedule_task(schedule_type* schedule, task_type* task, int log); /** * Unschedule task. * \param[in] schedule schedule * \param[in] task task to delete * \return task_type* task, if it was scheduled * */ task_type* unschedule_task(schedule_type* schedule, task_type* task); /** * Reschedule task. * \param[in] schedule schedule * \param[in] task task to delete * \param[in] what new task * \param[in] when new time * \return ods_status status * */ ods_status reschedule_task(schedule_type* schedule, task_type* task, task_id what, time_t when); /** * Pop the first scheduled task. * \param[in] schedule schedule * \return task_type* popped task * */ task_type* schedule_pop_task(schedule_type* schedule); /** * Get the first scheduled task. * \param[in] schedule schedule * \return task_type* first scheduled task * */ task_type* schedule_get_first_task(schedule_type* schedule); /** * Print schedule. * \param[in] out file descriptor * \param[in] schedule schedule * */ void schedule_print(FILE* out, schedule_type* schedule); /** * Clean up schedule. * \param[in] schedule schedule to be cleaned up * */ void schedule_cleanup(schedule_type* schedule); #endif /* SCHEDULER_SCHEDULE_H */ opendnssec-1.4.9/signer/src/scheduler/schedule.c0000644000175000017500000002315012650165732016613 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Task scheduling. * */ #include "config.h" #include "scheduler/schedule.h" #include "scheduler/task.h" #include "shared/duration.h" #include "shared/log.h" #include static const char* schedule_str = "scheduler"; /** * Create new schedule. * */ schedule_type* schedule_create(allocator_type* allocator) { schedule_type* schedule; if (!allocator) { return NULL; } schedule = (schedule_type*) allocator_alloc(allocator, sizeof(schedule_type)); if (!schedule) { ods_log_error("[%s] unable to create schedule: allocator_alloc() " "failed", schedule_str); return NULL; } schedule->allocator = allocator; schedule->loading = 0; schedule->flushcount = 0; schedule->tasks = ldns_rbtree_create(task_compare); if (!schedule->tasks) { ods_log_error("[%s] unable to create schedule: ldns_rbtree_create() " "failed", schedule_str); allocator_deallocate(allocator, (void*) schedule); return NULL; } lock_basic_init(&schedule->schedule_lock); return schedule; } /** * Flush schedule. * */ void schedule_flush(schedule_type* schedule, task_id override) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; ods_log_debug("[%s] flush all tasks", schedule_str); if (!schedule || !schedule->tasks) { return; } node = ldns_rbtree_first(schedule->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; task->flush = 1; schedule->flushcount++; if (override != TASK_NONE) { task->what = override; } node = ldns_rbtree_next(node); } return; } /** * Convert task to a tree node. * */ static ldns_rbnode_t* task2node(task_type* task) { ldns_rbnode_t* node = (ldns_rbnode_t*) malloc(sizeof(ldns_rbnode_t)); if (node) { node->key = task; node->data = task; } return node; } /** * Look up task. * */ task_type* schedule_lookup_task(schedule_type* schedule, task_type* task) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* lookup = NULL; if (!schedule || !task) { return NULL; } ods_log_assert(schedule->tasks); node = ldns_rbtree_search(schedule->tasks, task); if (node && node != LDNS_RBTREE_NULL) { lookup = (task_type*) node->data; } return lookup; } /** * Schedule task. * */ ods_status schedule_task(schedule_type* schedule, task_type* task, int log) { ldns_rbnode_t* new_node = NULL; ldns_rbnode_t* ins_node = NULL; if (!task || !schedule || !schedule->tasks) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] schedule task %s for zone %s", schedule_str, task_what2str(task->what), task_who2str(task)); if (schedule_lookup_task(schedule, task) != NULL) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " already present", schedule_str, task_what2str(task->what), task_who2str(task)); return ODS_STATUS_ERR; } new_node = task2node(task); if (!new_node) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " task2node() failed", schedule_str, task_what2str(task->what), task_who2str(task)); return ODS_STATUS_MALLOC_ERR; } ins_node = ldns_rbtree_insert(schedule->tasks, new_node); if (!ins_node) { ods_log_error("[%s] unable to schedule task %s for zone %s: " " insert failed", schedule_str, task_what2str(task->what), task_who2str(task)); free((void*)new_node); return ODS_STATUS_ERR; } if (task->flush) { schedule->flushcount++; } if (log) { task_log(task); } return ODS_STATUS_OK; } /** * Unschedule task. * */ task_type* unschedule_task(schedule_type* schedule, task_type* task) { ldns_rbnode_t* del_node = LDNS_RBTREE_NULL; task_type* del_task = NULL; if (!task || !schedule || !schedule->tasks) { return NULL; } ods_log_debug("[%s] unschedule task %s for zone %s", schedule_str, task_what2str(task->what), task_who2str(task)); del_node = ldns_rbtree_delete(schedule->tasks, (const void*) task); if (del_node) { del_task = (task_type*) del_node->data; free((void*)del_node); } else { ods_log_warning("[%s] unable to unschedule task %s for zone %s: not " "scheduled", schedule_str, task_what2str(task->what), task_who2str(task)); return NULL; } if (del_task->flush) { del_task->flush = 0; schedule->flushcount--; } return del_task; } /** * Reschedule task. * */ ods_status reschedule_task(schedule_type* schedule, task_type* task, task_id what, time_t when) { task_type* del_task = NULL; if (!task || !schedule || !schedule->tasks) { return ODS_STATUS_ASSERT_ERR; } del_task = unschedule_task(schedule, task); if (!del_task) { del_task = task; } del_task->what = what; del_task->when = when; return schedule_task(schedule, del_task, 1); } /** * Get the first scheduled task. * */ task_type* schedule_get_first_task(schedule_type* schedule) { ldns_rbnode_t* first_node = LDNS_RBTREE_NULL; ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* pop = NULL; if (!schedule || !schedule->tasks) { return NULL; } first_node = ldns_rbtree_first(schedule->tasks); if (!first_node) { return NULL; } if (schedule->flushcount > 0) { /* find remaining to be flushed tasks */ node = first_node; while (node && node != LDNS_RBTREE_NULL) { pop = (task_type*) node->data; if (pop->flush) { return pop; } node = ldns_rbtree_next(node); } /* no more to be flushed tasks found */ ods_log_warning("[%s] unable to get first scheduled task: could not " "find flush-task, while there should be %i flush-tasks left", schedule_str, schedule->flushcount); ods_log_info("[%s] reset flush count to 0", schedule_str); schedule->flushcount = 0; } /* no more tasks to be flushed, return first task in schedule */ pop = (task_type*) first_node->data; return pop; } /** * Pop the first scheduled task. * */ task_type* schedule_pop_task(schedule_type* schedule) { task_type* pop = NULL; time_t now = 0; if (!schedule || !schedule->tasks) { return NULL; } now = time_now(); pop = schedule_get_first_task(schedule); if (pop && (pop->flush || pop->when <= now)) { if (pop->flush) { ods_log_debug("[%s] flush task for zone %s", schedule_str, task_who2str(pop)); } else { ods_log_debug("[%s] pop task for zone %s", schedule_str, task_who2str(pop)); } return unschedule_task(schedule, pop); } return NULL; } /** * Print schedule. * */ void schedule_print(FILE* out, schedule_type* schedule) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; if (!out || !schedule || !schedule->tasks) { return; } node = ldns_rbtree_first(schedule->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; task_print(out, task); node = ldns_rbtree_next(node); } fprintf(out, "\n"); return; } /** * Internal task cleanup function. * */ static void task_delfunc(ldns_rbnode_t* elem) { task_type* task; if (elem && elem != LDNS_RBTREE_NULL) { task = (task_type*) elem->data; task_delfunc(elem->left); task_delfunc(elem->right); task_cleanup(task); free((void*)elem); } return; } /** * Clean up schedule. * */ void schedule_cleanup(schedule_type* schedule) { allocator_type* allocator; lock_basic_type schedule_lock; if (!schedule) { return; } ods_log_debug("[%s] cleanup schedule", schedule_str); if (schedule->tasks) { task_delfunc(schedule->tasks->root); ldns_rbtree_free(schedule->tasks); schedule->tasks = NULL; } allocator = schedule->allocator; schedule_lock = schedule->schedule_lock; allocator_deallocate(allocator, (void*) schedule); lock_basic_destroy(&schedule_lock); return; } opendnssec-1.4.9/signer/src/scheduler/task.h0000644000175000017500000000635612650165732015777 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Tasks. * */ #ifndef SCHEDULER_TASK_H #define SCHEDULER_TASK_H #include "config.h" #include "shared/allocator.h" #include enum task_id_enum { TASK_NONE = 0, TASK_SIGNCONF, /* ods-signer update */ TASK_READ, /* ods-signer sign */ TASK_NSECIFY, TASK_SIGN, /* ods-signer flush */ TASK_WRITE }; typedef enum task_id_enum task_id; /** * Task. */ typedef struct task_struct task_type; struct task_struct { allocator_type* allocator; task_id what; task_id interrupt; task_id halted; time_t when; time_t halted_when; time_t backoff; int flush; void* zone; }; /** * Create a new task. * \param[in] what task identifier * \param[in] when scheduled time * \param[in] zone zone reference * \return task_type* created task * */ task_type* task_create(task_id what, time_t when, void* zone); /** * Backup task. * \param[in] fd file descriptor * \param[in] task task * */ void task_backup(FILE* fd, task_type* task); /** * Compare tasks. * \param[in] a one task * \param[in] b another task * \return int -1, 0 or 1 * */ int task_compare(const void* a, const void* b); /** * Convert task to string. * \param[in] task task * \param[out] buffer to store string-based task in * \return string-format task * */ char* task2str(task_type* task, char* buftask); /** * String-format of who. * \param[in] what task identifier * \return const char* string-format of what * */ const char* task_what2str(task_id what); /** * String-format of who. * \param[in] task task * \return const char* string-format of who */ const char* task_who2str(task_type* task); /** * Print task. * \param[in] out file descriptor * \param[in] task task * */ void task_print(FILE* out, task_type* task); /** * Log task. * \param[in] task task * */ void task_log(task_type* task); /** * Clean up task. * \param[in] task task * */ void task_cleanup(task_type* task); #endif /* SCHEDULER_TASK_H */ opendnssec-1.4.9/signer/src/scheduler/task.c0000644000175000017500000001523112650165732015762 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Tasks. * */ #include "config.h" #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "signer/zone.h" static const char* task_str = "task"; /** * Create a new task. * */ task_type* task_create(task_id what, time_t when, void* zone) { allocator_type* allocator = NULL; task_type* task = NULL; if (!zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create task: allocator_create() failed", task_str); return NULL; } task = (task_type*) allocator_alloc(allocator, sizeof(task_type)); if (!task) { ods_log_error("[%s] unable to create task: allocator_alloc() failed", task_str); allocator_cleanup(allocator); return NULL; } task->allocator = allocator; task->what = what; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->when = when; task->halted_when = 0; task->backoff = 0; task->flush = 0; task->zone = zone; return task; } /** * Backup task. * */ void task_backup(FILE* fd, task_type* task) { if (!fd || !task) { return; } ods_log_assert(fd); ods_log_assert(task); fprintf(fd, ";;Task: when %u what %i interrupt %i halted %i backoff %i " "flush %i\n", (unsigned) task->when, (int) task->what, (int) task->interrupt, (int) task->halted, (unsigned) task->backoff, task->flush); return; } /** * Compare tasks. * */ int task_compare(const void* a, const void* b) { task_type* x = (task_type*)a; task_type* y = (task_type*)b; zone_type* zx = NULL; zone_type* zy = NULL; ods_log_assert(x); ods_log_assert(y); zx = (zone_type*) x->zone; zy = (zone_type*) y->zone; if (!ldns_dname_compare((const void*) zx->apex, (const void*) zy->apex)) { /* if dname is the same, consider the same task */ return 0; } /* order task on time, what to do, dname */ if (x->when != y->when) { return (int) x->when - y->when; } if (x->what != y->what) { return (int) x->what - y->what; } /* this is unfair, it prioritizes zones that are first in canonical line */ return ldns_dname_compare((const void*) zx->apex, (const void*) zy->apex); } /** * String-format of what. * */ const char* task_what2str(task_id what) { switch (what) { case TASK_NONE: return "[ignore]"; break; case TASK_SIGNCONF: return "[configure]"; break; case TASK_READ: return "[read]"; break; case TASK_SIGN: return "[sign]"; break; case TASK_WRITE: return "[write]"; break; default: break; } return "[???]"; } /** * String-format of who. * */ const char* task_who2str(task_type* task) { zone_type* zone = NULL; if (task) { zone = (zone_type*) task->zone; } if (zone && zone->name) { return zone->name; } return "(null)"; } /** * Convert task to string. * */ char* task2str(task_type* task, char* buftask) { char* strtime = NULL; char* strtask = NULL; if (task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } if (buftask) { (void)snprintf(buftask, ODS_SE_MAXLINE, "%s %s I will %s zone %s" "\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); return buftask; } else { strtask = (char*) calloc(ODS_SE_MAXLINE, sizeof(char)); if (strtask) { snprintf(strtask, ODS_SE_MAXLINE, "%s %s I will %s zone %s\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); return strtask; } else { ods_log_error("[%s] unable to convert task to string: malloc " "error", task_str); } } } return NULL; } /** * Print task. * */ void task_print(FILE* out, task_type* task) { char* strtime = NULL; if (out && task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } fprintf(out, "%s %s I will %s zone %s\n", task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); } return; } /** * Log task. * */ void task_log(task_type* task) { char* strtime = NULL; if (task) { strtime = ctime(&task->when); if (strtime) { strtime[strlen(strtime)-1] = '\0'; } ods_log_debug("[%s] %s %s I will %s zone %s", task_str, task->flush?"Flush":"On", strtime?strtime:"(null)", task_what2str(task->what), task_who2str(task)); } return; } /** * Clean up task. * */ void task_cleanup(task_type* task) { allocator_type* allocator; if (!task) { return; } allocator = task->allocator; allocator_deallocate(allocator, (void*) task); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/scheduler/fifoq.h0000644000175000017500000000554412650165732016137 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * FIFO Queue. * */ #ifndef SCHEDULER_FIFOQ_H #define SCHEDULER_FIFOQ_H #include "config.h" #include "daemon/worker.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #define FIFOQ_MAX_COUNT 1000 #define FIFOQ_TRIES_COUNT 10 /** * FIFO Queue. */ typedef struct fifoq_struct fifoq_type; struct fifoq_struct { allocator_type* allocator; void* blob[FIFOQ_MAX_COUNT]; worker_type* owner[FIFOQ_MAX_COUNT]; size_t count; lock_basic_type q_lock; cond_basic_type q_threshold; cond_basic_type q_nonfull; }; /** * Create new FIFO queue. * \param[in] allocator memory allocator * \return fifoq_type* created queue * */ fifoq_type* fifoq_create(allocator_type* allocator); /** * Wipe queue. * \param[in] q queue to be wiped * */ void fifoq_wipe(fifoq_type* q); /** * Pop item from queue. * \param[in] q queue * \param[out] worker worker that owns the item * \return void* popped item * */ void* fifoq_pop(fifoq_type* q, worker_type** worker); /** * Push item to queue. * \param[in] q queue * \param[in] item item * \param[in] worker owner of item * \param[out] tries number of tries * \return ods_status status * */ ods_status fifoq_push(fifoq_type* q, void* item, worker_type* worker, int* tries); /** * Clean up queue. * \param[in] q queue to be cleaned up * */ void fifoq_cleanup(fifoq_type* q); #endif /* SCHEDULER_FIFOQ_H */ opendnssec-1.4.9/signer/src/scheduler/fifoq.c0000644000175000017500000001060212650165732016121 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * FIFO Queue. * */ #include "config.h" #include "scheduler/fifoq.h" #include "shared/log.h" #include static const char* fifoq_str = "fifo"; /** * Create new FIFO queue. * */ fifoq_type* fifoq_create(allocator_type* allocator) { fifoq_type* fifoq; if (!allocator) { return NULL; } fifoq = (fifoq_type*) allocator_alloc(allocator, sizeof(fifoq_type)); if (!fifoq) { ods_log_error("[%s] unable to create fifoq: allocator_alloc() failed", fifoq_str); return NULL; } fifoq->allocator = allocator; fifoq_wipe(fifoq); lock_basic_init(&fifoq->q_lock); lock_basic_set(&fifoq->q_threshold); lock_basic_set(&fifoq->q_nonfull); return fifoq; } /** * Wipe queue. * */ void fifoq_wipe(fifoq_type* q) { size_t i = 0; for (i=0; i < FIFOQ_MAX_COUNT; i++) { q->blob[i] = NULL; q->owner[i] = NULL; } q->count = 0; return; } /** * Pop item from queue. * */ void* fifoq_pop(fifoq_type* q, worker_type** worker) { void* pop = NULL; size_t i = 0; if (!q || q->count <= 0) { return NULL; } pop = q->blob[0]; *worker = q->owner[0]; for (i = 0; i < q->count-1; i++) { q->blob[i] = q->blob[i+1]; q->owner[i] = q->owner[i+1]; } q->count -= 1; if (q->count <= (size_t) FIFOQ_MAX_COUNT * 0.1) { /** * Notify waiting workers that they can start queuing again * If no workers are waiting, this call has no effect. */ lock_basic_broadcast(&q->q_nonfull); } return pop; } /** * Push item to queue. * */ ods_status fifoq_push(fifoq_type* q, void* item, worker_type* worker, int* tries) { if (!q || !item || !worker) { return ODS_STATUS_ASSERT_ERR; } if (q->count >= FIFOQ_MAX_COUNT) { /** * #262: * If drudgers remain on hold, do additional broadcast. * If no drudgers are waiting, this call has no effect. */ if (*tries > FIFOQ_TRIES_COUNT) { lock_basic_broadcast(&q->q_threshold); ods_log_debug("[%s] queue full, notify drudgers again", fifoq_str); /* reset tries */ *tries = 0; } return ODS_STATUS_UNCHANGED; } q->blob[q->count] = item; q->owner[q->count] = worker; q->count += 1; if (q->count == 1) { ods_log_deeebug("[%s] threshold %u reached, notify drudgers", fifoq_str, q->count); /* If no drudgers are waiting, this call has no effect. */ lock_basic_broadcast(&q->q_threshold); } return ODS_STATUS_OK; } /** * Clean up queue. * */ void fifoq_cleanup(fifoq_type* q) { allocator_type* allocator; lock_basic_type q_lock; cond_basic_type q_threshold; cond_basic_type q_nonfull; if (!q) { return; } allocator = q->allocator; q_lock = q->q_lock; q_threshold = q->q_threshold; q_nonfull = q->q_nonfull; allocator_deallocate(allocator, (void*) q); lock_basic_off(&q_threshold); lock_basic_off(&q_nonfull); lock_basic_destroy(&q_lock); return; } opendnssec-1.4.9/signer/src/daemon/0000755000175000017500000000000012650166152014214 500000000000000opendnssec-1.4.9/signer/src/daemon/dnshandler.c0000644000175000017500000002305612650165732016433 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * DNS handler. * */ #include "config.h" #include "daemon/dnshandler.h" #include "daemon/engine.h" #include "shared/status.h" #include "wire/buffer.h" #include #include static const char* dnsh_str = "dnshandler"; static void dnshandler_handle_xfr(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Create dns handler. * */ dnshandler_type* dnshandler_create(allocator_type* allocator, listener_type* interfaces) { dnshandler_type* dnsh = NULL; if (!allocator || !interfaces || interfaces->count <= 0) { return NULL; } dnsh = (dnshandler_type*) allocator_alloc(allocator, sizeof(dnshandler_type)); if (!dnsh) { ods_log_error("[%s] unable to create dnshandler: " "allocator_alloc() failed", dnsh_str); return NULL; } dnsh->allocator = allocator; dnsh->need_to_exit = 0; dnsh->engine = NULL; dnsh->interfaces = interfaces; dnsh->socklist = NULL; dnsh->netio = NULL; dnsh->query = NULL; /* setup */ dnsh->socklist = (socklist_type*) allocator_alloc(allocator, sizeof(socklist_type)); if (!dnsh->socklist) { ods_log_error("[%s] unable to create socklist: " "allocator_alloc() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->netio = netio_create(allocator); if (!dnsh->netio) { ods_log_error("[%s] unable to create dnshandler: " "netio_create() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->query = query_create(); if (!dnsh->query) { ods_log_error("[%s] unable to create dnshandler: " "query_create() failed", dnsh_str); dnshandler_cleanup(dnsh); return NULL; } dnsh->xfrhandler.fd = -1; dnsh->xfrhandler.user_data = (void*) dnsh; dnsh->xfrhandler.timeout = 0; dnsh->xfrhandler.event_types = NETIO_EVENT_READ; dnsh->xfrhandler.event_handler = dnshandler_handle_xfr; return dnsh; } /** * Start dns handler listener. * */ ods_status dnshandler_listen(dnshandler_type* dnshandler) { ods_status status = ODS_STATUS_OK; ods_log_assert(dnshandler); status = sock_listen(dnshandler->socklist, dnshandler->interfaces); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to start: sock_listen() " "failed (%s)", dnsh_str, ods_status2str(status)); dnshandler->thread_id = 0; } return status; } /** * Start dns handler. * */ void dnshandler_start(dnshandler_type* dnshandler) { size_t i = 0; engine_type* engine = NULL; netio_handler_type* tcp_accept_handlers = NULL; ods_log_assert(dnshandler); ods_log_assert(dnshandler->engine); ods_log_debug("[%s] start", dnsh_str); /* udp */ for (i=0; i < dnshandler->interfaces->count; i++) { struct udp_data* data = NULL; netio_handler_type* handler = NULL; data = (struct udp_data*) allocator_alloc(dnshandler->allocator, sizeof(struct udp_data)); if (!data) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); dnshandler->thread_id = 0; engine->need_to_exit = 1; break; } data->query = dnshandler->query; data->engine = dnshandler->engine; data->socket = &dnshandler->socklist->udp[i]; handler = (netio_handler_type*) allocator_alloc( dnshandler->allocator, sizeof(netio_handler_type)); if (!handler) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); allocator_deallocate(dnshandler->allocator, (void*)data); dnshandler->thread_id = 0; engine->need_to_exit = 1; break; } handler->fd = dnshandler->socklist->udp[i].s; handler->timeout = NULL; handler->user_data = data; handler->event_types = NETIO_EVENT_READ; handler->event_handler = sock_handle_udp; ods_log_debug("[%s] add udp network handler fd %u", dnsh_str, (unsigned) handler->fd); netio_add_handler(dnshandler->netio, handler); } /* tcp */ tcp_accept_handlers = (netio_handler_type*) allocator_alloc( dnshandler->allocator, dnshandler->interfaces->count * sizeof(netio_handler_type)); for (i=0; i < dnshandler->interfaces->count; i++) { struct tcp_accept_data* data = NULL; netio_handler_type* handler = NULL; data = (struct tcp_accept_data*) allocator_alloc( dnshandler->allocator, sizeof(struct tcp_accept_data)); if (!data) { ods_log_error("[%s] unable to start: allocator_alloc() " "failed", dnsh_str); dnshandler->thread_id = 0; engine->need_to_exit = 1; return; } data->engine = dnshandler->engine; data->socket = &dnshandler->socklist->udp[i]; data->tcp_accept_handler_count = dnshandler->interfaces->count; data->tcp_accept_handlers = tcp_accept_handlers; handler = &tcp_accept_handlers[i]; handler->fd = dnshandler->socklist->tcp[i].s; handler->timeout = NULL; handler->user_data = data; handler->event_types = NETIO_EVENT_READ; handler->event_handler = sock_handle_tcp_accept; ods_log_debug("[%s] add tcp network handler fd %u", dnsh_str, (unsigned) handler->fd); netio_add_handler(dnshandler->netio, handler); } /* service */ while (dnshandler->need_to_exit == 0) { ods_log_deeebug("[%s] netio dispatch", dnsh_str); if (netio_dispatch(dnshandler->netio, NULL, NULL) == -1) { if (errno != EINTR) { ods_log_error("[%s] unable to dispatch netio: %s", dnsh_str, strerror(errno)); break; } } } /* shutdown */ ods_log_debug("[%s] shutdown", dnsh_str); for (i=0; i < dnshandler->interfaces->count; i++) { if (dnshandler->socklist->udp[i].s != -1) { close(dnshandler->socklist->udp[i].s); freeaddrinfo((void*)dnshandler->socklist->udp[i].addr); } if (dnshandler->socklist->tcp[i].s != -1) { close(dnshandler->socklist->tcp[i].s); freeaddrinfo((void*)dnshandler->socklist->tcp[i].addr); } } return; } /** * Signal dns handler. * */ void dnshandler_signal(dnshandler_type* dnshandler) { if (dnshandler && dnshandler->thread_id) { ods_thread_kill(dnshandler->thread_id, SIGHUP); } return; } /** * Forward notify to zone transfer handler. * */ void dnshandler_fwd_notify(dnshandler_type* dnshandler, uint8_t* pkt, size_t len) { ssize_t nb = 0; ods_log_assert(dnshandler); ods_log_assert(pkt); nb = send(dnshandler->xfrhandler.fd, (const void*) pkt, len, 0); if (nb < 0) { ods_log_error("[%s] unable to forward notify: send() failed (%s)", dnsh_str, strerror(errno)); } else { ods_log_debug("[%s] forwarded notify: %u bytes sent", dnsh_str, nb); } return; } /** * Handle forwarded dns packets. * */ static void dnshandler_handle_xfr(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { dnshandler_type* dnshandler = NULL; uint8_t buf[MAX_PACKET_SIZE]; ssize_t received = 0; if (!handler) { return; } dnshandler = (dnshandler_type*) handler->user_data; ods_log_assert(event_types & NETIO_EVENT_READ); received = read(dnshandler->xfrhandler.fd, &buf, MAX_PACKET_SIZE); ods_log_debug("[%s] read forwarded xfr packet: %d bytes received", dnsh_str, (int) received); if (received == -1) { ods_log_error("[%s] unable to forward xfr packet: %s", dnsh_str, strerror(errno)); } return; } /** * Cleanup dns handler. * */ void dnshandler_cleanup(dnshandler_type* dnshandler) { allocator_type* allocator = NULL; if (!dnshandler) { return; } allocator = dnshandler->allocator; netio_cleanup(dnshandler->netio); query_cleanup(dnshandler->query); allocator_deallocate(allocator, (void*) dnshandler->socklist); allocator_deallocate(allocator, (void*) dnshandler); return; } opendnssec-1.4.9/signer/src/daemon/cfg.c0000644000175000017500000002216712650165732015052 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer engine configuration. * */ #include "config.h" #include "daemon/cfg.h" #include "parser/confparser.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include #include #include static const char* conf_str = "config"; /** * Configure engine. * */ engineconfig_type* engine_config(allocator_type* allocator, const char* cfgfile, int cmdline_verbosity) { engineconfig_type* ecfg; const char* rngfile = ODS_SE_RNGDIR "/conf.rng"; FILE* cfgfd = NULL; if (!allocator || !cfgfile) { return NULL; } /* check syntax (slows down parsing configuration file) */ if (parse_file_check(cfgfile, rngfile) != ODS_STATUS_OK) { ods_log_error("[%s] unable to create config: parse error in %s", conf_str, cfgfile); return NULL; } /* open cfgfile */ cfgfd = ods_fopen(cfgfile, NULL, "r"); if (cfgfd) { ods_log_verbose("[%s] read cfgfile: %s", conf_str, cfgfile); /* create config */ ecfg = (engineconfig_type*) allocator_alloc(allocator, sizeof(engineconfig_type)); if (!ecfg) { ods_log_error("[%s] unable to create config: allocator_alloc() " "failed", conf_str); ods_fclose(cfgfd); return NULL; } ecfg->allocator = allocator; /* get values */ ecfg->cfg_filename = allocator_strdup(allocator, cfgfile); ecfg->zonelist_filename = parse_conf_zonelist_filename(allocator, cfgfile); ecfg->log_filename = parse_conf_log_filename(allocator, cfgfile); ecfg->pid_filename = parse_conf_pid_filename(allocator, cfgfile); ecfg->notify_command = parse_conf_notify_command(allocator, cfgfile); ecfg->clisock_filename = parse_conf_clisock_filename(allocator, cfgfile); ecfg->working_dir = parse_conf_working_dir(allocator, cfgfile); ecfg->username = parse_conf_username(allocator, cfgfile); ecfg->group = parse_conf_group(allocator, cfgfile); ecfg->chroot = parse_conf_chroot(allocator, cfgfile); ecfg->use_syslog = parse_conf_use_syslog(cfgfile); ecfg->num_worker_threads = parse_conf_worker_threads(cfgfile); ecfg->num_signer_threads = parse_conf_signer_threads(cfgfile); /* If any verbosity has been specified at cmd line we will use that */ if (cmdline_verbosity > 0) { ecfg->verbosity = cmdline_verbosity; } else { ecfg->verbosity = parse_conf_verbosity(cfgfile); } ecfg->interfaces = parse_conf_listener(allocator, cfgfile); /* done */ ods_fclose(cfgfd); return ecfg; } ods_log_error("[%s] unable to create config: failed to open file %s", conf_str, cfgfile); return NULL; } /** * Check configuration. * */ ods_status engine_config_check(engineconfig_type* config) { if (!config) { ods_log_error("[%s] config-check failed: no config", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->cfg_filename) { ods_log_error("[%s] config-check failed: no config filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->zonelist_filename) { ods_log_error("[%s] config-check failed: no zonelist filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->clisock_filename) { ods_log_error("[%s] config-check failed: no socket filename", conf_str); return ODS_STATUS_CFG_ERR; } if (!config->interfaces) { ods_log_error("[%s] config-check failed: no listener", conf_str); return ODS_STATUS_CFG_ERR; } /* [TODO] room for more checks here */ return ODS_STATUS_OK; } /** * Print configuration. * */ void engine_config_print(FILE* out, engineconfig_type* config) { if (!out) { return; } fprintf(out, "\n"); if (config) { fprintf(out, "\n"); /* Common */ fprintf(out, "\t\n"); if (config->use_syslog && config->log_filename) { fprintf(out, "\t\t\n"); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\t\t%s\n", config->log_filename); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\n"); } else if (config->log_filename) { fprintf(out, "\t\t\n"); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\t\t%s\n", config->log_filename); fprintf(out, "\t\t\t\n"); fprintf(out, "\t\t\n"); } fprintf(out, "\t\t%s\n", config->zonelist_filename); fprintf(out, "\t\n"); /* Signer */ fprintf(out, "\t\n"); if (config->username || config->group || config->chroot) { fprintf(out, "\t\t\n"); if (config->username) { fprintf(out, "\t\t%s\n", config->username); } if (config->group) { fprintf(out, "\t\t%s\n", config->group); } if (config->chroot) { fprintf(out, "\t\t%s\n", config->chroot); } fprintf(out, "\t\t\n"); } if (config->interfaces) { size_t i = 0; fprintf(out, "\t\t\n"); for (i=0; i < config->interfaces->count; i++) { fprintf(out, "\t\t\t"); if (config->interfaces->interfaces[i].address) { fprintf(out, "
%s
", config->interfaces->interfaces[i].address); } if (config->interfaces->interfaces[i].port) { fprintf(out, "%s", config->interfaces->interfaces[i].port); } fprintf(out, "\n"); } fprintf(out, "\t\t
\n"); } fprintf(out, "\t\t%s\n", config->working_dir); fprintf(out, "\t\t%i\n", config->num_worker_threads); fprintf(out, "\t\t%i\n", config->num_signer_threads); if (config->notify_command) { fprintf(out, "\t\t%s\n", config->notify_command); } fprintf(out, "\t
\n"); fprintf(out, "
\n"); /* make configurable: - pid_filename - clisock_filename */ } return; } /** * Clean up config. * */ void engine_config_cleanup(engineconfig_type* config) { allocator_type* allocator = NULL; if (!config) { return; } allocator = config->allocator; listener_cleanup(config->interfaces); allocator_deallocate(allocator, (void*) config->notify_command); allocator_deallocate(allocator, (void*) config->cfg_filename); allocator_deallocate(allocator, (void*) config->zonelist_filename); allocator_deallocate(allocator, (void*) config->log_filename); allocator_deallocate(allocator, (void*) config->pid_filename); allocator_deallocate(allocator, (void*) config->clisock_filename); allocator_deallocate(allocator, (void*) config->working_dir); allocator_deallocate(allocator, (void*) config->username); allocator_deallocate(allocator, (void*) config->group); allocator_deallocate(allocator, (void*) config->chroot); allocator_deallocate(allocator, (void*) config); return; } opendnssec-1.4.9/signer/src/daemon/signal.h0000644000175000017500000000363412650165732015573 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signal handling. * */ #ifndef DAEMON_SIGNAL_H #define DAEMON_SIGNAL_H #include "config.h" #include #define SIGNAL_RUN 0 #define SIGNAL_INIT 1 #define SIGNAL_RELOAD 2 #define SIGNAL_SHUTDOWN 3 /** * Set corresponding engine. * \param[in] engine corresponding engine * */ void signal_set_engine(void* engine); /** * Handle signals. * \param[in] sig signal to handle * */ void signal_handler(sig_atomic_t sig); /** * Capture signal. * \param[in] dflsig default signal * \return sig_atomic_t captured signal * */ sig_atomic_t signal_capture(sig_atomic_t dflsig); #endif /* DAEMON_SIGNAL_H */ opendnssec-1.4.9/signer/src/daemon/cmdhandler.h0000644000175000017500000000447612650165732016424 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Command handler. * */ #ifndef DAEMON_CMDHANDLER_H #define DAEMON_CMDHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include #define ODS_SE_MAX_HANDLERS 5 typedef struct cmdhandler_struct cmdhandler_type; struct cmdhandler_struct { allocator_type* allocator; void* engine; struct sockaddr_un listen_addr; ods_thread_type thread_id; int listen_fd; int client_fd; int need_to_exit; }; /** * Create command handler. * \param[in] allocator memory allocator * \param[in] filename socket file name * \return cmdhandler_type* created command handler * */ cmdhandler_type* cmdhandler_create(allocator_type* allocator, const char* filename); /** * Start command handler. * \param[in] cmdhandler_type* command handler * */ void cmdhandler_start(cmdhandler_type* cmdhandler); /** * Cleanup command handler. * \param[in] cmdhandler_type* command handler * */ void cmdhandler_cleanup(cmdhandler_type* cmdhandler); #endif /* DAEMON_CMDHANDLER_H */ opendnssec-1.4.9/signer/src/daemon/cfg.h0000644000175000017500000000576512650165732015064 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signer engine configuration. * */ #ifndef DAEMON_CONFIG_H #define DAEMON_CONFIG_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/listener.h" #include /** * Engine configuration. * */ typedef struct engineconfig_struct engineconfig_type; struct engineconfig_struct { allocator_type* allocator; listener_type* interfaces; const char* cfg_filename; const char* zonelist_filename; const char* log_filename; const char* pid_filename; const char* notify_command; const char* clisock_filename; const char* working_dir; const char* username; const char* group; const char* chroot; int use_syslog; int num_worker_threads; int num_signer_threads; int verbosity; }; /** * Configure engine. * \param[in] allocator memory allocator * \param[in] cfgfile config file * \param[in] cmdline_verbosity log level * \return engineconfig_type* engine configuration * */ engineconfig_type* engine_config(allocator_type* allocator, const char* cfgfile, int cmdline_verbosity); /** * Check configuration. * \param[in] config engine configuration * \return ods_status status * ODS_STATUS_OK: configuration settings ok * else: error in configuration settings * */ ods_status engine_config_check(engineconfig_type* config); /** * Print engine configuration. * \param[in] out output file descriptor * \param[in] config engine configuration * */ void engine_config_print(FILE* out, engineconfig_type* config); /** * Clean up config. * \param[in] config engine configuration * */ void engine_config_cleanup(engineconfig_type* config); #endif /* DAEMON_CONFIG_H */ opendnssec-1.4.9/signer/src/daemon/dnshandler.h0000644000175000017500000000607612650165732016443 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * DNS handler. * */ #ifndef DAEMON_DNSHANDLER_H #define DAEMON_DNSHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/listener.h" #include "wire/netio.h" #include "wire/query.h" #include "wire/sock.h" #include #define ODS_SE_NOTIFY_CMD "NOTIFY" #define ODS_SE_MAX_HANDLERS 5 typedef struct dnshandler_struct dnshandler_type; struct dnshandler_struct { allocator_type* allocator; ods_thread_type thread_id; void* engine; listener_type* interfaces; socklist_type* socklist; netio_type* netio; query_type* query; netio_handler_type xfrhandler; unsigned need_to_exit; }; /** * Create dns handler. * \param[in] allocator memory allocator * \param[in] interfaces list of interfaces * \return dnshandler_type* created dns handler * */ dnshandler_type* dnshandler_create(allocator_type* allocator, listener_type* interfaces); /** * Start dns handler listener. * \param[in] dnshandler_type* dns handler * \return ods_status status * */ ods_status dnshandler_listen(dnshandler_type* dnshandler); /** * Start dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_start(dnshandler_type* dnshandler); /** * Signal dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_signal(dnshandler_type* dnshandler); /** * Forward notify to zone transfer handler. * \param[in] dnshandler_type* dns handler * \param[in] pkt notify packet * \param[in] len packet length * */ void dnshandler_fwd_notify(dnshandler_type* dnshandler, uint8_t* pkt, size_t len); /** * Cleanup dns handler. * \param[in] dnshandler_type* dns handler * */ void dnshandler_cleanup(dnshandler_type* dnshandler); #endif /* DAEMON_DNSHANDLER_H */ opendnssec-1.4.9/signer/src/daemon/engine.h0000644000175000017500000000651412650165732015563 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * The engine. * */ #ifndef DAEMON_ENGINE_H #define DAEMON_ENGINE_H #include "config.h" #include "daemon/cfg.h" #include "daemon/cmdhandler.h" #include "daemon/dnshandler.h" #include "daemon/xfrhandler.h" #include "daemon/worker.h" #include "scheduler/fifoq.h" #include "scheduler/schedule.h" #include "shared/allocator.h" #include "shared/locks.h" #include "signer/zonelist.h" #include "wire/edns.h" #include /** * Engine stuff. * */ typedef struct engine_struct engine_type; struct engine_struct { allocator_type* allocator; engineconfig_type* config; worker_type** workers; worker_type** drudgers; zonelist_type* zonelist; schedule_type* taskq; fifoq_type* signq; cmdhandler_type* cmdhandler; dnshandler_type* dnshandler; xfrhandler_type* xfrhandler; edns_data_type edns; int cmdhandler_done; pid_t pid; uid_t uid; gid_t gid; int daemonize; int need_to_exit; int need_to_reload; sig_atomic_t signal; cond_basic_type signal_cond; lock_basic_type signal_lock; }; /** * Start engine. * \param[in] cfgfile configuration file * \param[in] cmdline_verbosity how many -v on the command line * \param[in] daemonize to run as daemon or not * \param[in] info print info and exit * \param[in] single_run run once * */ void engine_start(const char* cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run); /** * Start drudgers. * \param[in] engine engine * */ void engine_start_drudgers(engine_type* engine); /** * Stop drudgers. * \param[in] engine engine * */ void engine_stop_drudgers(engine_type* engine); /** * Wake up workers. * \param[in] engine engine * */ void engine_wakeup_workers(engine_type* engine); /** * Update zones. * \param[in] engine engine * \param[in] zl_changed whether the zonelist has changed or not * */ void engine_update_zones(engine_type* engine, ods_status zl_changed); /** * Clean up engine. * \param[in] engine engine * */ void engine_cleanup(engine_type* engine); #endif /* DAEMON_ENGINE_H */ opendnssec-1.4.9/signer/src/daemon/cmdhandler.c0000644000175000017500000010306112650165732016405 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Command handler. * */ #include "daemon/cmdhandler.h" #include "daemon/engine.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H # include #endif #include /* According to earlier standards: select() sys/time.h sys/types.h unistd.h */ #include #include #define SE_CMDH_CMDLEN 7 #ifndef SUN_LEN #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif static int count = 0; static char* cmdh_str = "cmdhandler"; /** * Handle the 'help' command. * */ static void cmdhandler_handle_cmd_help(int sockfd) { char buf[ODS_SE_MAXLINE]; (void) snprintf(buf, ODS_SE_MAXLINE, "Commands:\n" "zones Show the currently known zones.\n" "sign [--serial ] Read zone and schedule for immediate " "(re-)sign.\n" " If a serial is given, that serial is used " "in the output zone.\n" "sign --all Read all zones and schedule all for " "immediate (re-)sign.\n" ); ods_writen(sockfd, buf, strlen(buf)); (void) snprintf(buf, ODS_SE_MAXLINE, "clear Delete the internal storage of this " "zone.\n" " All signatures will be regenerated " "on the next re-sign.\n" "queue Show the current task queue.\n" "flush Execute all scheduled tasks " "immediately.\n" ); ods_writen(sockfd, buf, strlen(buf)); (void) snprintf(buf, ODS_SE_MAXLINE, "update Update this zone signer " "configurations.\n" "update [--all] Update zone list and all signer " "configurations.\n" "retransfer Retransfer the zone from the master.\n" "start Start the engine.\n" "running Check if the engine is running.\n" "reload Reload the engine.\n" "stop Stop the engine.\n" "verbosity Set verbosity.\n" ); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'zones' command. * */ static void cmdhandler_handle_cmd_zones(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; size_t i; ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; if (!engine->zonelist || !engine->zonelist->zones) { (void)snprintf(buf, ODS_SE_MAXLINE, "I have no zones configured\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /* how many zones */ lock_basic_lock(&engine->zonelist->zl_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "I have %i zones configured\n", (int) engine->zonelist->zones->count); ods_writen(sockfd, buf, strlen(buf)); /* list zones */ node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; for (i=0; i < ODS_SE_MAXLINE; i++) { buf[i] = 0; } (void)snprintf(buf, ODS_SE_MAXLINE, "- %s\n", zone->name); ods_writen(sockfd, buf, strlen(buf)); node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->zonelist->zl_lock); return; } /** * Handle the 'update' command. * */ static void cmdhandler_handle_cmd_update(int sockfd, cmdhandler_type* cmdc, const char* tbd) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_status status = ODS_STATUS_OK; zone_type* zone = NULL; ods_status zl_changed = ODS_STATUS_OK; ods_log_assert(tbd); ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); if (ods_strcmp(tbd, "--all") == 0) { lock_basic_lock(&engine->zonelist->zl_lock); zl_changed = zonelist_update(engine->zonelist, engine->config->zonelist_filename); if (zl_changed == ODS_STATUS_UNCHANGED) { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list has not changed." " Signer configurations updated.\n"); ods_writen(sockfd, buf, strlen(buf)); } else if (zl_changed == ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list updated: %i " "removed, %i added, %i updated.\n", engine->zonelist->just_removed, engine->zonelist->just_added, engine->zonelist->just_updated); ods_writen(sockfd, buf, strlen(buf)); } else { lock_basic_unlock(&engine->zonelist->zl_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Zone list has errors.\n"); ods_writen(sockfd, buf, strlen(buf)); } if (zl_changed == ODS_STATUS_OK || zl_changed == ODS_STATUS_UNCHANGED) { engine->zonelist->just_removed = 0; engine->zonelist->just_added = 0; engine->zonelist->just_updated = 0; lock_basic_unlock(&engine->zonelist->zl_lock); /** * Always update the signconf for zones, even if zonelist has * not changed: ODS_STATUS_OK. */ engine_update_zones(engine, ODS_STATUS_OK); } return; } else { /* look up zone */ lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); /* If this zone is just added, don't update (it might not have a * task yet) */ if (zone && zone->zl_status == ZONE_ZL_ADDED) { zone = NULL; } lock_basic_unlock(&engine->zonelist->zl_lock); if (!zone) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not found.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); /* update all */ cmdhandler_handle_cmd_update(sockfd, cmdc, "--all"); return; } lock_basic_lock(&zone->zone_lock); status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s config being updated.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] zone %s scheduled for immediate update signconf", cmdh_str, tbd); engine_wakeup_workers(engine); } } return; } /** * Handle the 'retransfer' command. * */ static void cmdhandler_handle_cmd_retransfer(int sockfd, cmdhandler_type* cmdc, char* tbd) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; zone_type* zone = NULL; ods_log_assert(tbd); ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); /* look up zone */ lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); /* If this zone is just added, don't retransfer (it might not have a * task yet) */ if (zone && zone->zl_status == ZONE_ZL_ADDED) { zone = NULL; } lock_basic_unlock(&engine->zonelist->zl_lock); if (!zone) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not found.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } else if (zone->adinbound->type != ADAPTER_DNS) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not configured to use DNS input adapter.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } zone->xfrd->serial_retransfer = 1; xfrd_set_timer_now(zone->xfrd); ods_log_debug("[%s] forward a notify", cmdh_str); dnshandler_fwd_notify(engine->dnshandler, (uint8_t*) ODS_SE_NOTIFY_CMD, strlen(ODS_SE_NOTIFY_CMD)); (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s being retransferred.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] zone %s being retransferred", cmdh_str, tbd); return; } static uint32_t max(uint32_t a, uint32_t b) { return (aengine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); if (ods_strcmp(tbd, "--all") == 0) { lock_basic_lock(&engine->taskq->schedule_lock); schedule_flush(engine->taskq, TASK_READ); lock_basic_unlock(&engine->taskq->schedule_lock); engine_wakeup_workers(engine); (void)snprintf(buf, ODS_SE_MAXLINE, "All zones scheduled for " "immediate re-sign.\n"); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] all zones scheduled for immediate re-sign", cmdh_str); return; } else { char* delim1 = strchr(tbd, ' '); char* delim2 = NULL; int force_serial = 0; uint32_t serial = 0; if (delim1) { char* end = NULL; /** Some trailing text, could it be --serial? */ if (strncmp(delim1+1, "--serial ", 9) != 0) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting " "--serial , got %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } delim2 = strchr(delim1+1, ' '); if (!delim2) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting serial.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } serial = (uint32_t) strtol(delim2+1, &end, 10); if (*end != '\0') { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Expecting serial, " "got %s.\n", delim2+1); ods_writen(sockfd, buf, strlen(buf)); return; } force_serial = 1; *delim1 = '\0'; } lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); /* If this zone is just added, don't update (it might not have a task * yet). */ if (zone && zone->zl_status == ZONE_ZL_ADDED) { zone = NULL; } lock_basic_unlock(&engine->zonelist->zl_lock); if (!zone) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Zone %s not found.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); return; } lock_basic_lock(&zone->zone_lock); if (force_serial) { ods_log_assert(zone->db); if (!util_serial_gt(serial, max(zone->db->outserial, zone->db->inbserial))) { lock_basic_unlock(&zone->zone_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to enforce " "serial %u for zone %s.\n", serial, tbd); ods_writen(sockfd, buf, strlen(buf)); return; } zone->db->altserial = serial; zone->db->force_serial = 1; } status = zone_reschedule_task(zone, engine->taskq, TASK_READ); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s scheduled for " "immediate re-sign.\n", tbd); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] zone %s scheduled for immediate re-sign", cmdh_str, tbd); engine_wakeup_workers(engine); } } return; } /** * Unlink backup file. * */ static void unlink_backup_file(const char* filename, const char* extension) { char* tmpname = ods_build_path(filename, extension, 0, 1); if (tmpname) { ods_log_debug("[%s] unlink file %s", cmdh_str, tmpname); unlink(tmpname); free((void*)tmpname); } return; } /** * Handle the 'clear' command. * */ static void cmdhandler_handle_cmd_clear(int sockfd, cmdhandler_type* cmdc, const char* tbd) { ods_status status = ODS_STATUS_OK; engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; zone_type* zone = NULL; uint32_t inbserial = 0; uint32_t intserial = 0; uint32_t outserial = 0; ods_log_assert(tbd); ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; unlink_backup_file(tbd, ".inbound"); unlink_backup_file(tbd, ".backup"); unlink_backup_file(tbd, ".axfr"); unlink_backup_file(tbd, ".ixfr"); lock_basic_lock(&engine->zonelist->zl_lock); zone = zonelist_lookup_zone_by_name(engine->zonelist, tbd, LDNS_RR_CLASS_IN); lock_basic_unlock(&engine->zonelist->zl_lock); if (zone) { lock_basic_lock(&zone->zone_lock); inbserial = zone->db->inbserial; intserial = zone->db->intserial; outserial = zone->db->outserial; namedb_cleanup(zone->db); ixfr_cleanup(zone->ixfr); signconf_cleanup(zone->signconf); zone->db = namedb_create((void*)zone); zone->ixfr = ixfr_create((void*)zone); zone->signconf = signconf_create(); if (!zone->signconf || !zone->ixfr || !zone->db) { ods_fatal_exit("[%s] unable to clear zone %s: failed to recreate" "signconf, ixfr of db structure (out of memory?)", cmdh_str, tbd); return; } /* restore serial management */ zone->db->inbserial = inbserial; zone->db->intserial = intserial; zone->db->outserial = outserial; zone->db->have_serial = 1; status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); if (status != ODS_STATUS_OK) { (void)snprintf(buf, ODS_SE_MAXLINE, "Error: Unable to reschedule " "task for zone %s.\n", tbd); ods_log_crit("[%s] unable to reschedule task for zone %s: %s", cmdh_str, zone->name, ods_status2str(status)); } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Internal zone information about " "%s cleared", tbd?tbd:"(null)"); ods_log_info("[%s] internal zone information about %s cleared", cmdh_str, tbd?tbd:"(null)"); } } else { (void)snprintf(buf, ODS_SE_MAXLINE, "Cannot clear zone %s, zone not " "found", tbd?tbd:"(null)"); ods_log_warning("[%s] cannot clear zone %s, zone not found", cmdh_str, tbd?tbd:"(null)"); } ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'queue' command. * */ static void cmdhandler_handle_cmd_queue(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char* strtime = NULL; char buf[ODS_SE_MAXLINE]; size_t i = 0; time_t now = 0; ldns_rbnode_t* node = LDNS_RBTREE_NULL; task_type* task = NULL; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; if (!engine->taskq || !engine->taskq->tasks) { (void)snprintf(buf, ODS_SE_MAXLINE, "I have no tasks scheduled.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /* current time */ now = time_now(); strtime = ctime(&now); (void)snprintf(buf, ODS_SE_MAXLINE, "It is now %s", strtime?strtime:"(null)"); ods_writen(sockfd, buf, strlen(buf)); /* current work */ lock_basic_lock(&engine->taskq->schedule_lock); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { task = engine->workers[i]->task; if (task) { (void)snprintf(buf, ODS_SE_MAXLINE, "Working with task %s on " "zone %s\n", task_what2str(engine->workers[i]->working_with), task_who2str(task)); ods_writen(sockfd, buf, strlen(buf)); } } /* how many tasks */ (void)snprintf(buf, ODS_SE_MAXLINE, "\nI have %i tasks scheduled.\n", (int) engine->taskq->tasks->count); ods_writen(sockfd, buf, strlen(buf)); /* list tasks */ node = ldns_rbtree_first(engine->taskq->tasks); while (node && node != LDNS_RBTREE_NULL) { task = (task_type*) node->data; for (i=0; i < ODS_SE_MAXLINE; i++) { buf[i] = 0; } (void)task2str(task, (char*) &buf[0]); ods_writen(sockfd, buf, strlen(buf)); node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->taskq->schedule_lock); return; } /** * Handle the 'flush' command. * */ static void cmdhandler_handle_cmd_flush(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->taskq); lock_basic_lock(&engine->taskq->schedule_lock); schedule_flush(engine->taskq, TASK_NONE); lock_basic_unlock(&engine->taskq->schedule_lock); engine_wakeup_workers(engine); (void)snprintf(buf, ODS_SE_MAXLINE, "All tasks scheduled immediately.\n"); ods_writen(sockfd, buf, strlen(buf)); ods_log_verbose("[%s] all tasks scheduled immediately", cmdh_str); return; } /** * Handle the 'reload' command. * */ static void cmdhandler_handle_cmd_reload(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; engine->need_to_reload = 1; lock_basic_lock(&engine->signal_lock); lock_basic_alarm(&engine->signal_cond); lock_basic_unlock(&engine->signal_lock); (void)snprintf(buf, ODS_SE_MAXLINE, "Reloading engine.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'stop' command. * */ static void cmdhandler_handle_cmd_stop(int sockfd, cmdhandler_type* cmdc) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; engine->need_to_exit = 1; lock_basic_lock(&engine->signal_lock); lock_basic_alarm(&engine->signal_cond); lock_basic_unlock(&engine->signal_lock); (void)snprintf(buf, ODS_SE_MAXLINE, ODS_SE_STOP_RESPONSE); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'start' command. * */ static void cmdhandler_handle_cmd_start(int sockfd) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Engine already running.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'running' command. * */ static void cmdhandler_handle_cmd_running(int sockfd) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Engine running.\n"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle the 'verbosity' command. * */ static void cmdhandler_handle_cmd_verbosity(int sockfd, cmdhandler_type* cmdc, int val) { engine_type* engine = NULL; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); ods_log_assert(cmdc->engine); engine = (engine_type*) cmdc->engine; ods_log_assert(engine->config); ods_log_init(engine->config->log_filename, engine->config->use_syslog, val); (void)snprintf(buf, ODS_SE_MAXLINE, "Verbosity level set to %i.\n", val); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle erroneous command. * */ static void cmdhandler_handle_cmd_error(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Error: %s.\n", str?str:"(null)"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle unknown command. * */ static void cmdhandler_handle_cmd_unknown(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Unknown command %s.\n", str?str:"(null)"); ods_writen(sockfd, buf, strlen(buf)); return; } /** * Handle not implemented. * static void cmdhandler_handle_cmd_notimpl(int sockfd, const char* str) { char buf[ODS_SE_MAXLINE]; (void)snprintf(buf, ODS_SE_MAXLINE, "Command %s not implemented.\n", str); ods_writen(sockfd, buf, strlen(buf)); return; } */ /** * Handle client command. * */ static void cmdhandler_handle_cmd(cmdhandler_type* cmdc) { ssize_t n = 0; int sockfd = 0; char buf[ODS_SE_MAXLINE]; ods_log_assert(cmdc); sockfd = cmdc->client_fd; again: while ((n = read(sockfd, buf, ODS_SE_MAXLINE)) > 0) { /* what if this number is smaller than the number of bytes requested? */ buf[n-1] = '\0'; n--; ods_log_verbose("[%s] received command %s[%i]", cmdh_str, buf, n); ods_str_trim(buf); n = strlen(buf); if (n == 4 && strncmp(buf, "help", n) == 0) { ods_log_debug("[%s] help command", cmdh_str); cmdhandler_handle_cmd_help(sockfd); } else if (n == 5 && strncmp(buf, "zones", n) == 0) { ods_log_debug("[%s] list zones command", cmdh_str); cmdhandler_handle_cmd_zones(sockfd, cmdc); } else if (n >= 4 && strncmp(buf, "sign", 4) == 0) { ods_log_debug("[%s] sign zone command", cmdh_str); if (n == 4 || buf[4] == '\0') { /* NOTE: wouldn't it be nice that we default to --all? */ cmdhandler_handle_cmd_error(sockfd, "sign command needs " "an argument (either '--all' or a zone name)"); } else if (buf[4] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_sign(sockfd, cmdc, &buf[5]); } } else if (n >= 5 && strncmp(buf, "clear", 5) == 0) { ods_log_debug("[%s] clear zone command", cmdh_str); if (n == 5 || buf[5] == '\0') { cmdhandler_handle_cmd_error(sockfd, "clear command needs " "a zone name"); } else if (buf[5] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_clear(sockfd, cmdc, &buf[6]); } } else if (n == 5 && strncmp(buf, "queue", n) == 0) { ods_log_debug("[%s] list tasks command", cmdh_str); cmdhandler_handle_cmd_queue(sockfd, cmdc); } else if (n == 5 && strncmp(buf, "flush", n) == 0) { ods_log_debug("[%s] flush tasks command", cmdh_str); cmdhandler_handle_cmd_flush(sockfd, cmdc); } else if (n >= 6 && strncmp(buf, "update", 6) == 0) { ods_log_debug("[%s] update command", cmdh_str); if (n == 6 || buf[6] == '\0') { cmdhandler_handle_cmd_update(sockfd, cmdc, "--all"); } else if (buf[6] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_update(sockfd, cmdc, &buf[7]); } } else if (n == 4 && strncmp(buf, "stop", n) == 0) { ods_log_debug("[%s] shutdown command", cmdh_str); cmdhandler_handle_cmd_stop(sockfd, cmdc); return; } else if (n == 5 && strncmp(buf, "start", n) == 0) { ods_log_debug("[%s] start command", cmdh_str); cmdhandler_handle_cmd_start(sockfd); } else if (n == 6 && strncmp(buf, "reload", n) == 0) { ods_log_debug("[%s] reload command", cmdh_str); cmdhandler_handle_cmd_reload(sockfd, cmdc); } else if (n == 7 && strncmp(buf, "running", n) == 0) { ods_log_debug("[%s] running command", cmdh_str); cmdhandler_handle_cmd_running(sockfd); } else if (n >= 9 && strncmp(buf, "verbosity", 9) == 0) { ods_log_debug("[%s] verbosity command", cmdh_str); if (n == 9 || buf[9] == '\0') { cmdhandler_handle_cmd_error(sockfd, "verbosity command " "an argument (verbosity level)"); } else if (buf[9] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_verbosity(sockfd, cmdc, atoi(&buf[10])); } } else if (n >= 10 && strncmp(buf, "retransfer", 10) == 0) { ods_log_debug("[%s] retransfer zone command", cmdh_str); if (n == 10 || buf[10] == '\0') { cmdhandler_handle_cmd_error(sockfd, "retransfer command needs " "an argument (a zone name)"); } else if (buf[10] != ' ') { cmdhandler_handle_cmd_unknown(sockfd, buf); } else { cmdhandler_handle_cmd_retransfer(sockfd, cmdc, &buf[11]); } } else if (n > 0) { ods_log_debug("[%s] unknown command", cmdh_str); cmdhandler_handle_cmd_unknown(sockfd, buf); } ods_log_debug("[%s] done handling command %s[%i]", cmdh_str, buf, n); (void)snprintf(buf, SE_CMDH_CMDLEN, "\ncmd> "); ods_writen(sockfd, buf, strlen(buf)); } if (n < 0 && (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN) ) { goto again; } else if (n < 0 && errno == ECONNRESET) { ods_log_debug("[%s] done handling client: %s", cmdh_str, strerror(errno)); } else if (n < 0 ) { ods_log_error("[%s] read error: %s", cmdh_str, strerror(errno)); } return; } /** * Accept client. * */ static void* cmdhandler_accept_client(void* arg) { cmdhandler_type* cmdc = (cmdhandler_type*) arg; ods_thread_blocksigs(); ods_thread_detach(cmdc->thread_id); ods_log_debug("[%s] accept client %i", cmdh_str, cmdc->client_fd); cmdhandler_handle_cmd(cmdc); if (cmdc->client_fd) { shutdown(cmdc->client_fd, SHUT_RDWR); close(cmdc->client_fd); } free(cmdc); count--; return NULL; } /** * Create command handler. * */ cmdhandler_type* cmdhandler_create(allocator_type* allocator, const char* filename) { cmdhandler_type* cmdh = NULL; struct sockaddr_un servaddr; int listenfd = 0; int flags = 0; int ret = 0; if (!allocator || !filename) { return NULL; } /* new socket */ ods_log_debug("[%s] create socket %s", cmdh_str, filename); listenfd = socket(AF_UNIX, SOCK_STREAM, 0); if (listenfd < 0) { ods_log_error("[%s] unable to create cmdhandler: " "socket() failed (%s)", cmdh_str, strerror(errno)); return NULL; } /* set it to non-blocking */ flags = fcntl(listenfd, F_GETFL, 0); if (flags < 0) { ods_log_error("[%s] unable to create cmdhandler: " "fcntl(F_GETFL) failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } flags |= O_NONBLOCK; if (fcntl(listenfd, F_SETFL, flags) < 0) { ods_log_error("[%s] unable to create cmdhandler: " "fcntl(F_SETFL) failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } /* no surprises so far */ if (filename) { (void)unlink(filename); } bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, filename, sizeof(servaddr.sun_path) - 1); #ifdef HAVE_SOCKADDR_SUN_LEN servaddr.sun_len = strlen(servaddr.sun_path); #endif /* bind and listen... */ ret = bind(listenfd, (const struct sockaddr*) &servaddr, SUN_LEN(&servaddr)); if (ret != 0) { ods_log_error("[%s] unable to create cmdhandler: " "bind() failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } ret = listen(listenfd, ODS_SE_MAX_HANDLERS); if (ret != 0) { ods_log_error("[%s] unable to create cmdhandler: " "listen() failed (%s)", cmdh_str, strerror(errno)); close(listenfd); return NULL; } /* all ok */ cmdh = (cmdhandler_type*) allocator_alloc(allocator, sizeof(cmdhandler_type)); if (!cmdh) { ods_log_error("[%s] unable to create cmdhandler: " "allocator_alloc() failed", cmdh_str); close(listenfd); return NULL; } cmdh->allocator = allocator; cmdh->listen_fd = listenfd; cmdh->listen_addr = servaddr; cmdh->need_to_exit = 0; return cmdh; } /** * Start command handler. * */ void cmdhandler_start(cmdhandler_type* cmdhandler) { struct sockaddr_un cliaddr; socklen_t clilen; cmdhandler_type* cmdc = NULL; engine_type* engine = NULL; fd_set rset; int connfd = 0; int ret = 0; ods_log_assert(cmdhandler); ods_log_assert(cmdhandler->engine); ods_log_debug("[%s] start", cmdh_str); engine = (engine_type*) cmdhandler->engine; ods_thread_detach(cmdhandler->thread_id); FD_ZERO(&rset); while (cmdhandler->need_to_exit == 0) { clilen = sizeof(cliaddr); FD_SET(cmdhandler->listen_fd, &rset); ret = select(cmdhandler->listen_fd+1, &rset, NULL, NULL, NULL); if (ret < 0) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_warning("[%s] select() error: %s", cmdh_str, strerror(errno)); } continue; } if (FD_ISSET(cmdhandler->listen_fd, &rset)) { connfd = accept(cmdhandler->listen_fd, (struct sockaddr *) &cliaddr, &clilen); if (connfd < 0) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_warning("[%s] accept() error: %s", cmdh_str, strerror(errno)); } continue; } /* client accepted, create new thread */ cmdc = (cmdhandler_type*) malloc(sizeof(cmdhandler_type)); if (!cmdc) { ods_log_crit("[%s] unable to create thread for client: " "malloc() failed", cmdh_str); cmdhandler->need_to_exit = 1; break; } cmdc->listen_fd = cmdhandler->listen_fd; cmdc->client_fd = connfd; cmdc->listen_addr = cmdhandler->listen_addr; cmdc->engine = cmdhandler->engine; cmdc->need_to_exit = cmdhandler->need_to_exit; ods_thread_create(&cmdc->thread_id, &cmdhandler_accept_client, (void*) cmdc); count++; ods_log_debug("[%s] %i clients in progress...", cmdh_str, count); } } ods_log_debug("[%s] shutdown", cmdh_str); engine = cmdhandler->engine; engine->cmdhandler_done = 1; return; } /** * Cleanup command handler. * */ void cmdhandler_cleanup(cmdhandler_type* cmdhandler) { allocator_type* allocator = NULL; if (!cmdhandler) { return; } allocator = cmdhandler->allocator; allocator_deallocate(allocator, (void*) cmdhandler); return; } opendnssec-1.4.9/signer/src/daemon/engine.c0000644000175000017500000010622312650165732015554 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * The engine. * */ #include "config.h" #include "daemon/cfg.h" #include "daemon/engine.h" #include "daemon/signal.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/privdrop.h" #include "shared/status.h" #include "shared/util.h" #include "signer/zonelist.h" #include "wire/tsig.h" #include #include #include #include #include #include #include #include #include #include #include #include #include static const char* engine_str = "engine"; /** * Create engine. * */ static engine_type* engine_create(void) { engine_type* engine; allocator_type* allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create engine: allocator_create() " "failed", engine_str); return NULL; } engine = (engine_type*) allocator_alloc(allocator, sizeof(engine_type)); if (!engine) { ods_log_error("[%s] unable to create engine: allocator_alloc() " "failed", engine_str); allocator_cleanup(allocator); return NULL; } engine->allocator = allocator; engine->config = NULL; engine->workers = NULL; engine->drudgers = NULL; engine->cmdhandler = NULL; engine->cmdhandler_done = 0; engine->dnshandler = NULL; engine->xfrhandler = NULL; engine->pid = -1; engine->uid = -1; engine->gid = -1; engine->daemonize = 0; engine->need_to_exit = 0; engine->need_to_reload = 0; lock_basic_init(&engine->signal_lock); lock_basic_set(&engine->signal_cond); lock_basic_lock(&engine->signal_lock); engine->signal = SIGNAL_INIT; lock_basic_unlock(&engine->signal_lock); engine->zonelist = zonelist_create(engine->allocator); if (!engine->zonelist) { engine_cleanup(engine); return NULL; } engine->taskq = schedule_create(engine->allocator); if (!engine->taskq) { engine_cleanup(engine); return NULL; } engine->signq = fifoq_create(engine->allocator); if (!engine->signq) { engine_cleanup(engine); return NULL; } return engine; } /** * Start command handler. * */ static void* cmdhandler_thread_start(void* arg) { cmdhandler_type* cmd = (cmdhandler_type*) arg; ods_thread_blocksigs(); cmdhandler_start(cmd); return NULL; } static void engine_start_cmdhandler(engine_type* engine) { ods_log_assert(engine); ods_log_debug("[%s] start command handler", engine_str); engine->cmdhandler->engine = engine; ods_thread_create(&engine->cmdhandler->thread_id, cmdhandler_thread_start, engine->cmdhandler); return; } /** * Self pipe trick (see Unix Network Programming). * */ static int self_pipe_trick(engine_type* engine) { int sockfd, ret; struct sockaddr_un servaddr; const char* servsock_filename = ODS_SE_SOCKFILE; ods_log_assert(engine); ods_log_assert(engine->cmdhandler); sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { ods_log_error("[%s] unable to connect to command handler: " "socket() failed (%s)", engine_str, strerror(errno)); return 1; } else { bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, servsock_filename, sizeof(servaddr.sun_path) - 1); ret = connect(sockfd, (const struct sockaddr*) &servaddr, sizeof(servaddr)); if (ret != 0) { ods_log_error("[%s] unable to connect to command handler: " "connect() failed (%s)", engine_str, strerror(errno)); close(sockfd); return 1; } else { /* self-pipe trick */ ods_writen(sockfd, "", 1); close(sockfd); } } return 0; } /** * Stop command handler. * */ static void engine_stop_cmdhandler(engine_type* engine) { ods_log_assert(engine); if (!engine->cmdhandler || engine->cmdhandler_done) { return; } ods_log_debug("[%s] stop command handler", engine_str); engine->cmdhandler->need_to_exit = 1; if (self_pipe_trick(engine) == 0) { while (!engine->cmdhandler_done) { ods_log_debug("[%s] waiting for command handler to exit...", engine_str); sleep(1); } } else { ods_log_error("[%s] command handler self pipe trick failed, " "unclean shutdown", engine_str); } } /** * Start/stop dnshandler. * */ static void* dnshandler_thread_start(void* arg) { dnshandler_type* dnshandler = (dnshandler_type*) arg; dnshandler_start(dnshandler); return NULL; } static void engine_start_dnshandler(engine_type* engine) { if (!engine || !engine->dnshandler) { return; } ods_log_debug("[%s] start dnshandler", engine_str); engine->dnshandler->engine = engine; ods_thread_create(&engine->dnshandler->thread_id, dnshandler_thread_start, engine->dnshandler); return; } static void engine_stop_dnshandler(engine_type* engine) { if (!engine || !engine->dnshandler || !engine->dnshandler->thread_id) { return; } ods_log_debug("[%s] stop dnshandler", engine_str); engine->dnshandler->need_to_exit = 1; dnshandler_signal(engine->dnshandler); ods_log_debug("[%s] join dnshandler", engine_str); ods_thread_join(engine->dnshandler->thread_id); engine->dnshandler->engine = NULL; return; } /** * Start/stop xfrhandler. * */ static void* xfrhandler_thread_start(void* arg) { xfrhandler_type* xfrhandler = (xfrhandler_type*) arg; xfrhandler_start(xfrhandler); return NULL; } static void engine_start_xfrhandler(engine_type* engine) { if (!engine || !engine->xfrhandler) { return; } ods_log_debug("[%s] start xfrhandler", engine_str); engine->xfrhandler->engine = engine; ods_thread_create(&engine->xfrhandler->thread_id, xfrhandler_thread_start, engine->xfrhandler); /* This might be the wrong place to mark the xfrhandler started but * if its isn't done here we might try to shutdown and stop it before * it has marked itself started */ engine->xfrhandler->started = 1; return; } static void engine_stop_xfrhandler(engine_type* engine) { if (!engine || !engine->xfrhandler) { return; } ods_log_debug("[%s] stop xfrhandler", engine_str); engine->xfrhandler->need_to_exit = 1; xfrhandler_signal(engine->xfrhandler); ods_log_debug("[%s] join xfrhandler", engine_str); if (engine->xfrhandler->started) { ods_thread_join(engine->xfrhandler->thread_id); engine->xfrhandler->started = 0; } engine->xfrhandler->engine = NULL; return; } /** * Drop privileges. * */ static ods_status engine_privdrop(engine_type* engine) { ods_status status = ODS_STATUS_OK; uid_t uid = -1; gid_t gid = -1; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] drop privileges", engine_str); if (engine->config->username && engine->config->group) { ods_log_verbose("[%s] drop privileges to user %s, group %s", engine_str, engine->config->username, engine->config->group); } else if (engine->config->username) { ods_log_verbose("[%s] drop privileges to user %s", engine_str, engine->config->username); } else if (engine->config->group) { ods_log_verbose("[%s] drop privileges to group %s", engine_str, engine->config->group); } if (engine->config->chroot) { ods_log_verbose("[%s] chroot to %s", engine_str, engine->config->chroot); } status = privdrop(engine->config->username, engine->config->group, engine->config->chroot, &uid, &gid); engine->uid = uid; engine->gid = gid; privclose(engine->config->username, engine->config->group); return status; } /** * Start/stop workers. * */ static void engine_create_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(engine->allocator); engine->workers = (worker_type**) allocator_alloc(engine->allocator, ((size_t)engine->config->num_worker_threads) * sizeof(worker_type*)); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i] = worker_create(engine->allocator, i, WORKER_WORKER); } return; } static void engine_create_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_assert(engine->allocator); engine->drudgers = (worker_type**) allocator_alloc(engine->allocator, ((size_t)engine->config->num_signer_threads) * sizeof(worker_type*)); for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i] = worker_create(engine->allocator, i, WORKER_DRUDGER); } return; } static void* worker_thread_start(void* arg) { worker_type* worker = (worker_type*) arg; ods_thread_blocksigs(); worker_start(worker); return NULL; } static void engine_start_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] start workers", engine_str); for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i]->need_to_exit = 0; engine->workers[i]->engine = (void*) engine; ods_thread_create(&engine->workers[i]->thread_id, worker_thread_start, engine->workers[i]); } return; } void engine_start_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] start drudgers", engine_str); for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i]->need_to_exit = 0; engine->drudgers[i]->engine = (void*) engine; ods_thread_create(&engine->drudgers[i]->thread_id, worker_thread_start, engine->drudgers[i]); } return; } static void engine_stop_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] stop workers", engine_str); /* tell them to exit and wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { engine->workers[i]->need_to_exit = 1; worker_wakeup(engine->workers[i]); } ods_log_debug("[%s] notify workers", engine_str); worker_notify_all(&engine->signq->q_lock, &engine->signq->q_nonfull); /* head count */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { ods_log_debug("[%s] join worker %i", engine_str, i+1); ods_thread_join(engine->workers[i]->thread_id); engine->workers[i]->engine = NULL; } return; } void engine_stop_drudgers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] stop drudgers", engine_str); /* tell them to exit and wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { engine->drudgers[i]->need_to_exit = 1; } ods_log_debug("[%s] notify drudgers", engine_str); worker_notify_all(&engine->signq->q_lock, &engine->signq->q_threshold); /* head count */ for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { ods_log_debug("[%s] join drudger %i", engine_str, i+1); ods_thread_join(engine->drudgers[i]->thread_id); engine->drudgers[i]->engine = NULL; } return; } /** * Wake up all workers. * */ void engine_wakeup_workers(engine_type* engine) { size_t i = 0; ods_log_assert(engine); ods_log_assert(engine->config); ods_log_debug("[%s] wake up workers", engine_str); /* wake up sleepyheads */ for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { worker_wakeup(engine->workers[i]); } return; } /** * Set up engine. * */ static ods_status engine_setup(engine_type* engine) { ods_status status = ODS_STATUS_OK; struct sigaction action; int result = 0; int sockets[2] = {0,0}; ods_log_debug("[%s] setup signer engine", engine_str); if (!engine || !engine->config) { return ODS_STATUS_ASSERT_ERR; } /* set edns */ edns_init(&engine->edns, EDNS_MAX_MESSAGE_LEN); /* create command handler (before chowning socket file) */ engine->cmdhandler = cmdhandler_create(engine->allocator, engine->config->clisock_filename); if (!engine->cmdhandler) { return ODS_STATUS_CMDHANDLER_ERR; } engine->dnshandler = dnshandler_create(engine->allocator, engine->config->interfaces); engine->xfrhandler = xfrhandler_create(engine->allocator); if (!engine->xfrhandler) { return ODS_STATUS_XFRHANDLER_ERR; } if (engine->dnshandler) { if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sockets) == -1) { return ODS_STATUS_XFRHANDLER_ERR; } engine->xfrhandler->dnshandler.fd = sockets[0]; engine->dnshandler->xfrhandler.fd = sockets[1]; status = dnshandler_listen(engine->dnshandler); if (status != ODS_STATUS_OK) { ods_log_error("[%s] setup: unable to listen to sockets (%s)", engine_str, ods_status2str(status)); } } /* privdrop */ engine->uid = privuid(engine->config->username); engine->gid = privgid(engine->config->group); /* TODO: does piddir exists? */ /* remove the chown stuff: piddir? */ ods_chown(engine->config->pid_filename, engine->uid, engine->gid, 1); ods_chown(engine->config->clisock_filename, engine->uid, engine->gid, 0); ods_chown(engine->config->working_dir, engine->uid, engine->gid, 0); if (engine->config->log_filename && !engine->config->use_syslog) { ods_chown(engine->config->log_filename, engine->uid, engine->gid, 0); } if (engine->config->working_dir && chdir(engine->config->working_dir) != 0) { ods_log_error("[%s] setup: unable to chdir to %s (%s)", engine_str, engine->config->working_dir, strerror(errno)); return ODS_STATUS_CHDIR_ERR; } if (engine_privdrop(engine) != ODS_STATUS_OK) { return ODS_STATUS_PRIVDROP_ERR; } /* daemonize */ if (engine->daemonize) { switch ((engine->pid = fork())) { case -1: /* error */ ods_log_error("[%s] setup: unable to fork daemon (%s)", engine_str, strerror(errno)); return ODS_STATUS_FORK_ERR; case 0: /* child */ break; default: /* parent */ engine_cleanup(engine); engine = NULL; xmlCleanupParser(); xmlCleanupGlobals(); xmlCleanupThreads(); exit(0); } if (setsid() == -1) { ods_log_error("[%s] setup: unable to setsid daemon (%s)", engine_str, strerror(errno)); return ODS_STATUS_SETSID_ERR; } } engine->pid = getpid(); ods_log_verbose("[%s] running as pid %lu", engine_str, (unsigned long) engine->pid); /* catch signals */ signal_set_engine(engine); action.sa_handler = (void (*)(int))signal_handler; sigfillset(&action.sa_mask); action.sa_flags = 0; sigaction(SIGTERM, &action, NULL); sigaction(SIGHUP, &action, NULL); sigaction(SIGINT, &action, NULL); sigaction(SIGILL, &action, NULL); sigaction(SIGUSR1, &action, NULL); sigaction(SIGALRM, &action, NULL); sigaction(SIGCHLD, &action, NULL); action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &action, NULL); /* set up hsm */ /* LEAK */ result = lhsm_open(engine->config->cfg_filename); if (result != HSM_OK) { return ODS_STATUS_HSM_ERR; } /* create workers/drudgers */ engine_create_workers(engine); engine_create_drudgers(engine); /* start cmd/dns/xfr handlers */ engine_start_cmdhandler(engine); engine_start_dnshandler(engine); engine_start_xfrhandler(engine); tsig_handler_init(engine->allocator); /* write pidfile */ if (util_write_pidfile(engine->config->pid_filename, engine->pid) == -1) { hsm_close(); return ODS_STATUS_WRITE_PIDFILE_ERR; } /* setup done */ return ODS_STATUS_OK; } /** * Make sure that all zones have been worked on at least once. * */ static int engine_all_zones_processed(engine_type* engine) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_log_assert(engine); ods_log_assert(engine->zonelist); ods_log_assert(engine->zonelist->zones); node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->key; ods_log_assert(zone); ods_log_assert(zone->db); if (!zone->db->is_processed) { return 0; } node = ldns_rbtree_next(node); } return 1; } /** * Run engine, run!. * */ static void engine_run(engine_type* engine, int single_run) { if (!engine) { return; } engine_start_workers(engine); engine_start_drudgers(engine); lock_basic_lock(&engine->signal_lock); engine->signal = SIGNAL_RUN; lock_basic_unlock(&engine->signal_lock); while (!engine->need_to_exit && !engine->need_to_reload) { lock_basic_lock(&engine->signal_lock); engine->signal = signal_capture(engine->signal); switch (engine->signal) { case SIGNAL_RUN: ods_log_assert(1); break; case SIGNAL_RELOAD: engine->need_to_reload = 1; break; case SIGNAL_SHUTDOWN: engine->need_to_exit = 1; break; default: ods_log_warning("[%s] invalid signal %d captured, " "keep running", engine_str, signal); engine->signal = SIGNAL_RUN; break; } lock_basic_unlock(&engine->signal_lock); if (single_run) { engine->need_to_exit = engine_all_zones_processed(engine); } lock_basic_lock(&engine->signal_lock); if (engine->signal == SIGNAL_RUN && !single_run) { ods_log_debug("[%s] taking a break", engine_str); lock_basic_sleep(&engine->signal_cond, &engine->signal_lock, 3600); } lock_basic_unlock(&engine->signal_lock); } ods_log_debug("[%s] signer halted", engine_str); engine_stop_drudgers(engine); engine_stop_workers(engine); (void)lhsm_reopen(engine->config->cfg_filename); return; } /** * Parse notify command. * */ static void set_notify_ns(zone_type* zone, const char* cmd) { const char* str = NULL; const char* str2 = NULL; char* token = NULL; ods_log_assert(cmd); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adoutbound); if (zone->adoutbound->type == ADAPTER_FILE) { str = ods_replace(cmd, "%zonefile", zone->adoutbound->configstr); if (!str) { ods_log_error("[%s] unable to set notify ns: replace zonefile failed", engine_str); } str2 = ods_replace(str, "%zone", zone->name); free((void*)str); } else { str2 = ods_replace(cmd, "%zone", zone->name); } if (str2) { ods_str_trim((char*) str2); str = str2; if (*str) { token = NULL; while ((token = strtok((char*) str, " "))) { if (*token) { ods_str_list_add(&zone->notify_args, token); } str = NULL; } } zone->notify_command = (char*) str2; zone->notify_ns = zone->notify_args[0]; ods_log_debug("[%s] set notify ns: %s", engine_str, zone->notify_ns); } else { ods_log_error("[%s] unable to set notify ns: replace zone failed", engine_str); } return; } /** * Update DNS configuration for zone. * */ static int dnsconfig_zone(engine_type* engine, zone_type* zone) { int numdns = 0; ods_log_assert(engine); ods_log_assert(engine->xfrhandler); ods_log_assert(engine->xfrhandler->netio); ods_log_assert(zone); ods_log_assert(zone->adinbound); ods_log_assert(zone->adoutbound); ods_log_assert(zone->name); if (zone->adinbound->type == ADAPTER_DNS) { /* zone transfer handler */ if (!zone->xfrd) { ods_log_debug("[%s] add transfer handler for zone %s", engine_str, zone->name); zone->xfrd = xfrd_create((void*) engine->xfrhandler, (void*) zone); ods_log_assert(zone->xfrd); netio_add_handler(engine->xfrhandler->netio, &zone->xfrd->handler); } else if (!zone->xfrd->serial_disk_acquired) { xfrd_set_timer_now(zone->xfrd); } numdns++; } else if (zone->xfrd) { netio_remove_handler(engine->xfrhandler->netio, &zone->xfrd->handler); xfrd_cleanup(zone->xfrd, 0); zone->xfrd = NULL; } if (zone->adoutbound->type == ADAPTER_DNS) { /* notify handler */ if (!zone->notify) { ods_log_debug("[%s] add notify handler for zone %s", engine_str, zone->name); zone->notify = notify_create((void*) engine->xfrhandler, (void*) zone); ods_log_assert(zone->notify); netio_add_handler(engine->xfrhandler->netio, &zone->notify->handler); } numdns++; } else if (zone->notify) { netio_remove_handler(engine->xfrhandler->netio, &zone->notify->handler); notify_cleanup(zone->notify); zone->notify = NULL; } return numdns; } /** * Update zones. * */ void engine_update_zones(engine_type* engine, ods_status zl_changed) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; zone_type* delzone = NULL; task_type* task = NULL; ods_status status = ODS_STATUS_OK; unsigned wake_up = 0; int warnings = 0; time_t now = 0; if (!engine || !engine->zonelist || !engine->zonelist->zones) { return; } now = time_now(); ods_log_debug("[%s] commit zone list changes", engine_str); lock_basic_lock(&engine->zonelist->zl_lock); node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; task = NULL; /* reset task */ if (zone->zl_status == ZONE_ZL_REMOVED) { node = ldns_rbtree_next(node); lock_basic_lock(&zone->zone_lock); delzone = zonelist_del_zone(engine->zonelist, zone); if (delzone) { lock_basic_lock(&engine->taskq->schedule_lock); task = unschedule_task(engine->taskq, (task_type*) zone->task); lock_basic_unlock(&engine->taskq->schedule_lock); } task_cleanup(task); task = NULL; lock_basic_unlock(&zone->zone_lock); netio_remove_handler(engine->xfrhandler->netio, &zone->xfrd->handler); zone_cleanup(zone); zone = NULL; continue; } else if (zone->zl_status == ZONE_ZL_ADDED) { lock_basic_lock(&zone->zone_lock); ods_log_assert(!zone->task); /* set notify nameserver command */ if (engine->config->notify_command && !zone->notify_ns) { set_notify_ns(zone, engine->config->notify_command); } /* create task */ task = task_create(TASK_SIGNCONF, now, zone); lock_basic_unlock(&zone->zone_lock); if (!task) { ods_log_crit("[%s] unable to create task for zone %s: " "task_create() failed", engine_str, zone->name); node = ldns_rbtree_next(node); continue; } } /* load adapter config */ status = adapter_load_config(zone->adinbound); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to load config for inbound adapter " "for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } status = adapter_load_config(zone->adoutbound); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to load config for outbound adapter " "for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } /* for dns adapters */ warnings += dnsconfig_zone(engine, zone); if (zone->zl_status == ZONE_ZL_ADDED) { ods_log_assert(task); lock_basic_lock(&zone->zone_lock); zone->task = task; lock_basic_unlock(&zone->zone_lock); /* TODO: task is reachable from other threads by means of * zone->task. To fix this we need to nest the locks. But * first investigate any possible deadlocks. */ lock_basic_lock(&engine->taskq->schedule_lock); status = schedule_task(engine->taskq, task, 0); lock_basic_unlock(&engine->taskq->schedule_lock); } else if (zl_changed == ODS_STATUS_OK) { /* always try to update signconf */ lock_basic_lock(&zone->zone_lock); status = zone_reschedule_task(zone, engine->taskq, TASK_SIGNCONF); lock_basic_unlock(&zone->zone_lock); } if (status != ODS_STATUS_OK) { ods_log_crit("[%s] unable to schedule task for zone %s: %s", engine_str, zone->name, ods_status2str(status)); } else { wake_up = 1; zone->zl_status = ZONE_ZL_OK; } node = ldns_rbtree_next(node); } lock_basic_unlock(&engine->zonelist->zl_lock); if (engine->dnshandler) { ods_log_debug("[%s] forward notify for all zones", engine_str); dnshandler_fwd_notify(engine->dnshandler, (uint8_t*) ODS_SE_NOTIFY_CMD, strlen(ODS_SE_NOTIFY_CMD)); } else if (warnings) { ods_log_warning("[%s] no dnshandler/listener configured, but zones " "are configured with dns adapters: notify and zone transfer " "requests will not work properly", engine_str); } if (wake_up) { engine_wakeup_workers(engine); } return; } /** * Try to recover from the backup files. * */ static ods_status engine_recover(engine_type* engine) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; zone_type* zone = NULL; ods_status status = ODS_STATUS_OK; ods_status result = ODS_STATUS_UNCHANGED; if (!engine || !engine->zonelist || !engine->zonelist->zones) { ods_log_error("[%s] cannot recover zones: no engine or zonelist", engine_str); return ODS_STATUS_ERR; /* no need to update zones */ } ods_log_assert(engine); ods_log_assert(engine->zonelist); ods_log_assert(engine->zonelist->zones); lock_basic_lock(&engine->zonelist->zl_lock); /* [LOCK] zonelist */ node = ldns_rbtree_first(engine->zonelist->zones); while (node && node != LDNS_RBTREE_NULL) { zone = (zone_type*) node->data; ods_log_assert(zone->zl_status == ZONE_ZL_ADDED); lock_basic_lock(&zone->zone_lock); status = zone_recover2(zone); if (status == ODS_STATUS_OK) { ods_log_assert(zone->task); ods_log_assert(zone->db); ods_log_assert(zone->signconf); /* notify nameserver */ if (engine->config->notify_command && !zone->notify_ns) { set_notify_ns(zone, engine->config->notify_command); } /* schedule task */ lock_basic_lock(&engine->taskq->schedule_lock); /* [LOCK] schedule */ status = schedule_task(engine->taskq, (task_type*) zone->task, 0); /* [UNLOCK] schedule */ lock_basic_unlock(&engine->taskq->schedule_lock); if (status != ODS_STATUS_OK) { ods_log_crit("[%s] unable to schedule task for zone %s: %s", engine_str, zone->name, ods_status2str(status)); task_cleanup((task_type*) zone->task); zone->task = NULL; result = ODS_STATUS_OK; /* will trigger update zones */ } else { ods_log_debug("[%s] recovered zone %s", engine_str, zone->name); /* recovery done */ zone->zl_status = ZONE_ZL_OK; } } else { if (status != ODS_STATUS_UNCHANGED) { ods_log_warning("[%s] unable to recover zone %s from backup," " performing full sign", engine_str, zone->name); } result = ODS_STATUS_OK; /* will trigger update zones */ } lock_basic_unlock(&zone->zone_lock); node = ldns_rbtree_next(node); } /* [UNLOCK] zonelist */ lock_basic_unlock(&engine->zonelist->zl_lock); return result; } /** * Start engine. * */ void engine_start(const char* cfgfile, int cmdline_verbosity, int daemonize, int info, int single_run) { engine_type* engine = NULL; int use_syslog = 0; ods_status zl_changed = ODS_STATUS_UNCHANGED; ods_status status = ODS_STATUS_OK; int close_hsm = 0; ods_log_assert(cfgfile); ods_log_init(NULL, use_syslog, cmdline_verbosity); ods_log_verbose("[%s] starting signer", engine_str); /* initialize */ xmlInitGlobals(); xmlInitParser(); xmlInitThreads(); engine = engine_create(); if (!engine) { ods_fatal_exit("[%s] create failed", engine_str); return; } engine->daemonize = daemonize; /* config */ engine->config = engine_config(engine->allocator, cfgfile, cmdline_verbosity); status = engine_config_check(engine->config); if (status != ODS_STATUS_OK) { ods_log_error("[%s] cfgfile %s has errors", engine_str, cfgfile); goto earlyexit; } if (info) { engine_config_print(stdout, engine->config); /* for debugging */ goto earlyexit; } /* check pidfile */ if (!util_check_pidfile(engine->config->pid_filename)) { exit(1); } /* open log */ ods_log_init(engine->config->log_filename, engine->config->use_syslog, engine->config->verbosity); /* setup */ tzset(); /* for portability */ status = engine_setup(engine); if (status != ODS_STATUS_OK) { ods_log_error("[%s] setup failed: %s", engine_str, ods_status2str(status)); engine->need_to_exit = 1; if (status != ODS_STATUS_WRITE_PIDFILE_ERR) { /* command handler had not yet been started */ engine->cmdhandler_done = 1; } } else { /* setup ok, mark hsm open */ close_hsm = 1; } /* run */ while (engine->need_to_exit == 0) { /* update zone list */ lock_basic_lock(&engine->zonelist->zl_lock); zl_changed = zonelist_update(engine->zonelist, engine->config->zonelist_filename); engine->zonelist->just_removed = 0; engine->zonelist->just_added = 0; engine->zonelist->just_updated = 0; lock_basic_unlock(&engine->zonelist->zl_lock); /* start/reload */ if (engine->need_to_reload) { ods_log_info("[%s] signer reloading", engine_str); engine->need_to_reload = 0; } else { ods_log_info("[%s] signer started (version %s), pid %u", engine_str, PACKAGE_VERSION, engine->pid); zl_changed = engine_recover(engine); } if (zl_changed == ODS_STATUS_OK || zl_changed == ODS_STATUS_UNCHANGED) { engine_update_zones(engine, zl_changed); } engine_run(engine, single_run); } /* shutdown */ ods_log_info("[%s] signer shutdown", engine_str); if (close_hsm) { ods_log_verbose("[%s] close hsm", engine_str); hsm_close(); } engine_stop_cmdhandler(engine); engine_stop_xfrhandler(engine); engine_stop_dnshandler(engine); earlyexit: if (engine && engine->config) { if (engine->config->pid_filename) { (void)unlink(engine->config->pid_filename); } if (engine->config->clisock_filename) { (void)unlink(engine->config->clisock_filename); } } tsig_handler_cleanup(); engine_cleanup(engine); engine = NULL; ods_log_close(); xmlCleanupParser(); xmlCleanupGlobals(); xmlCleanupThreads(); return; } /** * Clean up engine. * */ void engine_cleanup(engine_type* engine) { size_t i = 0; allocator_type* allocator; cond_basic_type signal_cond; lock_basic_type signal_lock; if (!engine) { return; } allocator = engine->allocator; signal_cond = engine->signal_cond; signal_lock = engine->signal_lock; if (engine->workers && engine->config) { for (i=0; i < (size_t) engine->config->num_worker_threads; i++) { worker_cleanup(engine->workers[i]); } allocator_deallocate(allocator, (void*) engine->workers); } if (engine->drudgers && engine->config) { for (i=0; i < (size_t) engine->config->num_signer_threads; i++) { worker_cleanup(engine->drudgers[i]); } allocator_deallocate(allocator, (void*) engine->drudgers); } zonelist_cleanup(engine->zonelist); schedule_cleanup(engine->taskq); fifoq_cleanup(engine->signq); cmdhandler_cleanup(engine->cmdhandler); dnshandler_cleanup(engine->dnshandler); xfrhandler_cleanup(engine->xfrhandler); engine_config_cleanup(engine->config); allocator_deallocate(allocator, (void*) engine); lock_basic_destroy(&signal_lock); lock_basic_off(&signal_cond); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/daemon/xfrhandler.h0000644000175000017500000000626012650165732016451 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone transfer handler. * */ #ifndef DAEMON_XFRHANDLER_H #define DAEMON_XFRHANDLER_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/notify.h" #include "wire/tcpset.h" #include "wire/xfrd.h" /** * Zone transfer handler. * */ typedef struct xfrhandler_struct xfrhandler_type; struct xfrhandler_struct { allocator_type* allocator; /* Engine reference */ ods_thread_type thread_id; void* engine; /* Start time */ time_t start_time; time_t current_time; /* Network support */ netio_type* netio; tcp_set_type* tcp_set; buffer_type* packet; xfrd_type* tcp_waiting_first; xfrd_type* udp_waiting_first; xfrd_type* udp_waiting_last; size_t udp_use_num; notify_type* notify_waiting_first; notify_type* notify_waiting_last; int notify_udp_num; netio_handler_type dnshandler; unsigned got_time : 1; unsigned need_to_exit : 1; unsigned started : 1; }; /** * Create zone transfer handler. * \param[in] allocator memory allocator * \return xfrhandler_type* created zoned transfer handler * */ xfrhandler_type* xfrhandler_create(allocator_type* allocator); /** * Start zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_start(xfrhandler_type* xfrhandler); /** * Get current time from the zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * \return time_t current time * */ time_t xfrhandler_time(xfrhandler_type* xfrhandler); /** * Signal zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_signal(xfrhandler_type* xfrhandler); /** * Cleanup zone transfer handler. * \param[in] xfrhandler_type* zone transfer handler * */ void xfrhandler_cleanup(xfrhandler_type* xfrhandler); #endif /* DAEMON_XFRHANDLER_H */ opendnssec-1.4.9/signer/src/daemon/signal.c0000644000175000017500000000611012650165732015556 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Signal handling. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/signal.h" #include "shared/locks.h" #include "shared/log.h" #include static int signal_hup_recvd = 0; static int signal_term_recvd = 0; static engine_type* signal_engine = NULL; static const char* signal_str = "signal"; /** * Set corresponding engine. * */ void signal_set_engine(void* engine) { signal_engine = (engine_type*) engine; return; } /** * Handle signals. * */ void signal_handler(sig_atomic_t sig) { switch (sig) { case SIGHUP: ods_log_debug("[%s] SIGHUP received", signal_str); signal_hup_recvd++; if (signal_engine) { lock_basic_lock(&signal_engine->signal_lock); /* [LOCK] signal */ lock_basic_alarm(&signal_engine->signal_cond); /* [UNLOCK] signal */ lock_basic_unlock(&signal_engine->signal_lock); } break; case SIGINT: case SIGTERM: ods_log_debug("[%s] SIGTERM received", signal_str); signal_term_recvd++; if (signal_engine) { lock_basic_lock(&signal_engine->signal_lock); /* [LOCK] signal */ lock_basic_alarm(&signal_engine->signal_cond); /* [UNLOCK] signal */ lock_basic_unlock(&signal_engine->signal_lock); } break; default: break; } return; } /** * Capture signal. * */ sig_atomic_t signal_capture(sig_atomic_t dflsig) { if (signal_term_recvd) { signal_term_recvd = 0; return SIGNAL_SHUTDOWN; } else if (signal_hup_recvd) { signal_hup_recvd = 0; return SIGNAL_RELOAD; } return dflsig; } opendnssec-1.4.9/signer/src/daemon/xfrhandler.c0000644000175000017500000001435512650165732016450 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Zone transfer handler. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/xfrhandler.h" #include "shared/duration.h" #include "shared/status.h" #include #include static const char* xfrh_str = "xfrhandler"; static void xfrhandler_handle_dns(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Create zone transfer handler. * */ xfrhandler_type* xfrhandler_create(allocator_type* allocator) { xfrhandler_type* xfrh = NULL; if (!allocator) { return NULL; } xfrh = (xfrhandler_type*) allocator_alloc(allocator, sizeof(xfrhandler_type)); if (!xfrh) { ods_log_error("[%s] unable to create xfrhandler: " "allocator_alloc() failed", xfrh_str); return NULL; } xfrh->allocator = allocator; xfrh->engine = NULL; xfrh->packet = NULL; xfrh->netio = NULL; xfrh->tcp_set = NULL; xfrh->tcp_waiting_first = NULL; xfrh->udp_waiting_first = NULL; xfrh->udp_waiting_last = NULL; xfrh->udp_use_num = 0; xfrh->start_time = 0; xfrh->current_time = 0; xfrh->got_time = 0; xfrh->need_to_exit = 0; xfrh->started = 0; /* notify */ xfrh->notify_waiting_first = NULL; xfrh->notify_waiting_last = NULL; xfrh->notify_udp_num = 0; /* setup */ xfrh->netio = netio_create(allocator); if (!xfrh->netio) { ods_log_error("[%s] unable to create xfrhandler: " "netio_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->packet = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!xfrh->packet) { ods_log_error("[%s] unable to create xfrhandler: " "buffer_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->tcp_set = tcp_set_create(allocator); if (!xfrh->tcp_set) { ods_log_error("[%s] unable to create xfrhandler: " "tcp_set_create() failed", xfrh_str); xfrhandler_cleanup(xfrh); return NULL; } xfrh->dnshandler.fd = -1; xfrh->dnshandler.user_data = (void*) xfrh; xfrh->dnshandler.timeout = 0; xfrh->dnshandler.event_types = NETIO_EVENT_READ; xfrh->dnshandler.event_handler = xfrhandler_handle_dns; return xfrh; } /** * Start zone transfer handler. * */ void xfrhandler_start(xfrhandler_type* xfrhandler) { ods_log_assert(xfrhandler); ods_log_assert(xfrhandler->engine); ods_log_debug("[%s] start", xfrh_str); /* setup */ xfrhandler->start_time = time_now(); /* handlers */ netio_add_handler(xfrhandler->netio, &xfrhandler->dnshandler); /* service */ while (xfrhandler->need_to_exit == 0) { /* dispatch may block for a longer period, so current is gone */ xfrhandler->got_time = 0; ods_log_deeebug("[%s] netio dispatch", xfrh_str); if (netio_dispatch(xfrhandler->netio, NULL, NULL) == -1) { if (errno != EINTR) { ods_log_error("[%s] unable to dispatch netio: %s", xfrh_str, strerror(errno)); } } } /* shutdown */ ods_log_debug("[%s] shutdown", xfrh_str); return; /* xfrd_write_state(xfrd); */ /* close tcp sockets */ /* close udp sockets */ } /** * Get current time from zone transfer handler. * */ time_t xfrhandler_time(xfrhandler_type* xfrhandler) { if (!xfrhandler) { return 0; } if (!xfrhandler->got_time) { xfrhandler->current_time = time_now(); xfrhandler->got_time = 1; } return xfrhandler->current_time; } /** * Signal zone transfer handler. * */ void xfrhandler_signal(xfrhandler_type* xfrhandler) { if (xfrhandler && xfrhandler->started) { ods_thread_kill(xfrhandler->thread_id, SIGHUP); } return; } /** * Handle forwarded dns packets. * */ static void xfrhandler_handle_dns(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { xfrhandler_type* xfrhandler = NULL; uint8_t buf[MAX_PACKET_SIZE]; ssize_t received = 0; if (!handler) { return; } xfrhandler = (xfrhandler_type*) handler->user_data; ods_log_assert(event_types & NETIO_EVENT_READ); received = read(xfrhandler->dnshandler.fd, &buf, MAX_PACKET_SIZE); ods_log_debug("[%s] read forwarded dns packet: %d bytes received", xfrh_str, (int) received); if (received == -1) { ods_log_error("[%s] unable to forward dns packet: %s", xfrh_str, strerror(errno)); } return; } /** * Cleanup zone transfer handler. * */ void xfrhandler_cleanup(xfrhandler_type* xfrhandler) { allocator_type* allocator = NULL; if (!xfrhandler) { return; } allocator = xfrhandler->allocator; netio_cleanup(xfrhandler->netio); buffer_cleanup(xfrhandler->packet, allocator); tcp_set_cleanup(xfrhandler->tcp_set, allocator); allocator_deallocate(allocator, (void*) xfrhandler); return; } opendnssec-1.4.9/signer/src/daemon/worker.c0000644000175000017500000007056412650165732015630 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * The hard workers. * */ #include "daemon/engine.h" #include "daemon/worker.h" #include "shared/allocator.h" #include "shared/duration.h" #include "shared/hsm.h" #include "shared/locks.h" #include "shared/log.h" #include "shared/status.h" #include "signer/tools.h" #include "signer/zone.h" #include /* time() */ ods_lookup_table worker_str[] = { { WORKER_WORKER, "worker" }, { WORKER_DRUDGER, "drudger" }, { 0, NULL } }; /** * Convert worker type to string. * */ static const char* worker2str(worker_id type) { ods_lookup_table *lt = ods_lookup_by_id(worker_str, type); if (lt) { return lt->name; } return NULL; } /** * Create worker. * */ worker_type* worker_create(allocator_type* allocator, int num, worker_id type) { worker_type* worker; if (!allocator) { return NULL; } worker = (worker_type*) allocator_alloc(allocator, sizeof(worker_type)); if (!worker) { return NULL; } ods_log_debug("[%s[%i]] create", worker2str(type), num+1); lock_basic_init(&worker->worker_lock); lock_basic_set(&worker->worker_alarm); lock_basic_lock(&worker->worker_lock); worker->allocator = allocator; worker->thread_num = num +1; worker->engine = NULL; worker->task = NULL; worker->working_with = TASK_NONE; worker->need_to_exit = 0; worker->type = type; worker->clock_in = 0; worker->jobs_appointed = 0; worker->jobs_completed = 0; worker->jobs_failed = 0; worker->sleeping = 0; worker->waiting = 0; lock_basic_unlock(&worker->worker_lock); return worker; } /** * Worker working with... * */ static void worker_working_with(worker_type* worker, task_id with, task_id next, const char* str, const char* name, task_id* what, time_t* when) { worker->working_with = with; ods_log_verbose("[%s[%i]] %s zone %s", worker2str(worker->type), worker->thread_num, str, name); *what = next; *when = time_now(); return; } /** * Has this worker measured up to all appointed jobs? * */ static int worker_fulfilled(worker_type* worker) { int ret = 0; ret = (worker->jobs_completed + worker->jobs_failed) == worker->jobs_appointed; return ret; } /** * Clear jobs. * */ static void worker_clear_jobs(worker_type* worker) { ods_log_assert(worker); lock_basic_lock(&worker->worker_lock); worker->jobs_appointed = 0; worker->jobs_completed = 0; worker->jobs_failed = 0; lock_basic_unlock(&worker->worker_lock); return; } /** * Queue RRset for signing. * */ static void worker_queue_rrset(worker_type* worker, fifoq_type* q, rrset_type* rrset) { ods_status status = ODS_STATUS_UNCHANGED; int tries = 0; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(rrset); lock_basic_lock(&q->q_lock); status = fifoq_push(q, (void*) rrset, worker, &tries); while (status == ODS_STATUS_UNCHANGED) { tries++; if (worker->need_to_exit) { lock_basic_unlock(&q->q_lock); return; } /** * Apparently the queue is full. Lets take a small break to not hog CPU. * The worker will release the signq lock while sleeping and will * automatically grab the lock when the queue is nonfull. * Queue is nonfull at 10% of the queue size. */ lock_basic_sleep(&q->q_nonfull, &q->q_lock, 5); status = fifoq_push(q, (void*) rrset, worker, &tries); } lock_basic_unlock(&q->q_lock); ods_log_assert(status == ODS_STATUS_OK); lock_basic_lock(&worker->worker_lock); worker->jobs_appointed += 1; lock_basic_unlock(&worker->worker_lock); return; } /** * Queue domain for signing. * */ static void worker_queue_domain(worker_type* worker, fifoq_type* q, domain_type* domain) { rrset_type* rrset = NULL; denial_type* denial = NULL; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(domain); rrset = domain->rrsets; while (rrset) { worker_queue_rrset(worker, q, rrset); rrset = rrset->next; } denial = (denial_type*) domain->denial; if (denial && denial->rrset) { worker_queue_rrset(worker, q, denial->rrset); } return; } /** * Queue zone for signing. * */ static void worker_queue_zone(worker_type* worker, fifoq_type* q, zone_type* zone) { ldns_rbnode_t* node = LDNS_RBTREE_NULL; domain_type* domain = NULL; ods_log_assert(worker); ods_log_assert(q); ods_log_assert(zone); worker_clear_jobs(worker); if (!zone->db || !zone->db->domains) { return; } if (zone->db->domains->root != LDNS_RBTREE_NULL) { node = ldns_rbtree_first(zone->db->domains); } while (node && node != LDNS_RBTREE_NULL) { domain = (domain_type*) node->data; worker_queue_domain(worker, q, domain); node = ldns_rbtree_next(node); } return; } /** * Make sure that no appointed jobs have failed. * */ static ods_status worker_check_jobs(worker_type* worker, task_type* task) { ods_log_assert(worker); ods_log_assert(task); lock_basic_lock(&worker->worker_lock); if (worker->jobs_failed) { ods_log_error("[%s[%i]] sign zone %s failed: %u RRsets failed", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_failed); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else if (worker->jobs_completed != worker->jobs_appointed) { ods_log_error("[%s[%i]] sign zone %s failed: processed %u of %u " "RRsets", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_completed, worker->jobs_appointed); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else if (worker->need_to_exit) { ods_log_debug("[%s[%i]] sign zone %s failed: worker needs to exit", worker2str(worker->type), worker->thread_num, task_who2str(task)); lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_ERR; } else { ods_log_debug("[%s[%i]] sign zone %s ok: %u of %u RRsets " "succeeded", worker2str(worker->type), worker->thread_num, task_who2str(task), worker->jobs_completed, worker->jobs_appointed); ods_log_assert(worker->jobs_appointed == worker->jobs_completed); } lock_basic_unlock(&worker->worker_lock); return ODS_STATUS_OK; } /** * Perform task. * */ static void worker_perform_task(worker_type* worker) { engine_type* engine = NULL; zone_type* zone = NULL; task_type* task = NULL; task_id what = TASK_NONE; time_t when = 0; time_t never = (3600*24*365); ods_status status = ODS_STATUS_OK; int backup = 0; time_t start = 0; time_t end = 0; if (!worker || !worker->task || !worker->task->zone || !worker->engine) { return; } engine = (engine_type*) worker->engine; task = (task_type*) worker->task; zone = (zone_type*) worker->task->zone; ods_log_debug("[%s[%i]] perform task %s for zone %s at %u", worker2str(worker->type), worker->thread_num, task_what2str(task->what), task_who2str(task), (uint32_t) worker->clock_in); /* do what you have been told to do */ switch (task->what) { case TASK_SIGNCONF: /* perform 'load signconf' task */ worker_working_with(worker, TASK_SIGNCONF, TASK_READ, "configure", task_who2str(task), &what, &when); status = tools_signconf(zone); if (status == ODS_STATUS_UNCHANGED) { if (!zone->signconf->last_modified) { ods_log_debug("[%s[%i]] no signconf.xml for zone %s yet", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_ERR; } } if (status == ODS_STATUS_UNCHANGED) { if (task->halted != TASK_NONE && task->halted != TASK_SIGNCONF) { goto task_perform_continue; } status = ODS_STATUS_OK; } else if (status == ODS_STATUS_OK) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } else { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* break; */ case TASK_READ: /* perform 'read input adapter' task */ worker_working_with(worker, TASK_READ, TASK_SIGN, "read", task_who2str(task), &what, &when); task->what = TASK_READ; if (!zone->signconf->last_modified) { ods_log_debug("[%s[%i]] no signconf.xml for zone %s yet", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_ERR; } else { lhsm_check_connection((void*)engine); status = tools_input(zone); } if (status == ODS_STATUS_UNCHANGED) { ods_log_verbose("[%s[%i]] zone %s unsigned data not changed, " "continue", worker2str(worker->type), worker->thread_num, task_who2str(task)); status = ODS_STATUS_OK; } if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* break; */ case TASK_SIGN: /* perform 'sign' task */ worker_working_with(worker, TASK_SIGN, TASK_WRITE, "sign", task_who2str(task), &what, &when); task->what = TASK_SIGN; status = zone_update_serial(zone); if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { ods_log_error("[%s[%i]] unable to sign zone %s: " "failed to increment serial", worker2str(worker->type), worker->thread_num, task_who2str(task)); if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } /* start timer */ start = time(NULL); if (zone->stats) { lock_basic_lock(&zone->stats->stats_lock); if (!zone->stats->start_time) { zone->stats->start_time = start; } zone->stats->sig_count = 0; zone->stats->sig_soa_count = 0; zone->stats->sig_reuse = 0; zone->stats->sig_time = 0; lock_basic_unlock(&zone->stats->stats_lock); } /* check the HSM connection before queuing sign operations */ lhsm_check_connection((void*)engine); /* prepare keys */ status = zone_prepare_keys(zone); if (status == ODS_STATUS_OK) { /* queue menial, hard signing work */ worker_queue_zone(worker, engine->signq, zone); ods_log_deeebug("[%s[%i]] wait until drudgers are finished " "signing zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); /* sleep until work is done */ worker_sleep_unless(worker, 0); } /* stop timer */ end = time(NULL); /* check status and jobs */ if (status == ODS_STATUS_OK) { status = worker_check_jobs(worker, task); } worker_clear_jobs(worker); if (status == ODS_STATUS_OK && zone->stats) { lock_basic_lock(&zone->stats->stats_lock); zone->stats->sig_time = (end-start); lock_basic_unlock(&zone->stats->stats_lock); } if (status != ODS_STATUS_OK) { if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } else { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } /* break; */ case TASK_WRITE: /* perform 'write to output adapter' task */ worker_working_with(worker, TASK_WRITE, TASK_SIGN, "write", task_who2str(task), &what, &when); task->what = TASK_WRITE; status = tools_output(zone, engine); if (status == ODS_STATUS_OK) { if (task->interrupt > TASK_SIGNCONF) { task->interrupt = TASK_NONE; task->halted = TASK_NONE; } } else { /* clear signatures? */ if (task->halted == TASK_NONE) { goto task_perform_fail; } goto task_perform_continue; } zone->db->is_processed = 1; if (zone->signconf && duration2time(zone->signconf->sig_resign_interval)) { what = TASK_SIGN; when = worker->clock_in + duration2time(zone->signconf->sig_resign_interval); } else { ods_log_error("[%s[%i]] unable to retrieve resign interval " "for zone %s: duration2time() failed", worker2str(worker->type), worker->thread_num, task_who2str(task)); ods_log_info("[%s[%i]] defaulting to 1H resign interval for " "zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); what = TASK_SIGN; when = worker->clock_in + 3600; } backup = 1; break; case TASK_NONE: worker->working_with = TASK_NONE; /* no task */ ods_log_warning("[%s[%i]] none task for zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); when = time_now() + never; break; default: worker->working_with = TASK_NONE; /* unknown task */ ods_log_warning("[%s[%i]] unknown task, trying full sign zone %s", worker2str(worker->type), worker->thread_num, task_who2str(task)); what = TASK_SIGNCONF; when = time_now(); break; } /* no error */ task->backoff = 0; if (task->interrupt != TASK_NONE && task->interrupt != what) { ods_log_debug("[%s[%i]] interrupt task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(what), task_who2str(task)); task->halted = what; task->halted_when = when; task->what = task->interrupt; task->when = time_now(); } else { ods_log_debug("[%s[%i]] next task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(what), task_who2str(task)); task->what = what; task->when = when; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->halted_when = 0; } /* backup the last successful run */ if (backup) { status = zone_backup2(zone); if (status != ODS_STATUS_OK) { ods_log_warning("[%s[%i]] unable to backup zone %s: %s", worker2str(worker->type), worker->thread_num, task_who2str(task), ods_status2str(status)); /* just a warning */ status = ODS_STATUS_OK; } backup = 0; } return; task_perform_fail: if (status != ODS_STATUS_XFR_NOT_READY) { /* other statuses is critical, and we know it is not ODS_STATUS_OK */ ods_log_crit("[%s[%i]] CRITICAL: failed to sign zone %s: %s", worker2str(worker->type), worker->thread_num, task_who2str(task), ods_status2str(status)); } /* in case of failure, also mark zone processed (for single run usage) */ zone->db->is_processed = 1; if (task->backoff) { task->backoff *= 2; } else { task->backoff = 60; } if (task->backoff > ODS_SE_MAX_BACKOFF) { task->backoff = ODS_SE_MAX_BACKOFF; } ods_log_info("[%s[%i]] backoff task %s for zone %s with %u seconds", worker2str(worker->type), worker->thread_num, task_what2str(task->what), task_who2str(task), task->backoff); task->when = time_now() + task->backoff; return; task_perform_continue: ods_log_info("[%s[%i]] continue task %s for zone %s", worker2str(worker->type), worker->thread_num, task_what2str(task->halted), task_who2str(task)); task->what = task->halted; task->when = task->halted_when; task->interrupt = TASK_NONE; task->halted = TASK_NONE; task->halted_when = 0; return; } /** * Work. * */ static void worker_work(worker_type* worker) { time_t now = 0; time_t timeout = 1; engine_type* engine = NULL; zone_type* zone = NULL; ods_status status = ODS_STATUS_OK; ods_log_assert(worker); ods_log_assert(worker->type == WORKER_WORKER); engine = (engine_type*) worker->engine; while (worker->need_to_exit == 0) { ods_log_debug("[%s[%i]] report for duty", worker2str(worker->type), worker->thread_num); now = time_now(); lock_basic_lock(&engine->taskq->schedule_lock); worker->task = schedule_pop_task(engine->taskq); if (worker->task) { worker->working_with = worker->task->what; lock_basic_unlock(&engine->taskq->schedule_lock); zone = (zone_type*) worker->task->zone; lock_basic_lock(&zone->zone_lock); ods_log_debug("[%s[%i]] start working on zone %s", worker2str(worker->type), worker->thread_num, zone->name); worker->clock_in = time(NULL); worker_perform_task(worker); zone->task = worker->task; ods_log_debug("[%s[%i]] finished working on zone %s", worker2str(worker->type), worker->thread_num, zone->name); lock_basic_lock(&engine->taskq->schedule_lock); worker->task = NULL; worker->working_with = TASK_NONE; status = schedule_task(engine->taskq, zone->task, 1); if (status != ODS_STATUS_OK) { ods_log_error("[%s[%i]] unable to schedule task for zone %s: " "%s", worker2str(worker->type), worker->thread_num, zone->name, ods_status2str(status)); } lock_basic_unlock(&engine->taskq->schedule_lock); lock_basic_unlock(&zone->zone_lock); timeout = 1; /** Do we need to tell the engine that we require a reload? */ lock_basic_lock(&engine->signal_lock); if (engine->need_to_reload) { lock_basic_alarm(&engine->signal_cond); } lock_basic_unlock(&engine->signal_lock); } else { ods_log_debug("[%s[%i]] nothing to do", worker2str(worker->type), worker->thread_num); worker->task = schedule_get_first_task(engine->taskq); lock_basic_unlock(&engine->taskq->schedule_lock); if (worker->task && !engine->taskq->loading) { timeout = (worker->task->when - now); } else { timeout *= 2; } if (timeout > ODS_SE_MAX_BACKOFF) { timeout = ODS_SE_MAX_BACKOFF; } worker->task = NULL; worker_sleep(worker, timeout); } } return; } /** * Drudge. * */ static void worker_drudge(worker_type* worker) { engine_type* engine = NULL; zone_type* zone = NULL; task_type* task = NULL; rrset_type* rrset = NULL; ods_status status = ODS_STATUS_OK; worker_type* superior = NULL; hsm_ctx_t* ctx = NULL; ods_log_assert(worker); ods_log_assert(worker->engine); ods_log_assert(worker->type == WORKER_DRUDGER); engine = (engine_type*) worker->engine; while (worker->need_to_exit == 0) { ods_log_deeebug("[%s[%i]] report for duty", worker2str(worker->type), worker->thread_num); /* initialize */ superior = NULL; zone = NULL; task = NULL; /* get item */ lock_basic_lock(&engine->signq->q_lock); rrset = (rrset_type*) fifoq_pop(engine->signq, &superior); if (!rrset) { ods_log_deeebug("[%s[%i]] nothing to do, wait", worker2str(worker->type), worker->thread_num); /** * Apparently the queue is empty. Wait until new work is queued. * The drudger will release the signq lock while sleeping and * will automatically grab the lock when the threshold is reached. * Threshold is at 1 and MAX (after a number of tries). */ lock_basic_sleep(&engine->signq->q_threshold, &engine->signq->q_lock, 0); rrset = (rrset_type*) fifoq_pop(engine->signq, &superior); } lock_basic_unlock(&engine->signq->q_lock); /* do some work */ if (rrset) { ods_log_assert(superior); if (!ctx) { ods_log_debug("[%s[%i]] create hsm context", worker2str(worker->type), worker->thread_num); ctx = hsm_create_context(); } if (!ctx) { ods_log_crit("[%s[%i]] error creating libhsm context", worker2str(worker->type), worker->thread_num); engine->need_to_reload = 1; lock_basic_lock(&superior->worker_lock); superior->jobs_failed++; lock_basic_unlock(&superior->worker_lock); } else { ods_log_assert(ctx); lock_basic_lock(&superior->worker_lock); task = superior->task; ods_log_assert(task); zone = task->zone; lock_basic_unlock(&superior->worker_lock); ods_log_assert(zone); ods_log_assert(zone->apex); ods_log_assert(zone->signconf); worker->clock_in = time(NULL); status = rrset_sign(ctx, rrset, superior->clock_in); lock_basic_lock(&superior->worker_lock); if (status == ODS_STATUS_OK) { superior->jobs_completed++; } else { superior->jobs_failed++; } lock_basic_unlock(&superior->worker_lock); } if (worker_fulfilled(superior) && superior->sleeping) { ods_log_deeebug("[%s[%i]] wake up superior[%u], work is " "done", worker2str(worker->type), worker->thread_num, superior->thread_num); worker_wakeup(superior); } superior = NULL; rrset = NULL; } /* done work */ } /* wake up superior */ if (superior && superior->sleeping) { ods_log_deeebug("[%s[%i]] wake up superior[%u], i am exiting", worker2str(worker->type), worker->thread_num, superior->thread_num); worker_wakeup(superior); } /* cleanup open HSM sessions */ if (ctx) { hsm_destroy_context(ctx); } return; } /** * Start worker. * */ void worker_start(worker_type* worker) { ods_log_assert(worker); switch (worker->type) { case WORKER_DRUDGER: worker_drudge(worker); break; case WORKER_WORKER: worker_work(worker); break; default: ods_log_error("[worker] illegal worker (id=%i)", worker->type); break; } return; } /** * Put worker to sleep. * */ void worker_sleep(worker_type* worker, time_t timeout) { ods_log_assert(worker); if (!worker->need_to_exit) { lock_basic_lock(&worker->worker_lock); worker->sleeping = 1; lock_basic_sleep(&worker->worker_alarm, &worker->worker_lock, timeout); lock_basic_unlock(&worker->worker_lock); } return; } /** * Put worker to sleep unless worker has measured up to all appointed jobs. * */ void worker_sleep_unless(worker_type* worker, time_t timeout) { ods_log_assert(worker); lock_basic_lock(&worker->worker_lock); while (!worker->need_to_exit && !worker_fulfilled(worker)) { worker->sleeping = 1; lock_basic_sleep(&worker->worker_alarm, &worker->worker_lock, timeout); ods_log_debug("[%s[%i]] somebody poked me, check completed jobs %u " "appointed, %u completed, %u failed", worker2str(worker->type), worker->thread_num, worker->jobs_appointed, worker->jobs_completed, worker->jobs_failed); } lock_basic_unlock(&worker->worker_lock); return; } /** * Wake up worker. * */ void worker_wakeup(worker_type* worker) { ods_log_assert(worker); if (worker && worker->sleeping && !worker->waiting) { ods_log_debug("[%s[%i]] wake up", worker2str(worker->type), worker->thread_num); lock_basic_lock(&worker->worker_lock); lock_basic_alarm(&worker->worker_alarm); worker->sleeping = 0; lock_basic_unlock(&worker->worker_lock); } return; } /** * Worker waiting. * */ void worker_wait_timeout(lock_basic_type* lock, cond_basic_type* condition, time_t timeout) { lock_basic_lock(lock); lock_basic_sleep(condition, lock, timeout); lock_basic_unlock(lock); return; } /** * Worker waiting. * */ void worker_wait(lock_basic_type* lock, cond_basic_type* condition) { worker_wait_timeout(lock, condition, 0); return; } /** * Notify a worker. * */ void worker_notify(lock_basic_type* lock, cond_basic_type* condition) { lock_basic_lock(lock); lock_basic_alarm(condition); lock_basic_unlock(lock); return; } /** * Notify all workers. * */ void worker_notify_all(lock_basic_type* lock, cond_basic_type* condition) { lock_basic_lock(lock); lock_basic_broadcast(condition); lock_basic_unlock(lock); return; } /** * Clean up worker. * */ void worker_cleanup(worker_type* worker) { allocator_type* allocator; cond_basic_type worker_cond; lock_basic_type worker_lock; if (!worker) { return; } allocator = worker->allocator; worker_cond = worker->worker_alarm; worker_lock = worker->worker_lock; allocator_deallocate(allocator, (void*) worker); lock_basic_destroy(&worker_lock); lock_basic_off(&worker_cond); return; } opendnssec-1.4.9/signer/src/daemon/worker.h0000644000175000017500000000772712650165732015636 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * The hard workers. * */ #ifndef DAEMON_WORKER_H #define DAEMON_WORKER_H #include "scheduler/task.h" #include "shared/allocator.h" #include "shared/locks.h" #include enum worker_enum { WORKER_NONE = 0, WORKER_WORKER = 1, WORKER_DRUDGER }; typedef enum worker_enum worker_id; typedef struct worker_struct worker_type; struct worker_struct { allocator_type* allocator; int thread_num; ods_thread_type thread_id; void* engine; task_type* task; task_id working_with; worker_id type; time_t clock_in; size_t jobs_appointed; size_t jobs_completed; size_t jobs_failed; cond_basic_type worker_alarm; lock_basic_type worker_lock; unsigned sleeping : 1; unsigned waiting : 1; unsigned need_to_exit : 1; }; /** * Create worker. * \param[in] allocator memory allocator * \param[in] num thread number * \param[in] type type of worker * \return worker_type* created worker * */ worker_type* worker_create(allocator_type* allocator, int num, worker_id type); /** * Start working. * \param[in] worker worker to start working * */ void worker_start(worker_type* worker); /** * Put worker to sleep. * \param[in] worker put this worker to sleep * \param[in] timeout time before alarm clock is going off, * 0 means no alarm clock is set. * */ void worker_sleep(worker_type* worker, time_t timeout); /** * Put worker to sleep unless the worker has measured up to all * appointed jobs. * \param[in] worker put this worker to sleep * \param[in] timeout time before alarm clock is going off, * 0 means no alarm clock is set. * */ void worker_sleep_unless(worker_type* worker, time_t timeout); /** * Wake up worker. * \param[in] worker wake up this worker * */ void worker_wakeup(worker_type* worker); /** * Let worker wait. * \param[in] lock lock to use * \param[in] condition condition to be met * */ void worker_wait(lock_basic_type* lock, cond_basic_type* condition); /** * Let worker wait. * \param[in] lock lock to use * \param[in] condition condition to be met * */ void worker_wait_timeout(lock_basic_type* lock, cond_basic_type* condition, time_t timeout); /** * Notify a worker. * \param[in] lock lock to use * \param[in] condition condition that has been met * */ void worker_notify(lock_basic_type* lock, cond_basic_type* condition); /** * Notify all workers. * \param[in] lock lock to use * \param[in] condition condition that has been met * */ void worker_notify_all(lock_basic_type* lock, cond_basic_type* condition); /** * Clean up worker. * \param[in] worker worker to clean up * */ void worker_cleanup(worker_type* worker); #endif /* DAEMON_WORKER_H */ opendnssec-1.4.9/signer/src/wire/0000755000175000017500000000000012650166152013717 500000000000000opendnssec-1.4.9/signer/src/wire/listener.h0000644000175000017500000000636712650165732015654 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Listener. * */ #ifndef WIRE_LISTENER_H #define WIRE_LISTENER_H #include "config.h" #include "shared/allocator.h" #include #include #include #include #include #include #include #include #include #include #include #include #define DNS_PORT_STRING "53" #define INBUF_SIZE 4096 /* max size for incoming queries */ #define MAX_INTERFACES 32 /** * Access control. * */ union acl_addr_storage { struct in_addr addr; struct in6_addr addr6; }; /** * Interface. * */ typedef struct interface_struct interface_type; struct interface_struct { char* port; char* address; int family; union acl_addr_storage addr; }; /** * Listener. * */ typedef struct listener_struct listener_type; struct listener_struct { allocator_type* allocator; interface_type* interfaces; size_t count; }; /** * Create listener. * \param[in] allocator memory allocator * \return listener_type* listener * */ listener_type* listener_create(allocator_type* allocator); /** * Push an interface to the listener. * \param[in] listener listener * \param[in] address IP address * \param[in] family address family * \param[in] port port or NULL * \return interface_type* added interface * */ interface_type* listener_push(listener_type* list, char* address, int family, char* port); /** * Print listener. * \param[in] fd file descriptor * \param[in] listener listener to print * */ void listener_print(FILE* fd, listener_type* listener); /** * Log listener. * \param[in] listener listener * */ void listener_log(listener_type* listener); /** * Clean up interface. * \param[in] i interface * */ void interface_cleanup(interface_type* i); /** * Clean up listener. * \param[in] listener listener to clean up * */ void listener_cleanup(listener_type* listener); #endif /* WIRE_LISTENER_H */ opendnssec-1.4.9/signer/src/wire/axfr.h0000644000175000017500000000434212650165675014764 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * AXFR. * */ #ifndef WIRE_AXFR_H #define WIRE_AXFR_H #include "config.h" #include "daemon/engine.h" #include "wire/query.h" #include /* NSD values */ #define MAX_COMPRESSION_OFFSET 16383 /* Compression pointers are 14 bit. */ #define AXFR_MAX_MESSAGE_LEN MAX_COMPRESSION_OFFSET /** * Handle SOA request. * \param[in] q soa request * \param[in] engine signer engine * \return query_state state of the query * */ query_state soa_request(query_type* q, engine_type* engine); /** * Do AXFR. * \param[in] q axfr request * \param[in] engine signer engine * \param[in] fallback fallback from ixfr? * \return query_state state of the query * */ query_state axfr(query_type* q, engine_type* engine, int fallback); /** * Do IXFR. * \param[in] q ixfr request * \param[in] engine signer engine * \return query_state state of the query * */ query_state ixfr(query_type* q, engine_type* engine); #endif /* WIRE_AXFR_H */ opendnssec-1.4.9/signer/src/wire/tcpset.h0000644000175000017500000000672712650165732015331 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * TCP connections. * */ #ifndef WIRE_TCPSET_H #define WIRE_TCPSET_H #include "config.h" #include "shared/allocator.h" #include "wire/buffer.h" #include "wire/xfrd.h" #include #define TCPSET_MAX 50 /** * tcp connection. * */ typedef struct tcp_conn_struct tcp_conn_type; struct tcp_conn_struct { int fd; /* how many bytes have been read/written - total, incl. tcp length bytes */ uint32_t total_bytes; /* msg len bytes */ uint16_t msglen; /* packet buffer of connection */ buffer_type* packet; /* state: reading or writing */ unsigned is_reading : 1; }; /* * Set of tcp connections. * */ typedef struct tcp_set_struct tcp_set_type; struct tcp_set_struct { tcp_conn_type* tcp_conn[TCPSET_MAX]; xfrd_type* tcp_waiting_first; xfrd_type* tcp_waiting_last; size_t tcp_count; }; /** * Create a tcp connection. * \param[in] allocator memory allocator * \return tcp_conn_type* TCP connection. * */ tcp_conn_type* tcp_conn_create(allocator_type* allocator); /** * Create a set of tcp connections. * \param[in] allocator memory allocator * \return tcp_set_type* set of tcp connection. * */ tcp_set_type* tcp_set_create(allocator_type* allocator); /** * Make tcp connection ready for reading. * \param[in] tcp tcp connection * */ void tcp_conn_ready(tcp_conn_type* tcp); /* * Read from a tcp connection. * On first call, make sure total_bytes = 0, msglen=0, buffer clear, * and the packet and fd need to be set. * \param[in] tcp tcp connection * \return int -1 on error, * 0 on short read, * 1 on completed read. * */ int tcp_conn_read(tcp_conn_type* tcp); /* * Write to a tcp connection. * On first call, make sure total_bytes=0, msglen=limit, buffer filled, * and the packet and fd need to be set. * \param[in] tcp tcp connection * \return int -1 on error, * 0 on short write, * 1 on completed write. * */ int tcp_conn_write(tcp_conn_type* tcp); /** * Clean up set of tcp connections. * \param[in] set set of tcp connections * \param[in] allocator memory allocator * */ void tcp_set_cleanup(tcp_set_type* set, allocator_type* allocator); #endif /* WIRE_TCPSET_H */ opendnssec-1.4.9/signer/src/wire/edns.h0000644000175000017500000000621712650165732014752 00000000000000/* * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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. * */ /** * EDNS. * */ #ifndef WIRE_EDNS_H #define WIRE_EDNS_H #include "config.h" #include "shared/allocator.h" #include "wire/buffer.h" #include #define OPT_LEN 9U /* length of the NSD EDNS response record minus 2 */ #define OPT_RDATA 2 /* holds the rdata length comes after OPT_LEN */ #define DNSSEC_OK_MASK 0x8000U /* do bit mask */ #define EDNS_MAX_MESSAGE_LEN 4096 /** * EDNS data. * */ typedef struct edns_data_struct edns_data_type; struct edns_data_struct { unsigned char ok[OPT_LEN]; unsigned char error[OPT_LEN]; unsigned char rdata_none[OPT_RDATA]; }; /** * EDNS status. * */ enum edns_status_enum { EDNS_NOT_PRESENT, EDNS_OK, EDNS_ERROR }; typedef enum edns_status_enum edns_status; /** * EDNS RR. * */ typedef struct edns_rr_struct edns_rr_type; struct edns_rr_struct { allocator_type* allocator; edns_status status; size_t position; size_t maxlen; int dnssec_ok; }; /** * Initialize EDNS. * \param[in] data EDNS data. * \param[in] max_length maximum length. * */ void edns_init(edns_data_type* data, uint16_t max_length); /** * Create new EDNS RR. * \param[in] allocator memory allocator. * \return edns_rr_type* EDNS RR. * */ edns_rr_type* edns_rr_create(allocator_type* allocator); /** * Reset EDNS OPT RR. * \param[in] err EDNS record. * */ void edns_rr_reset(edns_rr_type* err); /** * Parse EDNS OPT RR. * \param[in] err EDNS record. * \param[in] buffer packet buffer. * \return int 1 if EDNS and valid, 0 otherwise. * */ int edns_rr_parse(edns_rr_type* err, buffer_type* buffer); /** * The amount of space to reserve in the response for the EDNS data. * \param[in] err EDNS record. * \return size_t amount of space to reserve. * */ size_t edns_rr_reserved_space(edns_rr_type* err); #endif /* WIRE_EDNS_H */ opendnssec-1.4.9/signer/src/wire/netio.c0000644000175000017500000002343312650165732015131 00000000000000/* * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * See LICENSE for the license. * */ #include #include #include #include #include #include #include "shared/log.h" #include "wire/netio.h" #ifndef HAVE_PSELECT int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, const struct timespec* timeout, const sigset_t* sigmask); #else #include #endif /* One second is 1e9 nanoseconds. */ #define NANOSECONDS_PER_SECOND 1000000000L static const char* netio_str = "netio"; /* * Create a new netio instance. * \return netio_type* netio instance * */ netio_type* netio_create(allocator_type* allocator) { netio_type* netio = NULL; if (!allocator) { return NULL; } netio = (netio_type*) allocator_alloc(allocator, sizeof(netio_type)); netio->allocator = allocator; netio->handlers = NULL; netio->deallocated = NULL; netio->dispatch_next = NULL; return netio; } /* * Add a new handler to netio. * */ void netio_add_handler(netio_type* netio, netio_handler_type* handler) { netio_handler_list_type* l = NULL; if (!netio || !handler) { return; } if (netio->deallocated) { l = netio->deallocated; netio->deallocated = l->next; } else { ods_log_assert(netio->allocator); l = (netio_handler_list_type*) allocator_alloc(netio->allocator, sizeof(netio_handler_list_type)); } l->next = netio->handlers; l->handler = handler; netio->handlers = l; ods_log_debug("[%s] handler added", netio_str); return; } /* * Remove the handler from netio. * */ void netio_remove_handler(netio_type* netio, netio_handler_type* handler) { netio_handler_list_type** lptr; if (!netio || !handler) { return; } for (lptr = &netio->handlers; *lptr; lptr = &(*lptr)->next) { if ((*lptr)->handler == handler) { netio_handler_list_type* next = (*lptr)->next; if ((*lptr) == netio->dispatch_next) netio->dispatch_next = next; (*lptr)->handler = NULL; (*lptr)->next = netio->deallocated; netio->deallocated = *lptr; *lptr = next; break; } } ods_log_debug("[%s] handler removed", netio_str); return; } /* * Convert timeval to timespec. * */ static void timeval_to_timespec(struct timespec* left, const struct timeval* right) { left->tv_sec = right->tv_sec; left->tv_nsec = 1000 * right->tv_usec; return; } /** * Compare timespec. * */ static int timespec_compare(const struct timespec* left, const struct timespec* right) { if (left->tv_sec < right->tv_sec) { return -1; } else if (left->tv_sec > right->tv_sec) { return 1; } else if (left->tv_nsec < right->tv_nsec) { return -1; } else if (left->tv_nsec > right->tv_nsec) { return 1; } return 0; } /** * Add timespecs. * */ void timespec_add(struct timespec* left, const struct timespec* right) { left->tv_sec += right->tv_sec; left->tv_nsec += right->tv_nsec; if (left->tv_nsec >= NANOSECONDS_PER_SECOND) { ++left->tv_sec; left->tv_nsec -= NANOSECONDS_PER_SECOND; } return; } /** * Substract timespecs. * */ static void timespec_subtract(struct timespec* left, const struct timespec* right) { left->tv_sec -= right->tv_sec; left->tv_nsec -= right->tv_nsec; if (left->tv_nsec < 0L) { --left->tv_sec; left->tv_nsec += NANOSECONDS_PER_SECOND; } return; } /* * Retrieve the current time (using gettimeofday(2)). * */ const struct timespec* netio_current_time(netio_type* netio) { struct timeval current_timeval; ods_log_assert(netio); if (!netio->have_current_time) { if (gettimeofday(¤t_timeval, NULL) == -1) { ods_log_crit("[%s] unable to get current time: " "gettimeofday() failed (%s)", netio_str, strerror(errno)); abort(); } timeval_to_timespec(&netio->cached_current_time, ¤t_timeval); netio->have_current_time = 1; } return &netio->cached_current_time; } /* * Check for events and dispatch them to the handlers. * */ int netio_dispatch(netio_type* netio, const struct timespec* timeout, const sigset_t* sigmask) { fd_set readfds, writefds, exceptfds; int max_fd; int have_timeout = 0; struct timespec minimum_timeout; netio_handler_type* timeout_handler = NULL; netio_handler_list_type* l = NULL; int rc = 0; int result = 0; if (!netio || !netio->handlers) { return 0; } /* Clear the cached current time */ netio->have_current_time = 0; /* Initialize the minimum timeout with the timeout parameter */ if (timeout) { have_timeout = 1; memcpy(&minimum_timeout, timeout, sizeof(struct timespec)); } /* Initialize the fd_sets and timeout based on the handler * information */ max_fd = -1; FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); for (l = netio->handlers; l; l = l->next) { netio_handler_type* handler = l->handler; if (handler->fd >= 0 && handler->fd < (int) FD_SETSIZE) { if (handler->fd > max_fd) { max_fd = handler->fd; } if (handler->event_types & NETIO_EVENT_READ) { FD_SET(handler->fd, &readfds); } if (handler->event_types & NETIO_EVENT_WRITE) { FD_SET(handler->fd, &writefds); } if (handler->event_types & NETIO_EVENT_EXCEPT) { FD_SET(handler->fd, &exceptfds); } } if (handler->timeout && (handler->event_types & NETIO_EVENT_TIMEOUT)) { struct timespec relative; relative.tv_sec = handler->timeout->tv_sec; relative.tv_nsec = handler->timeout->tv_nsec; timespec_subtract(&relative, netio_current_time(netio)); if (!have_timeout || timespec_compare(&relative, &minimum_timeout) < 0) { have_timeout = 1; minimum_timeout.tv_sec = relative.tv_sec; minimum_timeout.tv_nsec = relative.tv_nsec; timeout_handler = handler; } } } if (have_timeout && minimum_timeout.tv_sec < 0) { /* * On negative timeout for a handler, immediately * dispatch the timeout event without checking for other events. */ ods_log_debug("[%s] dispatch timeout event without checking for " "other events", netio_str); if (timeout_handler && (timeout_handler->event_types & NETIO_EVENT_TIMEOUT)) { timeout_handler->event_handler(netio, timeout_handler, NETIO_EVENT_TIMEOUT); } return result; } /* Check for events. */ rc = pselect(max_fd + 1, &readfds, &writefds, &exceptfds, have_timeout ? &minimum_timeout : NULL, sigmask); if (rc == -1) { if(errno == EINVAL || errno == EACCES || errno == EBADF) { ods_fatal_exit("[%s] fatal error pselect: %s", netio_str, strerror(errno)); } return -1; } /* Clear the cached current_time (pselect(2) may block for * some time so the cached value is likely to be old). */ netio->have_current_time = 0; if (rc == 0) { ods_log_debug("[%s] no events before the minimum timeout " "expired", netio_str); /* * No events before the minimum timeout expired. * Dispatch to handler if interested. */ if (timeout_handler && (timeout_handler->event_types & NETIO_EVENT_TIMEOUT)) { timeout_handler->event_handler(netio, timeout_handler, NETIO_EVENT_TIMEOUT); } } else { /* * Dispatch all the events to interested handlers * based on the fd_sets. Note that a handler might * deinstall itself, so store the next handler before * calling the current handler! */ ods_log_assert(netio->dispatch_next == NULL); for (l = netio->handlers; l && rc; ) { netio_handler_type* handler = l->handler; netio->dispatch_next = l->next; if (handler->fd >= 0 && handler->fd < (int) FD_SETSIZE) { netio_events_type event_types = NETIO_EVENT_NONE; if (FD_ISSET(handler->fd, &readfds)) { event_types |= NETIO_EVENT_READ; FD_CLR(handler->fd, &readfds); rc--; } if (FD_ISSET(handler->fd, &writefds)) { event_types |= NETIO_EVENT_WRITE; FD_CLR(handler->fd, &writefds); rc--; } if (FD_ISSET(handler->fd, &exceptfds)) { event_types |= NETIO_EVENT_EXCEPT; FD_CLR(handler->fd, &exceptfds); rc--; } if (event_types & handler->event_types) { handler->event_handler(netio, handler, event_types & handler->event_types); ++result; } } l = netio->dispatch_next; } netio->dispatch_next = NULL; } return result; } /** * Clean up netio instance * */ void netio_cleanup(netio_type* netio) { allocator_type* allocator = NULL; if (!netio) { return; } allocator = netio->allocator; allocator_deallocate(allocator, (void*)netio->handlers); allocator_deallocate(allocator, (void*)netio->deallocated); allocator_deallocate(allocator, (void*)netio); return; } opendnssec-1.4.9/signer/src/wire/listener.c0000644000175000017500000001450112650165732015634 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Listener. * */ #include "config.h" #include "shared/log.h" #include "wire/listener.h" static const char* listener_str = "listener"; /** * Create listener. * */ listener_type* listener_create(allocator_type* allocator) { listener_type* listener = NULL; if (!allocator) { return NULL; } listener = (listener_type*) allocator_alloc(allocator, sizeof(listener_type)); if (!listener) { ods_log_error("[%s] create listener failed: allocator_alloc() failed", listener_str); return NULL; } listener->allocator = allocator; listener->count = 0; listener->interfaces = NULL; return listener; } /** * Push an interface to the listener. * */ interface_type* listener_push(listener_type* listener, char* address, int family, char* port) { interface_type* ifs_old = NULL; ods_log_assert(listener); ods_log_assert(address); ifs_old = listener->interfaces; listener->interfaces = (interface_type*) allocator_alloc( listener->allocator, (listener->count + 1) * sizeof(interface_type)); if (!listener->interfaces) { ods_fatal_exit("[%s] fatal unable to add interface: allocator_alloc() failed", listener_str); } if (ifs_old) { memcpy(listener->interfaces, ifs_old, (listener->count) * sizeof(interface_type)); } allocator_deallocate(listener->allocator, (void*) ifs_old); listener->count++; listener->interfaces[listener->count -1].address = allocator_strdup(listener->allocator, address); listener->interfaces[listener->count -1].family = family; if (port) { listener->interfaces[listener->count -1].port = allocator_strdup(listener->allocator, port); } else{ listener->interfaces[listener->count -1].port = NULL; } memset(&listener->interfaces[listener->count -1].addr, 0, sizeof(union acl_addr_storage)); if (listener->interfaces[listener->count -1].family == AF_INET6 && strlen(listener->interfaces[listener->count -1].address) > 0) { if (inet_pton(listener->interfaces[listener->count -1].family, listener->interfaces[listener->count -1].address, &listener->interfaces[listener->count -1].addr.addr6) != 1) { ods_log_error("[%s] bad ip address '%s'", listener->interfaces[listener->count -1].address); return NULL; } } else if (listener->interfaces[listener->count -1].family == AF_INET && strlen(listener->interfaces[listener->count -1].address) > 0) { if (inet_pton(listener->interfaces[listener->count -1].family, listener->interfaces[listener->count -1].address, &listener->interfaces[listener->count -1].addr.addr) != 1) { ods_log_error("[%s] bad ip address '%s'", listener->interfaces[listener->count -1].address); return NULL; } } return &listener->interfaces[listener->count -1]; } /** * Print interface. * */ static void interface_print(FILE* fd, interface_type* i) { if (!fd || !i) { return; } fprintf(fd, ""); if (i->family == AF_INET && i->address) { fprintf(fd, "%s", i->address); } else if (i->family == AF_INET6 && i->address) { fprintf(fd, "%s", i->address); } if (i->port) { fprintf(fd, "%s", i->port); } fprintf(fd, "\n"); return; } /** * Print listener. * */ void listener_print(FILE* fd, listener_type* listener) { uint16_t i = 0; if (!fd || !listener || listener->count <= 0) { return; } fprintf(fd, "\n"); for (i=0; i < listener->count; i++) { interface_print(fd, &listener->interfaces[i]); } fprintf(fd, "\n"); return; } /** * Log interface. * */ static void interface_log(interface_type* i) { if (!i) { return; } ods_log_debug("[%s] FAMILY[%s] ADDRESS[%s] PORT[%s]", listener_str, i->family==AF_INET6?"IPv6":"IPv4", i->address?i->address:"localhost", i->port?i->port:DNS_PORT_STRING); return; } /** * Log listener. * */ void listener_log(listener_type* listener) { uint16_t i = 0; if (!listener || listener->count <= 0) { return; } for (i=0; i < listener->count; i++) { interface_log(&listener->interfaces[i]); } return; } /** * Clean up interface. * */ void interface_cleanup(interface_type* i) { if (!i) { return; } free((void*)i->port); free((void*)i->address); return; } /** * Clean up listener. * */ void listener_cleanup(listener_type* listener) { uint16_t i = 0; allocator_type* allocator = NULL; if (!listener) { return; } for (i=0; i < listener->count; i++) { interface_cleanup(&listener->interfaces[i]); } allocator = listener->allocator; allocator_deallocate(allocator, (void*) listener->interfaces); allocator_deallocate(allocator, (void*) listener); return; } opendnssec-1.4.9/signer/src/wire/xfrd.c0000644000175000017500000021367112650165732014763 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Zone transfers. * */ #include "config.h" #include "daemon/engine.h" #include "daemon/xfrhandler.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "signer/backup.h" #include "signer/domain.h" #include "signer/zone.h" #include "wire/tcpset.h" #include "wire/xfrd.h" #include #include #define XFRD_TSIG_MAX_UNSIGNED 100 static const char* xfrd_str = "xfrd"; static void xfrd_handle_zone(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); static void xfrd_make_request(xfrd_type* xfrd); static socklen_t xfrd_acl_sockaddr(acl_type* acl, unsigned int port, struct sockaddr_storage *sck); static void xfrd_write_soa(xfrd_type* xfrd, buffer_type* buffer); static int xfrd_parse_soa(xfrd_type* xfrd, buffer_type* buffer, unsigned rdata_only, unsigned update, uint32_t t, uint32_t* serial); static ods_status xfrd_parse_rrs(xfrd_type* xfrd, buffer_type* buffer, uint16_t count, int* done); static xfrd_pkt_status xfrd_parse_packet(xfrd_type* xfrd, buffer_type* buffer); static xfrd_pkt_status xfrd_handle_packet(xfrd_type* xfrd, buffer_type* buffer); static void xfrd_tcp_obtain(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_read(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_release(xfrd_type* xfrd, tcp_set_type* set, int open_waiting); static void xfrd_tcp_write(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_tcp_xfr(xfrd_type* xfrd, tcp_set_type* set); static int xfrd_tcp_open(xfrd_type* xfrd, tcp_set_type* set); static void xfrd_udp_obtain(xfrd_type* xfrd); static void xfrd_udp_read(xfrd_type* xfrd); static void xfrd_udp_release(xfrd_type* xfrd); static int xfrd_udp_read_packet(xfrd_type* xfrd); static int xfrd_udp_send(xfrd_type* xfrd, buffer_type* buffer); static int xfrd_udp_send_request_ixfr(xfrd_type* xfrd); static time_t xfrd_time(xfrd_type* xfrd); static void xfrd_set_timer(xfrd_type* xfrd, time_t t); static void xfrd_set_timer_time(xfrd_type* xfrd, time_t t); static void xfrd_unset_timer(xfrd_type* xfrd); /** * Recover transfer variables. * */ static uint8_t xfrd_recover_dname(uint8_t* dname, const char* name) { const uint8_t *s = (const uint8_t *) name; uint8_t *h; uint8_t *p; uint8_t *d = dname; size_t label_length; if (strcmp(name, ".") == 0) { /* Root domain. */ dname[0] = 0; return 1; } for (h = d, p = h + 1; *s; ++s, ++p) { if (p - dname >= MAXDOMAINLEN) { return 0; } switch (*s) { case '.': if (p == h + 1) { /* Empty label. */ return 0; } else { label_length = p - h - 1; if (label_length > MAXLABELLEN) { return 0; } *h = label_length; h = p; } break; case '\\': /* Handle escaped characters (RFC1035 5.1) */ if (isdigit(s[1]) && isdigit(s[2]) && isdigit(s[3])) { int val = (ldns_hexdigit_to_int(s[1]) * 100 + ldns_hexdigit_to_int(s[2]) * 10 + ldns_hexdigit_to_int(s[3])); if (0 <= val && val <= 255) { s += 3; *p = val; } else { *p = *++s; } } else if (s[1] != '\0') { *p = *++s; } break; default: *p = *s; break; } } if (p != h + 1) { /* Terminate last label. */ label_length = p - h - 1; if (label_length > MAXLABELLEN) { return 0; } *h = label_length; h = p; } /* Add root label. */ *h = 0; return p-dname; } /** * Recover transfer variables. * */ static void xfrd_recover(xfrd_type* xfrd) { zone_type* zone = (zone_type*) xfrd->zone; char* file = NULL; FILE* fd = NULL; int round_num = 0; int master_num = 0; int next_master = 0; uint32_t timeout = 0; uint32_t serial_xfr = 0; uint32_t serial_notify = 0; uint32_t serial_disk = 0; time_t serial_xfr_acquired = 0; time_t serial_notify_acquired = 0; time_t serial_disk_acquired = 0; uint32_t soa_ttl = 0; uint32_t soa_serial = 0; uint32_t soa_refresh = 0; uint32_t soa_retry = 0; uint32_t soa_expire = 0; uint32_t soa_minimum = 0; const char* soa_mname = NULL; const char* soa_rname = NULL; if (zone && zone->name && zone->db && zone->db->is_initialized && zone->db->have_serial) { file = ods_build_path(zone->name, ".xfrd-state", 0, 1); if (file) { ods_log_verbose("[%s] recover xfrd.state file %s zone %s", xfrd_str, file, zone->name); fd = ods_fopen(file, NULL, "r"); if (fd) { if (!backup_read_check_str(fd, ODS_SE_FILE_MAGIC_V3)) { ods_log_error("[%s] corrupted state file zone %s: read " "magic (start) error", xfrd_str, zone->name); goto xfrd_recover_error; } if (!backup_read_check_str(fd, ";;Zone:") | !backup_read_check_str(fd, "name") | !backup_read_check_str(fd, zone->name) | !backup_read_check_str(fd, "ttl") | !backup_read_uint32_t(fd, &soa_ttl) | !backup_read_check_str(fd, "mname") | !backup_read_str(fd, &soa_mname) | !backup_read_check_str(fd, "rname") | !backup_read_str(fd, &soa_rname) | !backup_read_check_str(fd, "serial") | !backup_read_uint32_t(fd, &soa_serial) | !backup_read_check_str(fd, "refresh") | !backup_read_uint32_t(fd, &soa_refresh) | !backup_read_check_str(fd, "retry") | !backup_read_uint32_t(fd, &soa_retry) | !backup_read_check_str(fd, "expire") | !backup_read_uint32_t(fd, &soa_expire) | !backup_read_check_str(fd, "minimum") | !backup_read_uint32_t(fd, &soa_minimum)) { ods_log_error("[%s] corrupted state file zone %s: read " ";;Zone error", xfrd_str, zone->name); goto xfrd_recover_error; } if (!backup_read_check_str(fd, ";;Master:") | !backup_read_check_str(fd, "num") | !backup_read_int(fd, &master_num) | !backup_read_check_str(fd, "next") | !backup_read_int(fd, &next_master) | !backup_read_check_str(fd, "round") | !backup_read_int(fd, &round_num) | !backup_read_check_str(fd, "timeout") | !backup_read_uint32_t(fd, &timeout)) { ods_log_error("[%s] corrupt state file zone %s: read " ";;Master error", xfrd_str, zone->name); goto xfrd_recover_error; } if (!backup_read_check_str(fd, ";;Serial:") | !backup_read_check_str(fd, "xfr") | !backup_read_uint32_t(fd, &serial_xfr) | !backup_read_time_t(fd, &serial_xfr_acquired) | !backup_read_check_str(fd, "notify") | !backup_read_uint32_t(fd, &serial_notify) | !backup_read_time_t(fd, &serial_notify_acquired) | !backup_read_check_str(fd, "disk") | !backup_read_uint32_t(fd, &serial_disk) | !backup_read_time_t(fd, &serial_disk_acquired)) { ods_log_error("[%s] corrupt state file zone %s: read " ";;Serial error", xfrd_str, zone->name); goto xfrd_recover_error; } if (!backup_read_check_str(fd, ODS_SE_FILE_MAGIC_V3)) { ods_log_error("[%s] corrupt state file zone %s: read " "magic (end) error", xfrd_str, zone->name); goto xfrd_recover_error; } /* all ok */ xfrd->master_num = master_num; xfrd->next_master = next_master; xfrd->round_num = round_num; xfrd->timeout.tv_sec = timeout; xfrd->timeout.tv_nsec = 0; xfrd->master = NULL; /* acl_find_num(...) */ xfrd->soa.ttl = soa_ttl; xfrd->soa.serial = soa_serial; xfrd->soa.refresh = soa_refresh; xfrd->soa.retry = soa_retry; xfrd->soa.expire = soa_expire; xfrd->soa.minimum = soa_minimum; xfrd->soa.mname[0] = xfrd_recover_dname(xfrd->soa.mname+1, soa_mname); xfrd->soa.rname[0] = xfrd_recover_dname(xfrd->soa.rname+1, soa_rname); xfrd->serial_xfr = serial_xfr; xfrd->serial_xfr_acquired = serial_xfr_acquired; xfrd->serial_notify = serial_notify; xfrd->serial_notify_acquired = serial_notify_acquired; xfrd->serial_disk = serial_disk; xfrd->serial_disk_acquired = serial_disk_acquired; if (!timeout || serial_notify_acquired || (serial_disk_acquired && (uint32_t)xfrd_time(xfrd) - serial_disk_acquired > soa_refresh)) { xfrd_set_timer_refresh(xfrd); } if (serial_disk_acquired && ((uint32_t)xfrd_time(xfrd) - serial_disk_acquired > soa_expire)) { xfrd_set_timer_refresh(xfrd); } xfrd_recover_error: free((void*)soa_mname); free((void*)soa_rname); ods_fclose(fd); } free(file); } } else { ods_log_verbose("[%s] did not recover xfrd.state file zone %s", xfrd_str, (zone && zone->name)?zone->name:"(null)"); } return; } /** * Create zone transfer structure. * */ xfrd_type* xfrd_create(void* xfrhandler, void* zone) { xfrd_type* xfrd = NULL; allocator_type* allocator = NULL; if (!xfrhandler || !zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create zone xfr structure: " "allocator_create() failed", xfrd_str); return NULL; } xfrd = (xfrd_type*) allocator_alloc(allocator, sizeof(xfrd_type)); if (!xfrd) { ods_log_error("[%s] unable to create zone xfr structure: " " allocator_alloc() failed", xfrd_str); allocator_cleanup(allocator); return NULL; } lock_basic_init(&xfrd->serial_lock); lock_basic_init(&xfrd->rw_lock); xfrd->allocator = allocator; xfrd->xfrhandler = xfrhandler; xfrd->zone = zone; xfrd->tcp_conn = -1; xfrd->round_num = -1; xfrd->master_num = 0; xfrd->next_master = -1; xfrd->master = NULL; lock_basic_lock(&xfrd->serial_lock); xfrd->serial_xfr = 0; xfrd->serial_disk = 0; xfrd->serial_notify = 0; xfrd->serial_xfr_acquired = 0; xfrd->serial_disk_acquired = 0; xfrd->serial_notify_acquired = 0; xfrd->serial_retransfer = 0; lock_basic_unlock(&xfrd->serial_lock); xfrd->query_id = 0; xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; xfrd->msg_do_retransfer = 0; xfrd->udp_waiting = 0; xfrd->udp_waiting_next = NULL; xfrd->tcp_waiting = 0; xfrd->tcp_waiting_next = NULL; xfrd->tsig_rr = tsig_rr_create(allocator); if (!xfrd->tsig_rr) { xfrd_cleanup(xfrd, 0); return NULL; } memset(&xfrd->soa, 0, sizeof(xfrd->soa)); xfrd->soa.ttl = 0; xfrd->soa.mname[0] = 1; xfrd->soa.rname[0] = 1; xfrd->soa.serial = 0; xfrd->soa.refresh = 3600; xfrd->soa.retry = 300; xfrd->soa.expire = 604800; xfrd->soa.minimum = 3600; xfrd->handler.fd = -1; xfrd->handler.user_data = (void*) xfrd; xfrd->handler.timeout = 0; xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; xfrd->handler.event_handler = xfrd_handle_zone; xfrd_set_timer_time(xfrd, 0); xfrd_recover(xfrd); return xfrd; } /** * Get time. * */ static time_t xfrd_time(xfrd_type* xfrd) { ods_log_assert(xfrd); ods_log_assert(xfrd->xfrhandler); return xfrhandler_time((xfrhandler_type*) xfrd->xfrhandler); } /** * Set timer. * */ static void xfrd_set_timer(xfrd_type* xfrd, time_t t) { if (!xfrd || !xfrd->xfrhandler) { return; } /** * Randomize the time, within 90%-100% of original. * Not later so zones cannot expire too late. */ if(t > xfrd_time(xfrd) + 10) { time_t extra = t - xfrd_time(xfrd); time_t base = extra*9/10; #ifdef HAVE_ARC4RANDOM_UNIFORM t = xfrd_time(xfrd) + base + arc4random_uniform(extra-base); #elif HAVE_ARC4RANDOM t = xfrd_time(xfrd) + base + arc4random()%(extra-base); #else t = xfrd_time(xfrd) + base + random()%(extra-base); #endif } xfrd->handler.timeout = &xfrd->timeout; xfrd->timeout.tv_sec = t; xfrd->timeout.tv_nsec = 0; return; } /** * Unset timer. * */ static void xfrd_unset_timer(xfrd_type* xfrd) { ods_log_assert(xfrd); xfrd->handler.timeout = NULL; return; } /** * Set timer timeout to time. * */ static void xfrd_set_timer_time(xfrd_type* xfrd, time_t t) { ods_log_assert(xfrd); xfrd_set_timer(xfrd, xfrd_time(xfrd) + t); return; } /** * Set timeout for zone transfer to now. * */ void xfrd_set_timer_now(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout now", xfrd_str, zone->name); xfrd_set_timer_time(xfrd, 0); return; } /** * Set timeout for zone transfer to RETRY. * */ void xfrd_set_timer_retry(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout retry %u", xfrd_str, zone->name, (unsigned) xfrd->soa.retry); xfrd_set_timer_time(xfrd, xfrd->soa.retry); return; } /** * Set timeout for zone transfer to REFRESH. * */ void xfrd_set_timer_refresh(xfrd_type* xfrd) { zone_type* zone = NULL; if (!xfrd || !xfrd->zone || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s sets timer timeout refresh %u", xfrd_str, zone->name, (unsigned) xfrd->soa.refresh); xfrd_set_timer_time(xfrd, xfrd->soa.refresh); return; } /** * Use acl address to setup sockaddr struct. * */ static socklen_t xfrd_acl_sockaddr(acl_type* acl, unsigned int port, struct sockaddr_storage *sck) { ods_log_assert(acl); ods_log_assert(sck); ods_log_assert(port); memset(sck, 0, sizeof(struct sockaddr_storage)); if (acl->family == AF_INET6) { struct sockaddr_in6* sa = (struct sockaddr_in6*)sck; sa->sin6_family = AF_INET6; sa->sin6_port = htons(port); sa->sin6_addr = acl->addr.addr6; return sizeof(struct sockaddr_in6); } else { struct sockaddr_in* sa = (struct sockaddr_in*)sck; sa->sin_family = AF_INET; sa->sin_port = htons(port); sa->sin_addr = acl->addr.addr; return sizeof(struct sockaddr_in); } return 0; } /** * Use acl address to setup remote sockaddr struct. * */ socklen_t xfrd_acl_sockaddr_to(acl_type* acl, struct sockaddr_storage *to) { unsigned int port = 0; if (!acl || !to) { return 0; } port = acl->port ? acl->port : (unsigned) atoi(DNS_PORT_STRING); return xfrd_acl_sockaddr(acl, port, to); } /** * Sign transfer request. * */ static void xfrd_tsig_sign(xfrd_type* xfrd, buffer_type* buffer) { tsig_algo_type* algo = NULL; if (!xfrd || !xfrd->tsig_rr || !xfrd->master || !xfrd->master->tsig || !xfrd->master->tsig->key || !buffer) { return; /* no tsig configured */ } algo = tsig_lookup_algo(xfrd->master->tsig->algorithm); if (!algo) { ods_log_error("[%s] unable to sign request: tsig unknown algorithm " "%s", xfrd_str, xfrd->master->tsig->algorithm); return; } ods_log_assert(algo); tsig_rr_reset(xfrd->tsig_rr, algo, xfrd->master->tsig->key); xfrd->tsig_rr->original_query_id = buffer_pkt_id(buffer); xfrd->tsig_rr->algo_name = ldns_rdf_clone(xfrd->tsig_rr->algo->wf_name); xfrd->tsig_rr->key_name = ldns_rdf_clone(xfrd->tsig_rr->key->dname); log_dname(xfrd->tsig_rr->key_name, "tsig sign query with key", LOG_DEBUG); log_dname(xfrd->tsig_rr->algo_name, "tsig sign query with algorithm", LOG_DEBUG); tsig_rr_prepare(xfrd->tsig_rr); tsig_rr_update(xfrd->tsig_rr, buffer, buffer_position(buffer)); tsig_rr_sign(xfrd->tsig_rr); ods_log_debug("[%s] tsig append rr to request id=%u", xfrd_str, buffer_pkt_id(buffer)); tsig_rr_append(xfrd->tsig_rr, buffer); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1); tsig_rr_prepare(xfrd->tsig_rr); return; } /** * Process TSIG in transfer. * */ static int xfrd_tsig_process(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; int have_tsig = 0; if (!xfrd || !xfrd->tsig_rr || !xfrd->master || !xfrd->master->tsig || !xfrd->master->tsig->key || !buffer) { return 1; /* no tsig configured */ } zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(xfrd->master->address); if (!tsig_rr_find(xfrd->tsig_rr, buffer)) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has malformed tsig rr", xfrd_str, zone->name, xfrd->master->address); return 0; } if (xfrd->tsig_rr->status == TSIG_OK) { have_tsig = 1; if (xfrd->tsig_rr->error_code != LDNS_RCODE_NOERROR) { ods_log_error("[%s] zone %s, from %s has tsig error (%s)", xfrd_str, zone->name, xfrd->master->address, tsig_strerror(xfrd->tsig_rr->error_code)); } /* strip the TSIG resource record off... */ buffer_set_limit(buffer, xfrd->tsig_rr->position); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)-1); } /* keep running the TSIG hash */ tsig_rr_update(xfrd->tsig_rr, buffer, buffer_limit(buffer)); if (have_tsig) { if (!tsig_rr_verify(xfrd->tsig_rr)) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has bad tsig signature", xfrd_str, zone->name, xfrd->master->address); return 0; } /* prepare for next tsigs */ tsig_rr_prepare(xfrd->tsig_rr); } else if (xfrd->tsig_rr->update_since_last_prepare > XFRD_TSIG_MAX_UNSIGNED) { /* we allow a number of non-tsig signed packets */ ods_log_error("[%s] unable to process tsig: xfr zone %s, from %s " "has too many consecutive packets without tsig", xfrd_str, zone->name, xfrd->master->address); return 0; } if (!have_tsig && xfrd->msg_seq_nr == 0) { ods_log_error("[%s] unable to process tsig: xfr zone %s from %s " "has no tsig in first packet of reply", xfrd_str, zone->name, xfrd->master->address); return 0; } /* process TSIG ok */ return 1; } /** * Commit answer on disk. * */ static void xfrd_commit_packet(xfrd_type* xfrd) { zone_type* zone = NULL; char* xfrfile = NULL; FILE* fd = NULL; time_t serial_disk_acq = 0; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; xfrfile = ods_build_path(zone->name, ".xfrd", 0, 1); if (!xfrfile) { ods_log_crit("[%s] unable to commit xfr zone %s: build path failed", xfrd_str, zone->name); return; } ods_log_assert(zone); ods_log_assert(zone->name); lock_basic_lock(&zone->zone_lock); lock_basic_lock(&xfrd->rw_lock); lock_basic_lock(&xfrd->serial_lock); /* mark end packet */ fd = ods_fopen(xfrfile, NULL, "a"); free((void*)xfrfile); if (fd) { fprintf(fd, ";;ENDPACKET\n"); ods_fclose(fd); } else { lock_basic_unlock(&xfrd->rw_lock); lock_basic_unlock(&zone->zone_lock); lock_basic_unlock(&xfrd->serial_lock); ods_log_crit("[%s] unable to commit xfr zone %s: ods_fopen() failed " "(%s)", xfrd_str, zone->name, strerror(errno)); return; } /* update soa serial management */ xfrd->serial_disk = xfrd->msg_new_serial; serial_disk_acq = xfrd->serial_disk_acquired; xfrd->serial_disk_acquired = xfrd_time(xfrd); /* ensure newer time */ if (xfrd->serial_disk_acquired == serial_disk_acq) { xfrd->serial_disk_acquired++; } xfrd->soa.serial = xfrd->serial_disk; if (xfrd->msg_do_retransfer || (util_serial_gt(xfrd->serial_disk, xfrd->serial_xfr) && xfrd->serial_disk_acquired > xfrd->serial_xfr_acquired)) { /* reschedule task */ int ret = 0; xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; engine_type* engine = (engine_type*) xfrhandler->engine; ods_log_assert(xfrhandler); ods_log_assert(engine); ods_log_debug("[%s] reschedule task for zone %s: disk serial=%u " "acquired=%u, memory serial=%u acquired=%u", xfrd_str, zone->name, xfrd->serial_disk, xfrd->serial_disk_acquired, xfrd->serial_xfr, xfrd->serial_xfr_acquired); ret = zone_reschedule_task(zone, engine->taskq, TASK_READ); if (ret != ODS_STATUS_OK) { ods_log_crit("[%s] unable to reschedule task for zone %s: %s", xfrd_str, zone->name, ods_status2str(ret)); } else { engine_wakeup_workers(engine); } } /* reset retransfer */ xfrd->msg_do_retransfer = 0; lock_basic_unlock(&xfrd->serial_lock); lock_basic_unlock(&xfrd->rw_lock); lock_basic_unlock(&zone->zone_lock); return; } /** * Dump answer to disk. * */ static void xfrd_dump_packet(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; char* xfrfile = NULL; FILE* fd = NULL; ldns_pkt* pkt = NULL; ldns_status status = LDNS_STATUS_OK; ods_log_assert(buffer); ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); status = ldns_wire2pkt(&pkt, buffer_begin(buffer), buffer_limit(buffer)); if (status != LDNS_STATUS_OK) { ods_log_crit("[%s] unable to dump packet zone %s: ldns_wire2pkt() " "failed (%s)", xfrd_str, zone->name, ldns_get_errorstr_by_id(status)); return; } ods_log_assert(pkt); xfrfile = ods_build_path(zone->name, ".xfrd", 0, 1); if (!xfrfile) { ods_log_crit("[%s] unable to dump packet zone %s: build path failed", xfrd_str, zone->name); return; } lock_basic_lock(&xfrd->rw_lock); if (xfrd->msg_do_retransfer && !xfrd->msg_seq_nr && !xfrd->msg_is_ixfr) { fd = ods_fopen(xfrfile, NULL, "w"); } else { fd = ods_fopen(xfrfile, NULL, "a"); } free((void*) xfrfile); if (!fd) { ods_log_crit("[%s] unable to dump packet zone %s: ods_fopen() failed " "(%s)", xfrd_str, zone->name, strerror(errno)); lock_basic_unlock(&xfrd->rw_lock); return; } ods_log_assert(fd); if (xfrd->msg_seq_nr == 0) { fprintf(fd, ";;BEGINPACKET\n"); } ldns_rr_list_print(fd, ldns_pkt_answer(pkt)); ods_fclose(fd); lock_basic_unlock(&xfrd->rw_lock); ldns_pkt_free(pkt); return; } /** * Write SOA in packet. * */ static void xfrd_write_soa(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(xfrd); ods_log_assert(buffer); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->apex); buffer_write_rdf(buffer, zone->apex); buffer_write_u16(buffer, (uint16_t) LDNS_RR_TYPE_SOA); buffer_write_u16(buffer, (uint16_t) zone->klass); buffer_write_u32(buffer, xfrd->soa.ttl); rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(rdlength)); buffer_write(buffer, xfrd->soa.mname+1, xfrd->soa.mname[0]); buffer_write(buffer, xfrd->soa.rname+1, xfrd->soa.rname[0]); buffer_write_u32(buffer, xfrd->soa.serial); buffer_write_u32(buffer, xfrd->soa.refresh); buffer_write_u32(buffer, xfrd->soa.retry); buffer_write_u32(buffer, xfrd->soa.expire); buffer_write_u32(buffer, xfrd->soa.minimum); rdlength = buffer_position(buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(buffer, rdlength_pos, rdlength); return; } /** * Update SOA. * */ static void xfrd_update_soa(xfrd_type* xfrd, buffer_type* buffer, uint32_t ttl, uint16_t mname_pos, uint16_t rname_pos, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum) { zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(buffer); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->apex); xfrd->soa.ttl = ttl; xfrd->soa.refresh = refresh; xfrd->soa.retry = retry; xfrd->soa.expire = expire; xfrd->soa.minimum = minimum; buffer_set_position(buffer, mname_pos); if (!(xfrd->soa.mname[0] = buffer_read_dname(buffer, xfrd->soa.mname+1, 1))) { xfrd->soa.mname[0] = 1; xfrd->soa.mname[1] = 0; } buffer_set_position(buffer, rname_pos); if (!(xfrd->soa.rname[0] = buffer_read_dname(buffer, xfrd->soa.rname+1, 1))) { xfrd->soa.rname[0] = 1; xfrd->soa.rname[1] = 0; } return; } /** * Parse SOA RR in packet. * */ static int xfrd_parse_soa(xfrd_type* xfrd, buffer_type* buffer, unsigned rdata_only, unsigned update, uint32_t t, uint32_t* soa_serial) { ldns_rr_type type = LDNS_RR_TYPE_SOA; uint16_t mname_pos = 0; uint16_t rname_pos = 0; uint16_t pos = 0; uint32_t serial = 0; uint32_t refresh = 0; uint32_t retry = 0; uint32_t expire = 0; uint32_t minimum = 0; uint32_t ttl = t; ods_log_assert(xfrd); ods_log_assert(buffer); /* type class ttl */ if (!rdata_only) { if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] unable to parse soa: rr too short", xfrd_str); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_SOA) { ods_log_debug("[%s] unable to parse soa: rrtype %u != soa", xfrd_str, (unsigned) type); return 0; } (void)buffer_read_u16(buffer); /* class */ ttl = buffer_read_u32(buffer); /* rdata length */ if (!buffer_available(buffer, buffer_read_u16(buffer))) { ods_log_debug("[%s] unable to parse soa: rdata too short", xfrd_str); return 0; } } /* MNAME */ mname_pos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] unable to parse soa: bad mname", xfrd_str); return 0; } /* RNAME */ rname_pos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] unable to parse soa: bad rname", xfrd_str); return 0; } serial = buffer_read_u32(buffer); refresh = buffer_read_u32(buffer); retry = buffer_read_u32(buffer); expire = buffer_read_u32(buffer); minimum = buffer_read_u32(buffer); pos = buffer_position(buffer); if (soa_serial) { *soa_serial = serial; } if (update) { xfrd_update_soa(xfrd, buffer, ttl, mname_pos, rname_pos, refresh, retry, expire, minimum); } buffer_set_position(buffer, pos); return 1; } /** * Parse RRs in packet. * */ static ods_status xfrd_parse_rrs(xfrd_type* xfrd, buffer_type* buffer, uint16_t count, int* done) { ldns_rr_type type = 0; uint16_t rrlen = 0; uint32_t ttl = 0; uint32_t serial = 0; uint32_t tmp_serial = 0; size_t i = 0; ods_log_assert(xfrd); ods_log_assert(buffer); ods_log_assert(done); for (i=0; i < count; ++i, ++xfrd->msg_rr_count) { if (*done) { return ODS_STATUS_OK; } if (!buffer_skip_dname(buffer)) { return ODS_STATUS_SKIPDNAME; } if (!buffer_available(buffer, 10)) { return ODS_STATUS_BUFAVAIL; } (void)buffer_position(buffer); type = (ldns_rr_type) buffer_read_u16(buffer); (void)buffer_read_u16(buffer); /* class */ ttl = buffer_read_u32(buffer); rrlen = buffer_read_u16(buffer); if (!buffer_available(buffer, rrlen)) { return ODS_STATUS_BUFAVAIL; } if (type == LDNS_RR_TYPE_SOA) { if (!xfrd_parse_soa(xfrd, buffer, 1, 0, ttl, &serial)) { return ODS_STATUS_PARSESOA; } if (xfrd->msg_rr_count == 1 && serial != xfrd->msg_new_serial) { /* 2nd RR is SOA with different serial, this is an IXFR */ xfrd->msg_is_ixfr = 1; lock_basic_lock(&xfrd->serial_lock); if (!xfrd->serial_disk_acquired) { lock_basic_unlock(&xfrd->serial_lock); /* got IXFR but need AXFR */ return ODS_STATUS_REQAXFR; } if (!xfrd->msg_do_retransfer && serial != xfrd->serial_disk) { lock_basic_unlock(&xfrd->serial_lock); /* bad start serial in IXFR */ return ODS_STATUS_INSERIAL; } lock_basic_unlock(&xfrd->serial_lock); xfrd->msg_old_serial = serial; tmp_serial = serial; } else if (serial == xfrd->msg_new_serial) { /* saw another SOA of new serial. */ if (xfrd->msg_is_ixfr == 1) { xfrd->msg_is_ixfr = 2; /* seen middle SOA in ixfr */ } else { *done = 1; /* final axfr/ixfr soa */ } } else if (xfrd->msg_is_ixfr) { /* some additional checks */ if (util_serial_gt(serial, xfrd->msg_new_serial)) { /* bad middle serial in IXFR (too high) */ return ODS_STATUS_INSERIAL; } if (util_serial_gt(tmp_serial, serial)) { /* middle serial decreases in IXFR */ return ODS_STATUS_INSERIAL; } /* serial ok, update tmp serial */ tmp_serial = serial; } } else { buffer_skip(buffer, rrlen); } } return ODS_STATUS_OK; } /** * Parse packet. * */ static xfrd_pkt_status xfrd_parse_packet(xfrd_type* xfrd, buffer_type* buffer) { zone_type* zone = NULL; uint16_t qdcount = 0; uint16_t ancount = 0; uint16_t ancount_todo = 0; uint16_t rrcount = 0; uint32_t serial = 0; int done = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(buffer); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); /* check packet size */ if (!buffer_available(buffer, BUFFER_PKT_HEADER_SIZE)) { ods_log_error("[%s] unable to parse packet: zone %s received bad " "packet from %s (too small)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* check query id */ if (buffer_pkt_id(buffer) != xfrd->query_id) { ods_log_error("[%s] bad packet: zone %s received bad query id " "%u from %s (expected %u)", xfrd_str, zone->name, buffer_pkt_id(buffer), xfrd->master->address, xfrd->query_id); return XFRD_PKT_BAD; } /* check rcode */ if (buffer_pkt_rcode(buffer) != LDNS_RCODE_NOERROR) { ods_log_error("[%s] bad packet: zone %s received error code %s from %s", xfrd_str, zone->name, ldns_pkt_rcode2str(buffer_pkt_rcode(buffer)), xfrd->master->address); if (buffer_pkt_rcode(buffer) == LDNS_RCODE_NOTIMPL) { return XFRD_PKT_NOTIMPL; } else if (buffer_pkt_rcode(buffer) != LDNS_RCODE_NOTAUTH) { return XFRD_PKT_BAD; } } /* check tsig */ if (!xfrd_tsig_process(xfrd, buffer)) { ods_log_error("[%s] bad packet: zone %s received bad tsig " "from %s", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* skip header and question section */ buffer_skip(buffer, BUFFER_PKT_HEADER_SIZE); qdcount = buffer_pkt_qdcount(buffer); for (rrcount = 0; rrcount < qdcount; rrcount++) { if (!buffer_skip_rr(buffer, 1)) { ods_log_error("[%s] bad packet: zone %s received bad " "question section from %s (bad rr)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } } /* answer section */ ancount = buffer_pkt_ancount(buffer); if (xfrd->msg_rr_count == 0 && ancount == 0) { if (xfrd->tcp_conn == -1 && buffer_pkt_tc(buffer)) { ods_log_info("[%s] zone %s received tc from %s, retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "from %s (nodata)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } ancount_todo = ancount; if (xfrd->msg_rr_count == 0) { /* parse the first RR, see if it is a SOA */ if (!buffer_skip_dname(buffer) || !xfrd_parse_soa(xfrd, buffer, 0, 1, 0, &serial)) { ods_log_error("[%s] bad packet: zone %s received bad xfr " "packet from %s (bad soa)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } /* check serial */ lock_basic_lock(&xfrd->serial_lock); if (!xfrd->msg_do_retransfer && xfrd->serial_disk_acquired && xfrd->serial_disk == serial) { ods_log_info("[%s] zone %s got update indicating current " "serial %u from %s", xfrd_str, zone->name, serial, xfrd->master->address); xfrd->serial_disk_acquired = xfrd_time(xfrd); if (xfrd->serial_xfr == serial) { xfrd->serial_xfr_acquired = xfrd->serial_disk_acquired; if (!xfrd->serial_notify_acquired) { /* not notified or anything, so stop asking around */ xfrd->round_num = -1; /* next try start a new round */ xfrd_set_timer_refresh(xfrd); ods_log_debug("[%s] zone %s wait refresh time", xfrd_str, zone->name); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_NEWLEASE; } /* try next master */ ods_log_debug("[%s] zone %s try next master", xfrd_str, zone->name); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_BAD; } } if (!xfrd->msg_do_retransfer && xfrd->serial_disk_acquired && !util_serial_gt(serial, xfrd->serial_disk)) { ods_log_info("[%s] zone %s ignoring old serial %u from %s " "(have %u)", xfrd_str, zone->name, serial, xfrd->master->address, xfrd->serial_disk); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_BAD; } xfrd->msg_new_serial = serial; if (!xfrd->msg_do_retransfer && xfrd->serial_disk_acquired) { xfrd->msg_old_serial = xfrd->serial_disk; } else { xfrd->msg_old_serial = 0; } /* update notify serial if this xfr is newer */ if (ancount > 1 && xfrd->serial_notify_acquired && util_serial_gt(serial, xfrd->serial_notify)) { xfrd->serial_notify = serial; } lock_basic_unlock(&xfrd->serial_lock); xfrd->msg_rr_count = 1; xfrd->msg_is_ixfr = 0; ancount_todo = ancount - 1; } /* check tc bit */ if (xfrd->tcp_conn == -1 && buffer_pkt_tc(buffer)) { ods_log_info("[%s] zone %s received tc from %s, retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } if (xfrd->tcp_conn == -1 && ancount < 2) { /* too short to be a real ixfr/axfr data transfer */ ods_log_info("[%s] zone %s received too short udp reply from %s, " "retry tcp", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_TC; } status = xfrd_parse_rrs(xfrd, buffer, ancount_todo, &done); if (status != ODS_STATUS_OK) { ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "from %s (%s)", xfrd_str, zone->name, xfrd->master->address, ods_status2str(status)); return XFRD_PKT_BAD; } if (xfrd->tcp_conn == -1 && !done) { ods_log_error("[%s] bad packet: zone %s received bad xfr packet " "(xfr over udp incomplete)", xfrd_str, zone->name, xfrd->master->address); return XFRD_PKT_BAD; } if (!done) { return XFRD_PKT_MORE; } return XFRD_PKT_XFR; } /** * Handle packet. * */ static xfrd_pkt_status xfrd_handle_packet(xfrd_type* xfrd, buffer_type* buffer) { xfrd_pkt_status res = XFRD_PKT_BAD; zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); res = xfrd_parse_packet(xfrd, buffer); ods_log_debug("[%s] zone %s xfr packet parsed (res %d)", xfrd_str, zone->name, res); switch (res) { case XFRD_PKT_MORE: case XFRD_PKT_XFR: /* continue with commit */ break; case XFRD_PKT_NEWLEASE: case XFRD_PKT_TC: return res; break; case XFRD_PKT_NOTIMPL: case XFRD_PKT_BAD: default: /* rollback */ if (xfrd->msg_seq_nr > 0) { buffer_clear(buffer); ods_log_info("[%s] zone %s xfr rollback", xfrd_str, zone->name); buffer_flip(buffer); } return res; break; } /* dump reply on disk to diff file */ xfrd_dump_packet(xfrd, buffer); /* more? */ xfrd->msg_seq_nr++; if (res == XFRD_PKT_MORE) { /* wait for more */ return XFRD_PKT_MORE; } /* done */ buffer_clear(buffer); buffer_flip(buffer); /* commit packet */ xfrd_commit_packet(xfrd); /* next time */ lock_basic_lock(&xfrd->serial_lock); ods_log_info("[%s] zone %s transfer done [notify acquired %u, serial on " "disk %u, notify serial %u]", xfrd_str, zone->name, xfrd->serial_notify_acquired, xfrd->serial_disk, xfrd->serial_notify); if (xfrd->serial_notify_acquired && !util_serial_gt(xfrd->serial_notify, xfrd->serial_disk)) { ods_log_verbose("[%s] zone %s reset notify acquired", xfrd_str, zone->name); xfrd->serial_notify_acquired = 0; } if (!xfrd->serial_notify_acquired) { ods_log_debug("[%s] zone %s xfr done", xfrd_str, zone->name); xfrd->round_num = -1; /* next try start anew */ xfrd_set_timer_refresh(xfrd); lock_basic_unlock(&xfrd->serial_lock); return XFRD_PKT_XFR; } lock_basic_unlock(&xfrd->serial_lock); /* try to get an even newer serial */ ods_log_info("[%s] zone %s try get newer serial", xfrd_str, zone->name); return XFRD_PKT_BAD; } /** TCP **/ /** * Write to tcp. * */ static void xfrd_tcp_write(xfrd_type* xfrd, tcp_set_type* set) { zone_type* zone = NULL; tcp_conn_type* tcp = NULL; int ret = 0; int error = 0; socklen_t len = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); tcp = set->tcp_conn[xfrd->tcp_conn]; if (tcp->total_bytes == 0) { /* check for pending error from nonblocking connect */ /* from Stevens, unix network programming, vol1, 3rd ed, p450 */ len = sizeof(error); if (getsockopt(tcp->fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { error = errno; /* on solaris errno is error */ } if (error == EINPROGRESS || error == EWOULDBLOCK) { ods_log_debug("[%s] zone %s zero write, write again later (%s)", xfrd_str, zone->name, strerror(error)); return; /* try again later */ } if (error != 0) { ods_log_error("[%s] zone %s cannot tcp connect to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 1); return; } } ret = tcp_conn_write(tcp); if(ret == -1) { ods_log_error("[%s] zone %s cannot tcp write to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 1); return; } if (ret == 0) { ods_log_debug("[%s] zone %s zero write, write again later", xfrd_str, zone->name); return; /* write again later */ } /* done writing, get ready for reading */ ods_log_debug("[%s] zone %s done writing, get ready for reading", xfrd_str, zone->name); tcp->is_reading = 1; tcp_conn_ready(tcp); xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; xfrd_tcp_read(xfrd, set); return; } /** * Open tcp connection. * */ static int xfrd_tcp_open(xfrd_type* xfrd, tcp_set_type* set) { int fd, family, conn; struct sockaddr_storage to; socklen_t to_len; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s open tcp connection to %s", xfrd_str, zone->name, xfrd->master->address); set->tcp_conn[xfrd->tcp_conn]->is_reading = 0; set->tcp_conn[xfrd->tcp_conn]->total_bytes = 0; set->tcp_conn[xfrd->tcp_conn]->msglen = 0; if (xfrd->master->family == AF_INET6) { family = PF_INET6; } else { family = PF_INET; } fd = socket(family, SOCK_STREAM, IPPROTO_TCP); set->tcp_conn[xfrd->tcp_conn]->fd = fd; if (fd == -1) { ods_log_error("[%s] zone %s cannot create tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 0); return 0; } if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] zone %s cannot fcntl tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 0); return 0; } to_len = xfrd_acl_sockaddr_to(xfrd->master, &to); /* bind it? */ conn = connect(fd, (struct sockaddr*)&to, to_len); if (conn == -1 && errno != EINPROGRESS) { ods_log_error("[%s] zone %s cannot connect tcp socket to %s: %s", xfrd_str, zone->name, xfrd->master->address, strerror(errno)); xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 0); return 0; } xfrd->handler.fd = fd; xfrd->handler.event_types = NETIO_EVENT_WRITE|NETIO_EVENT_TIMEOUT; xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); return 1; } /** * Obtain tcp. * */ static void xfrd_tcp_obtain(xfrd_type* xfrd, tcp_set_type* set) { xfrhandler_type* xfrhandler; int i = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn == -1); ods_log_assert(xfrd->tcp_waiting == 0); if (set->tcp_count < TCPSET_MAX) { ods_log_assert(!set->tcp_waiting_first); set->tcp_count ++; /* find a free tcp_buffer */ for (i=0; i < TCPSET_MAX; i++) { if (set->tcp_conn[i]->fd == -1) { xfrd->tcp_conn = i; break; } } ods_log_assert(xfrd->tcp_conn != -1); xfrd->tcp_waiting = 0; /* stop udp use (if any) */ if (xfrd->handler.fd != -1) { xfrd_udp_release(xfrd); } if (!xfrd_tcp_open(xfrd, set)) { return; } xfrd_tcp_xfr(xfrd, set); return; } /* wait, at end of line */ ods_log_verbose("[%s] max number of tcp connections (%d) reached", xfrd_str, TCPSET_MAX); xfrd->tcp_waiting = 1; xfrd_unset_timer(xfrd); /* add it to the waiting queue */ xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; xfrd->tcp_waiting_next = xfrhandler->tcp_waiting_first; xfrhandler->tcp_waiting_first = xfrd; } /** * Start xfr. * */ static void xfrd_tcp_xfr(xfrd_type* xfrd, tcp_set_type* set) { tcp_conn_type* tcp = NULL; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->tcp_waiting == 0); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); /* start AXFR or IXFR for the zone */ tcp = set->tcp_conn[xfrd->tcp_conn]; if (xfrd->msg_do_retransfer || xfrd->serial_xfr_acquired <= 0 || xfrd->master->ixfr_disabled) { ods_log_info("[%s] zone %s request axfr to %s", xfrd_str, zone->name, xfrd->master->address); buffer_pkt_query(tcp->packet, zone->apex, LDNS_RR_TYPE_AXFR, zone->klass); } else { ods_log_info("[%s] zone %s request tcp/ixfr=%u to %s", xfrd_str, zone->name, xfrd->soa.serial, xfrd->master->address); buffer_pkt_query(tcp->packet, zone->apex, LDNS_RR_TYPE_IXFR, zone->klass); buffer_pkt_set_nscount(tcp->packet, 1); xfrd_write_soa(xfrd, tcp->packet); } /* make packet */ xfrd->query_id = buffer_pkt_id(tcp->packet); xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; xfrd_tsig_sign(xfrd, tcp->packet); buffer_flip(tcp->packet); tcp->msglen = buffer_limit(tcp->packet); ods_log_verbose("[%s] zone %s sending tcp query id=%d", xfrd_str, zone->name, xfrd->query_id); /* wait for select to complete connect before write */ return; } /** * Read from tcp. * */ static void xfrd_tcp_read(xfrd_type* xfrd, tcp_set_type* set) { tcp_conn_type* tcp = NULL; int ret = 0; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->tcp_conn != -1); tcp = set->tcp_conn[xfrd->tcp_conn]; ret = tcp_conn_read(tcp); if (ret == -1) { xfrd_set_timer_now(xfrd); xfrd_tcp_release(xfrd, set, 1); return; } if (ret == 0) { return; } /* completed msg */ buffer_flip(tcp->packet); ret = xfrd_handle_packet(xfrd, tcp->packet); switch (ret) { case XFRD_PKT_MORE: tcp_conn_ready(tcp); break; case XFRD_PKT_XFR: case XFRD_PKT_NEWLEASE: ods_log_verbose("[%s] tcp read %s: release connection", xfrd_str, XFRD_PKT_XFR?"xfr":"newlease"); xfrd_tcp_release(xfrd, set, 1); ods_log_assert(xfrd->round_num == -1); break; case XFRD_PKT_NOTIMPL: xfrd->master->ixfr_disabled = time_now(); ods_log_verbose("[%s] disable ixfr requests for %s from now (%u)", xfrd_str, xfrd->master->address, xfrd->master->ixfr_disabled); /* break; */ case XFRD_PKT_BAD: default: ods_log_debug("[%s] tcp read %s: release connection", xfrd_str, ret==XFRD_PKT_BAD?"bad":"notimpl"); xfrd_tcp_release(xfrd, set, 1); xfrd_make_request(xfrd); break; } return; } /** * Release tcp connection from set for xfrd. If there are waiting TCP * connections open as many as free slots in set. This step is skipped * if open_waiting flag is unset. */ static void xfrd_tcp_release(xfrd_type* xfrd, tcp_set_type* set, int open_waiting) { xfrhandler_type* xfrhandler; int conn = 0; zone_type* zone = NULL; ods_log_assert(set); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); ods_log_assert(xfrd->tcp_conn != -1); ods_log_assert(xfrd->tcp_waiting == 0); zone = (zone_type*) xfrd->zone; ods_log_debug("[%s] zone %s release tcp connection to %s", xfrd_str, zone->name, xfrd->master->address); conn = xfrd->tcp_conn; xfrd->tcp_conn = -1; xfrd->tcp_waiting = 0; xfrd->handler.fd = -1; xfrd->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; if (set->tcp_conn[conn]->fd != -1) { close(set->tcp_conn[conn]->fd); } set->tcp_conn[conn]->fd = -1; set->tcp_count --; /* see if there are any connections waiting for a slot. Or return. */ if (!open_waiting) return; xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; while (xfrhandler->tcp_waiting_first && set->tcp_count < TCPSET_MAX) { int i; xfrd_type* waiting_xfrd = xfrhandler->tcp_waiting_first; xfrhandler->tcp_waiting_first = waiting_xfrd->tcp_waiting_next; waiting_xfrd->tcp_waiting_next = NULL; /* find a free tcp_buffer */ for (i=0; i < TCPSET_MAX; i++) { if (set->tcp_conn[i]->fd == -1) { waiting_xfrd->tcp_conn = i; set->tcp_count++; break; } } waiting_xfrd->tcp_waiting = 0; /* stop udp use (if any) */ if (waiting_xfrd->handler.fd != -1) { xfrd_udp_release(waiting_xfrd); } /* if xfrd_tcp_open() fails its slot in set->tcp_conn[] * is released. Continue to next. We don't put it back in the * waiting queue, it would keep the signer busy retrying, making * things only worse. */ if (xfrd_tcp_open(waiting_xfrd, set)) { xfrd_tcp_xfr(waiting_xfrd, set); } } } /** UDP **/ /** * Send packet over udp. * */ static int xfrd_udp_send(xfrd_type* xfrd, buffer_type* buffer) { struct sockaddr_storage to; socklen_t to_len = 0; int fd = -1; int family = PF_INET; ssize_t nb = -1; ods_log_assert(buffer); ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); /* this will set the remote port to acl->port or TCP_PORT */ to_len = xfrd_acl_sockaddr_to(xfrd->master, &to); /* get the address family of the remote host */ if (xfrd->master->family == AF_INET6) { family = PF_INET6; } /* create socket */ fd = socket(family, SOCK_DGRAM, IPPROTO_UDP); if (fd == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "socket() failed (%s)", xfrd_str, xfrd->master->address, strerror(errno)); return -1; } /* bind it? */ /* send it (udp) */ ods_log_deeebug("[%s] send %d bytes over udp to %s", xfrd_str, buffer_remaining(buffer), xfrd->master->address); nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0, (struct sockaddr*)&to, to_len); if (nb == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "sendto() failed (%s)", xfrd_str, xfrd->master->address, strerror(errno)); close(fd); return -1; } return fd; } /** * Send IXFR request. * */ static int xfrd_udp_send_request_ixfr(xfrd_type* xfrd) { int fd; xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->master); ods_log_assert(xfrd->master->address); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); if (xfrd->tcp_conn != -1) { /* tcp is using the handler.fd */ ods_log_error("[%s] unable to transfer zone %s: tried to send " "udp while tcp obtained", xfrd_str, zone->name); return -1; } /* make packet */ xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); buffer_pkt_query(xfrhandler->packet, zone->apex, LDNS_RR_TYPE_IXFR, zone->klass); xfrd->query_id = buffer_pkt_id(xfrhandler->packet); xfrd->msg_seq_nr = 0; xfrd->msg_rr_count = 0; xfrd->msg_old_serial = 0; xfrd->msg_new_serial = 0; xfrd->msg_is_ixfr = 0; buffer_pkt_set_nscount(xfrhandler->packet, 1); xfrd_write_soa(xfrd, xfrhandler->packet); xfrd_tsig_sign(xfrd, xfrhandler->packet); buffer_flip(xfrhandler->packet); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_UDP_TIMEOUT); ods_log_info("[%s] zone %s request udp/ixfr=%u to %s", xfrd_str, zone->name, xfrd->soa.serial, xfrd->master->address); if((fd = xfrd_udp_send(xfrd, xfrhandler->packet)) == -1) { return -1; } return fd; } /** * Obtain udp. * */ static void xfrd_udp_obtain(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->xfrhandler); ods_log_assert(xfrd->udp_waiting == 0); xfrhandler = (void*) xfrd->xfrhandler; if (xfrd->tcp_conn != -1) { /* no tcp and udp at the same time */ xfrd_tcp_release(xfrd, xfrhandler->tcp_set, 1); } if (xfrhandler->udp_use_num < XFRD_MAX_UDP) { xfrhandler->udp_use_num++; xfrd->handler.fd = xfrd_udp_send_request_ixfr(xfrd); if (xfrd->handler.fd == -1) { xfrhandler->udp_use_num--; } return; } /* queue the zone as last */ xfrd->udp_waiting = 1; xfrd->udp_waiting_next = NULL; if (!xfrhandler->udp_waiting_first) { xfrhandler->udp_waiting_first = xfrd; } if (xfrhandler->udp_waiting_last) { xfrhandler->udp_waiting_last->udp_waiting_next = xfrd; } xfrhandler->udp_waiting_last = xfrd; xfrd_unset_timer(xfrd); return; } /** * Read packet from udp. * */ static int xfrd_udp_read_packet(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ssize_t received = 0; ods_log_assert(xfrd); xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); /* read the data */ buffer_clear(xfrhandler->packet); received = recvfrom(xfrd->handler.fd, buffer_begin(xfrhandler->packet), buffer_remaining(xfrhandler->packet), 0, NULL, NULL); if (received == -1) { ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d " "(%s)", xfrd_str, xfrd->handler.fd, strerror(errno)); return 0; } buffer_set_limit(xfrhandler->packet, received); return 1; } /** * Read from udp. * */ static void xfrd_udp_read(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; xfrd_pkt_status res = XFRD_PKT_BAD; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s read data from udp", xfrd_str, zone->name); if (!xfrd_udp_read_packet(xfrd)) { ods_log_error("[%s] unable to read data from udp zone %s: " "xfrd_udp_read_packet() failed", xfrd_str, zone->name); xfrd_udp_release(xfrd); return; } xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); res = xfrd_handle_packet(xfrd, xfrhandler->packet); switch (res) { case XFRD_PKT_TC: ods_log_verbose("[%s] truncation from %s", xfrd_str, xfrd->master->address); xfrd_udp_release(xfrd); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_obtain(xfrd, xfrhandler->tcp_set); break; case XFRD_PKT_XFR: case XFRD_PKT_NEWLEASE: ods_log_verbose("[%s] xfr/newlease from %s", xfrd_str, xfrd->master->address); /* nothing more to do */ ods_log_assert(xfrd->round_num == -1); xfrd_udp_release(xfrd); break; case XFRD_PKT_NOTIMPL: xfrd->master->ixfr_disabled = time_now(); ods_log_verbose("[%s] disable ixfr requests for %s from now (%u)", xfrd_str, xfrd->master->address, xfrd->master->ixfr_disabled); /* break; */ case XFRD_PKT_BAD: default: ods_log_debug("[%s] bad ixfr packet from %s", xfrd_str, xfrd->master->address); xfrd_udp_release(xfrd); xfrd_make_request(xfrd); break; } return; } /** * Release udp. * */ static void xfrd_udp_release(xfrd_type* xfrd) { xfrhandler_type* xfrhandler = NULL; ods_log_assert(xfrd); ods_log_assert(xfrd->udp_waiting == 0); if(xfrd->handler.fd != -1) close(xfrd->handler.fd); xfrd->handler.fd = -1; xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); /* see if there are waiting zones */ if (xfrhandler->udp_use_num == XFRD_MAX_UDP) { while (xfrhandler->udp_waiting_first) { /* snip off waiting list */ xfrd_type* wf = xfrhandler->udp_waiting_first; ods_log_assert(wf->udp_waiting); wf->udp_waiting = 0; xfrhandler->udp_waiting_first = wf->udp_waiting_next; if (xfrhandler->udp_waiting_last == wf) { xfrhandler->udp_waiting_last = NULL; } /* see if this zone needs udp connection */ if (wf->tcp_conn == -1) { wf->handler.fd = xfrd_udp_send_request_ixfr(wf); if (wf->handler.fd != -1) { return; } } } } /* no waiting zones */ if (xfrhandler->udp_use_num > 0) { xfrhandler->udp_use_num --; } return; } /** * Make a zone transfer request. * */ static void xfrd_make_request(xfrd_type* xfrd) { zone_type* zone = NULL; dnsin_type* dnsin = NULL; if (!xfrd || !xfrd->xfrhandler) { return; } zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adinbound); ods_log_assert(zone->adinbound->type == ADAPTER_DNS); ods_log_assert(zone->adinbound->config); dnsin = (dnsin_type*) zone->adinbound->config; if (xfrd->next_master != -1) { /* we are told to use this next master */ xfrd->master_num = xfrd->next_master; xfrd->master = NULL; /* acl_find_num(...) */ /* if there is no next master, fallback to use the first one */ if (!xfrd->master) { xfrd->master = dnsin->request_xfr; xfrd->master_num = 0; } /* fallback to cycle master */ xfrd->next_master = -1; xfrd->round_num = 0; /* fresh set of retries after notify */ } else { /* cycle master */ if (xfrd->round_num != -1 && xfrd->master && xfrd->master->next) { /* try the next master */ xfrd->master = xfrd->master->next; xfrd->master_num++; } else { /* start a new round */ xfrd->master = dnsin->request_xfr; xfrd->master_num = 0; xfrd->round_num++; } if (xfrd->round_num >= XFRD_MAX_ROUNDS) { /* tried all servers that many times, wait */ xfrd->round_num = -1; xfrd_set_timer_retry(xfrd); ods_log_verbose("[%s] zone %s make request wait retry", xfrd_str, zone->name); return; } } if (!xfrd->master) { ods_log_debug("[%s] unable to make request for zone %s: no master", xfrd_str, zone->name); xfrd->round_num = -1; xfrd_set_timer_retry(xfrd); return; } /* cache ixfr_disabled only for XFRD_NO_IXFR_CACHE time */ if (xfrd->master->ixfr_disabled && (xfrd->master->ixfr_disabled + XFRD_NO_IXFR_CACHE) <= xfrd_time(xfrd)) { ods_log_verbose("[%s] clear negative caching ixfr disabled for " "master %s", xfrd_str, xfrd->master->address); ods_log_debug("[%s] clear negative caching calc: %u + %u <= %u", xfrd_str, xfrd->master->ixfr_disabled, XFRD_NO_IXFR_CACHE, xfrd_time(xfrd)); xfrd->master->ixfr_disabled = 0; } /* perform xfr request */ if (xfrd->serial_xfr_acquired && !xfrd->master->ixfr_disabled && !xfrd->serial_retransfer) { xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_UDP_TIMEOUT); ods_log_verbose("[%s] zone %s make request [udp round %d master %s:%u]", xfrd_str, zone->name, xfrd->round_num, xfrd->master->address, xfrd->master->port); xfrd_udp_obtain(xfrd); } else if (!xfrd->serial_xfr_acquired || xfrd->master->ixfr_disabled || xfrd->serial_retransfer) { xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); if (xfrd->serial_retransfer) { xfrd->msg_do_retransfer = 1; xfrd->serial_retransfer = 0; } xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); ods_log_verbose("[%s] zone %s make request [tcp round %d master %s:%u]", xfrd_str, zone->name, xfrd->round_num, xfrd->master->address, xfrd->master->port); xfrd_tcp_obtain(xfrd, xfrhandler->tcp_set); } return; } /** * Handle zone transfer. * */ static void xfrd_handle_zone(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { xfrd_type* xfrd = NULL; zone_type* zone = NULL; if (!handler) { return; } xfrd = (xfrd_type*) handler->user_data; ods_log_assert(xfrd); zone = (zone_type*) xfrd->zone; ods_log_assert(zone); ods_log_assert(zone->name); if (xfrd->tcp_conn != -1) { /* busy in tcp transaction */ xfrhandler_type* xfrhandler = (xfrhandler_type*) xfrd->xfrhandler; ods_log_assert(xfrhandler); if (event_types & NETIO_EVENT_READ) { ods_log_deeebug("[%s] zone %s event tcp read", xfrd_str, zone->name); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_read(xfrd, xfrhandler->tcp_set); return; } else if (event_types & NETIO_EVENT_WRITE) { ods_log_deeebug("[%s] zone %s event tcp write", xfrd_str, zone->name); xfrd_set_timer(xfrd, xfrd_time(xfrd) + XFRD_TCP_TIMEOUT); xfrd_tcp_write(xfrd, xfrhandler->tcp_set); return; } else if (event_types & NETIO_EVENT_TIMEOUT) { /* tcp connection timed out. Stop it. */ ods_log_deeebug("[%s] zone %s event tcp timeout", xfrd_str, zone->name); xfrd_tcp_release(xfrd, xfrhandler->tcp_set, 1); /* continue to retry; as if a timeout happened */ event_types = NETIO_EVENT_TIMEOUT; } } if (event_types & NETIO_EVENT_READ) { /* busy in udp transaction */ ods_log_deeebug("[%s] zone %s event udp read", xfrd_str, zone->name); xfrd_set_timer_now(xfrd); xfrd_udp_read(xfrd); return; } /* timeout */ ods_log_deeebug("[%s] zone %s timeout", xfrd_str, zone->name); if (handler->fd != -1) { ods_log_assert(xfrd->tcp_conn == -1); xfrd_udp_release(xfrd); } if (xfrd->tcp_waiting) { ods_log_deeebug("[%s] zone %s skips retry: tcp connections full", xfrd_str, zone->name); xfrd_unset_timer(xfrd); return; } if (xfrd->udp_waiting) { ods_log_deeebug("[%s] zone %s skips retry: udp connections full", xfrd_str, zone->name); xfrd_unset_timer(xfrd); return; } /* make a new request */ xfrd_make_request(xfrd); return; } /** * Backup xfrd domain names. * */ static void xfrd_backup_dname(FILE* out, uint8_t* dname) { uint8_t* d= dname+1; uint8_t len = *d++; uint8_t i; if (dname[0]<=1) { fprintf(out, "."); return; } while (len) { ods_log_assert(d - (dname+1) <= dname[0]); for (i=0; izone; char* file = NULL; int timeout = 0; FILE* fd = NULL; if (zone && zone->name) { file = ods_build_path(zone->name, ".xfrd-state", 0, 1); if (file) { fd = ods_fopen(file, NULL, "w"); if (fd) { if (xfrd->handler.timeout) { timeout = xfrd->timeout.tv_sec; } fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); fprintf(fd, ";;Zone: name %s ttl %u mname ", zone->name, (unsigned) xfrd->soa.ttl); xfrd_backup_dname(fd, xfrd->soa.mname), fprintf(fd, " rname "); xfrd_backup_dname(fd, xfrd->soa.rname), fprintf(fd, " serial %u refresh %u retry %u expire %u " "minimum %u\n", (unsigned) xfrd->soa.serial, (unsigned) xfrd->soa.refresh, (unsigned) xfrd->soa.retry, (unsigned) xfrd->soa.expire, (unsigned) xfrd->soa.minimum); fprintf(fd, ";;Master: num %d next %d round %d timeout %d\n", xfrd->master_num, xfrd->next_master, xfrd->round_num, timeout); fprintf(fd, ";;Serial: xfr %u %u notify %u %u disk %u %u\n", (unsigned) xfrd->serial_xfr, (unsigned) xfrd->serial_xfr_acquired, (unsigned) xfrd->serial_notify, (unsigned) xfrd->serial_notify_acquired, (unsigned) xfrd->serial_disk, (unsigned) xfrd->serial_disk_acquired); fprintf(fd, "%s\n", ODS_SE_FILE_MAGIC_V3); ods_fclose(fd); } free(file); } } return; } /** * Unlink xfrd file. * */ static void xfrd_unlink(xfrd_type* xfrd) { zone_type* zone = (zone_type*) xfrd->zone; char* file = NULL; if (zone && zone->name) { ods_log_info("[%s] unlink zone %s xfrd state", xfrd_str, zone->name); file = ods_build_path(zone->name, ".xfrd-state", 0, 1); if (file) { (void)unlink(file); free(file); } } return; } /** * Cleanup zone transfer structure. * */ void xfrd_cleanup(xfrd_type* xfrd, int backup) { allocator_type* allocator = NULL; lock_basic_type serial_lock; lock_basic_type rw_lock; if (!xfrd) { return; } /* backup */ if (backup) { xfrd_backup(xfrd); } else { xfrd_unlink(xfrd); } allocator = xfrd->allocator; serial_lock = xfrd->serial_lock; rw_lock = xfrd->rw_lock; tsig_rr_cleanup(xfrd->tsig_rr); allocator_deallocate(allocator, (void*) xfrd); allocator_cleanup(allocator); lock_basic_destroy(&serial_lock); lock_basic_destroy(&rw_lock); return; } opendnssec-1.4.9/signer/src/wire/acl.c0000644000175000017500000003265712650165732014562 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Access Control List. * */ #include "config.h" #include "shared/log.h" #include "shared/file.h" #include "shared/status.h" #include "wire/acl.h" static const char* acl_str = "acl"; /** * Returns range type. * mask is the 2nd part of the range. * */ static acl_range_type acl_parse_range_type(char* ip, char** mask) { char *p; if((p=strchr(ip, '&'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_MASK; } if((p=strchr(ip, '/'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_SUBNET; } if((p=strchr(ip, '-'))!=0) { *p = 0; *mask = p+1; return ACL_RANGE_MINMAX; } *mask = 0; return ACL_RANGE_SINGLE; } /** * Parses subnet mask, fills 0 mask as well * */ static ods_status acl_parse_range_subnet(char* p, void* addr, int maxbits) { int subnet_bits = atoi(p); uint8_t* addr_bytes = (uint8_t*)addr; if (subnet_bits == 0 && strcmp(p, "0")!=0) { return ODS_STATUS_ACL_SUBNET_BAD_RANGE; } if (subnet_bits < 0 || subnet_bits > maxbits) { return ODS_STATUS_ACL_SUBNET_OUT_RANGE; } /* fill addr with n bits of 1s (struct has been zeroed) */ while(subnet_bits >= 8) { *addr_bytes++ = 0xff; subnet_bits -= 8; } if(subnet_bits > 0) { uint8_t shifts[] = {0x0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}; *addr_bytes = shifts[subnet_bits]; } return ODS_STATUS_OK; } /** * Parse family from address. * */ int acl_parse_family(const char* a) { /* see if addr is ipv6 or ipv4 -- by : and . */ while (*a) { if (*a == '.') { return AF_INET; } if (*a == ':') { return AF_INET6; } ++a; } /* default to v4 */ return AF_INET; } /** * Create ACL. * */ acl_type* acl_create(allocator_type* allocator, char* address, char* port, char* tsig_name, tsig_type* tsig) { ods_status status = ODS_STATUS_OK; acl_type* acl = NULL; char* p = NULL; if (!allocator) { return NULL; } acl = (acl_type*) allocator_alloc(allocator, sizeof(acl_type)); if (!acl) { ods_log_error("[%s] unable to create acl: allocator_alloc() " "failed", acl_str); return NULL; } acl->address = NULL; acl->next = NULL; acl->tsig = NULL; if (tsig_name) { acl->tsig = tsig_lookup_by_name(tsig, tsig_name); if (!acl->tsig) { ods_log_error("[%s] unable to create acl: tsig %s not found", acl_str, tsig_name); acl_cleanup(acl, allocator); return NULL; } } acl->port = 0; if (port) { acl->port = atoi((const char*) port); } memset(&acl->addr, 0, sizeof(union acl_addr_storage)); memset(&acl->range_mask, 0, sizeof(union acl_addr_storage)); if (address) { acl->family = acl_parse_family(address); acl->range_type = acl_parse_range_type(address, &p); acl->address = allocator_strdup(allocator, address); if (!acl->address) { ods_log_error("[%s] unable to create acl: allocator_strdup() " "failed", acl_str); acl_cleanup(acl, allocator); return NULL; } if (acl->family == AF_INET6) { if (inet_pton(AF_INET6, acl->address, &acl->addr.addr6) != 1) { ods_log_error("[%s] unable to create acl: bad ipv6 address " "(%s)", acl_str, acl->address); acl_cleanup(acl, allocator); return NULL; } if (acl->range_type == ACL_RANGE_MASK || acl->range_type == ACL_RANGE_MINMAX) { if (inet_pton(AF_INET6, p, &acl->range_mask.addr6) != 1) { ods_log_error("[%s] unable to create acl: bad ipv6 address" " mask (%s)", acl_str, p); acl_cleanup(acl, allocator); return NULL; } } else if (acl->range_type == ACL_RANGE_SUBNET) { status = acl_parse_range_subnet(p, &acl->range_mask.addr6, 128); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to create acl: %s (%s)", acl_str, ods_status2str(status), p); acl_cleanup(acl, allocator); return NULL; } } } else if (acl->family == AF_INET) { if (inet_pton(AF_INET, acl->address, &acl->addr.addr) != 1) { ods_log_error("[%s] unable to create acl: bad ipv4 address " "(%s)", acl_str, acl->address); acl_cleanup(acl, allocator); return NULL; } if (acl->range_type == ACL_RANGE_MASK || acl->range_type == ACL_RANGE_MINMAX) { if (inet_pton(AF_INET, p, &acl->range_mask.addr) != 1) { ods_log_error("[%s] unable to create acl: bad ipv4 address" " mask (%s)", acl_str, p); acl_cleanup(acl, allocator); return NULL; } } else if (acl->range_type == ACL_RANGE_SUBNET) { status = acl_parse_range_subnet(p, &acl->range_mask.addr, 32); if (status != ODS_STATUS_OK) { ods_log_error("[%s] unable to create acl: %s (%s)", acl_str, ods_status2str(status), p); acl_cleanup(acl, allocator); return NULL; } } } } acl->ixfr_disabled = 0; return acl; } /** * ACL matches address mask. * */ static int acl_addr_matches_mask(uint32_t* a, uint32_t* b, uint32_t* mask, size_t sz) { size_t i = 0; ods_log_assert(sz % 4 == 0); sz /= 4; for (i=0; i x[i]) { return 0; } if (checkmax && maxval[i] < x[i]) { return 0; } /* if x is equal to a bound, that bound needs further checks */ if (checkmin && minval[i] != x[i]) { checkmin = 0; } if (checkmax && maxval[i]!=x[i]) { checkmax = 0; } if (!checkmin && !checkmax) { return 1; /* will always match */ } } return 1; } /** * ACL matches address. * */ static int acl_addr_matches(acl_type* acl, struct sockaddr_storage* addr) { if (!acl) { return 0; } if (!acl->address) { /* all addresses match */ return 1; } if (acl->family == AF_INET6) { struct sockaddr_in6* addr6 = (struct sockaddr_in6*) addr; if (addr->ss_family != AF_INET6) { return 0; } if (acl->port != 0 && acl->port != ntohs(addr6->sin6_port)) { return 0; } switch(acl->range_type) { case ACL_RANGE_MASK: case ACL_RANGE_SUBNET: if (!acl_addr_matches_mask((uint32_t*)&acl->addr.addr6, (uint32_t*)&addr6->sin6_addr, (uint32_t*)&acl->range_mask.addr6, sizeof(struct in6_addr))) { return 0; } break; case ACL_RANGE_MINMAX: if (!acl_addr_matches_range((uint32_t*)&acl->addr.addr6, (uint32_t*)&addr6->sin6_addr, (uint32_t*)&acl->range_mask.addr6, sizeof(struct in6_addr))) { return 0; } break; case ACL_RANGE_SINGLE: default: if (memcmp(&addr6->sin6_addr, &acl->addr.addr6, sizeof(struct in6_addr)) != 0) { return 0; } break; } return 1; } else { struct sockaddr_in* addr4 = (struct sockaddr_in*)addr; if (addr4->sin_family != AF_INET) { return 0; } if (acl->port != 0 && acl->port != ntohs(addr4->sin_port)) { return 0; } switch (acl->range_type) { case ACL_RANGE_MASK: case ACL_RANGE_SUBNET: if (!acl_addr_matches_mask((uint32_t*)&acl->addr.addr, (uint32_t*)&addr4->sin_addr, (uint32_t*)&acl->range_mask.addr, sizeof(struct in_addr))) { return 0; } break; case ACL_RANGE_MINMAX: if (!acl_addr_matches_range((uint32_t*)&acl->addr.addr, (uint32_t*)&addr4->sin_addr, (uint32_t*)&acl->range_mask.addr, sizeof(struct in_addr))) { return 0; } break; case ACL_RANGE_SINGLE: default: if (memcmp(&addr4->sin_addr, &acl->addr.addr, sizeof(struct in_addr)) != 0) { return 0; } break; } return 1; } /* not reached */ return 0; } /** * ACL matches TSIG. * */ static int acl_tsig_matches(acl_type* acl, tsig_rr_type* tsig) { if (!acl || !tsig) { ods_log_debug("[%s] no match: no acl or tsig", acl_str); return 0; /* missing required elements */ } if (!acl->tsig) { if (tsig->status == TSIG_NOT_PRESENT) { return 1; } ods_log_debug("[%s] no match: tsig present but no config", acl_str); return 0; /* TSIG present but no config */ } if (tsig->status != TSIG_OK) { ods_log_debug("[%s] no match: tsig %s", acl_str, tsig_status2str(tsig->status)); return 0; /* query has no TSIG */ } if (tsig->error_code != LDNS_RCODE_NOERROR) { ods_log_debug("[%s] no match: tsig error %d", acl_str, tsig->error_code); return 0; /* query has bork TSIG */ } if (!tsig->key_name || !tsig->algo) { ods_log_debug("[%s] no match: missing key/algo", acl_str); return 0; } if (!acl->tsig->key) { ods_log_debug("[%s] no match: no config", acl_str); return 0; /* missing TSIG config */ } if (ldns_dname_compare(tsig->key_name, acl->tsig->key->dname) != 0) { ods_log_debug("[%s] no match: key names not the same", acl_str); return 0; /* wrong key name */ } if (ods_strlowercmp(tsig->algo->txt_name, acl->tsig->algorithm) != 0) { ods_log_debug("[%s] no match: algorithms not the same", acl_str); return 0; /* wrong algorithm name */ } /* tsig matches */ return 1; } /** * Address storage to IP string. * */ int addr2ip(struct sockaddr_storage addr, char* ip, size_t len) { if (addr.ss_family == AF_INET6) { if (!inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, ip, len)) { return 0; } } else { if (!inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, ip, len)) return 0; } return 1; } /** * Find ACL. * */ acl_type* acl_find(acl_type* acl, struct sockaddr_storage* addr, tsig_rr_type* trr) { acl_type* find = acl; while (find) { if (acl_addr_matches(find, addr) && acl_tsig_matches(find, trr)) { ods_log_debug("[%s] match %s", acl_str, find->address); return find; } find = find->next; } return NULL; } /** * Clean up ACL. * */ void acl_cleanup(acl_type* acl, allocator_type* allocator) { if (!acl || !allocator) { return; } acl_cleanup(acl->next, allocator); allocator_deallocate(allocator, (void*) acl->address); allocator_deallocate(allocator, (void*) acl); return; } opendnssec-1.4.9/signer/src/wire/query.c0000644000175000017500000010025712650165732015160 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Query. * */ #include "config.h" #include "daemon/dnshandler.h" #include "daemon/engine.h" #include "shared/file.h" #include "shared/util.h" #include "wire/axfr.h" #include "wire/query.h" const char* query_str = "query"; /** * Create query. * */ query_type* query_create(void) { allocator_type* allocator = NULL; query_type* q = NULL; allocator = allocator_create(malloc, free); if (!allocator) { return NULL; } q = (query_type*) allocator_alloc(allocator, sizeof(query_type)); if (!q) { allocator_cleanup(allocator); return NULL; } q->allocator = allocator; q->buffer = NULL; q->tsig_rr = NULL; q->axfr_fd = NULL; q->buffer = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!q->buffer) { query_cleanup(q); return NULL; } q->tsig_rr = tsig_rr_create(allocator); if (!q->tsig_rr) { query_cleanup(q); return NULL; } q->edns_rr = edns_rr_create(allocator); if (!q->edns_rr) { query_cleanup(q); return NULL; } query_reset(q, UDP_MAX_MESSAGE_LEN, 0); return q; } /** * Reset query. * */ void query_reset(query_type* q, size_t maxlen, int is_tcp) { if (!q) { return; } q->addrlen = sizeof(q->addr); q->maxlen = maxlen; q->reserved_space = 0; buffer_clear(q->buffer); tsig_rr_reset(q->tsig_rr, NULL, NULL); edns_rr_reset(q->edns_rr); q->tsig_prepare_it = 1; q->tsig_update_it = 1; q->tsig_sign_it = 1; q->tcp = is_tcp; /* qname, qtype, qclass */ q->zone = NULL; /* domain, opcode, cname count, delegation, compression, temp */ q->axfr_is_done = 0; if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } q->serial = 0; q->startpos = 0; return; } /** * Error. * */ static query_state query_error(query_type* q, ldns_pkt_rcode rcode) { size_t limit = 0; if (!q) { return QUERY_DISCARDED; } limit = buffer_limit(q->buffer); buffer_clear(q->buffer); buffer_pkt_set_qr(q->buffer); buffer_pkt_set_rcode(q->buffer, rcode); buffer_pkt_set_ancount(q->buffer, 0); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); buffer_set_position(q->buffer, limit); return QUERY_PROCESSED; } /** * FORMERR. * */ static query_state query_formerr(query_type* q) { ldns_pkt_opcode opcode = LDNS_PACKET_QUERY; if (!q) { return QUERY_DISCARDED; } opcode = buffer_pkt_opcode(q->buffer); /* preserve the RD flag, clear the rest */ buffer_pkt_set_flags(q->buffer, buffer_pkt_flags(q->buffer) & 0x0100U); buffer_pkt_set_opcode(q->buffer, opcode); buffer_pkt_set_qdcount(q->buffer, 0); ods_log_debug("[%s] formerr", query_str); return query_error(q, LDNS_RCODE_FORMERR); } /** * SERVFAIL. * */ static query_state query_servfail(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] servfail", query_str); buffer_set_position(q->buffer, 0); buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); return query_error(q, LDNS_RCODE_SERVFAIL); } /** * NOTIMPL. * */ static query_state query_notimpl(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] notimpl", query_str); return query_error(q, LDNS_RCODE_NOTIMPL); } /** * REFUSED. * */ static query_state query_refused(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] refused", query_str); return query_error(q, LDNS_RCODE_REFUSED); } /** * NOTAUTH. * */ static query_state query_notauth(query_type* q) { if (!q) { return QUERY_DISCARDED; } ods_log_debug("[%s] notauth", query_str); return query_error(q, LDNS_RCODE_NOTAUTH); } /** * Parse SOA RR in packet. * (kind of similar to xfrd_parse_soa) * */ static int query_parse_soa(buffer_type* buffer, uint32_t* serial) { ldns_rr_type type = 0; ods_log_assert(buffer); if (!buffer_available(buffer, 10)) { ods_log_error("[%s] bad soa: packet too short", query_str); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad soa: rr is not soa (%d)", query_str, type); return 0; } (void)buffer_read_u16(buffer); (void)buffer_read_u32(buffer); /* rdata length */ if (!buffer_available(buffer, buffer_read_u16(buffer))) { ods_log_error("[%s] bad soa: missing rdlength", query_str); return 0; } /* MNAME */ if (!buffer_skip_dname(buffer)) { ods_log_error("[%s] bad soa: missing mname", query_str); return 0; } /* RNAME */ if (!buffer_skip_dname(buffer)) { ods_log_error("[%s] bad soa: missing rname", query_str); return 0; } if (serial) { *serial = buffer_read_u32(buffer); } return 1; } /** * NOTIFY. * Parse notify query and initiate zone transfer if received serial is * newer than serial on disk. On success return QUERY_PROCESSED and * prepare notify reply packet in q->buffer. */ static query_state query_process_notify(query_type* q, ldns_rr_type qtype, void* engine) { engine_type* e = (engine_type*) engine; dnsin_type* dnsin = NULL; uint16_t count = 0; uint16_t rrcount = 0; uint32_t serial = 0; size_t pos = 0; char address[128]; if (!e || !q || !q->zone) { return QUERY_DISCARDED; } ods_log_assert(e->dnshandler); ods_log_assert(q->zone->name); ods_log_verbose("[%s] incoming notify for zone %s", query_str, q->zone->name); if (buffer_pkt_rcode(q->buffer) != LDNS_RCODE_NOERROR || buffer_pkt_qr(q->buffer) || !buffer_pkt_aa(q->buffer) || buffer_pkt_tc(q->buffer) || buffer_pkt_rd(q->buffer) || buffer_pkt_ra(q->buffer) || buffer_pkt_ad(q->buffer) || buffer_pkt_cd(q->buffer) || buffer_pkt_qdcount(q->buffer) != 1 || buffer_pkt_ancount(q->buffer) > 1 || qtype != LDNS_RR_TYPE_SOA) { return query_formerr(q); } if (!q->zone->adinbound || q->zone->adinbound->type != ADAPTER_DNS) { ods_log_error("[%s] zone %s is not configured to have input dns " "adapter", query_str, q->zone->name); return query_notauth(q); } ods_log_assert(q->zone->adinbound->config); dnsin = (dnsin_type*) q->zone->adinbound->config; if (!acl_find(dnsin->allow_notify, &q->addr, q->tsig_rr)) { if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] unauthorized notify for zone %s from %s: " "no acl matches", query_str, q->zone->name, address); } else { ods_log_info("[%s] unauthorized notify for zone %s from unknown " "source: no acl matches", query_str, q->zone->name); } return query_notauth(q); } ods_log_assert(q->zone->xfrd); /* skip header and question section */ buffer_skip(q->buffer, BUFFER_PKT_HEADER_SIZE); count = buffer_pkt_qdcount(q->buffer); for (rrcount = 0; rrcount < count; rrcount++) { if (!buffer_skip_rr(q->buffer, 1)) { if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] dropped packet: zone %s received bad " "notify from %s (bad question section)", query_str, q->zone->name, address); } else { ods_log_info("[%s] dropped packet: zone %s received bad " "notify from unknown source (bad question section)", query_str, q->zone->name); } return QUERY_DISCARDED; } } pos = buffer_position(q->buffer); /* examine answer section */ count = buffer_pkt_ancount(q->buffer); if (count) { if (!buffer_skip_dname(q->buffer) || !query_parse_soa(q->buffer, &serial)) { if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] dropped packet: zone %s received bad " "notify from %s (bad soa in answer section)", query_str, q->zone->name, address); } else { ods_log_info("[%s] dropped packet: zone %s received bad " "notify from unknown source (bad soa in answer section)", query_str, q->zone->name); } return QUERY_DISCARDED; } lock_basic_lock(&q->zone->xfrd->serial_lock); if (!util_serial_gt(serial, q->zone->xfrd->serial_disk)) { if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] ignore notify from %s: already got " "zone %s serial %u on disk (received %u)", query_str, address, q->zone->name, q->zone->xfrd->serial_disk, serial); } else { ods_log_info("[%s] ignore notify: already got zone %s " "serial %u on disk (received %u)", query_str, q->zone->name, q->zone->xfrd->serial_disk, serial); } lock_basic_unlock(&q->zone->xfrd->serial_lock); } else if (q->zone->xfrd->serial_notify_acquired) { lock_basic_unlock(&q->zone->xfrd->serial_lock); if (addr2ip(q->addr, address, sizeof(address))) { ods_log_info("[%s] ignore notify from %s: zone %s " "transfer in progress", query_str, address, q->zone->name); } else { ods_log_info("[%s] ignore notify: zone %s transfer in " "progress", query_str, q->zone->name); } } else { q->zone->xfrd->serial_notify = serial; q->zone->xfrd->serial_notify_acquired = time_now(); lock_basic_unlock(&q->zone->xfrd->serial_lock); /* forward notify to xfrd */ if (addr2ip(q->addr, address, sizeof(address))) { ods_log_verbose("[%s] forward notify for zone %s from client %s", query_str, q->zone->name, address); } else { ods_log_verbose("[%s] forward notify for zone %s", query_str, q->zone->name); } xfrd_set_timer_now(q->zone->xfrd); dnshandler_fwd_notify(e->dnshandler, buffer_begin(q->buffer), buffer_remaining(q->buffer)); } } /* send notify ok */ buffer_pkt_set_qr(q->buffer); buffer_pkt_set_aa(q->buffer); buffer_pkt_set_ancount(q->buffer, 0); buffer_clear(q->buffer); /* lim = pos, pos = 0; */ buffer_set_position(q->buffer, pos); buffer_set_limit(q->buffer, buffer_capacity(q->buffer)); q->reserved_space = edns_rr_reserved_space(q->edns_rr); q->reserved_space += tsig_rr_reserved_space(q->tsig_rr); return QUERY_PROCESSED; } /** * IXFR. * */ static query_state query_process_ixfr(query_type* q) { uint16_t count = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(buffer_pkt_qdcount(q->buffer) == 1); /* skip header and question section */ buffer_skip(q->buffer, BUFFER_PKT_HEADER_SIZE); if (!buffer_skip_rr(q->buffer, 1)) { ods_log_error("[%s] dropped packet: zone %s received bad ixfr " "request (bad question section)", query_str, q->zone->name); return QUERY_DISCARDED; } /* answer section is empty */ ods_log_assert(buffer_pkt_ancount(q->buffer) == 0); /* examine auth section */ q->startpos = buffer_position(q->buffer); count = buffer_pkt_nscount(q->buffer); if (count) { if (!buffer_skip_dname(q->buffer) || !query_parse_soa(q->buffer, &(q->serial))) { ods_log_error("[%s] dropped packet: zone %s received bad ixfr " "request (bad soa in auth section)", query_str, q->zone->name); return QUERY_DISCARDED; } ods_log_debug("[%s] found ixfr request zone %s serial=%u", query_str, q->zone->name, q->serial); return QUERY_PROCESSED; } ods_log_debug("[%s] ixfr request zone %s has no auth section", query_str, q->zone->name); q->serial = 0; return QUERY_PROCESSED; } /** * Add RRset to response. * */ static int response_add_rrset(response_type* r, rrset_type* rrset, ldns_pkt_section section) { if (!r || !rrset || !section) { return 0; } /* duplicates? */ r->sections[r->rrset_count] = section; r->rrsets[r->rrset_count] = rrset; ++r->rrset_count; return 1; } /** * Encode RR. * */ static int response_encode_rr(query_type* q, ldns_rr* rr, ldns_pkt_section section) { uint8_t *data = NULL; size_t size = 0; ldns_status status = LDNS_STATUS_OK; ods_log_assert(q); ods_log_assert(rr); ods_log_assert(section); status = ldns_rr2wire(&data, rr, section, &size); if (status != LDNS_STATUS_OK) { ods_log_error("[%s] unable to send good response: ldns_rr2wire() " "failed (%s)", query_str, ldns_get_errorstr_by_id(status)); return 0; } buffer_write(q->buffer, (const void*) data, size); LDNS_FREE(data); return 1; } /** * Encode RRset. * */ static uint16_t response_encode_rrset(query_type* q, rrset_type* rrset, ldns_pkt_section section) { uint16_t i = 0; uint16_t added = 0; ods_log_assert(q); ods_log_assert(rrset); ods_log_assert(section); for (i = 0; i < rrset->rr_count; i++) { added += response_encode_rr(q, rrset->rrs[i].rr, section); } if (q->edns_rr && q->edns_rr->dnssec_ok) { for (i = 0; i < rrset->rrsig_count; i++) { added += response_encode_rr(q, rrset->rrsigs[i].rr, section); } } /* truncation? */ return added; } /** * Encode response. * */ static void response_encode(query_type* q, response_type* r) { uint16_t counts[LDNS_SECTION_ANY]; ldns_pkt_section s = LDNS_SECTION_QUESTION; size_t i = 0; ods_log_assert(q); ods_log_assert(r); for (s = LDNS_SECTION_ANSWER; s < LDNS_SECTION_ANY; s++) { counts[s] = 0; } for (s = LDNS_SECTION_ANSWER; s < LDNS_SECTION_ANY; s++) { for (i = 0; i < r->rrset_count; i++) { if (r->sections[i] == s) { counts[s] += response_encode_rrset(q, r->rrsets[i], s); } } } buffer_pkt_set_ancount(q->buffer, counts[LDNS_SECTION_ANSWER]); buffer_pkt_set_nscount(q->buffer, counts[LDNS_SECTION_AUTHORITY]); buffer_pkt_set_arcount(q->buffer, counts[LDNS_SECTION_ADDITIONAL]); buffer_pkt_set_qr(q->buffer); buffer_pkt_set_aa(q->buffer); return; } /** * Query response. * */ static query_state query_response(query_type* q, ldns_rr_type qtype) { rrset_type* rrset = NULL; response_type r; if (!q || !q->zone) { return QUERY_DISCARDED; } r.rrset_count = 0; lock_basic_lock(&q->zone->zone_lock); rrset = zone_lookup_rrset(q->zone, q->zone->apex, qtype); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_ANSWER)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } /* NS RRset goes into Authority Section */ rrset = zone_lookup_rrset(q->zone, q->zone->apex, LDNS_RR_TYPE_NS); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_AUTHORITY)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } } } else if (qtype != LDNS_RR_TYPE_SOA) { rrset = zone_lookup_rrset(q->zone, q->zone->apex, LDNS_RR_TYPE_SOA); if (rrset) { if (!response_add_rrset(&r, rrset, LDNS_SECTION_AUTHORITY)) { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } } } else { lock_basic_unlock(&q->zone->zone_lock); return query_servfail(q); } lock_basic_unlock(&q->zone->zone_lock); response_encode(q, &r); /* compression */ return QUERY_PROCESSED; } /** * Prepare response. * */ void query_prepare(query_type* q) { uint16_t limit = 0; uint16_t flags = 0; ods_log_assert(q); ods_log_assert(q->buffer); limit = buffer_limit(q->buffer); flags = buffer_pkt_flags(q->buffer); flags &= 0x0100U; /* preserve the rd flag */ flags |= 0x8000U; /* set the qr flag */ buffer_pkt_set_flags(q->buffer, flags); buffer_clear(q->buffer); buffer_set_position(q->buffer, limit); buffer_set_limit(q->buffer, buffer_capacity(q->buffer)); q->reserved_space = edns_rr_reserved_space(q->edns_rr); q->reserved_space += tsig_rr_reserved_space(q->tsig_rr); return; } /** * QUERY. * */ static query_state query_process_query(query_type* q, ldns_rr_type qtype, engine_type* engine) { dnsout_type* dnsout = NULL; if (!q || !q->zone) { return QUERY_DISCARDED; } ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming query qtype=%s for zone %s", query_str, rrset_type2str(qtype), q->zone->name); /* sanity checks */ if (buffer_pkt_qdcount(q->buffer) != 1 || buffer_pkt_tc(q->buffer)) { buffer_pkt_set_flags(q->buffer, 0); return query_formerr(q); } if (buffer_pkt_ancount(q->buffer) != 0 || (qtype != LDNS_RR_TYPE_IXFR && buffer_pkt_nscount(q->buffer) != 0)) { buffer_pkt_set_flags(q->buffer, 0); return query_formerr(q); } /* acl */ if (!q->zone->adoutbound || q->zone->adoutbound->type != ADAPTER_DNS) { ods_log_error("[%s] zone %s is not configured to have output dns " "adapter", query_str, q->zone->name); return query_refused(q); } ods_log_assert(q->zone->adoutbound->config); dnsout = (dnsout_type*) q->zone->adoutbound->config; /* acl also in use for soa and other queries */ if (!acl_find(dnsout->provide_xfr, &q->addr, q->tsig_rr)) { ods_log_debug("[%s] zone %s acl query refused", query_str, q->zone->name); return query_refused(q); } query_prepare(q); /* ixfr? */ if (qtype == LDNS_RR_TYPE_IXFR) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming ixfr request serial=%u for zone %s", query_str, q->serial, q->zone->name); return ixfr(q, engine); } /* axfr? */ if (qtype == LDNS_RR_TYPE_AXFR) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming axfr request for zone %s", query_str, q->zone->name); return axfr(q, engine, 0); } /* (soa) query */ if (qtype == LDNS_RR_TYPE_SOA) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming soa request for zone %s", query_str, q->zone->name); return soa_request(q, engine); } /* other qtypes */ return query_response(q, qtype); } /** * UPDATE. * */ static query_state query_process_update(query_type* q) { if (!q || !q->zone) { return QUERY_DISCARDED; } ods_log_debug("[%s] dynamic update not implemented", query_str); return query_notimpl(q); } /** * Process TSIG RR. * */ static ldns_pkt_rcode query_process_tsig(query_type* q) { if (!q || !q->tsig_rr) { return LDNS_RCODE_SERVFAIL; } if (q->tsig_rr->status == TSIG_ERROR) { return LDNS_RCODE_FORMERR; } if (q->tsig_rr->status == TSIG_OK) { if (!tsig_rr_lookup(q->tsig_rr)) { ods_log_debug("[%s] tsig unknown key/algorithm", query_str); return LDNS_RCODE_REFUSED; } buffer_set_limit(q->buffer, q->tsig_rr->position); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)-1); tsig_rr_prepare(q->tsig_rr); tsig_rr_update(q->tsig_rr, q->buffer, buffer_limit(q->buffer)); if (!tsig_rr_verify(q->tsig_rr)) { ods_log_debug("[%s] bad tsig signature", query_str); return LDNS_RCODE_NOTAUTH; } } return LDNS_RCODE_NOERROR; } /** * Process EDNS OPT RR. * */ static ldns_pkt_rcode query_process_edns(query_type* q) { if (!q || !q->edns_rr) { return LDNS_RCODE_SERVFAIL; } if (q->edns_rr->status == EDNS_ERROR) { /* The only error is VERSION not implemented */ return LDNS_RCODE_FORMERR; } if (q->edns_rr->status == EDNS_OK) { /* Only care about UDP size larger than normal... */ if (!q->tcp && q->edns_rr->maxlen > UDP_MAX_MESSAGE_LEN) { if (q->edns_rr->maxlen < EDNS_MAX_MESSAGE_LEN) { q->maxlen = q->edns_rr->maxlen; } else { q->maxlen = EDNS_MAX_MESSAGE_LEN; } } /* Strip the OPT resource record off... */ buffer_set_position(q->buffer, q->edns_rr->position); buffer_set_limit(q->buffer, q->edns_rr->position); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) - 1); } return LDNS_RCODE_NOERROR; } /** * Find TSIG RR. * */ static int query_find_tsig(query_type* q) { size_t saved_pos = 0; size_t rrcount = 0; size_t i = 0; ods_log_assert(q); ods_log_assert(q->tsig_rr); ods_log_assert(q->buffer); if (buffer_pkt_arcount(q->buffer) == 0) { q->tsig_rr->status = TSIG_NOT_PRESENT; return 1; } saved_pos = buffer_position(q->buffer); rrcount = buffer_pkt_qdcount(q->buffer) + buffer_pkt_ancount(q->buffer) + buffer_pkt_nscount(q->buffer); buffer_set_position(q->buffer, BUFFER_PKT_HEADER_SIZE); for (i=0; i < rrcount; i++) { if (!buffer_skip_rr(q->buffer, i < buffer_pkt_qdcount(q->buffer))) { buffer_set_position(q->buffer, saved_pos); return 0; } } rrcount = buffer_pkt_arcount(q->buffer); ods_log_assert(rrcount != 0); if (!tsig_rr_parse(q->tsig_rr, q->buffer)) { ods_log_debug("[%s] got bad tsig", query_str); return 0; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { --rrcount; } if (rrcount) { if (edns_rr_parse(q->edns_rr, q->buffer)) { --rrcount; } } if (rrcount && q->tsig_rr->status == TSIG_NOT_PRESENT) { /* see if tsig is after the edns record */ if (!tsig_rr_parse(q->tsig_rr, q->buffer)) { ods_log_debug("[%s] got bad tsig", query_str); return 0; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { --rrcount; } } if (rrcount > 0) { ods_log_debug("[%s] too many additional rrs", query_str); return 0; } buffer_set_position(q->buffer, saved_pos); return 1; } /** * Process query. * */ query_state query_process(query_type* q, void* engine) { ldns_status status = LDNS_STATUS_OK; ldns_pkt* pkt = NULL; ldns_rr* rr = NULL; ldns_pkt_rcode rcode = LDNS_RCODE_NOERROR; ldns_pkt_opcode opcode = LDNS_PACKET_QUERY; ldns_rr_type qtype = LDNS_RR_TYPE_SOA; engine_type* e = (engine_type*) engine; ods_log_assert(e); ods_log_assert(q); ods_log_assert(q->buffer); if (!e || !q || !q->buffer) { ods_log_error("[%s] drop query: assertion error", query_str); return QUERY_DISCARDED; /* should not happen */ } if (buffer_limit(q->buffer) < BUFFER_PKT_HEADER_SIZE) { ods_log_debug("[%s] drop query: packet too small", query_str); return QUERY_DISCARDED; /* too small */ } if (buffer_pkt_qr(q->buffer)) { ods_log_debug("[%s] drop query: qr bit set", query_str); return QUERY_DISCARDED; /* not a query */ } /* parse packet */ status = ldns_wire2pkt(&pkt, buffer_current(q->buffer), buffer_remaining(q->buffer)); if (status != LDNS_STATUS_OK) { ods_log_debug("[%s] got bad packet: %s", query_str, ldns_get_errorstr_by_id(status)); return query_formerr(q); } rr = ldns_rr_list_rr(ldns_pkt_question(pkt), 0); lock_basic_lock(&e->zonelist->zl_lock); /* we can just lookup the zone, because we will only handle SOA queries, zone transfers, updates and notifies */ q->zone = zonelist_lookup_zone_by_dname(e->zonelist, ldns_rr_owner(rr), ldns_rr_get_class(rr)); /* don't answer for zones that are just added */ if (q->zone && q->zone->zl_status == ZONE_ZL_ADDED) { ods_log_assert(q->zone->name); ods_log_warning("[%s] zone %s just added, don't answer for now", query_str, q->zone->name); q->zone = NULL; } lock_basic_unlock(&e->zonelist->zl_lock); if (!q->zone) { ods_log_debug("[%s] zone not found", query_str); return query_servfail(q); } /* see if it is tsig signed */ if (!query_find_tsig(q)) { return query_formerr(q); } /* else: valid tsig, or no tsig present */ ods_log_debug("[%s] tsig %s", query_str, tsig_status2str(q->tsig_rr->status)); /* get opcode, qtype, ixfr=serial */ opcode = ldns_pkt_get_opcode(pkt); qtype = ldns_rr_get_type(rr); if (qtype == LDNS_RR_TYPE_IXFR) { ods_log_assert(q->zone->name); ods_log_debug("[%s] incoming ixfr request for zone %s", query_str, q->zone->name); if (query_process_ixfr(q) != QUERY_PROCESSED) { return query_formerr(q); } } /* process tsig */ rcode = query_process_tsig(q); if (rcode != LDNS_RCODE_NOERROR) { return query_error(q, rcode); } /* process edns */ rcode = query_process_edns(q); if (rcode != LDNS_RCODE_NOERROR) { /* We should not return FORMERR, but BADVERS (=16). * BADVERS is created with Ext. RCODE, followed by RCODE. * Ext. RCODE is set to 1, RCODE must be 0 (getting 0x10 = 16). * Thus RCODE = NOERROR = NSD_RC_OK. */ return query_error(q, LDNS_RCODE_NOERROR); } /* handle incoming request */ ldns_pkt_free(pkt); switch (opcode) { case LDNS_PACKET_NOTIFY: return query_process_notify(q, qtype, engine); case LDNS_PACKET_QUERY: return query_process_query(q, qtype, engine); case LDNS_PACKET_UPDATE: return query_process_update(q); default: break; } return query_notimpl(q); } /** * Check if query does not overflow. * */ static int query_overflow(query_type* q) { ods_log_assert(q); ods_log_assert(q->buffer); return buffer_position(q->buffer) > (q->maxlen - q->reserved_space); } /** * Add optional RRs to query. * */ void query_add_optional(query_type* q, void* engine) { engine_type* e = (engine_type*) engine; edns_data_type* edns = NULL; if (!q || !e) { return; } /** First EDNS */ if (q->edns_rr) { edns = &e->edns; switch (q->edns_rr->status) { case EDNS_NOT_PRESENT: break; case EDNS_OK: ods_log_debug("[%s] add edns opt ok", query_str); if (q->edns_rr->dnssec_ok) { edns->ok[7] = 0x80; } else { edns->ok[7] = 0x00; } buffer_write(q->buffer, edns->ok, OPT_LEN); /* fill with NULLs */ buffer_write(q->buffer, edns->rdata_none, OPT_RDATA); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) + 1); break; case EDNS_ERROR: ods_log_debug("[%s] add edns opt err", query_str); if (q->edns_rr->dnssec_ok) { edns->ok[7] = 0x80; } else { edns->ok[7] = 0x00; } buffer_write(q->buffer, edns->error, OPT_LEN); buffer_write(q->buffer, edns->rdata_none, OPT_RDATA); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer) + 1); break; default: break; } } /** Then TSIG */ if (!q->tsig_rr) { return; } if (q->tsig_rr->status != TSIG_NOT_PRESENT) { if (q->tsig_rr->status == TSIG_ERROR || q->tsig_rr->error_code != LDNS_RCODE_NOERROR) { ods_log_debug("[%s] add tsig err", query_str); tsig_rr_error(q->tsig_rr); tsig_rr_append(q->tsig_rr, q->buffer); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)+1); } else if (q->tsig_rr->status == TSIG_OK && q->tsig_rr->error_code == LDNS_RCODE_NOERROR) { ods_log_debug("[%s] add tsig ok", query_str); if (q->tsig_prepare_it) tsig_rr_prepare(q->tsig_rr); if (q->tsig_update_it) tsig_rr_update(q->tsig_rr, q->buffer, buffer_position(q->buffer)); if (q->tsig_sign_it) { tsig_rr_sign(q->tsig_rr); tsig_rr_append(q->tsig_rr, q->buffer); buffer_pkt_set_arcount(q->buffer, buffer_pkt_arcount(q->buffer)+1); } } } return; } /** * Add RR to query. * */ int query_add_rr(query_type* q, ldns_rr* rr) { size_t i = 0; size_t tc_mark = 0; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(rr); /* set truncation mark, in case rr does not fit */ tc_mark = buffer_position(q->buffer); /* owner type class ttl */ if (!buffer_available(q->buffer, ldns_rdf_size(ldns_rr_owner(rr)))) { goto query_add_rr_tc; } buffer_write_rdf(q->buffer, ldns_rr_owner(rr)); if (!buffer_available(q->buffer, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(rdlength))) { goto query_add_rr_tc; } buffer_write_u16(q->buffer, (uint16_t) ldns_rr_get_type(rr)); buffer_write_u16(q->buffer, (uint16_t) ldns_rr_get_class(rr)); buffer_write_u32(q->buffer, (uint32_t) ldns_rr_ttl(rr)); /* skip rdlength */ rdlength_pos = buffer_position(q->buffer); buffer_skip(q->buffer, sizeof(rdlength)); /* write rdata */ for (i=0; i < ldns_rr_rd_count(rr); i++) { if (!buffer_available(q->buffer, ldns_rdf_size(ldns_rr_rdf(rr, i)))) { goto query_add_rr_tc; } buffer_write_rdf(q->buffer, ldns_rr_rdf(rr, i)); } if (!query_overflow(q)) { /* write rdlength */ rdlength = buffer_position(q->buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(q->buffer, rdlength_pos, rdlength); /* position updated by buffer_write() */ return 1; } query_add_rr_tc: buffer_set_position(q->buffer, tc_mark); ods_log_assert(!query_overflow(q)); return 0; } /** * Cleanup query. * */ void query_cleanup(query_type* q) { allocator_type* allocator = NULL; if (!q) { return; } allocator = q->allocator; if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } buffer_cleanup(q->buffer, allocator); tsig_rr_cleanup(q->tsig_rr); allocator_deallocate(allocator, (void*)q); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/wire/query.h0000644000175000017500000000733712650165732015172 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Query. * */ #ifndef WIRE_QUERY_H #define WIRE_QUERY_H #include "config.h" #include "shared/allocator.h" #include "signer/zone.h" #include "wire/buffer.h" #include "wire/edns.h" #include "wire/tsig.h" #define UDP_MAX_MESSAGE_LEN 512 #define TCP_MAX_MESSAGE_LEN 65535 #define QUERY_RESPONSE_MAX_RRSET 10 /* should be enough */ enum query_enum { QUERY_PROCESSED = 0, QUERY_DISCARDED, QUERY_AXFR, QUERY_IXFR }; typedef enum query_enum query_state; /** * Query. * */ typedef struct query_struct query_type; struct query_struct { /* Memory allocator */ allocator_type* allocator; /* Query from addres */ struct sockaddr_storage addr; socklen_t addrlen; /* Maximum supported query size */ size_t maxlen; size_t reserved_space; /* TSIG */ tsig_rr_type* tsig_rr; /* EDNS */ edns_rr_type* edns_rr; /* TCP */ int tcp; uint16_t tcplen; buffer_type* buffer; /* QNAME, QTYPE, QCLASS */ /* Zone */ zone_type* zone; /* Compression */ /* AXFR IXFR */ FILE* axfr_fd; uint32_t serial; size_t startpos; /* Bits */ unsigned axfr_is_done : 1; unsigned tsig_prepare_it : 1; unsigned tsig_update_it : 1; unsigned tsig_sign_it : 1; }; /** * Response. * */ typedef struct response_struct response_type; struct response_struct { size_t rrset_count; ldns_pkt_section sections[QUERY_RESPONSE_MAX_RRSET]; rrset_type* rrsets[QUERY_RESPONSE_MAX_RRSET]; }; /** * Create query. * \return query_type* query * */ query_type* query_create(void); /** * Prepare response. * \param[in] q query * */ void query_prepare(query_type* q); /** * Process query. * \param[in] q query * \param[in] engine signer engine * \return query_state state of the query * */ query_state query_process(query_type* q, void* engine); /** * Reset query. * \param[in] q query * \param[in] maxlen maximum message length * \param[in] is_tcp 1 if tcp query * */ void query_reset(query_type* q, size_t maxlen, int is_tcp); /** * Add optional RRs to query. * \param[in] q query * \param[in] engine signer engine * */ void query_add_optional(query_type* q, void* engine); /** * Add RR to query. * \param[in] q query * \param[in] rr RR * \return int 1 if ok, 0 if overflow. * */ int query_add_rr(query_type* q, ldns_rr* rr); /** * Cleanup query. * \param[in] q query * */ void query_cleanup(query_type* q); #endif /* WIRE_QUERY_H */ opendnssec-1.4.9/signer/src/wire/notify.c0000644000175000017500000004305412650165732015324 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Notify sending. * */ #include "config.h" #include "adapter/addns.h" #include "daemon/xfrhandler.h" #include "signer/domain.h" #include "signer/zone.h" #include "wire/notify.h" #include "wire/xfrd.h" #include static const char* notify_str = "notify"; static void notify_handle_zone(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Get time. * */ static time_t notify_time(notify_type* notify) { ods_log_assert(notify); ods_log_assert(notify->xfrhandler); return xfrhandler_time((xfrhandler_type*) notify->xfrhandler); } /** * Set timer. * */ static void notify_set_timer(notify_type* notify, time_t t) { if (!notify || !notify->xfrhandler) { return; } /** * Randomize the time, within 90%-100% of original. * Not later so zones cannot expire too late. */ if(t > notify_time(notify) + 10) { time_t extra = t - notify_time(notify); time_t base = extra*9/10; #ifdef HAVE_ARC4RANDOM_UNIFORM t = notify_time(notify) + base + arc4random_uniform(extra-base); #elif HAVE_ARC4RANDOM t = notify_time(notify) + base + arc4random()%(extra-base); #else t = notify_time(notify) + base + random()%(extra-base); #endif } notify->handler.timeout = ¬ify->timeout; notify->timeout.tv_sec = t; notify->timeout.tv_nsec = 0; return; } /** * Create notify structure. * */ notify_type* notify_create(void* xfrhandler, void* zone) { notify_type* notify = NULL; allocator_type* allocator = NULL; if (!xfrhandler || !zone) { return NULL; } allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to create notify structure: " "allocator_create() failed", notify_str); return NULL; } notify = (notify_type*) allocator_alloc(allocator, sizeof(notify_type)); if (!notify) { ods_log_error("[%s] unable to create notify structure: " " allocator_alloc() failed", notify_str); allocator_cleanup(allocator); return NULL; } notify->allocator = allocator; notify->zone = zone; notify->xfrhandler = xfrhandler; notify->waiting_next = NULL; notify->secondary = NULL; notify->soa = NULL; notify->tsig_rr = tsig_rr_create(allocator); if (!notify->tsig_rr) { notify_cleanup(notify); return NULL; } notify->retry = 0; notify->query_id = 0; notify->is_waiting = 0; notify->handler.fd = -1; notify->timeout.tv_sec = 0; notify->timeout.tv_nsec = 0; notify->handler.timeout = NULL; notify->handler.user_data = notify; notify->handler.event_types = NETIO_EVENT_READ|NETIO_EVENT_TIMEOUT; notify->handler.event_handler = notify_handle_zone; return notify; } /** * Setup notify. * */ static void notify_setup(notify_type* notify) { zone_type* zone = NULL; dnsout_type* dnsout = NULL; if (!notify) { return; } zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->adoutbound); ods_log_assert(zone->adoutbound->config); ods_log_assert(zone->adoutbound->type == ADAPTER_DNS); dnsout = (dnsout_type*) zone->adoutbound->config; notify->retry = 0; notify->secondary = dnsout->do_notify; ods_log_debug("[%s] setup notify for zone %s", notify_str, zone->name); notify_set_timer(notify, notify_time(notify)); return; } /** * Disable notify. * */ static void notify_disable(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; if (!notify) { return; } xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); notify->secondary = NULL; notify->handler.timeout = NULL; if (notify->handler.fd != -1) { close(notify->handler.fd); notify->handler.fd = -1; } if (xfrhandler->notify_udp_num == NOTIFY_MAX_UDP) { while (xfrhandler->notify_waiting_first) { notify_type* wn = xfrhandler->notify_waiting_first; ods_log_assert(wn->is_waiting); wn->is_waiting = 0; xfrhandler->notify_waiting_first = wn->waiting_next; if (xfrhandler->notify_waiting_last == wn) { xfrhandler->notify_waiting_last = NULL; } if (wn->secondary) { ods_log_debug("[%s] zone %s notify off waiting list", notify_str, zone->name); notify_setup(wn); return; } } } ods_log_debug("[%s] notify for zone %s disabled", notify_str, zone->name); xfrhandler->notify_udp_num--; return; } /** * Next secondary. * */ static void notify_next(notify_type* notify) { if (!notify || !notify->secondary) { return; } notify->secondary = notify->secondary->next; notify->retry = 0; if (!notify->secondary) { zone_type* zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] zone %s no more secondaries, disable notify", notify_str, zone->name); notify_disable(notify); } return; } /** * Read packet from udp. * */ static int notify_udp_read_packet(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; ssize_t received = 0; ods_log_assert(notify); xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); buffer_clear(xfrhandler->packet); received = recvfrom(notify->handler.fd, buffer_begin(xfrhandler->packet), buffer_remaining(xfrhandler->packet), 0, NULL, NULL); if (received == -1) { ods_log_error("[%s] unable to read packet: recvfrom() failed fd %d " "(%s)", notify_str, notify->handler.fd, strerror(errno)); return 0; } buffer_set_limit(xfrhandler->packet, received); return 1; } /** * Handle notify reply. * */ static int notify_handle_reply(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); if (xfrhandler->packet->limit < 3 || (buffer_pkt_opcode(xfrhandler->packet) != LDNS_PACKET_NOTIFY) || (buffer_pkt_qr(xfrhandler->packet) == 0)) { ods_log_error("[%s] zone %s received bad notify reply opcode/qr from %s", notify_str, zone->name, notify->secondary->address); return 0; } if (buffer_pkt_id(xfrhandler->packet) != notify->query_id) { ods_log_error("[%s] zone %s received bad notify reply id from %s", notify_str, zone->name, notify->secondary->address); return 0; } /* could check tsig */ if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOERROR) { const char* str = buffer_rcode2str(buffer_pkt_rcode(xfrhandler->packet)); ods_log_error("[%s] zone %s received bad notify rcode %s from %s", notify_str, zone->name, str?str:"UNKNOWN", notify->secondary->address); if (buffer_pkt_rcode(xfrhandler->packet) != LDNS_RCODE_NOTIMPL) { return 1; } return 0; } ods_log_debug("[%s] zone %s secondary %s notify reply ok", notify_str, zone->name, notify->secondary->address); return 1; } /** * Send notify over udp. * */ static int notify_send_udp(notify_type* notify, buffer_type* buffer) { struct sockaddr_storage to; socklen_t to_len = 0; int fd = -1; int family = PF_INET; ssize_t nb = 0; ods_log_assert(buffer); ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); /* this will set the remote port to acl->port or TCP_PORT */ to_len = xfrd_acl_sockaddr_to(notify->secondary, &to); /* get the address family of the remote host */ if (notify->secondary->family == AF_INET6) { family = PF_INET6; } /* create socket */ fd = socket(family, SOCK_DGRAM, IPPROTO_UDP); if (fd == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "socket() failed (%s)", notify_str, notify->secondary->address, strerror(errno)); return -1; } /* bind it? */ /* send it (udp) */ ods_log_deeebug("[%s] send %d bytes over udp to %s", notify_str, buffer_remaining(buffer), notify->secondary->address); nb = sendto(fd, buffer_current(buffer), buffer_remaining(buffer), 0, (struct sockaddr*)&to, to_len); if (nb == -1) { ods_log_error("[%s] unable to send data over udp to %s: " "sendto() failed (%s)", notify_str, notify->secondary->address, strerror(errno)); close(fd); return -1; } return fd; } /** * Sign notify. * */ static void notify_tsig_sign(notify_type* notify, buffer_type* buffer) { tsig_algo_type* algo = NULL; if (!notify || !notify->tsig_rr || !notify->secondary || !notify->secondary->tsig || !notify->secondary->tsig->key || !buffer) { return; /* no tsig configured */ } algo = tsig_lookup_algo(notify->secondary->tsig->algorithm); if (!algo) { ods_log_error("[%s] unable to sign notify: tsig unknown algorithm " "%s", notify_str, notify->secondary->tsig->algorithm); return; } ods_log_assert(algo); tsig_rr_reset(notify->tsig_rr, algo, notify->secondary->tsig->key); notify->tsig_rr->original_query_id = buffer_pkt_id(buffer); notify->tsig_rr->algo_name = ldns_rdf_clone(notify->tsig_rr->algo->wf_name); notify->tsig_rr->key_name = ldns_rdf_clone(notify->tsig_rr->key->dname); log_dname(notify->tsig_rr->key_name, "tsig sign notify with key", LOG_DEBUG); log_dname(notify->tsig_rr->algo_name, "tsig sign notify with algorithm", LOG_DEBUG); tsig_rr_prepare(notify->tsig_rr); tsig_rr_update(notify->tsig_rr, buffer, buffer_position(buffer)); tsig_rr_sign(notify->tsig_rr); ods_log_debug("[%s] tsig append rr to notify id=%u", notify_str, buffer_pkt_id(buffer)); tsig_rr_append(notify->tsig_rr, buffer); buffer_pkt_set_arcount(buffer, buffer_pkt_arcount(buffer)+1); tsig_rr_prepare(notify->tsig_rr); return; } /** * Send notify. * */ void notify_send(notify_type* notify) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; ods_log_assert(notify); ods_log_assert(notify->secondary); ods_log_assert(notify->secondary->address); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); if (notify->handler.fd != -1) { close(notify->handler.fd); } notify->handler.fd = -1; notify->timeout.tv_sec = notify_time(notify) + NOTIFY_RETRY_TIMEOUT; buffer_pkt_notify(xfrhandler->packet, zone->apex, LDNS_RR_CLASS_IN); notify->query_id = buffer_pkt_id(xfrhandler->packet); buffer_pkt_set_aa(xfrhandler->packet); /* add current SOA to answer section */ if (notify->soa) { if (buffer_write_rr(xfrhandler->packet, notify->soa)) { buffer_pkt_set_ancount(xfrhandler->packet, 1); } } if (notify->secondary->tsig) { notify_tsig_sign(notify, xfrhandler->packet); } buffer_flip(xfrhandler->packet); notify->handler.fd = notify_send_udp(notify, xfrhandler->packet); if (notify->handler.fd == -1) { ods_log_error("[%s] unable to send notify retry %u for zone %s to " "%s: notify_send_udp() failed", notify_str, notify->retry, zone->name, notify->secondary->address); return; } ods_log_verbose("[%s] notify retry %u for zone %s sent to %s", notify_str, notify->retry, zone->name, notify->secondary->address); return; } /** * Handle notify. * */ static void notify_handle_zone(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { notify_type* notify = NULL; xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; if (!handler) { return; } notify = (notify_type*) handler->user_data; ods_log_assert(notify); xfrhandler = (xfrhandler_type*) notify->xfrhandler; zone = (zone_type*) notify->zone; ods_log_assert(xfrhandler); ods_log_assert(zone); ods_log_assert(zone->name); ods_log_debug("[%s] handle notify for zone %s", notify_str, zone->name); if (notify->is_waiting) { ods_log_debug("[%s] already waiting, skipping notify for zone %s", notify_str, zone->name); ods_log_assert(notify->handler.fd == -1); return; } if (event_types & NETIO_EVENT_READ) { ods_log_debug("[%s] read notify ok for zone %s", notify_str, zone->name); ods_log_assert(notify->handler.fd != -1); if (notify_udp_read_packet(notify)) { if (notify_handle_reply(notify)) { notify_next(notify); } } } else if(event_types & NETIO_EVENT_TIMEOUT) { ods_log_debug("[%s] notify timeout for zone %s", notify_str, zone->name); /* timeout, try again */ } /* see if notify is still enabled */ if (notify->secondary) { ods_log_assert(notify->secondary->address); notify->retry++; if (notify->retry > NOTIFY_MAX_RETRY) { ods_log_verbose("[%s] notify max retry for zone %s, %s unreachable", notify_str, zone->name, notify->secondary->address); notify_next(notify); } else { notify_send(notify); } } return; } /** * Update current SOA. * */ static void notify_update_soa(notify_type* notify, ldns_rr* soa) { if (!notify) { return; } if (notify->soa) { ldns_rr_free(notify->soa); } notify->soa = soa; return; } /** * Enable notify. * */ void notify_enable(notify_type* notify, ldns_rr* soa) { xfrhandler_type* xfrhandler = NULL; zone_type* zone = NULL; dnsout_type* dnsout = NULL; if (!notify) { return; } xfrhandler = (xfrhandler_type*) notify->xfrhandler; ods_log_assert(xfrhandler); zone = (zone_type*) notify->zone; ods_log_assert(zone); ods_log_assert(zone->name); ods_log_assert(zone->adoutbound); ods_log_assert(zone->adoutbound->config); ods_log_assert(zone->adoutbound->type == ADAPTER_DNS); dnsout = (dnsout_type*) zone->adoutbound->config; if (!dnsout->do_notify) { ods_log_warning("[%s] zone %s has no notify acl", notify_str, zone->name); return; /* nothing to do */ } notify_update_soa(notify, soa); if (notify->is_waiting) { ods_log_debug("[%s] zone %s already on waiting list", notify_str, zone->name); return; } if (xfrhandler->notify_udp_num < NOTIFY_MAX_UDP) { notify_setup(notify); xfrhandler->notify_udp_num++; ods_log_debug("[%s] zone %s notify enabled", notify_str, zone->name); return; } /* put it in waiting list */ notify->secondary = dnsout->do_notify; notify->is_waiting = 1; notify->waiting_next = NULL; if (xfrhandler->notify_waiting_last) { xfrhandler->notify_waiting_last->waiting_next = notify; } else { xfrhandler->notify_waiting_first = notify; } xfrhandler->notify_waiting_last = notify; notify->handler.timeout = NULL; ods_log_debug("[%s] zone %s notify on waiting list", notify_str, zone->name); return; } /** * Cleanup notify structure. * */ void notify_cleanup(notify_type* notify) { allocator_type* allocator = NULL; if (!notify) { return; } allocator = notify->allocator; if (notify->handler.fd != -1) { close(notify->handler.fd); notify->handler.fd = -1; } if (notify->soa) { ldns_rr_free(notify->soa); } tsig_rr_cleanup(notify->tsig_rr); allocator_deallocate(allocator, (void*) notify); allocator_cleanup(allocator); return; } opendnssec-1.4.9/signer/src/wire/sock.c0000644000175000017500000006456712650165732014767 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Sockets. * */ #include "config.h" #include "daemon/engine.h" #include "shared/log.h" #include "signer/zone.h" #include "wire/axfr.h" #include "wire/netio.h" #include "wire/sock.h" #include "wire/xfrd.h" #include #include #include #include #define SOCK_TCP_BACKLOG 5 static const char* sock_str = "socket"; /** * Set udp socket to non-blocking and bind. * */ static ods_status sock_fcntl_and_bind(sock_type* sock, const char* node, const char* port, const char* stype, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(stype); ods_log_assert(fam); if (fcntl(sock->s, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] unable to set %s/%s socket '%s:%s' to " "non-blocking: fcntl() failed (%s)", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_FCNTL_NONBLOCK; } ods_log_debug("[%s] bind %s/%s socket '%s:%s'", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); if (bind(sock->s, (struct sockaddr *) sock->addr->ai_addr, sock->addr->ai_addrlen) != 0) { ods_log_error("[%s] unable to bind %s/%s socket '%s:%s': bind() " "failed (%s)", sock_str, stype, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_BIND; } return ODS_STATUS_OK; } /** * Set socket to v6 only. * */ static ods_status sock_v6only(sock_type* sock, const char* node, const char* port, int on, const char* stype) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(stype); #ifdef IPV6_V6ONLY #if defined(IPPROTO_IPV6) ods_log_debug("[%s] set %s/ipv6 socket '%s:%s' v6only", sock_str, stype, node?node:"localhost", port); if (setsockopt(sock->s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0) { ods_log_error("[%s] unable to set %s/ipv6 socket '%s:%s' to " "ipv6-only: setsockopt() failed (%s)", sock_str, stype, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_SETSOCKOPT_V6ONLY; } #endif #endif /* IPV6_V6ONLY */ return ODS_STATUS_OK; } /** * Set tcp socket to reusable. * */ static void sock_tcp_reuseaddr(sock_type* sock, const char* node, const char* port, int on, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(fam); if (setsockopt(sock->s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { ods_log_error("[%s] unable to set tcp/%s socket '%s:%s' to " "reuse-addr: setsockopt() failed (%s)", sock_str, fam, node?node:"localhost", port, strerror(errno)); } return; } /** * Listen on tcp socket. * */ static ods_status sock_tcp_listen(sock_type* sock, const char* node, const char* port, const char* fam) { ods_log_assert(sock); ods_log_assert(port); ods_log_assert(fam); if (listen(sock->s, SOCK_TCP_BACKLOG) == -1) { ods_log_error("[%s] unable to listen on tcp/%s socket '%s:%s': " "listen() failed (%s)", sock_str, fam, node?node:"localhost", port, strerror(errno)); return ODS_STATUS_SOCK_LISTEN; } return ODS_STATUS_OK; } /** * Create server udp socket. * */ static ods_status sock_server_udp(sock_type* sock, const char* node, const char* port, unsigned* ip6_support) { int on = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(sock); ods_log_assert(port); #if defined(SO_REUSEADDR) || defined(IPV6_V6ONLY) on = 1; #endif *ip6_support = 1; /* socket */ ods_log_debug("[%s] create udp socket '%s:%s'", sock_str, node?node:"localhost", port, strerror(errno)); if ((sock->s = socket(sock->addr->ai_family, SOCK_DGRAM, 0))== -1) { ods_log_error("[%s] unable to create udp/ipv4 socket '%s:%s': " "socket() failed (%s)", sock_str, node?node:"localhost", port, strerror(errno)); if (sock->addr->ai_family == AF_INET6 && errno == EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_SOCKET_UDP; } /* ipv4 */ if (sock->addr->ai_family == AF_INET) { status = sock_fcntl_and_bind(sock, node, port, "udp", "ipv4"); } /* ipv6 */ else if (sock->addr->ai_family == AF_INET6) { status = sock_v6only(sock, node, port, on, "udp"); if (status != ODS_STATUS_OK) { return status; } status = sock_fcntl_and_bind(sock, node, port, "udp", "ipv6"); } return status; } /** * Create server tcp socket. * */ static ods_status sock_server_tcp(sock_type* sock, const char* node, const char* port, unsigned* ip6_support) { int on = 0; ods_status status = ODS_STATUS_OK; ods_log_assert(sock); ods_log_assert(port); #if defined(SO_REUSEADDR) || defined(IPV6_V6ONLY) on = 1; #endif *ip6_support = 1; /* socket */ ods_log_debug("[%s] create tcp socket '%s:%s'", sock_str, node?node:"localhost", port, strerror(errno)); if ((sock->s = socket(sock->addr->ai_family, SOCK_STREAM, 0))== -1) { ods_log_error("[%s] unable to create tcp/ipv4 socket '%s:%s': " "socket() failed (%s)", sock_str, node?node:"localhost", port, strerror(errno)); if (sock->addr->ai_family == AF_INET6 && errno == EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_SOCKET_TCP; } /* ipv4 */ if (sock->addr->ai_family == AF_INET) { sock_tcp_reuseaddr(sock, node, port, on, "ipv4"); status = sock_fcntl_and_bind(sock, node, port, "tcp", "ipv4"); if (status == ODS_STATUS_OK) { status = sock_tcp_listen(sock, node, port, "ipv4"); } } /* ipv6 */ else if (sock->addr->ai_family == AF_INET6) { status = sock_v6only(sock, node, port, on, "tcp"); if (status != ODS_STATUS_OK) { return status; } sock_tcp_reuseaddr(sock, node, port, on, "ipv6"); status = sock_fcntl_and_bind(sock, node, port, "tcp", "ipv6"); if (status == ODS_STATUS_OK) { status = sock_tcp_listen(sock, node, port, "ipv6"); } } return status; } /** * Create listening socket. * */ static ods_status socket_listen(sock_type* sock, struct addrinfo hints, int socktype, const char* node, const char* port, unsigned* ip6_support) { ods_status status = ODS_STATUS_OK; int r = 0; ods_log_assert(sock); ods_log_assert(port); *ip6_support = 1; hints.ai_socktype = socktype; /* getaddrinfo */ if ((r = getaddrinfo(node, port, &hints, &sock->addr)) != 0 || !sock->addr) { ods_log_error("[%s] unable to parse address '%s:%s': getaddrinfo() " "failed (%s %s)", sock_str, node?node:"localhost", port, gai_strerror(r), #ifdef EAI_SYSTEM r==EAI_SYSTEM?(char*)strerror(errno):""); #else ""); #endif if (hints.ai_family == AF_INET6 && r==EAFNOSUPPORT) { *ip6_support = 0; } return ODS_STATUS_SOCK_GETADDRINFO; } /* socket */ if (socktype == SOCK_DGRAM) { status = sock_server_udp(sock, node, port, ip6_support); } else if (socktype == SOCK_STREAM) { status = sock_server_tcp(sock, node, port, ip6_support); } ods_log_debug("[%s] socket listening to %s:%s", sock_str, node?node:"localhost", port); return status; } /** * Create sockets and listen. * */ ods_status sock_listen(socklist_type* sockets, listener_type* listener) { ods_status status = ODS_STATUS_OK; struct addrinfo hints[MAX_INTERFACES]; const char* node = NULL; const char* port = NULL; size_t i = 0; unsigned ip6_support = 1; if (!sockets || !listener) { return ODS_STATUS_ASSERT_ERR; } /* Initialize values */ for (i = 0; i < MAX_INTERFACES; i++) { memset(&hints[i], 0, sizeof(hints[i])); hints[i].ai_family = AF_UNSPEC; hints[i].ai_flags = AI_PASSIVE; sockets->udp[i].s = -1; sockets->tcp[i].s = -1; } /* Walk interfaces */ for (i=0; i < listener->count; i++) { node = NULL; if (strlen(listener->interfaces[i].address) > 0) { node = listener->interfaces[i].address; } port = DNS_PORT_STRING; if (listener->interfaces[i].port) { port = listener->interfaces[i].port; } if (node != NULL) { hints[i].ai_flags |= AI_NUMERICHOST; } else { hints[i].ai_family = listener->interfaces[i].family; } /* udp */ status = socket_listen(&sockets->udp[i], hints[i], SOCK_DGRAM, node, port, &ip6_support); if (status != ODS_STATUS_OK) { if (!ip6_support) { ods_log_warning("[%s] fallback to udp/ipv4, no udp/ipv6: " "not supported", sock_str); status = ODS_STATUS_OK; } else { return status; } } /* tcp */ status = socket_listen(&sockets->tcp[i], hints[i], SOCK_STREAM, node, port, &ip6_support); if (status != ODS_STATUS_OK) { if (!ip6_support) { ods_log_warning("[%s] fallback to udp/ipv4, no udp/ipv6: " "not supported", sock_str); status = ODS_STATUS_OK; } else { return status; } } } /* All ok */ return ODS_STATUS_OK; } /** * Send data over udp. * */ static void send_udp(struct udp_data* data, query_type* q) { ssize_t nb; ods_log_deeebug("[%s] sending %d bytes over udp", sock_str, (int)buffer_remaining(q->buffer)); nb = sendto(data->socket->s, buffer_begin(q->buffer), buffer_remaining(q->buffer), 0, (struct sockaddr*) &q->addr, q->addrlen); if (nb == -1) { ods_log_error("[%s] unable to send data over udp: sendto() failed " "(%s)", sock_str, strerror(errno)); ods_log_debug("[%s] len=%u", sock_str, buffer_remaining(q->buffer)); } else if ((size_t) nb != buffer_remaining(q->buffer)) { ods_log_error("[%s] unable to send data over udp: only sent %d of %d " "octets", sock_str, (int)nb, (int)buffer_remaining(q->buffer)); } return; } /** * Handle incoming udp queries. * */ void sock_handle_udp(netio_type* ATTR_UNUSED(netio), netio_handler_type* handler, netio_events_type event_types) { struct udp_data* data = (struct udp_data*) handler->user_data; int received = 0; query_type* q = data->query; query_state qstate = QUERY_PROCESSED; if (!(event_types & NETIO_EVENT_READ)) { return; } ods_log_debug("[%s] incoming udp message", sock_str); query_reset(q, UDP_MAX_MESSAGE_LEN, 0); received = recvfrom(handler->fd, buffer_begin(q->buffer), buffer_remaining(q->buffer), 0, (struct sockaddr*) &q->addr, &q->addrlen); if (received < 1) { if (errno != EAGAIN && errno != EINTR) { ods_log_error("[%s] recvfrom() failed: %s", sock_str, strerror(errno)); } return; } buffer_skip(q->buffer, received); buffer_flip(q->buffer); qstate = query_process(q, data->engine); if (qstate != QUERY_DISCARDED) { ods_log_debug("[%s] query processed qstate=%d", sock_str, qstate); query_add_optional(q, data->engine); buffer_flip(q->buffer); send_udp(data, q); } return; } /** * Cleanup tcp handler data. * */ static void cleanup_tcp_handler(netio_type* netio, netio_handler_type* handler) { struct tcp_data* data = (struct tcp_data*) handler->user_data; allocator_type* allocator = data->allocator; netio_remove_handler(netio, handler); close(handler->fd); allocator_deallocate(allocator, (void*) handler->timeout); allocator_deallocate(allocator, (void*) handler); query_cleanup(data->query); allocator_deallocate(allocator, (void*) data); allocator_cleanup(allocator); return; } /** * Handle incoming tcp connections. * */ void sock_handle_tcp_accept(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { allocator_type* allocator = NULL; struct tcp_accept_data* accept_data = (struct tcp_accept_data*) handler->user_data; int s = 0; struct tcp_data* tcp_data = NULL; netio_handler_type* tcp_handler = NULL; struct sockaddr_storage addr; socklen_t addrlen = 0; if (!(event_types & NETIO_EVENT_READ)) { return; } ods_log_debug("[%s] handle incoming tcp connection", sock_str); addrlen = sizeof(addr); s = accept(handler->fd, (struct sockaddr *) &addr, &addrlen); if (s == -1) { if (errno != EINTR && errno != EWOULDBLOCK) { ods_log_error("[%s] unable to handle incoming tcp connection: " "accept() failed (%s)", sock_str, strerror(errno)); } return; } if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) { ods_log_error("[%s] unable to handle incoming tcp connection: " "fcntl() failed: %s", sock_str, strerror(errno)); close(s); return; } /* create tcp handler data */ allocator = allocator_create(malloc, free); if (!allocator) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_create() failed", sock_str); close(s); return; } tcp_data = (struct tcp_data*) allocator_alloc(allocator, sizeof(struct tcp_data)); if (!tcp_data) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() data failed", sock_str); allocator_cleanup(allocator); close(s); return; } tcp_data->allocator = allocator; tcp_data->query = query_create(); if (!tcp_data->query) { ods_log_error("[%s] unable to handle incoming tcp connection: " "query_create() failed", sock_str); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_data->engine = accept_data->engine; tcp_data->tcp_accept_handler_count = accept_data->tcp_accept_handler_count; tcp_data->tcp_accept_handlers = accept_data->tcp_accept_handlers; tcp_data->qstate = QUERY_PROCESSED; tcp_data->bytes_transmitted = 0; memcpy(&tcp_data->query->addr, &addr, addrlen); tcp_data->query->addrlen = addrlen; tcp_handler = (netio_handler_type*) allocator_alloc(allocator, sizeof(netio_handler_type)); if (!tcp_handler) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() handler failed", sock_str); query_cleanup(tcp_data->query); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_handler->fd = s; tcp_handler->timeout = (struct timespec*) allocator_alloc(allocator, sizeof(struct timespec)); if (!tcp_handler->timeout) { ods_log_error("[%s] unable to handle incoming tcp connection: " "allocator_alloc() timeout failed", sock_str); allocator_deallocate(allocator, (void*) tcp_handler); query_cleanup(tcp_data->query); allocator_deallocate(allocator, (void*) tcp_data); allocator_cleanup(allocator); close(s); return; } tcp_handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; tcp_handler->timeout->tv_nsec = 0L; timespec_add(tcp_handler->timeout, netio_current_time(netio)); tcp_handler->user_data = tcp_data; tcp_handler->event_types = NETIO_EVENT_READ | NETIO_EVENT_TIMEOUT; tcp_handler->event_handler = sock_handle_tcp_read; netio_add_handler(netio, tcp_handler); return; } /** * Handle incoming tcp queries. * */ void sock_handle_tcp_read(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { struct tcp_data* data = (struct tcp_data *) handler->user_data; ssize_t received = 0; query_state qstate = QUERY_PROCESSED; if (event_types & NETIO_EVENT_TIMEOUT) { cleanup_tcp_handler(netio, handler); return; } ods_log_assert(event_types & NETIO_EVENT_READ); ods_log_debug("[%s] incoming tcp message", sock_str); if (data->bytes_transmitted == 0) { ods_log_debug("[%s] TCP_READ: reset query", sock_str); query_reset(data->query, TCP_MAX_MESSAGE_LEN, 1); } /* check if we received the leading packet length bytes yet. */ if (data->bytes_transmitted < sizeof(uint16_t)) { received = read(handler->fd, (char *) &data->query->tcplen + data->bytes_transmitted, sizeof(uint16_t) - data->bytes_transmitted); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, wait until more data is available. */ return; } else { ods_log_error("[%s] unable to handle incoming tcp query: " "read() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (received == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += received; ods_log_debug("[%s] TCP_READ: bytes transmitted %u (received %u)", sock_str, data->bytes_transmitted, received); if (data->bytes_transmitted < sizeof(uint16_t)) { /* not done with the tcplen yet, wait for more. */ ods_log_debug("[%s] TCP_READ: bytes transmitted %u, while ", "sizeof uint16_t %u", sock_str, data->bytes_transmitted, sizeof(uint16_t)); return; } ods_log_assert(data->bytes_transmitted == sizeof(uint16_t)); data->query->tcplen = ntohs(data->query->tcplen); /* minimum query size is: 12 + 1 + 2 + 2: * header size + root dname + qclass + qtype */ if (data->query->tcplen < 17) { ods_log_warning("[%s] unable to handle incoming tcp query: " "packet too small", sock_str); cleanup_tcp_handler(netio, handler); return; } if (data->query->tcplen > data->query->maxlen) { ods_log_warning("[%s] unable to handle incoming tcp query: " "insufficient tcp buffer", sock_str); cleanup_tcp_handler(netio, handler); return; } buffer_set_limit(data->query->buffer, data->query->tcplen); } ods_log_assert(buffer_remaining(data->query->buffer) > 0); /* read the (remaining) query data. */ received = read(handler->fd, buffer_current(data->query->buffer), buffer_remaining(data->query->buffer)); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, wait until more data is available. */ return; } else { ods_log_error("[%s] unable to handle incoming tcp query: " "read() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (received == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += received; ods_log_debug("[%s] TCP_READ: bytes transmitted %u (received %u)", sock_str, data->bytes_transmitted, received); buffer_skip(data->query->buffer, received); if (buffer_remaining(data->query->buffer) > 0) { /* not done with message yet, wait for more. */ ods_log_debug("[%s] TCP_READ: remaining %u", sock_str, buffer_remaining(data->query->buffer)); return; } ods_log_assert(buffer_position(data->query->buffer) == data->query->tcplen); /* we have a complete query, process it. */ buffer_flip(data->query->buffer); qstate = query_process(data->query, data->engine); if (qstate == QUERY_DISCARDED) { cleanup_tcp_handler(netio, handler); return; } ods_log_debug("[%s] query processed qstate=%d", sock_str, qstate); data->qstate = qstate; /* edns, tsig */ query_add_optional(data->query, data->engine); /* switch to tcp write handler. */ buffer_flip(data->query->buffer); data->query->tcplen = buffer_remaining(data->query->buffer); ods_log_debug("[%s] TCP_READ: new tcplen %u", sock_str, data->query->tcplen); data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); handler->event_types = NETIO_EVENT_WRITE | NETIO_EVENT_TIMEOUT; handler->event_handler = sock_handle_tcp_write; return; } /** * Handle outgoing tcp responses. * */ void sock_handle_tcp_write(netio_type* netio, netio_handler_type* handler, netio_events_type event_types) { struct tcp_data* data = (struct tcp_data *) handler->user_data; ssize_t sent = 0; query_type* q = data->query; if (event_types & NETIO_EVENT_TIMEOUT) { cleanup_tcp_handler(netio, handler); return; } ods_log_assert(event_types & NETIO_EVENT_WRITE); if (data->bytes_transmitted < sizeof(q->tcplen)) { uint16_t n_tcplen = htons(q->tcplen); sent = write(handler->fd, (const char*) &n_tcplen + data->bytes_transmitted, sizeof(n_tcplen) - data->bytes_transmitted); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, wait until socket becomes writeable. */ return; } else { ods_log_error("[%s] unable to handle outgoing tcp response: " "write() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (sent == 0) { cleanup_tcp_handler(netio, handler); return; } data->bytes_transmitted += sent; ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u (sent %u)", sock_str, data->bytes_transmitted, sent); if (data->bytes_transmitted < sizeof(q->tcplen)) { /* writing not complete, wait until socket becomes writable. */ ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u, while ", "sizeof tcplen %u", sock_str, data->bytes_transmitted, sizeof(q->tcplen)); return; } ods_log_assert(data->bytes_transmitted == sizeof(q->tcplen)); } ods_log_assert(data->bytes_transmitted < q->tcplen + sizeof(q->tcplen)); sent = write(handler->fd, buffer_current(q->buffer), buffer_remaining(q->buffer)); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, wait until socket becomes writeable. */ return; } else { ods_log_error("[%s] unable to handle outgoing tcp response: " "write() failed (%s)", sock_str, strerror(errno)); cleanup_tcp_handler(netio, handler); return; } } else if (sent == 0) { cleanup_tcp_handler(netio, handler); return; } buffer_skip(q->buffer, sent); data->bytes_transmitted += sent; if (data->bytes_transmitted < q->tcplen + sizeof(q->tcplen)) { /* still more data to write when socket becomes writable. */ ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u, while tcplen " "%u and sizeof tcplen %u", sock_str, data->bytes_transmitted, q->tcplen, sizeof(q->tcplen)); return; } ods_log_debug("[%s] TCP_WRITE: bytes transmitted %u", sock_str, data->bytes_transmitted); ods_log_debug("[%s] TCP_WRITE: tcplen %u", sock_str, q->tcplen); ods_log_debug("[%s] TCP_WRITE: sizeof tcplen %u", sock_str, sizeof(q->tcplen)); ods_log_assert(data->bytes_transmitted == q->tcplen + sizeof(q->tcplen)); if (data->qstate == QUERY_AXFR || data->qstate == QUERY_IXFR) { /* continue processing AXFR and writing back results. */ buffer_clear(q->buffer); if (data->qstate == QUERY_IXFR) { data->qstate = ixfr(q, data->engine); } else { data->qstate = axfr(q, data->engine, 0); } if (data->qstate != QUERY_PROCESSED) { /* edns, tsig */ query_add_optional(q, data->engine); buffer_flip(q->buffer); q->tcplen = buffer_remaining(q->buffer); data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); return; } } /* done sending, wait for the next request. */ data->bytes_transmitted = 0; handler->timeout->tv_sec = XFRD_TCP_TIMEOUT; handler->timeout->tv_nsec = 0L; timespec_add(handler->timeout, netio_current_time(netio)); handler->event_types = NETIO_EVENT_READ | NETIO_EVENT_TIMEOUT; handler->event_handler = sock_handle_tcp_read; return; } opendnssec-1.4.9/signer/src/wire/acl.h0000644000175000017500000000646712650165732014567 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Access Control List. * */ #ifndef WIRE_ACL_H #define WIRE_ACL_H #include "config.h" #include "shared/allocator.h" #include "wire/listener.h" #include "wire/tsig.h" /** * Address range type. * */ enum acl_range_enum { ACL_RANGE_SINGLE = 0, /* single adress */ ACL_RANGE_MASK = 1, /* 10.20.30.40&255.255.255.0 */ ACL_RANGE_SUBNET = 2, /* 10.20.30.40/28 */ ACL_RANGE_MINMAX = 3 /* 10.20.30.40-10.20.30.60 (mask=max) */ }; typedef enum acl_range_enum acl_range_type; /** * ACL. * */ typedef struct acl_struct acl_type; struct acl_struct { acl_type* next; /* address */ char* address; unsigned int port; int family; union acl_addr_storage addr; union acl_addr_storage range_mask; acl_range_type range_type; /* tsig */ const char* tsig_name; tsig_type* tsig; /* cache */ time_t ixfr_disabled; }; /** * Create ACL. * \param[in] allocator memory allocator * \param[in] address IP address * \param[in] port port * \param[in] tsig_name TSIG name * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* acl_create(allocator_type* allocator, char* address, char* port, char* tsig_name, tsig_type* tsig); /** * Find ACL. * \param[in] acl ACL * \param[in] addr remote address storage * \param[in] tsig tsig credentials * \return acl_type* ACL that matches * */ acl_type* acl_find(acl_type* acl, struct sockaddr_storage* addr, tsig_rr_type* tsig); /** * Parse family from address. * \param[in] a address in string format * \return int address family * */ int acl_parse_family(const char* a); /** * Address storage to IP string. * \param[in] addr socket address storage * \param[out] ip ip address * \param[in] len max strlen of ip address * \return int 0 if failed, 1 otherwise * */ int addr2ip(struct sockaddr_storage addr, char* ip, size_t len); /** * Clean up ACL. * \param[in] acl ACL * \param[in] allocator memory allocator * */ void acl_cleanup(acl_type* acl, allocator_type* allocator); #endif /* WIRE_ACL_H */ opendnssec-1.4.9/signer/src/wire/buffer.c0000644000175000017500000005675512650165732015301 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Packet buffer. * * 1 1 1 1 1 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 01 | ID | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 23 |QR| Opcode |AA|TC|RD|RA| Z|AD|CD| RCODE | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 45 | QDCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 67 | ANCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 89 | NSCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * 01 | ARCOUNT | * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * */ #include "config.h" #include "shared/log.h" #include "wire/buffer.h" #include static const char* buffer_str = "buffer"; ods_lookup_table ods_rcode_str[] = { { LDNS_RCODE_NOERROR, "NOERROR" }, { LDNS_RCODE_FORMERR, "FORMERR" }, { LDNS_RCODE_SERVFAIL, "SERVFAIL" }, { LDNS_RCODE_NXDOMAIN, "NXDOMAIN" }, { LDNS_RCODE_NOTIMPL, "NOTIMPL" }, { LDNS_RCODE_REFUSED, "REFUSED" }, { LDNS_RCODE_YXDOMAIN, "YXDOMAIN" }, { LDNS_RCODE_YXRRSET, "YXRRSET" }, { LDNS_RCODE_NXRRSET, "NXRRSET" }, { LDNS_RCODE_NOTAUTH, "NOTAUTH" }, { LDNS_RCODE_NOTZONE, "NOTZONE" }, { 0, NULL } }; /** * Create a new buffer with the specified capacity. * */ buffer_type* buffer_create(allocator_type* allocator, size_t capacity) { buffer_type* buffer = NULL; if (!allocator || !capacity) { return NULL; } buffer = (buffer_type *) allocator_alloc(allocator, sizeof(buffer_type)); if (!buffer) { return NULL; } buffer->data = (uint8_t*) calloc(capacity, sizeof(uint8_t)); buffer->position = 0; buffer->limit = capacity; buffer->capacity = capacity; buffer->fixed = 0; return buffer; } /** * Create a buffer with the specified data. * */ void buffer_create_from(buffer_type* buffer, void* data, size_t size) { ods_log_assert(buffer); buffer->data = (uint8_t*) data; buffer->position = 0; buffer->limit = size; buffer->capacity = size; buffer->fixed = 1; return; } /** * Clear the buffer and make it ready for writing. * */ void buffer_clear(buffer_type* buffer) { ods_log_assert(buffer); buffer->position = 0; buffer->limit = buffer->capacity; return; } /** * Flip the buffer and make it ready for reading. * */ void buffer_flip(buffer_type* buffer) { ods_log_assert(buffer); buffer->limit = buffer->position; buffer->position = 0; return; } /** * Make the buffer ready for re-reading the data. * */ void buffer_rewind(buffer_type* buffer) { ods_log_assert(buffer); buffer->position = 0; return; } /** * Get the buffer's position. * */ size_t buffer_position(buffer_type* buffer) { ods_log_assert(buffer); return buffer->position; } /** * Set the buffer's position. * */ void buffer_set_position(buffer_type* buffer, size_t pos) { ods_log_assert(buffer); ods_log_assert(pos <= buffer->limit); buffer->position = pos; return; } /** * Change the buffer's position. * */ void buffer_skip(buffer_type* buffer, ssize_t count) { ods_log_assert(buffer); ods_log_assert(buffer->position + count <= buffer->limit); buffer->position += count; return; } /** * Get bit. * */ static int get_bit(uint8_t bits[], size_t index) { return bits[index / 8] & (1 << (7 - index % 8)); } /** * Set bit. * */ static void set_bit(uint8_t bits[], size_t index) { bits[index / 8] |= (1 << (7 - index % 8)); return; } /** * Is pointer label> * */ static int label_is_pointer(const uint8_t* label) { ods_log_assert(label); return (label[0] & 0xc0) == 0xc0; } /** * Pointer label location. * */ static uint16_t label_pointer_location(const uint8_t* label) { ods_log_assert(label); ods_log_assert(label_is_pointer(label)); return ((uint16_t) (label[0] & ~0xc0) << 8) | (uint16_t) label[1]; } /** * Is normal label? * */ static int label_is_normal(const uint8_t* label) { ods_log_assert(label); return (label[0] & 0xc0) == 0; } /* * Is root label? * */ static inline int label_is_root(const uint8_t* label) { ods_log_assert(label); return label[0] == 0; } /* * Label length. * */ static uint8_t label_length(const uint8_t* label) { ods_log_assert(label); ods_log_assert(label_is_normal(label)); return label[0]; } /** * Read dname from buffer. * */ size_t buffer_read_dname(buffer_type* buffer, uint8_t* dname, unsigned allow_pointers) { int done = 0; uint8_t visited[(MAX_PACKET_SIZE+7)/8]; size_t dname_length = 0; const uint8_t *label = NULL; ssize_t mark = -1; ods_log_assert(buffer); memset(visited, 0, (buffer_limit(buffer)+7)/8); while (!done) { if (!buffer_available(buffer, 1)) { return 0; } if (get_bit(visited, buffer_position(buffer))) { ods_log_error("[%s] dname loop!", buffer_str); return 0; } set_bit(visited, buffer_position(buffer)); label = buffer_current(buffer); if (label_is_pointer(label)) { size_t pointer = 0; if (!allow_pointers) { return 0; } if (!buffer_available(buffer, 2)) { return 0; } pointer = label_pointer_location(label); if (pointer >= buffer_limit(buffer)) { return 0; } buffer_skip(buffer, 2); if (mark == -1) { mark = buffer_position(buffer); } buffer_set_position(buffer, pointer); } else if (label_is_normal(label)) { size_t length = label_length(label) + 1; done = label_is_root(label); if (!buffer_available(buffer, length)) { return 0; } if (dname_length + length >= MAXDOMAINLEN+1) { return 0; } buffer_read(buffer, dname + dname_length, length); dname_length += length; } else { return 0; } } if (mark != -1) { buffer_set_position(buffer, mark); } return dname_length; } /** * Change the buffer's position so that one dname is skipped. * */ int buffer_skip_dname(buffer_type* buffer) { ods_log_assert(buffer); while (1) { uint8_t label_size = 0; if (!buffer_available(buffer, 1)) { return 0; } label_size = buffer_read_u8(buffer); if (label_size == 0) { break; } else if ((label_size & 0xc0) != 0) { if (!buffer_available(buffer, 1)) { return 0; } buffer_skip(buffer, 1); break; } else if (!buffer_available(buffer, label_size)) { return 0; } else { buffer_skip(buffer, label_size); } } return 1; } /** * Change the buffer's position so that one RR is skipped. * */ int buffer_skip_rr(buffer_type* buffer, unsigned qrr) { if (!buffer_skip_dname(buffer)) { return 0; } if (qrr) { if (!buffer_available(buffer, 4)) { return 0; } buffer_skip(buffer, 4); } else { uint16_t rdata_size; if (!buffer_available(buffer, 10)) { return 0; } buffer_skip(buffer, 8); rdata_size = buffer_read_u16(buffer); if (!buffer_available(buffer, rdata_size)) { return 0; } buffer_skip(buffer, rdata_size); } return 1; } /** * Get the buffer's limit. * */ size_t buffer_limit(buffer_type* buffer) { ods_log_assert(buffer); return buffer->limit; } /** * Set the buffer's limit. * */ void buffer_set_limit(buffer_type* buffer, size_t limit) { ods_log_assert(buffer); ods_log_assert(limit <= buffer->capacity); buffer->limit = limit; if (buffer->position > buffer->limit) { buffer->position = buffer->limit; } return; } /** * Get the buffer's capacity. * */ size_t buffer_capacity(buffer_type* buffer) { ods_log_assert(buffer); return buffer->capacity; } /** * Return a pointer to the data at the indicated position. * */ uint8_t* buffer_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at <= buffer->limit); return buffer->data + at; } /** * Return a pointer to the data at the beginning of the buffer. * */ uint8_t* buffer_begin(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, 0); } /** * Return a pointer to the data at the end of the buffer. * */ uint8_t* buffer_end(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, buffer->limit); } /** * Return a pointer to the data at the buffer's current position. * */ uint8_t* buffer_current(buffer_type* buffer) { ods_log_assert(buffer); return buffer_at(buffer, buffer->position); } /** * The number of bytes remaining between the at and limit. * */ static size_t buffer_remaining_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at <= buffer->limit); return buffer->limit - at; } /** * The number of bytes remaining between the buffer's position and limit. * */ size_t buffer_remaining(buffer_type* buffer) { ods_log_assert(buffer); return buffer_remaining_at(buffer, buffer->position); } /** * Check if the buffer has enough bytes available at indicated position. * */ static int buffer_available_at(buffer_type *buffer, size_t at, size_t count) { ods_log_assert(buffer); return count <= buffer_remaining_at(buffer, at); } /** * Check if the buffer has enough bytes available. * */ int buffer_available(buffer_type *buffer, size_t count) { ods_log_assert(buffer); return buffer_available_at(buffer, buffer->position, count); } /** * Write to buffer at indicated position. * */ static void buffer_write_u8_at(buffer_type* buffer, size_t at, uint8_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); buffer->data[at] = data; return; } /** * Write to buffer at indicated position. * */ void buffer_write_u16_at(buffer_type* buffer, size_t at, uint16_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); write_uint16(buffer->data + at, data); return; } /** * Write to buffer at indicated position. * */ static void buffer_write_u32_at(buffer_type* buffer, size_t at, uint32_t data) { ods_log_assert(buffer); ods_log_assert(buffer_available_at(buffer, at, sizeof(data))); write_uint32(buffer->data + at, data); return; } /** * Write to buffer. * */ void buffer_write(buffer_type* buffer, const void* data, size_t count) { ods_log_assert(buffer); ods_log_assert(buffer_available(buffer, count)); memcpy(buffer->data + buffer->position, data, count); buffer->position += count; return; } /** * Write uint8_t to buffer. * */ void buffer_write_u8(buffer_type* buffer, uint8_t data) { ods_log_assert(buffer); buffer_write_u8_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write uint16_t to buffer. * */ void buffer_write_u16(buffer_type* buffer, uint16_t data) { ods_log_assert(buffer); buffer_write_u16_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write uint32_t to buffer. * */ void buffer_write_u32(buffer_type* buffer, uint32_t data) { ods_log_assert(buffer); buffer_write_u32_at(buffer, buffer->position, data); buffer->position += sizeof(data); return; } /** * Write rdf to buffer. * */ void buffer_write_rdf(buffer_type* buffer, ldns_rdf* rdf) { ods_log_assert(buffer); ods_log_assert(rdf); buffer_write(buffer, ldns_rdf_data(rdf), ldns_rdf_size(rdf)); /* position updated by buffer_write() */ return; } /** * Write rr to buffer. * */ int buffer_write_rr(buffer_type* buffer, ldns_rr* rr) { size_t i = 0; size_t tc_mark = 0; size_t rdlength_pos = 0; uint16_t rdlength = 0; ods_log_assert(buffer); ods_log_assert(rr); /* set truncation mark, in case rr does not fit */ tc_mark = buffer_position(buffer); /* owner type class ttl */ if (!buffer_available(buffer, ldns_rdf_size(ldns_rr_owner(rr)))) { goto buffer_tc; } buffer_write_rdf(buffer, ldns_rr_owner(rr)); if (!buffer_available(buffer, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(rdlength))) { goto buffer_tc; } buffer_write_u16(buffer, (uint16_t) ldns_rr_get_type(rr)); buffer_write_u16(buffer, (uint16_t) ldns_rr_get_class(rr)); buffer_write_u32(buffer, (uint32_t) ldns_rr_ttl(rr)); /* skip rdlength */ rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(rdlength)); /* write rdata */ for (i=0; i < ldns_rr_rd_count(rr); i++) { if (!buffer_available(buffer, ldns_rdf_size(ldns_rr_rdf(rr, i)))) { goto buffer_tc; } buffer_write_rdf(buffer, ldns_rr_rdf(rr, i)); } /* write rdlength */ rdlength = buffer_position(buffer) - rdlength_pos - sizeof(rdlength); buffer_write_u16_at(buffer, rdlength_pos, rdlength); /* position updated by buffer_write() */ return 1; buffer_tc: buffer_set_position(buffer, tc_mark); return 0; } /** * Read uint8_t from buffer at indicated position. * */ static uint8_t buffer_read_u8_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); ods_log_assert(at < buffer->capacity); return buffer->data[at]; } /** * Read uint16_t from buffer at indicated position. * */ static uint16_t buffer_read_u16_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); return read_uint16(buffer->data + at); } /** * Read uint32_t from buffer at indicated position. * */ static uint32_t buffer_read_u32_at(buffer_type* buffer, size_t at) { ods_log_assert(buffer); return read_uint32(buffer->data + at); } /** * Read from buffer. * */ void buffer_read(buffer_type* buffer, void* data, size_t count) { ods_log_assert(buffer); ods_log_assert(buffer_available(buffer, count)); memcpy(data, buffer->data + buffer->position, count); buffer->position += count; return; } /** * Read uint8_t from buffer. * */ uint8_t buffer_read_u8(buffer_type* buffer) { uint16_t result = 0; ods_log_assert(buffer); result = buffer_read_u8_at(buffer, buffer->position); buffer->position += sizeof(uint8_t); return result; } /** * Read uint16_t from buffer. * */ uint16_t buffer_read_u16(buffer_type* buffer) { uint16_t result = 0; ods_log_assert(buffer); result = buffer_read_u16_at(buffer, buffer->position); buffer->position += sizeof(uint16_t); return result; } /** * Read uint32_t from buffer. * */ uint32_t buffer_read_u32(buffer_type* buffer) { uint32_t result = 0; ods_log_assert(buffer); result = buffer_read_u32_at(buffer, buffer->position); buffer->position += sizeof(uint32_t); return result; } /** * Get query id from buffer. * */ uint16_t buffer_pkt_id(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 0); } /** * Get a random query id. * */ static uint16_t random_id(void) { return ldns_get_random(); } /** * Set random query id in buffer. * */ void buffer_pkt_set_random_id(buffer_type* buffer) { uint16_t qid = 0; ods_log_assert(buffer); qid = random_id(); buffer_write_u16_at(buffer, 0, qid); return; } /** * Get flags from buffer. * */ uint16_t buffer_pkt_flags(buffer_type* buffer) { ods_log_assert(buffer); return (uint16_t) buffer_read_u16_at(buffer, 2); } /** * Set flags in buffer. * */ void buffer_pkt_set_flags(buffer_type* buffer, uint16_t flags) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 2, flags); return; } /** * Get QR bit from buffer. * */ int buffer_pkt_qr(buffer_type* buffer) { ods_log_assert(buffer); return (int) QR(buffer); } /** * Set QR bit in buffer. * */ void buffer_pkt_set_qr(buffer_type* buffer) { ods_log_assert(buffer); QR_SET(buffer); return; } /** * Clear QR bit in buffer. * */ void buffer_pkt_clear_qr(buffer_type* buffer) { ods_log_assert(buffer); QR_CLR(buffer); return; } /** * Get OPCODE from buffer. * */ ldns_pkt_opcode buffer_pkt_opcode(buffer_type* buffer) { ods_log_assert(buffer); return (ldns_pkt_opcode) OPCODE(buffer); } /** * Set OPCODE in buffer. * */ void buffer_pkt_set_opcode(buffer_type* buffer, ldns_pkt_opcode opcode) { ods_log_assert(buffer); OPCODE_SET(buffer, opcode); return; } /** * Get AA bit from buffer. * */ int buffer_pkt_aa(buffer_type* buffer) { ods_log_assert(buffer); return (int) AA(buffer); } /** * Set AA bit in buffer. * */ void buffer_pkt_set_aa(buffer_type* buffer) { ods_log_assert(buffer); AA_SET(buffer); return; } /** * Get TC bit from buffer. * */ int buffer_pkt_tc(buffer_type* buffer) { ods_log_assert(buffer); return (int) TC(buffer); } /** * Get RD bit from buffer. * */ int buffer_pkt_rd(buffer_type* buffer) { ods_log_assert(buffer); return (int) RD(buffer); } /** * Get RA bit from buffer. * */ int buffer_pkt_ra(buffer_type* buffer) { ods_log_assert(buffer); return (int) RA(buffer); } /** * Get AD bit from buffer. * */ int buffer_pkt_ad(buffer_type* buffer) { ods_log_assert(buffer); return (int) AD(buffer); } /** * Get CD bit from buffer. * */ int buffer_pkt_cd(buffer_type* buffer) { ods_log_assert(buffer); return (int) CD(buffer); } /** * Get RCODE from buffer. * */ ldns_pkt_rcode buffer_pkt_rcode(buffer_type* buffer) { ods_log_assert(buffer); return (ldns_pkt_rcode) RCODE(buffer); } /** * Set RCODE in buffer. * */ void buffer_pkt_set_rcode(buffer_type* buffer, ldns_pkt_rcode rcode) { ods_log_assert(buffer); RCODE_SET(buffer, rcode); return; } /** * Look up a descriptive text by each rcode. * */ const char* buffer_rcode2str(ldns_pkt_rcode rcode) { ods_lookup_table *lt; lt = ods_lookup_by_id(ods_rcode_str, rcode); if (lt) { return lt->name; } return NULL; } /** * Get QDCOUNT from buffer. * */ uint16_t buffer_pkt_qdcount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 4); } /** * Set QDCOUNT in buffer. * */ void buffer_pkt_set_qdcount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 4, count); return; } /** * Get ANCOUNT from buffer. * */ uint16_t buffer_pkt_ancount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 6); } /** * Set ANCOUNT in buffer. * */ void buffer_pkt_set_ancount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 6, count); return; } /** * Get NSCOUNT from buffer. * */ uint16_t buffer_pkt_nscount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 8); } /** * Set NSCOUNT in buffer. * */ void buffer_pkt_set_nscount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 8, count); return; } /** * Get ARCOUNT from buffer. * */ uint16_t buffer_pkt_arcount(buffer_type* buffer) { ods_log_assert(buffer); return buffer_read_u16_at(buffer, 10); } /** * Set ARCOUNT in buffer. * */ void buffer_pkt_set_arcount(buffer_type* buffer, uint16_t count) { ods_log_assert(buffer); buffer_write_u16_at(buffer, 10, count); return; } /** * Make a new packet. * */ static void buffer_pkt_new(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass, ldns_pkt_opcode opcode) { ods_log_assert(buffer); ods_log_assert(qname); ods_log_assert(qtype); ods_log_assert(qclass); /* The header */ buffer_clear(buffer); buffer_pkt_set_random_id(buffer); buffer_pkt_set_opcode(buffer, opcode); buffer_pkt_clear_qr(buffer); buffer_pkt_set_rcode(buffer, LDNS_RCODE_NOERROR); buffer_pkt_set_qdcount(buffer, 1); buffer_pkt_set_ancount(buffer, 0); buffer_pkt_set_nscount(buffer, 0); buffer_pkt_set_arcount(buffer, 0); buffer_skip(buffer, BUFFER_PKT_HEADER_SIZE); /* The question record */ buffer_write_rdf(buffer, qname); buffer_write_u16(buffer, qtype); buffer_write_u16(buffer, qclass); return; } /** * Make a new query. * */ void buffer_pkt_query(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, qtype, qclass, LDNS_PACKET_QUERY); buffer_pkt_set_flags(buffer, 0); return; } /** * Make a new notify. * */ void buffer_pkt_notify(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, LDNS_RR_TYPE_SOA, qclass, LDNS_PACKET_NOTIFY); return; } /** * Make a new axfr. * */ void buffer_pkt_axfr(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass) { buffer_pkt_new(buffer, qname, LDNS_RR_TYPE_AXFR, qclass, LDNS_PACKET_QUERY); buffer_pkt_set_qr(buffer); return; } /** * Print packet buffer. * */ void buffer_pkt_print(FILE* fd, buffer_type* buffer) { ldns_status status = LDNS_STATUS_OK; ldns_pkt* pkt = NULL; ods_log_assert(fd); ods_log_assert(buffer); status = ldns_wire2pkt(&pkt, buffer_begin(buffer), buffer_remaining(buffer)); if (status == LDNS_STATUS_OK) { ods_log_assert(pkt); ldns_pkt_print(fd, pkt); ldns_pkt_free(pkt); } else { fprintf(fd, ";;\n"); fprintf(fd, ";; Bogus packet: %s\n", ldns_get_errorstr_by_id(status)); fprintf(fd, ";;\n"); fprintf(fd, ";;\n"); fprintf(fd, "\n"); } return; } /** * Clean up buffer. * */ void buffer_cleanup(buffer_type* buffer, allocator_type* allocator) { if (!buffer || !allocator) { return; } free((void*)buffer->data); allocator_deallocate(allocator, (void*) buffer); return; } opendnssec-1.4.9/signer/src/wire/buffer.h0000644000175000017500000004122412650165732015267 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Packet buffer. * */ #ifndef WIRE_BUFFER_H #define WIRE_BUFFER_H #include "config.h" #include "shared/allocator.h" #include "shared/log.h" #include "shared/status.h" #include #include #define BUFFER_PKT_HEADER_SIZE 12 #define MAXDOMAINLEN 255 #define MAXLABELLEN 63 #define MAX_RDLENGTH 65535 #define MAX_RR_SIZE \ (MAXDOMAINLEN + sizeof(uint32_t) + 4*sizeof(uint16_t) + MAX_RDLENGTH) #define MAX_PACKET_SIZE 65535 #define PACKET_BUFFER_SIZE (MAX_PACKET_SIZE + MAX_RR_SIZE) #define QR_MASK 0x80U #define QR_SHIFT 7 #define QR(packet) (*buffer_at((packet), 2) & QR_MASK) #define QR_SET(packet) (*buffer_at((packet), 2) |= QR_MASK) #define QR_CLR(packet) (*buffer_at((packet), 2) &= ~QR_MASK) #define OPCODE_MASK 0x78U #define OPCODE_SHIFT 3 #define OPCODE(packet) ((*buffer_at((packet), 2) & OPCODE_MASK) >> OPCODE_SHIFT) #define OPCODE_SET(packet, opcode) \ (*buffer_at((packet), 2) = (*buffer_at((packet), 2) & ~OPCODE_MASK) | ((opcode) << OPCODE_SHIFT)) #define AA_MASK 0x04U #define AA_SHIFT 2 #define AA(packet) (*buffer_at((packet), 2) & AA_MASK) #define AA_SET(packet) (*buffer_at((packet), 2) |= AA_MASK) #define AA_CLR(packet) (*buffer_at((packet), 2) &= ~AA_MASK) #define TC_MASK 0x02U #define TC_SHIFT 1 #define TC(packet) (*buffer_at((packet), 2) & TC_MASK) #define TC_SET(packet) (*buffer_at((packet), 2) |= TC_MASK) #define TC_CLR(packet) (*buffer_at((packet), 2) &= ~TC_MASK) #define RD_MASK 0x01U #define RD_SHIFT 0 #define RD(packet) (*buffer_at((packet), 2) & RD_MASK) #define RD_SET(packet) (*buffer_at((packet), 2) |= RD_MASK) #define RD_CLR(packet) (*buffer_at((packet), 2) &= ~RD_MASK) #define RA_MASK 0x80U #define RA_SHIFT 7 #define RA(packet) (*buffer_at((packet), 3) & RA_MASK) #define RA_SET(packet) (*buffer_at((packet), 3) |= RA_MASK) #define RA_CLR(packet) (*buffer_at((packet), 3) &= ~RA_MASK) #define AD_MASK 0x20U #define AD_SHIFT 5 #define AD(packet) (*buffer_at((packet), 3) & AD_MASK) #define AD_SET(packet) (*buffer_at((packet), 3) |= AD_MASK) #define AD_CLR(packet) (*buffer_at((packet), 3) &= ~AD_MASK) #define CD_MASK 0x10U #define CD_SHIFT 4 #define CD(packet) (*buffer_at((packet), 3) & CD_MASK) #define CD_SET(packet) (*buffer_at((packet), 3) |= CD_MASK) #define CD_CLR(packet) (*buffer_at((packet), 3) &= ~CD_MASK) #define RCODE_MASK 0x0fU #define RCODE_SHIFT 0 #define RCODE(packet) (*buffer_at((packet), 3) & RCODE_MASK) #define RCODE_SET(packet, rcode) \ (*buffer_at((packet), 3) = (*buffer_at((packet), 3) & ~RCODE_MASK) | (rcode)) extern ods_lookup_table ods_rcode_str[]; /** * Buffer. */ typedef struct buffer_struct buffer_type; struct buffer_struct { size_t position; size_t limit; size_t capacity; uint8_t* data; unsigned fixed : 1; }; /** * Create a new buffer with the specified capacity. * \param[in] allocator memory allocator * \param[in] capacity specified capacity * \return buffer_type* buffer * */ buffer_type* buffer_create(allocator_type* allocator, size_t capacity); /** * Create a buffer with the specified data. * The data is not copied and no memory allocations are done. * The buffer is fixed and cannot be resized using buffer_reserve(). * \param[in] buffer buffer * \param[in] data specified data * \param[in] size size of data * */ void buffer_create_from(buffer_type* buffer, void* data, size_t size); /** * Clear the buffer and make it ready for writing. * The buffer's limit is set to the capacity and the position is set to 0. * \param[in] buffer buffer * */ void buffer_clear(buffer_type* buffer); /** * Flip the buffer and make it ready for reading. * The data that has been written to the buffer. * The buffer's limit is set to the current position and the position is set * to 0. * \param[in] buffer buffer * */ void buffer_flip(buffer_type* buffer); /** * Make the buffer ready for re-reading the data. * The buffer's position is reset to 0. * \param[in] buffer buffer * */ void buffer_rewind(buffer_type* buffer); /** * Get the buffer's position. * \param[in] buffer buffer * \return size_t position * */ size_t buffer_position(buffer_type* buffer); /** * Set the buffer's position. * The position must be less than or equal to the buffer's limit. * \param[in] buffer buffer * \param[in] pos position * */ void buffer_set_position(buffer_type* buffer, size_t pos); /** * Change the buffer's position. * The position must not be moved behind the buffer's limit or before the * beginning of the buffer. * \param[in] buffer buffer * \param[in] count number of bytes to skip * */ void buffer_skip(buffer_type* buffer, ssize_t count); /** * Change the buffer's position so that one dname is skipped. * \param[in] buffer buffer * \return int 0 if dname skipping failed * 1 otherwise * */ int buffer_skip_dname(buffer_type* buffer); /** * Change the buffer's position so that one RR is skipped. * \param[in] buffer buffer * \param[in] qrr 1 if we skip RRs in the question section. * \return int 0 if RR skipping failed * 1 otherwise * */ int buffer_skip_rr(buffer_type* buffer, unsigned qrr); /** * Get the buffer's limit. * \param[in] buffer buffer * \return size_t limit * */ size_t buffer_limit(buffer_type* buffer); /** * Set the buffer's limit. If the buffer's position is greater * than the new limit, the position is set to the limit. * \param[in] buffer buffer * \param[in] limit limit * */ void buffer_set_limit(buffer_type* buffer, size_t limit); /** * Get the buffer's capacity. * \param[in] buffer buffer * \return size_t capacity * */ size_t buffer_capacity(buffer_type* buffer); /** * Return a pointer to the data at the indicated position. * \param[in] buffer buffer * \param[in] at indicated position * \return uint8_t* pointer to the data at the indicated position * */ uint8_t* buffer_at(buffer_type* buffer, size_t at); /** * Return a pointer to the data at the beginning of the buffer. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the begin of the buffer * */ uint8_t* buffer_begin(buffer_type* buffer); /** * Return a pointer to the data at the end of the buffer. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the end of the buffer * */ uint8_t* buffer_end(buffer_type* buffer); /** * Return a pointer to the data at the buffer's current position. * \param[in] buffer buffer * \return uint8_t* pointer to the data at the buffer's current position * */ uint8_t* buffer_current(buffer_type* buffer); /** * The number of bytes remaining between the buffer's position and limit. * \param[in] buffer buffer * \return size_t remaining number of bytes * */ size_t buffer_remaining(buffer_type* buffer); /** * Check if the buffer has enough bytes available. * \param[in] buffer buffer * \param[in] count number of bytes that needs to be available * \return int 0 if not enough bytes are available * 1 otherwise * */ int buffer_available(buffer_type* buffer, size_t count); /** * Write to buffer. * \param[in] buffer buffer * \param[in] data data to write * \param[in] count number of bytes to write * */ void buffer_write(buffer_type* buffer, const void* data, size_t count); /** * Write uint8_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u8(buffer_type* buffer, uint8_t data); /** * Write uint16_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u16(buffer_type* buffer, uint16_t data); /** * Write uint16_t to buffer at indicated position. * \param[in] buffer buffer * \param[in] at indicated position * \param[in] data data to write * */ void buffer_write_u16_at(buffer_type* buffer, size_t at, uint16_t data); /** * Write uint32_t to buffer. * \param[in] buffer buffer * \param[in] data data to write * */ void buffer_write_u32(buffer_type* buffer, uint32_t data); /** * Write rdf to buffer. * \param[in] buffer buffer * \param[in] rdf data to write * */ void buffer_write_rdf(buffer_type* buffer, ldns_rdf* rdf); /** * Write rr to buffer. * \param[in] buffer buffer * \param[in] rr data to write * \return int 1 if rr fits, 0 otherwise * */ int buffer_write_rr(buffer_type* buffer, ldns_rr* rr); /** * Read from buffer. * \param[in] buffer buffer * \param[in] data read data * \param[in] count number of bytes to read * */ void buffer_read(buffer_type* buffer, void* data, size_t count); /** * Read uint8_t from buffer. * \param[in] buffer buffer * \return uint8_t read data * */ uint8_t buffer_read_u8(buffer_type* buffer); /** * Read uint16_t from buffer. * \param[in] buffer buffer * \return uint16_t read data * */ uint16_t buffer_read_u16(buffer_type* buffer); /** * Read uint32_t from buffer. * \param[in] buffer buffer * \return uint32_t read data * */ uint32_t buffer_read_u32(buffer_type* buffer); /** * Read dname from buffer. * \param[in] buffer buffer * \param[out] dname dname * \param[in] allow_pointers allow pointer labels * \return int dname length * */ size_t buffer_read_dname(buffer_type* buffer, uint8_t* dname, unsigned allow_pointers); /** * Get query id from buffer. * \param[in] buffer buffer * \return uint16_t query id * */ uint16_t buffer_pkt_id(buffer_type* buffer); /** * Set random query id in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_random_id(buffer_type* buffer); /** * Get flags from buffer. * \param[in] buffer buffer * \return uint16_t flags * */ uint16_t buffer_pkt_flags(buffer_type* buffer); /** * Set flags in buffer. * \param[in] buffer buffer * \param[in] flags flags * */ void buffer_pkt_set_flags(buffer_type* buffer, uint16_t flags); /** * Get QR bit from buffer. * \param[in] buffer buffer * \return int 0 if QR bit is clear * 1 if QR bit is set * */ int buffer_pkt_qr(buffer_type* buffer); /** * Set QR bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_qr(buffer_type* buffer); /** * Clear QR bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_clear_qr(buffer_type* buffer); /** * Get AA bit from buffer. * \param[in] buffer buffer * \return int 0 if AA bit is clear * 1 if AA bit is set * */ int buffer_pkt_aa(buffer_type* buffer); /** * Set AA bit in buffer. * \param[in] buffer buffer * */ void buffer_pkt_set_aa(buffer_type* buffer); /** * Get TC bit from buffer. * \param[in] buffer buffer * \return int 0 if TC bit is clear * 1 if TC bit is set * */ int buffer_pkt_tc(buffer_type* buffer); /** * Get RD bit from buffer. * \param[in] buffer buffer * \return int 0 if RD bit is clear * 1 if RD bit is set * */ int buffer_pkt_rd(buffer_type* buffer); /** * Get RA bit from buffer. * \param[in] buffer buffer * \return int 0 if RA bit is clear * 1 if RA bit is set * */ int buffer_pkt_ra(buffer_type* buffer); /** * Get AD bit from buffer. * \param[in] buffer buffer * \return int 0 if AD bit is clear * 1 if AD bit is set * */ int buffer_pkt_ad(buffer_type* buffer); /** * Get CD bit from buffer. * \param[in] buffer buffer * \return int 0 if CD bit is clear * 1 if CD bit is set * */ int buffer_pkt_cd(buffer_type* buffer); /** * Get OPCODE from buffer. * \param[in] buffer buffer * \return ldns_pkt_opcode OPCODE * */ ldns_pkt_opcode buffer_pkt_opcode(buffer_type* buffer); /** * Set OPCODE in buffer. * \param[in] buffer buffer * \param[in] opcode OPCODE * */ void buffer_pkt_set_opcode(buffer_type* buffer, ldns_pkt_opcode opcode); /** * Get RCODE from buffer. * \param[in] buffer buffer * \return ldns_pkt_rcode RCODE * */ ldns_pkt_rcode buffer_pkt_rcode(buffer_type* buffer); /** * Set RCODE in buffer. * \param[in] buffer buffer * \param[in] rcode RCODE * */ void buffer_pkt_set_rcode(buffer_type* buffer, ldns_pkt_rcode rcode); /** * Look up a descriptive text by each rcode. * \param[in] rcode rcode * \return const char* descriptive text * */ const char* buffer_rcode2str(ldns_pkt_rcode rcode); /** * Get QDCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t QDCOUNT * */ uint16_t buffer_pkt_qdcount(buffer_type* buffer); /** * Set QDCOUNT in buffer. * \param[in] buffer buffer * \param[in] count QDCOUNT * */ void buffer_pkt_set_qdcount(buffer_type* buffer, uint16_t count); /** * Get ANCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t ANCOUNT * */ uint16_t buffer_pkt_ancount(buffer_type* buffer); /** * Set ANCOUNT in buffer. * \param[in] buffer buffer * \param[in] count ANCOUNT * */ void buffer_pkt_set_ancount(buffer_type* buffer, uint16_t count); /** * Get NSCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t NSCOUNT * */ uint16_t buffer_pkt_nscount(buffer_type* buffer); /** * Set NSCOUNT in buffer. * \param[in] buffer buffer * \param[in] count NSCOUNT * */ void buffer_pkt_set_nscount(buffer_type* buffer, uint16_t count); /** * Get ARCOUNT from buffer. * \param[in] buffer buffer * \return uint16_t ARCOUNT * */ uint16_t buffer_pkt_arcount(buffer_type* buffer); /** * Set ARCOUNT in buffer. * \param[in] buffer buffer * \param[in] count ARCOUNT * */ void buffer_pkt_set_arcount(buffer_type* buffer, uint16_t count); /** * Make a new query. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qtype qtype * \param[in] qclass qclass * */ void buffer_pkt_query(buffer_type* buffer, ldns_rdf* qname, ldns_rr_type qtype, ldns_rr_class qclass); /** * Make a new notify. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qclass qclass * */ void buffer_pkt_notify(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass); /** * Make a new axfr. * \param[in] buffer buffer * \param[in] qname qname * \param[in] qclass qclass * */ void buffer_pkt_axfr(buffer_type* buffer, ldns_rdf* qname, ldns_rr_class qclass); /** * Print packet buffer. * \param[in] fd file descriptor * \param[in] buffer buffer * */ void buffer_pkt_print(FILE* fd, buffer_type* buffer); /** * Clean up buffer. * \param[in] buffer buffer * \param[in] allocator memory allocator * */ void buffer_cleanup(buffer_type* buffer, allocator_type* allocator); /** UTIL **/ /* * Copy data allowing for unaligned accesses in network byte order * (big endian). */ static inline uint16_t read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES return ntohs(* (uint16_t *) src); #else uint8_t *p = (uint8_t *) src; return (p[0] << 8) | p[1]; #endif } static inline uint32_t read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES return ntohl(* (uint32_t *) src); #else uint8_t *p = (uint8_t *) src; return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; #endif } static inline void write_uint16(void *dst, uint16_t data) { #ifdef ALLOW_UNALIGNED_ACCESSES * (uint16_t *) dst = htons(data); #else uint8_t *p = (uint8_t *) dst; p[0] = (uint8_t) ((data >> 8) & 0xff); p[1] = (uint8_t) (data & 0xff); #endif } static inline void write_uint32(void *dst, uint32_t data) { #ifdef ALLOW_UNALIGNED_ACCESSES * (uint32_t *) dst = htonl(data); #else uint8_t *p = (uint8_t *) dst; p[0] = (uint8_t) ((data >> 24) & 0xff); p[1] = (uint8_t) ((data >> 16) & 0xff); p[2] = (uint8_t) ((data >> 8) & 0xff); p[3] = (uint8_t) (data & 0xff); #endif } #endif /* WIRE_BUFFER_H */ opendnssec-1.4.9/signer/src/wire/tsig.h0000644000175000017500000001677012650165732014774 00000000000000/* * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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. * */ /** * TSIG. * */ #ifndef WIRE_TSIG_H #define WIRE_TSIG_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/buffer.h" #include #define TSIG_ERROR_BADSIG 16 #define TSIG_ERROR_BADKEY 17 #define TSIG_ERROR_BADTIME 18 #define TSIG_HMAC_MD5 157 #define TSIG_HMAC_SHA1 158 #define TSIG_HMAC_SHA256 159 /** * TSIG status. * */ enum tsig_status_enum { TSIG_NOT_PRESENT, TSIG_OK, TSIG_ERROR }; typedef enum tsig_status_enum tsig_status; /** * TSIG lookup table. * */ typedef struct tsig_lookup_table_struct tsig_lookup_table; struct tsig_lookup_table_struct { uint8_t id; const char* short_name; }; /** * TSIG key. * */ typedef struct tsig_key_struct tsig_key_type; struct tsig_key_struct { ldns_rdf* dname; size_t size; const uint8_t* data; }; /** * TSIG algorithm. * */ typedef struct tsig_algo_struct tsig_algo_type; struct tsig_algo_struct { const char* txt_name; ldns_rdf* wf_name; size_t max_digest_size; const void* data; /* create a new HMAC context */ void*(*hmac_create)(allocator_type* allocator); /* initialize an HMAC context */ void(*hmac_init)(void* context, tsig_algo_type* algo, tsig_key_type* key); /* update the HMAC context */ void(*hmac_update)(void* context, const void* data, size_t size); /* finalize digest */ void(*hmac_final)(void* context, uint8_t* digest, size_t* size); }; /** * TSIG configuration. * */ typedef struct tsig_struct tsig_type; struct tsig_struct { tsig_type* next; const char* name; const char* algorithm; const char* secret; tsig_key_type* key; }; /** * TSIG RR. * */ typedef struct tsig_rr_struct tsig_rr_type; struct tsig_rr_struct { allocator_type* allocator; tsig_status status; size_t position; size_t response_count; size_t update_since_last_prepare; void* context; tsig_algo_type* algo; tsig_key_type* key; size_t prior_mac_size; uint8_t* prior_mac_data; ldns_rdf* key_name; ldns_rdf* algo_name; uint16_t signed_time_high; uint32_t signed_time_low; uint16_t signed_time_fudge; uint16_t mac_size; uint8_t* mac_data; uint16_t original_query_id; uint16_t error_code; uint16_t other_size; uint8_t* other_data; }; /** * Initialize TSIG handler. * \param[in] allocator memory allocator * \return ods_status status * */ ods_status tsig_handler_init(allocator_type* allocator); /** * Clean up TSIG handler. * */ void tsig_handler_cleanup(void); /** * Add key to TSIG handler. * \param[in] key tsig key * */ void tsig_handler_add_key(tsig_key_type* key); /** * Add algorithm to TSIG handler. * \param[in] algo tsig algorithm * */ void tsig_handler_add_algo(tsig_algo_type* algo); /** * Create new TSIG. * \param[in] allocator memory allocator * \param[in] name tsig name * \param[in] algo tsig algorithm * \param[in] secret tsig secret * \return tsig_type* TSIG * */ tsig_type* tsig_create(allocator_type* allocator, char* name, char* algo, char* secret); /** * Lookup TSIG by key name. * \param[in] tsig TSIG list * \param[in] naem TSIG name * \return tsig_type* TSIG * */ tsig_type* tsig_lookup_by_name(tsig_type* tsig, const char* name); /** * Lookup TSIG algorithm by name. * \param[in] name algorithm name * \return tsig_algo_type* TSIG algorithm * */ tsig_algo_type* tsig_lookup_algo(const char* name); /** * Create new TSIG RR. * \param[in] allocator memory allocator * \return tsig_rr_type* TSIG RR * */ tsig_rr_type* tsig_rr_create(allocator_type* allocator); /** * Reset TSIG RR. * \param[in] trr TSIG RR * \param[in] algo tsig algorithm * \param[in] key tsig key * */ void tsig_rr_reset(tsig_rr_type* trr, tsig_algo_type* algo, tsig_key_type* key); /** * Find TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \return int 1 if not present or present and valid, 0 otherwise. * */ int tsig_rr_find(tsig_rr_type* trr, buffer_type* buffer); /** * Parse TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \return int 1 if not TSIG RR or TSIG RR and valid, 0 otherwise. * */ int tsig_rr_parse(tsig_rr_type* trr, buffer_type* buffer); /** * Lookup TSIG RR. * \param[in] trr TSIG RR * \return int 1 if succeeded, 0 if unknown * */ int tsig_rr_lookup(tsig_rr_type* trr); /** * Prepare TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_prepare(tsig_rr_type* trr); /** * Update TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * \param[in] length number of octets of buffer to add to the TSIG hash, * replacing the buffer's id with the original * query idfrom TSIG. * */ void tsig_rr_update(tsig_rr_type* trr, buffer_type* buffer, size_t length); /** * Sign TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_sign(tsig_rr_type* trr); /** * Verify TSIG RR. * \param[in] trr TSIG RR * \return int 1 if verified, 0 on error * */ int tsig_rr_verify(tsig_rr_type* trr); /** * Append TSIG RR. * \param[in] trr TSIG RR * \param[in] buffer packet buffer * */ void tsig_rr_append(tsig_rr_type* trr, buffer_type* buffer); /* * The amount of space to reserve in the response for the TSIG data. * \param[in] trr TSIG RR * \return size_t reserved space size * */ size_t tsig_rr_reserved_space(tsig_rr_type *trr); /** * Reply with error TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_error(tsig_rr_type* trr); /** * Get human readable TSIG error code. * \param[in] status TSIG status * \return const char* TSIG status * */ const char* tsig_status2str(tsig_status status); /** * Get human readable TSIG error code. * \param[in] error TSIG error code * \return const char* readable error code * */ const char* tsig_strerror(uint16_t error); /** * Free TSIG RR. * \param[in] trr TSIG RR * */ void tsig_rr_free(tsig_rr_type* trr); /** * Cleanup TSIG RR * \param[in] trr TSIG RR * */ void tsig_rr_cleanup(tsig_rr_type* trr); /** * Clean up TSIG. * \param[in] tsig TSIG * \param[in] allocator memory allocator * */ void tsig_cleanup(tsig_type* tsig, allocator_type* allocator); #endif /* WIRE_TSIG_H */ opendnssec-1.4.9/signer/src/wire/tsig-openssl.c0000644000175000017500000001351012650165732016435 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Interface to OpenSSL for TSIG support. * */ #include "config.h" #ifdef HAVE_SSL #include "shared/log.h" #include "wire/tsig.h" #include "wire/tsig-openssl.h" static const char* tsig_str = "tsig-ssl"; /** allocator */ static allocator_type* tsig_allocator = NULL; /** helper funcgtions */ static void *create_context(allocator_type* allocator); static void init_context(void *context, tsig_algo_type *algorithm, tsig_key_type *key); static void update(void *context, const void *data, size_t size); static void final(void *context, uint8_t *digest, size_t *size); typedef struct tsig_cleanup_table_struct tsig_cleanup_table_type; struct tsig_cleanup_table_struct { tsig_cleanup_table_type* next; void* cleanup; }; static tsig_cleanup_table_type* tsig_cleanup_table = NULL; /** * Initiallize algorithm. * */ static int tsig_openssl_init_algorithm(allocator_type* allocator, const char* digest, const char* name, const char* wireformat) { tsig_algo_type* algorithm = NULL; const EVP_MD *hmac_algorithm = NULL; ods_log_assert(allocator); ods_log_assert(digest); ods_log_assert(name); ods_log_assert(wireformat); hmac_algorithm = EVP_get_digestbyname(digest); if (!hmac_algorithm) { ods_log_error("[%s] %s digest not available", tsig_str, digest); return 0; } algorithm = (tsig_algo_type *) allocator_alloc(allocator, sizeof(tsig_algo_type)); algorithm->txt_name = name; algorithm->wf_name = ldns_dname_new_frm_str(wireformat); if (!algorithm->wf_name) { ods_log_error("[%s] unable to parse %s algorithm", tsig_str, wireformat); return 0; } algorithm->max_digest_size = EVP_MAX_MD_SIZE; algorithm->data = hmac_algorithm; algorithm->hmac_create = create_context; algorithm->hmac_init = init_context; algorithm->hmac_update = update; algorithm->hmac_final = final; tsig_handler_add_algo(algorithm); return 1; } /** * Initialize OpenSSL support for TSIG. * */ ods_status tsig_handler_openssl_init(allocator_type* allocator) { tsig_cleanup_table = NULL; tsig_allocator = allocator; OpenSSL_add_all_digests(); ods_log_debug("[%s] add md5", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "md5", "hmac-md5", "hmac-md5.sig-alg.reg.int.")) { return ODS_STATUS_ERR; } #ifdef HAVE_EVP_SHA1 ods_log_debug("[%s] add sha1", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "sha1", "hmac-sha1", "hmac-sha1.")) { return ODS_STATUS_ERR; } #endif /* HAVE_EVP_SHA1 */ #ifdef HAVE_EVP_SHA256 ods_log_debug("[%s] add sha256", tsig_str); if (!tsig_openssl_init_algorithm(allocator, "sha256", "hmac-sha256", "hmac-sha256.")) { return ODS_STATUS_ERR; } #endif /* HAVE_EVP_SHA256 */ return ODS_STATUS_OK; } static void cleanup_context(void *data) { HMAC_CTX* context = (HMAC_CTX*) data; HMAC_CTX_cleanup(context); return; } static void context_add_cleanup(void* context) { tsig_cleanup_table_type* entry = NULL; if (!context) { return; } entry = (tsig_cleanup_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_cleanup_table_type)); if (entry) { entry->cleanup = context; entry->next = tsig_cleanup_table; tsig_cleanup_table = entry; } return; } static void* create_context(allocator_type* allocator) { HMAC_CTX* context = (HMAC_CTX*) allocator_alloc(allocator, sizeof(HMAC_CTX)); HMAC_CTX_init(context); context_add_cleanup(context); return context; } static void init_context(void* context, tsig_algo_type *algorithm, tsig_key_type *key) { HMAC_CTX* ctx = (HMAC_CTX*) context; const EVP_MD* md = (const EVP_MD*) algorithm->data; HMAC_Init_ex(ctx, key->data, key->size, md, NULL); return; } static void update(void* context, const void* data, size_t size) { HMAC_CTX* ctx = (HMAC_CTX*) context; HMAC_Update(ctx, (unsigned char*) data, (int) size); return; } static void final(void* context, uint8_t* digest, size_t* size) { HMAC_CTX* ctx = (HMAC_CTX*) context; unsigned len = (unsigned) *size; HMAC_Final(ctx, digest, &len); *size = (size_t) len; return; } /** * Finalize OpenSSL support for TSIG. * */ void tsig_handler_openssl_finalize(void) { tsig_cleanup_table_type* entry = tsig_cleanup_table; while (entry) { cleanup_context(entry->cleanup); entry = entry->next; } EVP_cleanup(); return; } #endif /* HAVE_SSL */ opendnssec-1.4.9/signer/src/wire/edns.c0000644000175000017500000001140512650165732014740 00000000000000/* * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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. * */ /** * TSIG. * */ #include "config.h" #include "compat.h" #include "wire/buffer.h" #include "wire/edns.h" #include static const char* edns_str = "edns"; /** * Create new EDNS RR. * */ edns_rr_type* edns_rr_create(allocator_type* allocator) { edns_rr_type* err = NULL; if (!allocator) { return NULL; } err = (edns_rr_type*) allocator_alloc(allocator, sizeof(edns_rr_type)); if (!err) { ods_log_error("[%s] unable to create edns rr: allocator_alloc() " "failed", edns_str); return NULL; } err->allocator = allocator; edns_rr_reset(err); return err; } /** * Initialize EDNS. * */ void edns_init(edns_data_type* data, uint16_t max_length) { if (!data) { return; } memset(data, 0, sizeof(edns_data_type)); /* record type: OPT */ data->ok[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8; /* type_hi */ data->ok[2] = LDNS_RR_TYPE_OPT & 0x00ff; /* type_lo */ /* udp payload size */ data->ok[3] = (max_length & 0xff00) >> 8; /* size_hi */ data->ok[4] = max_length & 0x00ff; /* size_lo */ data->error[1] = (LDNS_RR_TYPE_OPT & 0xff00) >> 8; /* type_hi */ data->error[2] = LDNS_RR_TYPE_OPT & 0x00ff; /* type_lo */ data->error[3] = (max_length & 0xff00) >> 8; /* size_hi */ data->error[4] = max_length & 0x00ff; /* size_lo */ data->error[5] = 1; /* Extended RCODE=BAD VERS */ return; } /** * Reset EDNS OPT RR. * */ void edns_rr_reset(edns_rr_type* err) { if (!err) { return; } err->status = EDNS_NOT_PRESENT; err->position = 0; err->maxlen = 0; err->dnssec_ok = 0; return; } /** * Parse EDNS OPT RR. * */ int edns_rr_parse(edns_rr_type* err, buffer_type* buffer) { /* OPT record type... */ uint8_t opt_owner; uint16_t opt_type; uint16_t opt_class; uint8_t opt_version; uint16_t opt_flags; if (!err || !buffer) { ods_log_debug("[%s] parse: no edns rr or no packet buffer available", edns_str); return 0; } err->position = buffer_position(buffer); if (!buffer_available(buffer, (OPT_LEN + OPT_RDATA))) { ods_log_debug("[%s] parse: edns rr too small", edns_str); return 0; } opt_owner = buffer_read_u8(buffer); opt_type = buffer_read_u16(buffer); if (opt_owner != 0 || opt_type != LDNS_RR_TYPE_OPT) { /* Not EDNS. */ ods_log_debug("[%s] parse: not OPT: owner=%02x, type=%02x", edns_str, opt_owner, opt_type); buffer_set_position(buffer, err->position); return 0; } opt_class = buffer_read_u16(buffer); (void)buffer_read_u8(buffer); /* opt_extended_rcode */ opt_version = buffer_read_u8(buffer); opt_flags = buffer_read_u16(buffer); (void)buffer_read_u16(buffer); /* opt_rdlen */ if (opt_version != 0) { /* The only error is VERSION not implemented */ ods_log_debug("[%s] parse: wrong edns version", edns_str); err->status = EDNS_ERROR; return 1; } err->status = EDNS_OK; err->maxlen = opt_class; err->dnssec_ok = opt_flags & DNSSEC_OK_MASK; return 1; } /** * The amount of space to reserve in the response for the EDNS data. * */ size_t edns_rr_reserved_space(edns_rr_type* err) { if (!err) { return 0; } return err->status == EDNS_NOT_PRESENT ? 0 : (OPT_LEN + OPT_RDATA); } opendnssec-1.4.9/signer/src/wire/xfrd.h0000644000175000017500000001237212650165732014763 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Zone transfers. * */ #ifndef WIRE_XFRD_H #define WIRE_XFRD_H #include "config.h" #include "shared/allocator.h" #include "shared/locks.h" #include "shared/status.h" #include "wire/acl.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/tsig.h" #include #include #define XFRD_MAX_ROUNDS 3 /* max number of rounds along the masters */ #define XFRD_MAX_UDP 100 /* max number of udp sockets at a time for ixfr */ #define XFRD_NO_IXFR_CACHE 172800 /* 48h before retrying ixfr after notimpl */ #define XFRD_TCP_TIMEOUT 120 /* seconds, before a tcp request times out */ #define XFRD_UDP_TIMEOUT 5 /* seconds, before a udp request times out */ /** * Packet status. * */ enum xfrd_pkt_enum { XFRD_PKT_BAD, /* drop the packet/connection */ XFRD_PKT_MORE, /* more packets to follow on tcp */ XFRD_PKT_NOTIMPL, /* server responded with NOTIMPL or FORMATERR */ XFRD_PKT_TC, /* try tcp connection */ XFRD_PKT_XFR, /* server responded with transfer*/ XFRD_PKT_NEWLEASE /* no changes, soa OK */ }; typedef enum xfrd_pkt_enum xfrd_pkt_status; /* * Zone transfer SOA information. */ typedef struct soa_struct soa_type; struct soa_struct { /* owner equals zone apex */ /* class equals zone klass */ /* type is SOA */ uint32_t ttl; /* rdata count = 7 */ uint8_t mname[MAXDOMAINLEN + 2]; uint8_t rname[MAXDOMAINLEN + 2]; uint32_t serial; uint32_t refresh; uint32_t retry; uint32_t expire; uint32_t minimum; }; /** * Zone transfer state. * */ typedef struct xfrd_struct xfrd_type; struct xfrd_struct { allocator_type* allocator; void* xfrhandler; void* zone; lock_basic_type serial_lock; /* mutexes soa serial management */ lock_basic_type rw_lock; /* mutexes .xfrd file */ /* transfer request handling */ int tcp_conn; int round_num; int master_num; int next_master; acl_type* master; /* soa serial management */ uint32_t serial_xfr; /* Last received serial via notify. Only valid if * serial_notify_acquired is not 0 */ uint32_t serial_notify; /* current serial on inbound side */ uint32_t serial_disk; time_t serial_xfr_acquired; /* time of last received notify that is being handled. If non-zero * it indicates a transfer is in progress */ time_t serial_notify_acquired; time_t serial_disk_acquired; uint8_t serial_retransfer; soa_type soa; /* timeout and event handling */ struct timespec timeout; netio_handler_type handler; /* packet handling */ uint16_t query_id; uint32_t msg_seq_nr; uint32_t msg_old_serial; uint32_t msg_new_serial; size_t msg_rr_count; uint8_t msg_is_ixfr; uint8_t msg_do_retransfer; tsig_rr_type* tsig_rr; xfrd_type* tcp_waiting_next; xfrd_type* udp_waiting_next; unsigned tcp_waiting : 1; unsigned udp_waiting : 1; }; /** * Create zone transfer structure. * \param[in] xfrhandler zone transfer handler * \param[in] zone zone reference * \return xfrd_type* zone transfer structure. * */ xfrd_type* xfrd_create(void* xfrhandler, void* zone); /** * Set timeout for zone transfer to now. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_now(xfrd_type* xfrd); /** * Set timeout for zone transfer to RETRY. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_retry(xfrd_type* xfrd); /** * Set timeout for zone transfer to REFRESH. * \param[in] xfrd zone transfer structure. * */ void xfrd_set_timer_refresh(xfrd_type* xfrd); /** * Use acl address to setup remote sockaddr struct. * \param[in] acl acl * \param[in] to remote address storage * \return socklen_t length of address * */ socklen_t xfrd_acl_sockaddr_to(acl_type* acl, struct sockaddr_storage* to); /** * Cleanup zone transfer structure. * \param[in] xfrd zone transfer structure. * \param[in] backup backup transfer variables. * */ void xfrd_cleanup(xfrd_type* xfrd, int backup); #endif /* WIRE_XFRD_H */ opendnssec-1.4.9/signer/src/wire/tsig.c0000644000175000017500000006152612650165732014766 00000000000000/* * Copyright (c) 2011 NLNet Labs. All rights reserved. * * Taken from NSD3 and adjusted for OpenDNSSEC, NLnet Labs. * * 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. * */ /** * TSIG. * */ #include "config.h" #include "compat.h" #include "shared/duration.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "shared/util.h" #include "wire/buffer.h" #include "wire/tsig.h" #include "wire/tsig-openssl.h" #include #define TSIG_SIGNED_TIME_FUDGE 300 static const char* tsig_str = "tsig"; /** allocator */ static allocator_type* tsig_allocator = NULL; /** key table */ typedef struct tsig_key_table_struct tsig_key_table_type; struct tsig_key_table_struct { tsig_key_table_type* next; tsig_key_type* key; }; static tsig_key_table_type* tsig_key_table = NULL; /** algorithm table */ typedef struct tsig_algo_table_struct tsig_algo_table_type; struct tsig_algo_table_struct { tsig_algo_table_type* next; tsig_algo_type* algorithm; }; static tsig_algo_table_type* tsig_algo_table = NULL; /** maximum algorithm digest size */ static size_t max_algo_digest_size = 0; /** lookup algorithm table */ tsig_lookup_table tsig_supported_algorithms[] = { { TSIG_HMAC_MD5, "hmac-md5" }, #ifdef HAVE_EVP_SHA1 { TSIG_HMAC_SHA1, "hmac-sha1" }, #endif #ifdef HAVE_EVP_SHA256 { TSIG_HMAC_SHA256, "hmac-sha256" }, #endif { 0, NULL } }; /** * Add key to TSIG handler. * */ void tsig_handler_add_key(tsig_key_type* key) { tsig_key_table_type* entry = NULL; if (!key) { return; } entry = (tsig_key_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_key_table_type)); if (entry) { entry->key = key; entry->next = tsig_key_table; tsig_key_table = entry; } return; } /** * Add algorithm to TSIG handler. * */ void tsig_handler_add_algo(tsig_algo_type* algo) { tsig_algo_table_type* entry = NULL; if (!algo) { return; } entry = (tsig_algo_table_type *) allocator_alloc(tsig_allocator, sizeof(tsig_algo_table_type)); if (entry) { entry->algorithm = algo; entry->next = tsig_algo_table; tsig_algo_table = entry; if (algo->max_digest_size > max_algo_digest_size) { max_algo_digest_size = algo->max_digest_size; } } return; } /** * Initialize TSIG handler. * */ ods_status tsig_handler_init(allocator_type* allocator) { if (!allocator) { return ODS_STATUS_ERR; } tsig_allocator = allocator; tsig_key_table = NULL; tsig_algo_table = NULL; #ifdef HAVE_SSL ods_log_debug("[%s] init openssl", tsig_str); return tsig_handler_openssl_init(allocator); #else ods_log_debug("[%s] openssl disabled", tsig_str); return ODS_STATUS_OK; #endif } /** * Clean up TSIG handler. * */ void tsig_handler_cleanup(void) { tsig_algo_table_type* aentry = NULL, *anext = NULL; tsig_key_table_type* kentry = NULL, *knext = NULL; #ifdef HAVE_SSL tsig_handler_openssl_finalize(); #endif aentry = tsig_algo_table; while (aentry) { anext = aentry->next; ldns_rdf_deep_free(aentry->algorithm->wf_name); allocator_deallocate(tsig_allocator, (void*)aentry->algorithm); allocator_deallocate(tsig_allocator, (void*)aentry); aentry = anext; } kentry = tsig_key_table; while (kentry) { knext = kentry->next; ldns_rdf_deep_free(kentry->key->dname); allocator_deallocate(tsig_allocator, (void*)kentry->key->data); allocator_deallocate(tsig_allocator, (void*)kentry->key); allocator_deallocate(tsig_allocator, (void*)kentry); kentry = knext; } return; } /** * Create new TSIG key. * */ tsig_key_type* tsig_key_create(allocator_type* allocator, tsig_type* tsig) { tsig_key_type* key = NULL; ldns_rdf* dname = NULL; uint8_t* data = NULL; int size = 0; if (!allocator || !tsig || !tsig->name || !tsig->secret) { return NULL; } key = (tsig_key_type*) allocator_alloc(allocator, sizeof(tsig_key_type)); if (!key) { return NULL; } dname = ldns_dname_new_frm_str(tsig->name); if (!dname) { return NULL; } data = allocator_alloc(allocator, sizeof(uint8_t) * util_b64_pton_calculate_size(strlen(tsig->secret))); if (!data) { ldns_rdf_deep_free(dname); return NULL; } size = b64_pton(tsig->secret, data, util_b64_pton_calculate_size(strlen(tsig->secret))); if (size < 0) { ods_log_error("[%s] unable to create tsig key %s: failed to parse " "secret", tsig_str, tsig->name); ldns_rdf_deep_free(dname); allocator_deallocate(allocator, (void*)data); } key->dname = dname; key->size = size; key->data = data; tsig_handler_add_key(key); return key; } /** * Create new TSIG. * */ tsig_type* tsig_create(allocator_type* allocator, char* name, char* algo, char* secret) { tsig_type* tsig = NULL; if (!allocator || !name || !algo || !secret) { return NULL; } tsig = (tsig_type*) allocator_alloc(allocator, sizeof(tsig_type)); if (!tsig) { ods_log_error("[%s] unable to create tsig: allocator_alloc() " "failed", tsig_str); return NULL; } tsig->next = NULL; tsig->name = allocator_strdup(allocator, name); tsig->algorithm = allocator_strdup(allocator, algo); tsig->secret = allocator_strdup(allocator, secret); tsig->key = tsig_key_create(allocator, tsig); if (!tsig->key) { ods_log_error("[%s] unable to create tsig: tsig_key_create() " "failed", tsig_str); tsig_cleanup(tsig, allocator); return NULL; } return tsig; } /** * Lookup TSIG by key name. * */ tsig_type* tsig_lookup_by_name(tsig_type* tsig, const char* name) { tsig_type* find = NULL; if (!tsig || !name) { return NULL; } find = tsig; while (find) { if (ods_strlowercmp(find->name, name) == 0) { return find; } find = find->next; } return NULL; } /** * Lookup TSIG algorithm by name. * */ tsig_algo_type* tsig_lookup_algo(const char* name) { tsig_algo_table_type* entry = NULL; for (entry = tsig_algo_table; entry; entry = entry->next) { if (ods_strlowercmp(name, entry->algorithm->txt_name) == 0) { return entry->algorithm; } } return NULL; } /** * Create new TSIG RR. * */ tsig_rr_type* tsig_rr_create(allocator_type* allocator) { tsig_rr_type* trr = NULL; if (!allocator) { return NULL; } trr = (tsig_rr_type*) allocator_alloc(allocator, sizeof(tsig_rr_type)); if (!trr) { ods_log_error("[%s] unable to create tsig rr: allocator_alloc() " "failed", tsig_str); return NULL; } trr->allocator = allocator; trr->key_name = NULL; trr->algo_name = NULL; trr->mac_data = NULL; trr->other_data = NULL; tsig_rr_reset(trr, NULL, NULL); return trr; } /** * Reset TSIG RR. * */ void tsig_rr_reset(tsig_rr_type* trr, tsig_algo_type* algo, tsig_key_type* key) { if (!trr) { return; } tsig_rr_free(trr); trr->status = TSIG_NOT_PRESENT; trr->position = 0; trr->response_count = 0; trr->update_since_last_prepare = 0; trr->context = NULL; trr->algo = algo; trr->key = key; trr->prior_mac_size = 0; trr->prior_mac_data = NULL; trr->signed_time_high = 0; trr->signed_time_low = 0; trr->signed_time_fudge = 0; trr->mac_size = 0; trr->original_query_id = 0; trr->error_code = LDNS_RCODE_NOERROR; trr->other_size = 0; return; } /** * Parse TSIG RR. * */ int tsig_rr_parse(tsig_rr_type* trr, buffer_type* buffer) { uint16_t dname_len = 0; ldns_rr_type type = 0; ldns_rr_class klass = 0; uint32_t ttl = 0; uint16_t rdlen = 0; uint16_t curpos = 0; ods_log_assert(trr); ods_log_assert(trr->allocator); ods_log_assert(buffer); trr->status = TSIG_NOT_PRESENT; trr->position = buffer_position(buffer); curpos = trr->position; if (!buffer_skip_dname(buffer)) { buffer_set_position(buffer, trr->position); ods_log_debug("[%s] parse: skip key name failed", tsig_str); return 0; } dname_len = buffer_position(buffer) - curpos; buffer_set_position(buffer, curpos); trr->key_name = ldns_dname_new_frm_data(dname_len, (const void*) buffer_current(buffer)); if (!trr->key_name) { buffer_set_position(buffer, trr->position); ods_log_debug("[%s] parse: read key name failed", tsig_str); return 0; } buffer_set_position(buffer, curpos + dname_len); if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } type = (ldns_rr_type) buffer_read_u16(buffer); klass = (ldns_rr_class) buffer_read_u16(buffer); if (type != LDNS_RR_TYPE_TSIG || klass != LDNS_RR_CLASS_ANY) { /* not present */ ods_log_debug("[%s] parse: not TSIG or not ANY", tsig_str, klass, type); buffer_set_position(buffer, trr->position); return 1; } ttl = buffer_read_u32(buffer); rdlen = buffer_read_u16(buffer); /* default to error */ trr->status = TSIG_ERROR; trr->error_code = LDNS_RCODE_FORMERR; if (ttl || !buffer_available(buffer, rdlen)) { ods_log_debug("[%s] parse: TTL!=0 or RDLEN=0", tsig_str); buffer_set_position(buffer, trr->position); return 0; } curpos = buffer_position(buffer); if (!buffer_skip_dname(buffer)) { ods_log_debug("[%s] parse: skip algo name failed", tsig_str); buffer_set_position(buffer, trr->position); return 0; } dname_len = buffer_position(buffer) - curpos; buffer_set_position(buffer, curpos); trr->algo_name = ldns_dname_new_frm_data(dname_len, (const void*) buffer_current(buffer)); if (!trr->algo_name) { ods_log_debug("[%s] parse: read algo name failed", tsig_str); buffer_set_position(buffer, trr->position); return 0; } buffer_set_position(buffer, curpos + dname_len); if (!buffer_available(buffer, 10)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } trr->signed_time_high = buffer_read_u16(buffer); trr->signed_time_low = buffer_read_u32(buffer); trr->signed_time_fudge = buffer_read_u16(buffer); trr->mac_size = buffer_read_u16(buffer); if (!buffer_available(buffer, trr->mac_size)) { ods_log_debug("[%s] parse: wrong mac size", tsig_str); buffer_set_position(buffer, trr->position); trr->mac_size = 0; return 0; } trr->mac_data = (uint8_t *) allocator_alloc_init(trr->allocator, trr->mac_size, (const void*) buffer_current(buffer)); buffer_skip(buffer, trr->mac_size); if (!buffer_available(buffer, 6)) { ods_log_debug("[%s] parse: not enough available", tsig_str); buffer_set_position(buffer, trr->position); return 0; } trr->original_query_id = buffer_read_u16(buffer); trr->error_code = buffer_read_u16(buffer); trr->other_size = buffer_read_u16(buffer); if (!buffer_available(buffer, trr->other_size) || trr->other_size > 16) { ods_log_debug("[%s] parse: not enough available", tsig_str); trr->other_size = 0; buffer_set_position(buffer, trr->position); return 0; } trr->other_data = (uint8_t *) allocator_alloc_init(trr->allocator, trr->other_size, (const void*) buffer_current(buffer)); buffer_skip(buffer, trr->other_size); trr->status = TSIG_OK; return 1; } /** * Find TSIG RR. * */ int tsig_rr_find(tsig_rr_type* trr, buffer_type* buffer) { size_t saved_pos = 0; size_t rrcount = 0; size_t i = 0; int result = 0; ods_log_assert(trr); ods_log_assert(buffer); if (buffer_pkt_arcount(buffer) == 0) { trr->status = TSIG_NOT_PRESENT; return 1; } saved_pos = buffer_position(buffer); rrcount = buffer_pkt_qdcount(buffer) + buffer_pkt_ancount(buffer) + buffer_pkt_nscount(buffer) + buffer_pkt_arcount(buffer); buffer_set_position(buffer, BUFFER_PKT_HEADER_SIZE); for (i=0; i < rrcount - 1; i++) { if (!buffer_skip_rr(buffer, i < buffer_pkt_qdcount(buffer))) { buffer_set_position(buffer, saved_pos); return 0; } } result = tsig_rr_parse(trr, buffer); buffer_set_position(buffer, saved_pos); return result; } /** * Lookup TSIG RR. * */ int tsig_rr_lookup(tsig_rr_type* trr) { tsig_key_table_type* kentry = NULL; tsig_key_type* key = NULL; tsig_algo_table_type* aentry = NULL; tsig_algo_type* algorithm = NULL; uint64_t current_time = 0; uint64_t signed_time = 0; ods_log_assert(trr); ods_log_assert(trr->status == TSIG_OK); ods_log_assert(!trr->algo); ods_log_assert(!trr->key); for (kentry = tsig_key_table; kentry; kentry = kentry->next) { if (ldns_dname_compare(trr->key_name, kentry->key->dname) == 0) { key = kentry->key; break; } } for (aentry = tsig_algo_table; aentry; aentry = aentry->next) { if (ldns_dname_compare(trr->algo_name, aentry->algorithm->wf_name) == 0) { algorithm = aentry->algorithm; break; } } if (!key || !algorithm) { /* algorithm or key is unknown, cannot authenticate. */ ods_log_debug("[%s] algorithm or key missing", tsig_str); trr->error_code = TSIG_ERROR_BADKEY; return 0; } if ((trr->algo && algorithm != trr->algo) || (trr->key && key != trr->key)) { /* algorithm or key changed during a single connection, error. */ ods_log_debug("[%s] algorithm or key has changed", tsig_str); trr->error_code = TSIG_ERROR_BADKEY; return 0; } signed_time = ((((uint64_t) trr->signed_time_high) << 32) | ((uint64_t) trr->signed_time_low)); current_time = (uint64_t) time_now(); if ((current_time < signed_time - trr->signed_time_fudge) || (current_time > signed_time + trr->signed_time_fudge)) { uint16_t current_time_high; uint32_t current_time_low; trr->error_code = TSIG_ERROR_BADTIME; current_time_high = (uint16_t) (current_time >> 32); current_time_low = (uint32_t) current_time; trr->other_size = 6; trr->other_data = (uint8_t *) allocator_alloc(trr->allocator, sizeof(uint16_t) + sizeof(uint32_t)); write_uint16(trr->other_data, current_time_high); write_uint32(trr->other_data + 2, current_time_low); ods_log_debug("[%s] bad time", tsig_str); return 0; } trr->algo = algorithm; trr->key = key; trr->response_count = 0; trr->prior_mac_size = 0; return 1; } /** * Prepare TSIG RR. * */ void tsig_rr_prepare(tsig_rr_type* trr) { ods_log_assert(trr->algo); ods_log_assert(trr->allocator); if (!trr->context) { trr->context = trr->algo->hmac_create(trr->allocator); trr->prior_mac_data = (uint8_t *) allocator_alloc( trr->allocator, trr->algo->max_digest_size); } trr->algo->hmac_init(trr->context, trr->algo, trr->key); if (trr->prior_mac_size > 0) { uint16_t mac_size = htons(trr->prior_mac_size); trr->algo->hmac_update(trr->context, &mac_size, sizeof(mac_size)); trr->algo->hmac_update(trr->context, trr->prior_mac_data, trr->prior_mac_size); } trr->update_since_last_prepare = 0; return; } /** * Update TSIG RR. * */ void tsig_rr_update(tsig_rr_type* trr, buffer_type* buffer, size_t length) { uint16_t original_query_id = 0; ods_log_assert(trr); ods_log_assert(trr->algo); ods_log_assert(trr->context); ods_log_assert(buffer); ods_log_assert(length <= buffer_limit(buffer)); original_query_id = htons(trr->original_query_id); trr->algo->hmac_update(trr->context, &original_query_id, sizeof(original_query_id)); trr->algo->hmac_update(trr->context, buffer_at(buffer, sizeof(original_query_id)), length - sizeof(original_query_id)); if (buffer_pkt_qr(buffer)) { ++trr->response_count; } ++trr->update_since_last_prepare; return; } /** * Digest variables. * */ static void tsig_rr_digest_variables(tsig_rr_type* trr, int tsig_timers_only) { uint16_t klass = htons(LDNS_RR_CLASS_ANY); uint32_t ttl = htonl(0); uint16_t signed_time_high = htons(trr->signed_time_high); uint32_t signed_time_low = htonl(trr->signed_time_low); uint16_t signed_time_fudge = htons(trr->signed_time_fudge); uint16_t error_code = htons(trr->error_code); uint16_t other_size = htons(trr->other_size); ods_log_assert(trr->context); ods_log_assert(trr->algo); ods_log_assert(trr->key_name); if (!tsig_timers_only) { ods_log_assert(trr->key_name); ods_log_assert(trr->algo_name); trr->algo->hmac_update(trr->context, ldns_rdf_data(trr->key_name), ldns_rdf_size(trr->key_name)); trr->algo->hmac_update(trr->context, &klass, sizeof(klass)); trr->algo->hmac_update(trr->context, &ttl, sizeof(ttl)); trr->algo->hmac_update(trr->context, ldns_rdf_data(trr->algo_name), ldns_rdf_size(trr->algo_name)); } trr->algo->hmac_update(trr->context, &signed_time_high, sizeof(signed_time_high)); trr->algo->hmac_update(trr->context, &signed_time_low, sizeof(signed_time_low)); trr->algo->hmac_update(trr->context, &signed_time_fudge, sizeof(signed_time_fudge)); if (!tsig_timers_only) { trr->algo->hmac_update(trr->context, &error_code, sizeof(error_code)); trr->algo->hmac_update(trr->context, &other_size, sizeof(other_size)); trr->algo->hmac_update(trr->context, trr->other_data, trr->other_size); } return; } /** * Sign TSIG RR. * */ void tsig_rr_sign(tsig_rr_type* trr) { uint64_t current_time = (uint64_t) time_now(); ods_log_assert(trr); ods_log_assert(trr->context); trr->signed_time_high = (uint16_t) (current_time >> 32); trr->signed_time_low = (uint32_t) current_time; trr->signed_time_fudge = TSIG_SIGNED_TIME_FUDGE; tsig_rr_digest_variables(trr, trr->response_count > 1); trr->algo->hmac_final(trr->context, trr->prior_mac_data, &trr->prior_mac_size); trr->mac_size = trr->prior_mac_size; trr->mac_data = trr->prior_mac_data; return; } /** * Verify TSIG RR. * */ int tsig_rr_verify(tsig_rr_type* trr) { ods_log_assert(trr); ods_log_assert(trr->algo); tsig_rr_digest_variables(trr, trr->response_count > 1); trr->algo->hmac_final(trr->context, trr->prior_mac_data, &trr->prior_mac_size); if (trr->mac_size != trr->prior_mac_size || memcmp(trr->mac_data, trr->prior_mac_data, trr->mac_size) != 0) { /* digest is incorrect, cannot authenticate. */ trr->error_code = TSIG_ERROR_BADSIG; return 0; } return 1; } /** * Append TSIG RR. * */ void tsig_rr_append(tsig_rr_type* trr, buffer_type* buffer) { size_t rdlength_pos = 0; if (!trr || !buffer) { return; } /* [TODO] key name compression? */ if (trr->key_name) { buffer_write_rdf(buffer, trr->key_name); } else { buffer_write_u8(buffer, 0); } buffer_write_u16(buffer, (uint16_t)LDNS_RR_TYPE_TSIG); buffer_write_u16(buffer, (uint16_t)LDNS_RR_CLASS_ANY); buffer_write_u32(buffer, 0); /* TTL */ rdlength_pos = buffer_position(buffer); buffer_skip(buffer, sizeof(uint16_t)); if (trr->algo_name) { buffer_write_rdf(buffer, trr->algo_name); } else { buffer_write_u8(buffer, 0); } buffer_write_u16(buffer, trr->signed_time_high); buffer_write_u32(buffer, trr->signed_time_low); buffer_write_u16(buffer, trr->signed_time_fudge); buffer_write_u16(buffer, trr->mac_size); buffer_write(buffer, trr->mac_data, trr->mac_size); buffer_write_u16(buffer, trr->original_query_id); buffer_write_u16(buffer, trr->error_code); buffer_write_u16(buffer, trr->other_size); buffer_write(buffer, trr->other_data, trr->other_size); buffer_write_u16_at(buffer, rdlength_pos, buffer_position(buffer) - rdlength_pos - sizeof(uint16_t)); return; } /* * The amount of space to reserve in the response for the TSIG data. * */ size_t tsig_rr_reserved_space(tsig_rr_type* trr) { if (!trr || trr->status == TSIG_NOT_PRESENT) { return 0; } return ( (trr->key_name?ldns_rdf_size(trr->key_name):1) + sizeof(uint16_t) /* Type */ + sizeof(uint16_t) /* Class */ + sizeof(uint32_t) /* TTL */ + sizeof(uint16_t) /* RDATA length */ + (trr->algo_name?ldns_rdf_size(trr->algo_name):1) + sizeof(uint16_t) /* Signed time (high) */ + sizeof(uint32_t) /* Signed time (low) */ + sizeof(uint16_t) /* Signed time fudge */ + sizeof(uint16_t) /* MAC size */ + max_algo_digest_size /* MAC data */ + sizeof(uint16_t) /* Original query ID */ + sizeof(uint16_t) /* Error code */ + sizeof(uint16_t) /* Other size */ + trr->other_size); /* Other data */ } /** * Reply with error TSIG RR. * */ void tsig_rr_error(tsig_rr_type* trr) { if (!trr) { return; } if (trr->mac_data) { memset(trr->mac_data, 0, trr->mac_size); } trr->mac_size = 0; return; } /** * Print TSIG status. * */ const char* tsig_status2str(tsig_status status) { switch (status) { case TSIG_NOT_PRESENT: return "NOT PRESENT"; case TSIG_OK: return "OK"; case TSIG_ERROR: return "ERROR"; } return "UNKNOWN"; } /** * Get human readable TSIG error code. * */ const char* tsig_strerror(uint16_t error) { static char message[1000]; switch (error) { case 0: return "No Error"; break; case TSIG_ERROR_BADSIG: return "Bad Signature"; break; case TSIG_ERROR_BADKEY: return "Bad Key"; break; case TSIG_ERROR_BADTIME: return "Bad Time"; break; default: if (error < 16) { /* DNS rcodes */ return (const char*) ldns_pkt_rcode2str(error); } snprintf(message, sizeof(message), "Unknown Error %d", error); break; } return message; } /** * Free TSIG RR. * */ void tsig_rr_free(tsig_rr_type* trr) { if (!trr || !trr->allocator) { return; } ldns_rdf_deep_free(trr->key_name); ldns_rdf_deep_free(trr->algo_name); allocator_deallocate(trr->allocator, (void*) trr->mac_data); allocator_deallocate(trr->allocator, (void*) trr->other_data); trr->key_name = NULL; trr->algo_name = NULL; trr->mac_data = NULL; trr->other_data = NULL; return; } /** * Cleanup TSIG RR. * */ void tsig_rr_cleanup(tsig_rr_type* trr) { allocator_type* allocator = NULL; if (!trr || !trr->allocator) { return; } tsig_rr_free(trr); allocator = trr->allocator; allocator_deallocate(allocator, (void*) trr); return; } /** * Clean up TSIG. * */ void tsig_cleanup(tsig_type* tsig, allocator_type* allocator) { if (!tsig || !allocator) { return; } tsig_cleanup(tsig->next, allocator); allocator_deallocate(allocator, (void*) tsig->name); allocator_deallocate(allocator, (void*) tsig->algorithm); allocator_deallocate(allocator, (void*) tsig->secret); allocator_deallocate(allocator, (void*) tsig); return; } opendnssec-1.4.9/signer/src/wire/netio.h0000644000175000017500000001433012650165732015132 00000000000000/* * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * See LICENSE for the license. * * * The netio module implements event based I/O handling using * pselect(2). Multiple event handlers can wait for a certain event * to occur simultaneously. Each event handler is called when an * event occurs that the event handler has indicated that it is * willing to handle. * * There are four types of events that can be handled: * * NETIO_EVENT_READ: reading will not block. * NETIO_EVENT_WRITE: writing will not block. * NETIO_EVENT_EXCEPT: an exception occurred. * NETIO_EVENT_TIMEOUT: the timeout expired. * * A file descriptor must be specified if the handler is interested in * the first three event types. A timeout must be specified if the * event handler is interested in timeouts. These event types can be * OR'ed together if the handler is willing to handle multiple types * of events. * * The special event type NETIO_EVENT_NONE is available if you wish to * temporarily disable the event handler without removing and adding * the handler to the netio structure. * * The event callbacks are free to modify the netio_handler_type * structure to change the file descriptor, timeout, event types, user * data, or handler functions. * * The main loop of the program must call netio_dispatch to check for * events and dispatch them to the handlers. An additional timeout * can be specified as well as the signal mask to install while * blocked in pselect(2). */ /** * Network I/O Support. * */ #ifndef WIRE_NETIO_H_ #define WIRE_NETIO_H_ #ifdef HAVE_SYS_SELECT_H #include #endif #include #include "config.h" #include "shared/allocator.h" #ifndef PF_INET #define PF_INET AF_INET #endif #ifndef PF_INET6 #define PF_INET6 AF_INET6 #endif /* * The type of events a handler is interested in. * These can be OR'ed together to specify multiple event types. * */ enum netio_events_enum { NETIO_EVENT_NONE = 0, NETIO_EVENT_READ = 1, NETIO_EVENT_WRITE = 2, NETIO_EVENT_EXCEPT = 4, NETIO_EVENT_TIMEOUT = 8 }; typedef enum netio_events_enum netio_events_type; typedef struct netio_struct netio_type; typedef struct netio_handler_struct netio_handler_type; typedef struct netio_handler_list_struct netio_handler_list_type; /** * Network I/O event handler function. * */ typedef void (*netio_event_handler_type)(netio_type *netio, netio_handler_type* handler, netio_events_type event_types); /** * Network I/O event handler list. * */ struct netio_handler_list_struct { netio_handler_list_type* next; netio_handler_type* handler; }; /** * Network I/O event handler. * */ struct netio_handler_struct { /* * The file descriptor that should be checked for events. If * the file descriptor is negative only timeout events are * checked for. */ int fd; /* * The time when no events should be checked for and the * handler should be called with the NETIO_EVENT_TIMEOUT * event type. Unlike most timeout parameters the time should * be absolute, not relative! */ struct timespec* timeout; /* * User data. */ void* user_data; /* * The type of events that should be checked for. These types * can be OR'ed together to wait for multiple types of events. */ netio_events_type event_types; /* * The event handler. The event_types parameter contains the * OR'ed set of event types that actually triggered. The * event handler is allowed to modify this handler object. * The event handler SHOULD NOT block. */ netio_event_handler_type event_handler; }; /** * Network I/O instance. * */ struct netio_struct { allocator_type* allocator; netio_handler_list_type* handlers; netio_handler_list_type* deallocated; /* * Cached value of the current time. The cached value is * cleared at the start of netio_dispatch to calculate the * relative timeouts of the event handlers and after calling * pselect(2) so handlers can use it to calculate a new * absolute timeout. * * Use netio_current_time() to read the current time. */ int have_current_time; struct timespec cached_current_time; /* * Next handler in the dispatch. Only valid during callbacks. * To make sure that deletes respect the state of the iterator. */ netio_handler_list_type* dispatch_next; }; /* * Create a new netio instance. * \param[in] allocator memory allocator * \return netio_type* netio instance * */ netio_type* netio_create(allocator_type* allocator); /* * Add a new handler to netio. * \param[in] netio netio instance * \param[in] handler handler * */ void netio_add_handler(netio_type* netio, netio_handler_type* handler); /* * Remove the handler from netio. * \param[in] netio netio instance * \param[in] handler handler * */ void netio_remove_handler(netio_type* netio, netio_handler_type* handler); /* * Retrieve the current time (using gettimeofday(2)). * \param[in] netio netio instance * \return const struct timespec* current time * */ const struct timespec* netio_current_time(netio_type* netio); /* * Check for events and dispatch them to the handlers. * \param[in] netio netio instance * \param[in] timeout if specified, the maximum time to wait for an * event to arrive. * \param[in] sigmask is passed to the underlying pselect(2) call * \return int the number of non-timeout events dispatched, 0 on timeout, * and -1 on error (with errno set appropriately). * */ int netio_dispatch(netio_type* netio, const struct timespec* timeout, const sigset_t* sigmask); /** * Clean up netio instance * \param[in] netio netio instance * */ void netio_cleanup(netio_type* netio); /** * Add timespecs. * \param[in] left left * \param[in] right right * */ void timespec_add(struct timespec* left, const struct timespec* right); #ifdef __cplusplus inline netio_events_type operator | (netio_events_type lhs, netio_events_type rhs) { return (netio_events_type) (lhs | rhs); } inline netio_events_type operator |= (netio_events_type &lhs, netio_events_type rhs) { lhs = (netio_events_type) (lhs | rhs); return lhs; } #endif /* __cplusplus */ #endif /* WIRE_NETIO_H_ */ opendnssec-1.4.9/signer/src/wire/sock.h0000644000175000017500000000747012650165732014762 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Sockets. * */ #ifndef WIRE_SOCK_H #define WIRE_SOCK_H #include "config.h" #include "shared/allocator.h" #include "shared/status.h" #include "wire/listener.h" #include "wire/netio.h" #include "wire/query.h" /** * Socket. * */ typedef struct sock_struct sock_type; struct sock_struct { struct addrinfo* addr; int s; }; /** * List of sockets. * */ typedef struct socklist_struct socklist_type; struct socklist_struct { sock_type tcp[MAX_INTERFACES]; sock_type udp[MAX_INTERFACES]; }; /** * Data for udp handlers. * */ struct udp_data { void* engine; sock_type* socket; query_type* query; }; /** * Data for tcp accept handlers. * */ struct tcp_accept_data { void* engine; sock_type* socket; size_t tcp_accept_handler_count; netio_handler_type* tcp_accept_handlers; }; /** * Data for tcp handlers. * */ struct tcp_data { allocator_type* allocator; void* engine; query_type* query; size_t tcp_accept_handler_count; netio_handler_type* tcp_accept_handlers; query_state qstate; size_t bytes_transmitted; }; /** * Create sockets and listen. * \param[out] sockets sockets * \param[in] listener interfaces * \return ods_status status * */ ods_status sock_listen(socklist_type* sockets, listener_type* listener); /** * Handle incoming udp queries. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_udp(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle incoming tcp connections. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_accept(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle incoming tcp queries. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_read(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); /** * Handle outgoing tcp responses. * \param[in] netio network I/O event handler * \param[in] handler event handler * \param[in] event_types the types of events that should be checked for * */ void sock_handle_tcp_write(netio_type* netio, netio_handler_type* handler, netio_events_type event_types); #endif /* WIRE_SOCK_H */ opendnssec-1.4.9/signer/src/wire/tsig-openssl.h0000644000175000017500000000354212650165732016446 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Interface to OpenSSL for TSIG support. * */ #ifndef WIRE_TSIG_OPENSSL_H #define WIRE_TSIG_OPENSSL_H #ifdef HAVE_SSL #include "shared/allocator.h" #include "shared/status.h" #include #include /** * Initialize OpenSSL support for TSIG. * \param[in] allocator memory allocator * \return ods_status status * */ ods_status tsig_handler_openssl_init(allocator_type* allocator); /** * Finalize OpenSSL support for TSIG. * */ void tsig_handler_openssl_finalize(void); #endif /* HAVE_SSL */ #endif /* WIRE_TSIG_OPENSSL_H */ opendnssec-1.4.9/signer/src/wire/tcpset.c0000644000175000017500000001624512650165732015320 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * TCP connections. * */ #include "config.h" #include "wire/tcpset.h" #include static const char* tcp_str = "tcp"; /** * Create a tcp connection. * */ tcp_conn_type* tcp_conn_create(allocator_type* allocator) { tcp_conn_type* tcp_conn = NULL; if (!allocator) { return NULL; } tcp_conn = (tcp_conn_type*) allocator_alloc(allocator, sizeof(tcp_conn_type)); if (!tcp_conn) { return NULL; } memset(tcp_conn, 0, sizeof(tcp_conn_type)); tcp_conn->packet = buffer_create(allocator, PACKET_BUFFER_SIZE); if (!tcp_conn->packet) { allocator_deallocate(allocator, (void*)tcp_conn); return NULL; } tcp_conn->msglen = 0; tcp_conn->total_bytes = 0; tcp_conn->fd = -1; return tcp_conn; } /** * Create a set of tcp connections. * */ tcp_set_type* tcp_set_create(allocator_type* allocator) { size_t i = 0; tcp_set_type* tcp_set = NULL; tcp_set = (tcp_set_type*) allocator_alloc(allocator, sizeof(tcp_set_type)); memset(tcp_set, 0, sizeof(tcp_set_type)); tcp_set->tcp_count = 0; for (i=0; i < TCPSET_MAX; i++) { tcp_set->tcp_conn[i] = tcp_conn_create(allocator); } tcp_set->tcp_waiting_first = NULL; tcp_set->tcp_waiting_last = NULL; return tcp_set; } /** * Make tcp connection ready for reading. * \param[in] tcp tcp connection * */ void tcp_conn_ready(tcp_conn_type* tcp) { ods_log_assert(tcp); tcp->total_bytes = 0; tcp->msglen = 0; buffer_clear(tcp->packet); return; } /* * Read from a tcp connection. * */ int tcp_conn_read(tcp_conn_type* tcp) { ssize_t received = 0; ods_log_assert(tcp); ods_log_assert(tcp->fd != -1); /* receive leading packet length bytes */ if (tcp->total_bytes < sizeof(tcp->msglen)) { received = read(tcp->fd, (char*) &tcp->msglen + tcp->total_bytes, sizeof(tcp->msglen) - tcp->total_bytes); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, try later */ return 0; } else { if (errno != ECONNRESET) { ods_log_error("[%s] error read() sz: %s", tcp_str, strerror(errno)); } return -1; } } else if (received == 0) { /* EOF */ return -1; } tcp->total_bytes += received; if (tcp->total_bytes < sizeof(tcp->msglen)) { /* not complete yet, try later */ return 0; } ods_log_assert(tcp->total_bytes == sizeof(tcp->msglen)); tcp->msglen = ntohs(tcp->msglen); if (tcp->msglen > buffer_capacity(tcp->packet)) { /* packet to big, drop connection */ ods_log_error("[%s] packet too big, dropping connection", tcp_str); return 0; } buffer_set_limit(tcp->packet, tcp->msglen); } ods_log_assert(buffer_remaining(tcp->packet) > 0); received = read(tcp->fd, buffer_current(tcp->packet), buffer_remaining(tcp->packet)); if (received == -1) { if (errno == EAGAIN || errno == EINTR) { /* read would block, try later */ return 0; } else { if (errno != ECONNRESET) { ods_log_error("[%s] error read(): %s", tcp_str, strerror(errno)); } return -1; } } else if (received == 0) { /* EOF */ return -1; } tcp->total_bytes += received; buffer_skip(tcp->packet, received); if (buffer_remaining(tcp->packet) > 0) { /* not complete yet, wait for more */ return 0; } /* completed */ ods_log_assert(buffer_position(tcp->packet) == tcp->msglen); return 1; } /* * Write to a tcp connection. * */ int tcp_conn_write(tcp_conn_type* tcp) { ssize_t sent = 0; ods_log_assert(tcp); ods_log_assert(tcp->fd != -1); if (tcp->total_bytes < sizeof(tcp->msglen)) { uint16_t sendlen = htons(tcp->msglen); sent = write(tcp->fd, (const char*)&sendlen + tcp->total_bytes, sizeof(tcp->msglen) - tcp->total_bytes); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, try later */ return 0; } else { return -1; } } tcp->total_bytes += sent; if (tcp->total_bytes < sizeof(tcp->msglen)) { /* incomplete write, resume later */ return 0; } ods_log_assert(tcp->total_bytes == sizeof(tcp->msglen)); } ods_log_assert(tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen)); sent = write(tcp->fd, buffer_current(tcp->packet), buffer_remaining(tcp->packet)); if (sent == -1) { if (errno == EAGAIN || errno == EINTR) { /* write would block, try later */ return 0; } else { return -1; } } buffer_skip(tcp->packet, sent); tcp->total_bytes += sent; if (tcp->total_bytes < tcp->msglen + sizeof(tcp->msglen)) { /* more to write when socket becomes writable again */ return 0; } ods_log_assert(tcp->total_bytes == tcp->msglen + sizeof(tcp->msglen)); return 1; } /** * Clean up tcp connection. * */ static void tcp_conn_cleanup(tcp_conn_type* conn, allocator_type* allocator) { if (!conn || !allocator) { return; } buffer_cleanup(conn->packet, allocator); allocator_deallocate(allocator, (void*) conn); return; } /** * Clean up set of tcp connections. * */ void tcp_set_cleanup(tcp_set_type* set, allocator_type* allocator) { size_t i = 0; if (!set || !allocator) { return; } for (i=0; i < TCPSET_MAX; i++) { tcp_conn_cleanup(set->tcp_conn[i], allocator); } allocator_deallocate(allocator, (void*) set); return; } opendnssec-1.4.9/signer/src/wire/axfr.c0000644000175000017500000005410312650165732014751 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * AXFR. * */ #include "config.h" #include "adapter/addns.h" #include "adapter/adutil.h" #include "shared/file.h" #include "shared/util.h" #include "wire/axfr.h" #include "wire/buffer.h" #include "wire/edns.h" #include "wire/query.h" #include "wire/sock.h" #define AXFR_TSIG_SIGN_EVERY_NTH 96 /* tsig sign every N packets. */ const char* axfr_str = "axfr"; /** * Handle SOA request. * */ query_state soa_request(query_type* q, engine_type* engine) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; FILE* fd = NULL; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); ods_log_assert(engine); xfrfile = ods_build_path(q->zone->name, ".axfr", 0, 1); if (xfrfile) { fd = ods_fopen(xfrfile, NULL, "r"); } if (!fd) { ods_log_error("[%s] unable to open file %s for zone %s", axfr_str, xfrfile, q->zone->name); free((void*)xfrfile); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ rr = addns_read_rr(fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad axfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad axfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired at %u, and it is now %u: " "not serving soa", axfr_str, q->zone->name, expire, time_now()); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in response %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); ldns_rr_free(rr); rr = NULL; } else { ods_log_error("[%s] soa does not fit in response %s", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(fd); return QUERY_PROCESSED; } ods_fclose(fd); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); buffer_pkt_set_aa(q->buffer); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } return QUERY_PROCESSED; } /** * Do AXFR. * */ query_state axfr(query_type* q, engine_type* engine, int fallback) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint16_t total_added = 0; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; long fpos = 0; size_t bufpos = 0; ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); ods_log_assert(engine); if (q->axfr_is_done) { ods_log_debug("[%s] zone transfer %s completed", axfr_str, q->zone->name); return QUERY_PROCESSED; } if (q->maxlen > AXFR_MAX_MESSAGE_LEN) { q->maxlen = AXFR_MAX_MESSAGE_LEN; } /* prepare TSIG */ if (!fallback) { q->tsig_prepare_it = 0; q->tsig_update_it = 1; if (q->tsig_sign_it) { q->tsig_prepare_it = 1; q->tsig_sign_it = 0; } } ods_log_assert(q->tsig_rr); if (q->axfr_fd == NULL) { /* start AXFR */ xfrfile = ods_build_path(q->zone->name, ".axfr", 0, 1); if (xfrfile) { q->axfr_fd = ods_fopen(xfrfile, NULL, "r"); } if (!q->axfr_fd) { ods_log_error("[%s] unable to open axfr file %s for zone %s", axfr_str, xfrfile, q->zone->name); free((void*)xfrfile); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad axfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad axfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired, not transferring zone", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in axfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; ldns_rr_free(rr); rr = NULL; bufpos = buffer_position(q->buffer); } else { ods_log_error("[%s] soa does not fit in axfr zone %s", axfr_str, q->zone->name); ldns_rr_free(rr); rr = NULL; buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } else if (q->tcp) { /* subsequent AXFR packets */ ods_log_debug("[%s] subsequent axfr packet zone %s", axfr_str, q->zone->name); q->edns_rr->status = EDNS_NOT_PRESENT; buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); query_prepare(q); } /* add as many records as fit */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } while ((rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { ods_log_deeebug("[%s] read rr at line %d", axfr_str, l); if (status != LDNS_STATUS_OK) { ldns_rr_free(rr); rr = NULL; ods_log_error("[%s] error reading rr at line %i (%s): %s", axfr_str, l, ldns_get_errorstr_by_id(status), line); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_deeebug("[%s] add rr at line %d", axfr_str, l); ldns_rr_free(rr); rr = NULL; fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read axfr for zone %s: " "ftell() failed (%s)", axfr_str, q->zone->name, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; } else { ods_log_deeebug("[%s] rr at line %d does not fit", axfr_str, l); ldns_rr_free(rr); rr = NULL; if (fseek(q->axfr_fd, fpos, SEEK_SET) != 0) { ods_log_error("[%s] unable to reset file position in axfr " "file: fseek() failed (%s)", axfr_str, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } else if (q->tcp) { goto return_axfr; } else { goto udp_overflow; } } } ods_log_debug("[%s] axfr zone %s is done", axfr_str, q->zone->name); q->tsig_sign_it = 1; /* sign last packet */ q->axfr_is_done = 1; ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return_axfr: if (q->tcp) { ods_log_debug("[%s] return part axfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, total_added); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { if (q->tsig_rr->update_since_last_prepare >= AXFR_TSIG_SIGN_EVERY_NTH) { q->tsig_sign_it = 1; } } return QUERY_AXFR; } ods_log_error("[%s] zone transfer %s not tcp", axfr_str, q->zone->name); udp_overflow: /* UDP Overflow */ ods_log_info("[%s] axfr udp overflow zone %s", axfr_str, q->zone->name); buffer_set_position(q->buffer, bufpos); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } ods_log_debug("[%s] zone transfer %s udp overflow", axfr_str, q->zone->name); return QUERY_PROCESSED; } /** * Do IXFR (equal to AXFR for now). * */ query_state ixfr(query_type* q, engine_type* engine) { char* xfrfile = NULL; ldns_rr* rr = NULL; ldns_rdf* prev = NULL; ldns_rdf* orig = NULL; uint16_t total_added = 0; uint32_t ttl = 0; time_t expire = 0; ldns_status status = LDNS_STATUS_OK; char line[SE_ADFILE_MAXLINE]; unsigned l = 0; long fpos = 0; size_t bufpos = 0; uint32_t new_serial = 0; unsigned del_mode = 0; unsigned soa_found = 0; ods_log_assert(engine); ods_log_assert(q); ods_log_assert(q->buffer); ods_log_assert(q->zone); ods_log_assert(q->zone->name); if (q->axfr_is_done) { return QUERY_PROCESSED; } if (q->maxlen > AXFR_MAX_MESSAGE_LEN) { q->maxlen = AXFR_MAX_MESSAGE_LEN; } /* prepare TSIG */ q->tsig_prepare_it = 0; q->tsig_update_it = 1; if (q->tsig_sign_it) { q->tsig_prepare_it = 1; q->tsig_sign_it = 0; } ods_log_assert(q->tsig_rr); if (q->axfr_fd == NULL) { /* start IXFR */ xfrfile = ods_build_path(q->zone->name, ".ixfr", 0, 1); if (xfrfile) { q->axfr_fd = ods_fopen(xfrfile, NULL, "r"); } if (!q->axfr_fd) { ods_log_error("[%s] unable to open ixfr file %s for zone %s", axfr_str, xfrfile, q->zone->name); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); free((void*)xfrfile); buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } free((void*)xfrfile); if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; /* sign first packet in stream */ } /* compression? */ /* add SOA RR */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() " "failed (%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l); if (!rr) { /* no SOA no transfer */ ods_log_error("[%s] bad ixfr zone %s, corrupted file", axfr_str, q->zone->name); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } /* first RR must be SOA */ if (ldns_rr_get_type(rr) != LDNS_RR_TYPE_SOA) { ods_log_error("[%s] bad ixfr zone %s, first rr is not soa", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } /* zone not expired? */ if (q->zone->xfrd) { expire = q->zone->xfrd->serial_xfr_acquired; expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE)); if (expire < time_now()) { ods_log_warning("[%s] zone %s expired, not transferring zone", axfr_str, q->zone->name); ldns_rr_free(rr); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return QUERY_PROCESSED; } } /* newest serial */ new_serial = ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL)); /* does it fit? */ buffer_set_position(q->buffer, q->startpos); if (query_add_rr(q, rr)) { ods_log_debug("[%s] set soa in ixfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; ldns_rr_free(rr); rr = NULL; bufpos = buffer_position(q->buffer); } else { ods_log_error("[%s] soa does not fit in ixfr zone %s", axfr_str, q->zone->name); ldns_rr_free(rr); rr = NULL; buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } if (util_serial_gt(q->serial, new_serial)) { goto axfr_fallback; } } else if (q->tcp) { /* subsequent IXFR packets */ ods_log_debug("[%s] subsequent ixfr packet zone %s", axfr_str, q->zone->name); buffer_set_limit(q->buffer, BUFFER_PKT_HEADER_SIZE); buffer_pkt_set_qdcount(q->buffer, 0); query_prepare(q); soa_found = 1; } /* add as many records as fit */ fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() failed " "(%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } while ((rr = addns_read_rr(q->axfr_fd, line, &orig, &prev, &ttl, &status, &l)) != NULL) { ods_log_deeebug("[%s] read rr at line %d", axfr_str, l); if (status != LDNS_STATUS_OK) { ldns_rr_free(rr); rr = NULL; ods_log_error("[%s] error reading rr at line %i (%s): %s", axfr_str, l, ldns_get_errorstr_by_id(status), line); goto axfr_fallback; } if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) { del_mode = !del_mode; } if (!soa_found) { if (del_mode && ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA && q->serial == ldns_rdf2native_int32( ldns_rr_rdf(rr, SE_SOA_RDATA_SERIAL))) { soa_found = 1; } else { ods_log_deeebug("[%s] soa serial %u not found for rr at line %d", axfr_str, q->serial, l); continue; } } /* does it fit? */ if (query_add_rr(q, rr)) { ods_log_deeebug("[%s] add rr at line %d", axfr_str, l); ldns_rr_free(rr); rr = NULL; fpos = ftell(q->axfr_fd); if (fpos < 0) { ods_log_error("[%s] unable to read ixfr for zone %s: ftell() " "failed (%s)", axfr_str, q->zone->name, strerror(errno)); ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); ods_fclose(q->axfr_fd); q->axfr_fd = NULL; buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } buffer_pkt_set_ancount(q->buffer, buffer_pkt_ancount(q->buffer)+1); total_added++; } else { ods_log_deeebug("[%s] rr at line %d does not fit", axfr_str, l); ldns_rr_free(rr); rr = NULL; if (fseek(q->axfr_fd, fpos, SEEK_SET) != 0) { ods_log_error("[%s] unable to reset file position in ixfr " "file: fseek() failed (%s)", axfr_str, strerror(errno)); buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL); return QUERY_PROCESSED; } else if (q->tcp) { goto return_ixfr; } else { goto axfr_fallback; } } } if (!soa_found) { ods_log_warning("[%s] zone %s journal not found for serial %u", axfr_str, q->zone->name, q->serial); goto axfr_fallback; } ods_log_debug("[%s] ixfr zone %s is done", axfr_str, q->zone->name); q->tsig_sign_it = 1; /* sign last packet */ q->axfr_is_done = 1; ods_fclose(q->axfr_fd); q->axfr_fd = NULL; return_ixfr: ods_log_debug("[%s] return part ixfr zone %s", axfr_str, q->zone->name); buffer_pkt_set_ancount(q->buffer, total_added); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { if (q->tsig_rr->update_since_last_prepare >= AXFR_TSIG_SIGN_EVERY_NTH) { q->tsig_sign_it = 1; } } return QUERY_IXFR; axfr_fallback: if (q->tcp) { ods_log_info("[%s] axfr fallback zone %s", axfr_str, q->zone->name); if (q->axfr_fd) { ods_fclose(q->axfr_fd); q->axfr_fd = NULL; } buffer_set_position(q->buffer, q->startpos); return axfr(q, engine, 1); } /* UDP Overflow */ ods_log_info("[%s] ixfr udp overflow zone %s", axfr_str, q->zone->name); buffer_set_position(q->buffer, bufpos); buffer_pkt_set_ancount(q->buffer, 1); buffer_pkt_set_nscount(q->buffer, 0); buffer_pkt_set_arcount(q->buffer, 0); /* check if it needs TSIG signatures */ if (q->tsig_rr->status == TSIG_OK) { q->tsig_sign_it = 1; } return QUERY_PROCESSED; } opendnssec-1.4.9/signer/src/wire/notify.h0000644000175000017500000000515712650165732015333 00000000000000/* * Copyright (c) 2011 NLNet Labs. 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 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. * */ /** * Notify sending. * */ #ifndef WIRE_NOTIFY_H #define WIRE_NOTIFY_H #include "config.h" #include "shared/allocator.h" #include "wire/acl.h" #include "wire/buffer.h" #include "wire/netio.h" #include "wire/tsig.h" #include #define NOTIFY_MAX_UDP 50 #define NOTIFY_MAX_RETRY 5 #define NOTIFY_RETRY_TIMEOUT 15 /** * Notify. * */ typedef struct notify_struct notify_type; struct notify_struct { notify_type* waiting_next; allocator_type* allocator; ldns_rr* soa; tsig_rr_type* tsig_rr; acl_type* secondary; void* zone; void* xfrhandler; netio_handler_type handler; struct timespec timeout; uint16_t query_id; uint8_t retry; unsigned is_waiting : 1; }; /** * Create notify structure. * \param[in] xfrhandler zone transfer handler * \param[in] zone zone reference * \return notify_type* notify structure. * */ notify_type* notify_create(void* xfrhandler, void* zone); /** * Enable notify. * \param[in] notify notify structure * \param[in] soa current soa * */ void notify_enable(notify_type* notify, ldns_rr* soa); /** * Send notify. * \param[in] notify notify structure * */ void notify_send(notify_type* notify); /** * Cleanup notify structure. * \param[in] notify notify structure. * */ void notify_cleanup(notify_type* notify); #endif /* WIRE_NOTIFY_H */ opendnssec-1.4.9/signer/src/ods-getconf.c0000644000175000017500000000765312650165732015263 00000000000000/* * Copyright (c) 2014 NLNet Labs. 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 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. * */ /** * OpenDNSSEC get configuration values. * */ #include "config.h" #include "parser/confparser.h" #include "shared/log.h" #include #include #include /* fcntl() */ #include /* fprintf() */ #include /* strerror(), strncmp(), strlen(), strcpy(), strncat() */ #include /* bzero() */ #include /* select(), FD_ZERO(), FD_SET(), FD_ISSET(), FD_CLR() */ #include /* socket(), connect(), shutdown() */ #include #include /* exit(), read(), write() */ /* According to earlier standards, we need sys/time.h, sys/types.h, unistd.h for select() */ #include #include /** * Prints usage. * */ static void usage(FILE* out) { fprintf(out, "Usage: %s []\n", "ods-getconf"); fprintf(out, "Simple command line tool to get the value of a " "configuration option.\n\n"); fprintf(out, "Supported options:\n"); fprintf(out, " -c | --config Read configuration from file.\n"); fprintf(out, " -h | --help Show this help and exit.\n"); fprintf(out, "\nBSD licensed, see LICENSE in source package for " "details.\n"); fprintf(out, "Version %s. Report bugs to <%s>.\n", PACKAGE_VERSION, PACKAGE_BUGREPORT); } /** * Prints version. * */ static void version(FILE* out) { fprintf(out, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit(0); } /** * Main. start interface tool. * */ int main(int argc, char* argv[]) { int c; int options_index = 0; const char* str; const char* cfgfile = ODS_SE_CFGFILE; static struct option long_options[] = { {"config", required_argument, 0, 'c'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, { 0, 0, 0, 0} }; /* parse the commandline */ while ((c=getopt_long(argc, argv, "c:hV", long_options, &options_index)) != -1) { switch (c) { case 'c': cfgfile = optarg; break; case 'h': usage(stdout); exit(0); break; case 'V': version(stdout); exit(0); break; default: usage(stderr); exit(2); break; } } argc -= optind; argv += optind; if (argc != 1) { usage(stderr); exit(2); } str = parse_conf_string(cfgfile, argv[0], 0); if (str) { fprintf(stdout, "%s", str); free((void*)str); } fprintf(stdout, "\n"); return 0; } opendnssec-1.4.9/signer/src/Makefile.in0000644000175000017500000040104612650165765014754 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = ods-signerd$(EXEEXT) ods-signer$(EXEEXT) bin_PROGRAMS = ods-getconf$(EXEEXT) subdir = signer/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_ods_getconf_OBJECTS = ods-getconf.$(OBJEXT) adapi.$(OBJEXT) \ adapter.$(OBJEXT) addns.$(OBJEXT) adfile.$(OBJEXT) \ adutil.$(OBJEXT) cfg.$(OBJEXT) cmdhandler.$(OBJEXT) \ dnshandler.$(OBJEXT) xfrhandler.$(OBJEXT) engine.$(OBJEXT) \ signal.$(OBJEXT) worker.$(OBJEXT) addnsparser.$(OBJEXT) \ confparser.$(OBJEXT) signconfparser.$(OBJEXT) \ zonelistparser.$(OBJEXT) fifoq.$(OBJEXT) schedule.$(OBJEXT) \ task.$(OBJEXT) allocator.$(OBJEXT) duration.$(OBJEXT) \ file.$(OBJEXT) hsm.$(OBJEXT) locks.$(OBJEXT) log.$(OBJEXT) \ privdrop.$(OBJEXT) status.$(OBJEXT) util.$(OBJEXT) \ backup.$(OBJEXT) denial.$(OBJEXT) domain.$(OBJEXT) \ ixfr.$(OBJEXT) keys.$(OBJEXT) namedb.$(OBJEXT) \ nsec3params.$(OBJEXT) rrset.$(OBJEXT) signconf.$(OBJEXT) \ stats.$(OBJEXT) tools.$(OBJEXT) zone.$(OBJEXT) \ zonelist.$(OBJEXT) acl.$(OBJEXT) axfr.$(OBJEXT) \ buffer.$(OBJEXT) edns.$(OBJEXT) listener.$(OBJEXT) \ netio.$(OBJEXT) notify.$(OBJEXT) query.$(OBJEXT) \ sock.$(OBJEXT) tcpset.$(OBJEXT) tsig.$(OBJEXT) \ tsig-openssl.$(OBJEXT) xfrd.$(OBJEXT) ods_getconf_OBJECTS = $(am_ods_getconf_OBJECTS) ods_getconf_DEPENDENCIES = $(LIBHSM) $(LIBCOMPAT) 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_ods_signer_OBJECTS = ods-signer.$(OBJEXT) adapi.$(OBJEXT) \ adapter.$(OBJEXT) addns.$(OBJEXT) adfile.$(OBJEXT) \ adutil.$(OBJEXT) cfg.$(OBJEXT) cmdhandler.$(OBJEXT) \ dnshandler.$(OBJEXT) xfrhandler.$(OBJEXT) engine.$(OBJEXT) \ signal.$(OBJEXT) worker.$(OBJEXT) addnsparser.$(OBJEXT) \ confparser.$(OBJEXT) signconfparser.$(OBJEXT) \ zonelistparser.$(OBJEXT) fifoq.$(OBJEXT) schedule.$(OBJEXT) \ task.$(OBJEXT) allocator.$(OBJEXT) duration.$(OBJEXT) \ file.$(OBJEXT) hsm.$(OBJEXT) locks.$(OBJEXT) log.$(OBJEXT) \ privdrop.$(OBJEXT) status.$(OBJEXT) util.$(OBJEXT) \ backup.$(OBJEXT) denial.$(OBJEXT) domain.$(OBJEXT) \ ixfr.$(OBJEXT) keys.$(OBJEXT) namedb.$(OBJEXT) \ nsec3params.$(OBJEXT) rrset.$(OBJEXT) signconf.$(OBJEXT) \ stats.$(OBJEXT) tools.$(OBJEXT) zone.$(OBJEXT) \ zonelist.$(OBJEXT) acl.$(OBJEXT) axfr.$(OBJEXT) \ buffer.$(OBJEXT) edns.$(OBJEXT) listener.$(OBJEXT) \ netio.$(OBJEXT) notify.$(OBJEXT) query.$(OBJEXT) \ sock.$(OBJEXT) tcpset.$(OBJEXT) tsig.$(OBJEXT) \ tsig-openssl.$(OBJEXT) xfrd.$(OBJEXT) ods_signer_OBJECTS = $(am_ods_signer_OBJECTS) ods_signer_DEPENDENCIES = $(LIBHSM) $(LIBCOMPAT) am_ods_signerd_OBJECTS = ods-signerd.$(OBJEXT) adapi.$(OBJEXT) \ adapter.$(OBJEXT) addns.$(OBJEXT) adfile.$(OBJEXT) \ adutil.$(OBJEXT) cfg.$(OBJEXT) cmdhandler.$(OBJEXT) \ dnshandler.$(OBJEXT) xfrhandler.$(OBJEXT) engine.$(OBJEXT) \ signal.$(OBJEXT) worker.$(OBJEXT) addnsparser.$(OBJEXT) \ confparser.$(OBJEXT) signconfparser.$(OBJEXT) \ zonelistparser.$(OBJEXT) fifoq.$(OBJEXT) schedule.$(OBJEXT) \ task.$(OBJEXT) allocator.$(OBJEXT) duration.$(OBJEXT) \ file.$(OBJEXT) hsm.$(OBJEXT) locks.$(OBJEXT) log.$(OBJEXT) \ privdrop.$(OBJEXT) status.$(OBJEXT) util.$(OBJEXT) \ backup.$(OBJEXT) denial.$(OBJEXT) domain.$(OBJEXT) \ ixfr.$(OBJEXT) keys.$(OBJEXT) namedb.$(OBJEXT) \ nsec3params.$(OBJEXT) rrset.$(OBJEXT) signconf.$(OBJEXT) \ stats.$(OBJEXT) tools.$(OBJEXT) zone.$(OBJEXT) \ zonelist.$(OBJEXT) acl.$(OBJEXT) axfr.$(OBJEXT) \ buffer.$(OBJEXT) edns.$(OBJEXT) listener.$(OBJEXT) \ netio.$(OBJEXT) notify.$(OBJEXT) query.$(OBJEXT) \ sock.$(OBJEXT) tcpset.$(OBJEXT) tsig.$(OBJEXT) \ tsig-openssl.$(OBJEXT) xfrd.$(OBJEXT) ods_signerd_OBJECTS = $(am_ods_signerd_OBJECTS) ods_signerd_DEPENDENCIES = $(LIBHSM) $(LIBCOMPAT) 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)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles 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 = $(ods_getconf_SOURCES) $(ods_signer_SOURCES) \ $(ods_signerd_SOURCES) DIST_SOURCES = $(ods_getconf_SOURCES) $(ods_signer_SOURCES) \ $(ods_signerd_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)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBHSM = ${top_builddir}/libhsm/src/lib/libhsm.a LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(top_srcdir)/libhsm/src/lib \ @SSL_INCLUDES@ \ @XML2_INCLUDES@ \ @LDNS_INCLUDES@ signerdir = @libdir@/opendnssec/signer ods_signerd_SOURCES = ods-signerd.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signerd_LDADD = $(LIBHSM) $(LIBCOMPAT) @LDNS_LIBS@ @XML2_LIBS@ \ @PTHREAD_LIBS@ @RT_LIBS@ @SSL_LIBS@ @C_LIBS@ $(am__empty) ods_signer_SOURCES = ods-signer.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_signer_LDADD = $(LIBHSM) @LDNS_LIBS@ @XML2_LIBS@ @RT_LIBS@ \ $(LIBCOMPAT) ods_getconf_SOURCES = ods-getconf.c \ adapter/adapi.c adapter/adapi.h \ adapter/adapter.c adapter/adapter.h \ adapter/addns.c adapter/addns.h \ adapter/adfile.c adapter/adfile.h \ adapter/adutil.c adapter/adutil.h \ daemon/cfg.c daemon/cfg.h \ daemon/cmdhandler.c daemon/cmdhandler.h \ daemon/dnshandler.c daemon/dnshandler.h \ daemon/xfrhandler.c daemon/xfrhandler.h \ daemon/engine.c daemon/engine.h \ daemon/signal.c daemon/signal.h \ daemon/worker.c daemon/worker.h \ parser/addnsparser.c parser/addnsparser.h \ parser/confparser.c parser/confparser.h \ parser/signconfparser.c parser/signconfparser.h \ parser/zonelistparser.c parser/zonelistparser.h \ scheduler/fifoq.c scheduler/fifoq.h \ scheduler/schedule.c scheduler/schedule.h \ scheduler/task.c scheduler/task.h \ shared/allocator.c shared/allocator.h \ shared/duration.c shared/duration.h \ shared/file.c shared/file.h \ shared/hsm.c shared/hsm.h \ shared/locks.c shared/locks.h \ shared/log.c shared/log.h \ shared/privdrop.c shared/privdrop.h \ shared/status.c shared/status.h \ shared/util.c shared/util.h \ signer/backup.c signer/backup.h \ signer/denial.c signer/denial.h \ signer/domain.c signer/domain.h \ signer/ixfr.c signer/ixfr.h \ signer/keys.c signer/keys.h \ signer/namedb.c signer/namedb.h \ signer/nsec3params.c signer/nsec3params.h \ signer/rrset.c signer/rrset.h \ signer/signconf.c signer/signconf.h \ signer/stats.c signer/stats.h \ signer/tools.c signer/tools.h \ signer/zone.c signer/zone.h \ signer/zonelist.c signer/zonelist.h \ wire/acl.c wire/acl.h \ wire/axfr.c wire/axfr.h \ wire/buffer.c wire/buffer.h \ wire/edns.c wire/edns.h \ wire/listener.c wire/listener.h \ wire/netio.c wire/netio.h \ wire/notify.c wire/notify.h \ wire/query.c wire/query.h \ wire/sock.c wire/sock.h \ wire/tcpset.c wire/tcpset.h \ wire/tsig.c wire/tsig.h \ wire/tsig-openssl.c wire/tsig-openssl.h \ wire/xfrd.c wire/xfrd.h ods_getconf_LDADD = $(LIBHSM) @LDNS_LIBS@ @XML2_LIBS@ @RT_LIBS@ \ $(LIBCOMPAT) 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 signer/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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-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 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 ods-getconf$(EXEEXT): $(ods_getconf_OBJECTS) $(ods_getconf_DEPENDENCIES) $(EXTRA_ods_getconf_DEPENDENCIES) @rm -f ods-getconf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ods_getconf_OBJECTS) $(ods_getconf_LDADD) $(LIBS) ods-signer$(EXEEXT): $(ods_signer_OBJECTS) $(ods_signer_DEPENDENCIES) $(EXTRA_ods_signer_DEPENDENCIES) @rm -f ods-signer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ods_signer_OBJECTS) $(ods_signer_LDADD) $(LIBS) ods-signerd$(EXEEXT): $(ods_signerd_OBJECTS) $(ods_signerd_DEPENDENCIES) $(EXTRA_ods_signerd_DEPENDENCIES) @rm -f ods-signerd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ods_signerd_OBJECTS) $(ods_signerd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adapter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addnsparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/allocator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/axfr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/denial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnshandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/domain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/duration.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edns.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifoq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ixfr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namedb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsec3params.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ods-getconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ods-signer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ods-signerd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privdrop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signconfparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsig-openssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsig.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfrd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfrhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zone.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zonelist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zonelistparser.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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 $@ $< adapi.o: adapter/adapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapi.o -MD -MP -MF $(DEPDIR)/adapi.Tpo -c -o adapi.o `test -f 'adapter/adapi.c' || echo '$(srcdir)/'`adapter/adapi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adapi.Tpo $(DEPDIR)/adapi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adapi.c' object='adapi.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adapi.o `test -f 'adapter/adapi.c' || echo '$(srcdir)/'`adapter/adapi.c adapi.obj: adapter/adapi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapi.obj -MD -MP -MF $(DEPDIR)/adapi.Tpo -c -o adapi.obj `if test -f 'adapter/adapi.c'; then $(CYGPATH_W) 'adapter/adapi.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapi.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adapi.Tpo $(DEPDIR)/adapi.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adapi.c' object='adapi.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adapi.obj `if test -f 'adapter/adapi.c'; then $(CYGPATH_W) 'adapter/adapi.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapi.c'; fi` adapter.o: adapter/adapter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapter.o -MD -MP -MF $(DEPDIR)/adapter.Tpo -c -o adapter.o `test -f 'adapter/adapter.c' || echo '$(srcdir)/'`adapter/adapter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adapter.Tpo $(DEPDIR)/adapter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adapter.c' object='adapter.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adapter.o `test -f 'adapter/adapter.c' || echo '$(srcdir)/'`adapter/adapter.c adapter.obj: adapter/adapter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adapter.obj -MD -MP -MF $(DEPDIR)/adapter.Tpo -c -o adapter.obj `if test -f 'adapter/adapter.c'; then $(CYGPATH_W) 'adapter/adapter.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adapter.Tpo $(DEPDIR)/adapter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adapter.c' object='adapter.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adapter.obj `if test -f 'adapter/adapter.c'; then $(CYGPATH_W) 'adapter/adapter.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adapter.c'; fi` addns.o: adapter/addns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addns.o -MD -MP -MF $(DEPDIR)/addns.Tpo -c -o addns.o `test -f 'adapter/addns.c' || echo '$(srcdir)/'`adapter/addns.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/addns.Tpo $(DEPDIR)/addns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/addns.c' object='addns.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o addns.o `test -f 'adapter/addns.c' || echo '$(srcdir)/'`adapter/addns.c addns.obj: adapter/addns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addns.obj -MD -MP -MF $(DEPDIR)/addns.Tpo -c -o addns.obj `if test -f 'adapter/addns.c'; then $(CYGPATH_W) 'adapter/addns.c'; else $(CYGPATH_W) '$(srcdir)/adapter/addns.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/addns.Tpo $(DEPDIR)/addns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/addns.c' object='addns.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o addns.obj `if test -f 'adapter/addns.c'; then $(CYGPATH_W) 'adapter/addns.c'; else $(CYGPATH_W) '$(srcdir)/adapter/addns.c'; fi` adfile.o: adapter/adfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adfile.o -MD -MP -MF $(DEPDIR)/adfile.Tpo -c -o adfile.o `test -f 'adapter/adfile.c' || echo '$(srcdir)/'`adapter/adfile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adfile.Tpo $(DEPDIR)/adfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adfile.c' object='adfile.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adfile.o `test -f 'adapter/adfile.c' || echo '$(srcdir)/'`adapter/adfile.c adfile.obj: adapter/adfile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adfile.obj -MD -MP -MF $(DEPDIR)/adfile.Tpo -c -o adfile.obj `if test -f 'adapter/adfile.c'; then $(CYGPATH_W) 'adapter/adfile.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adfile.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adfile.Tpo $(DEPDIR)/adfile.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adfile.c' object='adfile.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adfile.obj `if test -f 'adapter/adfile.c'; then $(CYGPATH_W) 'adapter/adfile.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adfile.c'; fi` adutil.o: adapter/adutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adutil.o -MD -MP -MF $(DEPDIR)/adutil.Tpo -c -o adutil.o `test -f 'adapter/adutil.c' || echo '$(srcdir)/'`adapter/adutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adutil.Tpo $(DEPDIR)/adutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adutil.c' object='adutil.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adutil.o `test -f 'adapter/adutil.c' || echo '$(srcdir)/'`adapter/adutil.c adutil.obj: adapter/adutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT adutil.obj -MD -MP -MF $(DEPDIR)/adutil.Tpo -c -o adutil.obj `if test -f 'adapter/adutil.c'; then $(CYGPATH_W) 'adapter/adutil.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adutil.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/adutil.Tpo $(DEPDIR)/adutil.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='adapter/adutil.c' object='adutil.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adutil.obj `if test -f 'adapter/adutil.c'; then $(CYGPATH_W) 'adapter/adutil.c'; else $(CYGPATH_W) '$(srcdir)/adapter/adutil.c'; fi` cfg.o: daemon/cfg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfg.o -MD -MP -MF $(DEPDIR)/cfg.Tpo -c -o cfg.o `test -f 'daemon/cfg.c' || echo '$(srcdir)/'`daemon/cfg.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cfg.Tpo $(DEPDIR)/cfg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/cfg.c' object='cfg.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfg.o `test -f 'daemon/cfg.c' || echo '$(srcdir)/'`daemon/cfg.c cfg.obj: daemon/cfg.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfg.obj -MD -MP -MF $(DEPDIR)/cfg.Tpo -c -o cfg.obj `if test -f 'daemon/cfg.c'; then $(CYGPATH_W) 'daemon/cfg.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cfg.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cfg.Tpo $(DEPDIR)/cfg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/cfg.c' object='cfg.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfg.obj `if test -f 'daemon/cfg.c'; then $(CYGPATH_W) 'daemon/cfg.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cfg.c'; fi` cmdhandler.o: daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmdhandler.o -MD -MP -MF $(DEPDIR)/cmdhandler.Tpo -c -o cmdhandler.o `test -f 'daemon/cmdhandler.c' || echo '$(srcdir)/'`daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cmdhandler.Tpo $(DEPDIR)/cmdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/cmdhandler.c' object='cmdhandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cmdhandler.o `test -f 'daemon/cmdhandler.c' || echo '$(srcdir)/'`daemon/cmdhandler.c cmdhandler.obj: daemon/cmdhandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cmdhandler.obj -MD -MP -MF $(DEPDIR)/cmdhandler.Tpo -c -o cmdhandler.obj `if test -f 'daemon/cmdhandler.c'; then $(CYGPATH_W) 'daemon/cmdhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cmdhandler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cmdhandler.Tpo $(DEPDIR)/cmdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/cmdhandler.c' object='cmdhandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cmdhandler.obj `if test -f 'daemon/cmdhandler.c'; then $(CYGPATH_W) 'daemon/cmdhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/cmdhandler.c'; fi` dnshandler.o: daemon/dnshandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dnshandler.o -MD -MP -MF $(DEPDIR)/dnshandler.Tpo -c -o dnshandler.o `test -f 'daemon/dnshandler.c' || echo '$(srcdir)/'`daemon/dnshandler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dnshandler.Tpo $(DEPDIR)/dnshandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/dnshandler.c' object='dnshandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dnshandler.o `test -f 'daemon/dnshandler.c' || echo '$(srcdir)/'`daemon/dnshandler.c dnshandler.obj: daemon/dnshandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dnshandler.obj -MD -MP -MF $(DEPDIR)/dnshandler.Tpo -c -o dnshandler.obj `if test -f 'daemon/dnshandler.c'; then $(CYGPATH_W) 'daemon/dnshandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/dnshandler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dnshandler.Tpo $(DEPDIR)/dnshandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/dnshandler.c' object='dnshandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dnshandler.obj `if test -f 'daemon/dnshandler.c'; then $(CYGPATH_W) 'daemon/dnshandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/dnshandler.c'; fi` xfrhandler.o: daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrhandler.o -MD -MP -MF $(DEPDIR)/xfrhandler.Tpo -c -o xfrhandler.o `test -f 'daemon/xfrhandler.c' || echo '$(srcdir)/'`daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfrhandler.Tpo $(DEPDIR)/xfrhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/xfrhandler.c' object='xfrhandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xfrhandler.o `test -f 'daemon/xfrhandler.c' || echo '$(srcdir)/'`daemon/xfrhandler.c xfrhandler.obj: daemon/xfrhandler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrhandler.obj -MD -MP -MF $(DEPDIR)/xfrhandler.Tpo -c -o xfrhandler.obj `if test -f 'daemon/xfrhandler.c'; then $(CYGPATH_W) 'daemon/xfrhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/xfrhandler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfrhandler.Tpo $(DEPDIR)/xfrhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/xfrhandler.c' object='xfrhandler.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xfrhandler.obj `if test -f 'daemon/xfrhandler.c'; then $(CYGPATH_W) 'daemon/xfrhandler.c'; else $(CYGPATH_W) '$(srcdir)/daemon/xfrhandler.c'; fi` engine.o: daemon/engine.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine.o -MD -MP -MF $(DEPDIR)/engine.Tpo -c -o engine.o `test -f 'daemon/engine.c' || echo '$(srcdir)/'`daemon/engine.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/engine.Tpo $(DEPDIR)/engine.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/engine.c' object='engine.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o engine.o `test -f 'daemon/engine.c' || echo '$(srcdir)/'`daemon/engine.c engine.obj: daemon/engine.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT engine.obj -MD -MP -MF $(DEPDIR)/engine.Tpo -c -o engine.obj `if test -f 'daemon/engine.c'; then $(CYGPATH_W) 'daemon/engine.c'; else $(CYGPATH_W) '$(srcdir)/daemon/engine.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/engine.Tpo $(DEPDIR)/engine.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/engine.c' object='engine.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o engine.obj `if test -f 'daemon/engine.c'; then $(CYGPATH_W) 'daemon/engine.c'; else $(CYGPATH_W) '$(srcdir)/daemon/engine.c'; fi` signal.o: daemon/signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal.o -MD -MP -MF $(DEPDIR)/signal.Tpo -c -o signal.o `test -f 'daemon/signal.c' || echo '$(srcdir)/'`daemon/signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signal.Tpo $(DEPDIR)/signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/signal.c' object='signal.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signal.o `test -f 'daemon/signal.c' || echo '$(srcdir)/'`daemon/signal.c signal.obj: daemon/signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signal.obj -MD -MP -MF $(DEPDIR)/signal.Tpo -c -o signal.obj `if test -f 'daemon/signal.c'; then $(CYGPATH_W) 'daemon/signal.c'; else $(CYGPATH_W) '$(srcdir)/daemon/signal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signal.Tpo $(DEPDIR)/signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/signal.c' object='signal.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signal.obj `if test -f 'daemon/signal.c'; then $(CYGPATH_W) 'daemon/signal.c'; else $(CYGPATH_W) '$(srcdir)/daemon/signal.c'; fi` worker.o: daemon/worker.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT worker.o -MD -MP -MF $(DEPDIR)/worker.Tpo -c -o worker.o `test -f 'daemon/worker.c' || echo '$(srcdir)/'`daemon/worker.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/worker.Tpo $(DEPDIR)/worker.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/worker.c' object='worker.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o worker.o `test -f 'daemon/worker.c' || echo '$(srcdir)/'`daemon/worker.c worker.obj: daemon/worker.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT worker.obj -MD -MP -MF $(DEPDIR)/worker.Tpo -c -o worker.obj `if test -f 'daemon/worker.c'; then $(CYGPATH_W) 'daemon/worker.c'; else $(CYGPATH_W) '$(srcdir)/daemon/worker.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/worker.Tpo $(DEPDIR)/worker.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='daemon/worker.c' object='worker.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o worker.obj `if test -f 'daemon/worker.c'; then $(CYGPATH_W) 'daemon/worker.c'; else $(CYGPATH_W) '$(srcdir)/daemon/worker.c'; fi` addnsparser.o: parser/addnsparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addnsparser.o -MD -MP -MF $(DEPDIR)/addnsparser.Tpo -c -o addnsparser.o `test -f 'parser/addnsparser.c' || echo '$(srcdir)/'`parser/addnsparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/addnsparser.Tpo $(DEPDIR)/addnsparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/addnsparser.c' object='addnsparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o addnsparser.o `test -f 'parser/addnsparser.c' || echo '$(srcdir)/'`parser/addnsparser.c addnsparser.obj: parser/addnsparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT addnsparser.obj -MD -MP -MF $(DEPDIR)/addnsparser.Tpo -c -o addnsparser.obj `if test -f 'parser/addnsparser.c'; then $(CYGPATH_W) 'parser/addnsparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/addnsparser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/addnsparser.Tpo $(DEPDIR)/addnsparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/addnsparser.c' object='addnsparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o addnsparser.obj `if test -f 'parser/addnsparser.c'; then $(CYGPATH_W) 'parser/addnsparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/addnsparser.c'; fi` confparser.o: parser/confparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT confparser.o -MD -MP -MF $(DEPDIR)/confparser.Tpo -c -o confparser.o `test -f 'parser/confparser.c' || echo '$(srcdir)/'`parser/confparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/confparser.Tpo $(DEPDIR)/confparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/confparser.c' object='confparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o confparser.o `test -f 'parser/confparser.c' || echo '$(srcdir)/'`parser/confparser.c confparser.obj: parser/confparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT confparser.obj -MD -MP -MF $(DEPDIR)/confparser.Tpo -c -o confparser.obj `if test -f 'parser/confparser.c'; then $(CYGPATH_W) 'parser/confparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/confparser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/confparser.Tpo $(DEPDIR)/confparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/confparser.c' object='confparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o confparser.obj `if test -f 'parser/confparser.c'; then $(CYGPATH_W) 'parser/confparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/confparser.c'; fi` signconfparser.o: parser/signconfparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconfparser.o -MD -MP -MF $(DEPDIR)/signconfparser.Tpo -c -o signconfparser.o `test -f 'parser/signconfparser.c' || echo '$(srcdir)/'`parser/signconfparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signconfparser.Tpo $(DEPDIR)/signconfparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/signconfparser.c' object='signconfparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signconfparser.o `test -f 'parser/signconfparser.c' || echo '$(srcdir)/'`parser/signconfparser.c signconfparser.obj: parser/signconfparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconfparser.obj -MD -MP -MF $(DEPDIR)/signconfparser.Tpo -c -o signconfparser.obj `if test -f 'parser/signconfparser.c'; then $(CYGPATH_W) 'parser/signconfparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/signconfparser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signconfparser.Tpo $(DEPDIR)/signconfparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/signconfparser.c' object='signconfparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signconfparser.obj `if test -f 'parser/signconfparser.c'; then $(CYGPATH_W) 'parser/signconfparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/signconfparser.c'; fi` zonelistparser.o: parser/zonelistparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelistparser.o -MD -MP -MF $(DEPDIR)/zonelistparser.Tpo -c -o zonelistparser.o `test -f 'parser/zonelistparser.c' || echo '$(srcdir)/'`parser/zonelistparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zonelistparser.Tpo $(DEPDIR)/zonelistparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/zonelistparser.c' object='zonelistparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zonelistparser.o `test -f 'parser/zonelistparser.c' || echo '$(srcdir)/'`parser/zonelistparser.c zonelistparser.obj: parser/zonelistparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelistparser.obj -MD -MP -MF $(DEPDIR)/zonelistparser.Tpo -c -o zonelistparser.obj `if test -f 'parser/zonelistparser.c'; then $(CYGPATH_W) 'parser/zonelistparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/zonelistparser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zonelistparser.Tpo $(DEPDIR)/zonelistparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser/zonelistparser.c' object='zonelistparser.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zonelistparser.obj `if test -f 'parser/zonelistparser.c'; then $(CYGPATH_W) 'parser/zonelistparser.c'; else $(CYGPATH_W) '$(srcdir)/parser/zonelistparser.c'; fi` fifoq.o: scheduler/fifoq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fifoq.o -MD -MP -MF $(DEPDIR)/fifoq.Tpo -c -o fifoq.o `test -f 'scheduler/fifoq.c' || echo '$(srcdir)/'`scheduler/fifoq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fifoq.Tpo $(DEPDIR)/fifoq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/fifoq.c' object='fifoq.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fifoq.o `test -f 'scheduler/fifoq.c' || echo '$(srcdir)/'`scheduler/fifoq.c fifoq.obj: scheduler/fifoq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fifoq.obj -MD -MP -MF $(DEPDIR)/fifoq.Tpo -c -o fifoq.obj `if test -f 'scheduler/fifoq.c'; then $(CYGPATH_W) 'scheduler/fifoq.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/fifoq.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fifoq.Tpo $(DEPDIR)/fifoq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/fifoq.c' object='fifoq.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fifoq.obj `if test -f 'scheduler/fifoq.c'; then $(CYGPATH_W) 'scheduler/fifoq.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/fifoq.c'; fi` schedule.o: scheduler/schedule.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT schedule.o -MD -MP -MF $(DEPDIR)/schedule.Tpo -c -o schedule.o `test -f 'scheduler/schedule.c' || echo '$(srcdir)/'`scheduler/schedule.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/schedule.Tpo $(DEPDIR)/schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/schedule.c' object='schedule.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o schedule.o `test -f 'scheduler/schedule.c' || echo '$(srcdir)/'`scheduler/schedule.c schedule.obj: scheduler/schedule.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT schedule.obj -MD -MP -MF $(DEPDIR)/schedule.Tpo -c -o schedule.obj `if test -f 'scheduler/schedule.c'; then $(CYGPATH_W) 'scheduler/schedule.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/schedule.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/schedule.Tpo $(DEPDIR)/schedule.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/schedule.c' object='schedule.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o schedule.obj `if test -f 'scheduler/schedule.c'; then $(CYGPATH_W) 'scheduler/schedule.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/schedule.c'; fi` task.o: scheduler/task.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.o -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.o `test -f 'scheduler/task.c' || echo '$(srcdir)/'`scheduler/task.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/task.c' object='task.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.o `test -f 'scheduler/task.c' || echo '$(srcdir)/'`scheduler/task.c task.obj: scheduler/task.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT task.obj -MD -MP -MF $(DEPDIR)/task.Tpo -c -o task.obj `if test -f 'scheduler/task.c'; then $(CYGPATH_W) 'scheduler/task.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/task.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/task.Tpo $(DEPDIR)/task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scheduler/task.c' object='task.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o task.obj `if test -f 'scheduler/task.c'; then $(CYGPATH_W) 'scheduler/task.c'; else $(CYGPATH_W) '$(srcdir)/scheduler/task.c'; fi` allocator.o: shared/allocator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT allocator.o -MD -MP -MF $(DEPDIR)/allocator.Tpo -c -o allocator.o `test -f 'shared/allocator.c' || echo '$(srcdir)/'`shared/allocator.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/allocator.Tpo $(DEPDIR)/allocator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/allocator.c' object='allocator.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o allocator.o `test -f 'shared/allocator.c' || echo '$(srcdir)/'`shared/allocator.c allocator.obj: shared/allocator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT allocator.obj -MD -MP -MF $(DEPDIR)/allocator.Tpo -c -o allocator.obj `if test -f 'shared/allocator.c'; then $(CYGPATH_W) 'shared/allocator.c'; else $(CYGPATH_W) '$(srcdir)/shared/allocator.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/allocator.Tpo $(DEPDIR)/allocator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/allocator.c' object='allocator.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o allocator.obj `if test -f 'shared/allocator.c'; then $(CYGPATH_W) 'shared/allocator.c'; else $(CYGPATH_W) '$(srcdir)/shared/allocator.c'; fi` duration.o: shared/duration.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT duration.o -MD -MP -MF $(DEPDIR)/duration.Tpo -c -o duration.o `test -f 'shared/duration.c' || echo '$(srcdir)/'`shared/duration.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/duration.Tpo $(DEPDIR)/duration.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/duration.c' object='duration.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o duration.o `test -f 'shared/duration.c' || echo '$(srcdir)/'`shared/duration.c duration.obj: shared/duration.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT duration.obj -MD -MP -MF $(DEPDIR)/duration.Tpo -c -o duration.obj `if test -f 'shared/duration.c'; then $(CYGPATH_W) 'shared/duration.c'; else $(CYGPATH_W) '$(srcdir)/shared/duration.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/duration.Tpo $(DEPDIR)/duration.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/duration.c' object='duration.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o duration.obj `if test -f 'shared/duration.c'; then $(CYGPATH_W) 'shared/duration.c'; else $(CYGPATH_W) '$(srcdir)/shared/duration.c'; fi` file.o: shared/file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f 'shared/file.c' || echo '$(srcdir)/'`shared/file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/file.c' object='file.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f 'shared/file.c' || echo '$(srcdir)/'`shared/file.c file.obj: shared/file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f 'shared/file.c'; then $(CYGPATH_W) 'shared/file.c'; else $(CYGPATH_W) '$(srcdir)/shared/file.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/file.c' object='file.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f 'shared/file.c'; then $(CYGPATH_W) 'shared/file.c'; else $(CYGPATH_W) '$(srcdir)/shared/file.c'; fi` hsm.o: shared/hsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hsm.o -MD -MP -MF $(DEPDIR)/hsm.Tpo -c -o hsm.o `test -f 'shared/hsm.c' || echo '$(srcdir)/'`shared/hsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hsm.Tpo $(DEPDIR)/hsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/hsm.c' object='hsm.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hsm.o `test -f 'shared/hsm.c' || echo '$(srcdir)/'`shared/hsm.c hsm.obj: shared/hsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hsm.obj -MD -MP -MF $(DEPDIR)/hsm.Tpo -c -o hsm.obj `if test -f 'shared/hsm.c'; then $(CYGPATH_W) 'shared/hsm.c'; else $(CYGPATH_W) '$(srcdir)/shared/hsm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hsm.Tpo $(DEPDIR)/hsm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/hsm.c' object='hsm.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hsm.obj `if test -f 'shared/hsm.c'; then $(CYGPATH_W) 'shared/hsm.c'; else $(CYGPATH_W) '$(srcdir)/shared/hsm.c'; fi` locks.o: shared/locks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT locks.o -MD -MP -MF $(DEPDIR)/locks.Tpo -c -o locks.o `test -f 'shared/locks.c' || echo '$(srcdir)/'`shared/locks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/locks.Tpo $(DEPDIR)/locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/locks.c' object='locks.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o locks.o `test -f 'shared/locks.c' || echo '$(srcdir)/'`shared/locks.c locks.obj: shared/locks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT locks.obj -MD -MP -MF $(DEPDIR)/locks.Tpo -c -o locks.obj `if test -f 'shared/locks.c'; then $(CYGPATH_W) 'shared/locks.c'; else $(CYGPATH_W) '$(srcdir)/shared/locks.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/locks.Tpo $(DEPDIR)/locks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/locks.c' object='locks.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o locks.obj `if test -f 'shared/locks.c'; then $(CYGPATH_W) 'shared/locks.c'; else $(CYGPATH_W) '$(srcdir)/shared/locks.c'; fi` log.o: shared/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.o -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.o `test -f 'shared/log.c' || echo '$(srcdir)/'`shared/log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/log.c' object='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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.o `test -f 'shared/log.c' || echo '$(srcdir)/'`shared/log.c log.obj: shared/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT log.obj -MD -MP -MF $(DEPDIR)/log.Tpo -c -o log.obj `if test -f 'shared/log.c'; then $(CYGPATH_W) 'shared/log.c'; else $(CYGPATH_W) '$(srcdir)/shared/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/log.Tpo $(DEPDIR)/log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/log.c' object='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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o log.obj `if test -f 'shared/log.c'; then $(CYGPATH_W) 'shared/log.c'; else $(CYGPATH_W) '$(srcdir)/shared/log.c'; fi` privdrop.o: shared/privdrop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT privdrop.o -MD -MP -MF $(DEPDIR)/privdrop.Tpo -c -o privdrop.o `test -f 'shared/privdrop.c' || echo '$(srcdir)/'`shared/privdrop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/privdrop.Tpo $(DEPDIR)/privdrop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/privdrop.c' object='privdrop.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o privdrop.o `test -f 'shared/privdrop.c' || echo '$(srcdir)/'`shared/privdrop.c privdrop.obj: shared/privdrop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT privdrop.obj -MD -MP -MF $(DEPDIR)/privdrop.Tpo -c -o privdrop.obj `if test -f 'shared/privdrop.c'; then $(CYGPATH_W) 'shared/privdrop.c'; else $(CYGPATH_W) '$(srcdir)/shared/privdrop.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/privdrop.Tpo $(DEPDIR)/privdrop.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/privdrop.c' object='privdrop.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o privdrop.obj `if test -f 'shared/privdrop.c'; then $(CYGPATH_W) 'shared/privdrop.c'; else $(CYGPATH_W) '$(srcdir)/shared/privdrop.c'; fi` status.o: shared/status.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT status.o -MD -MP -MF $(DEPDIR)/status.Tpo -c -o status.o `test -f 'shared/status.c' || echo '$(srcdir)/'`shared/status.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/status.Tpo $(DEPDIR)/status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/status.c' object='status.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o status.o `test -f 'shared/status.c' || echo '$(srcdir)/'`shared/status.c status.obj: shared/status.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT status.obj -MD -MP -MF $(DEPDIR)/status.Tpo -c -o status.obj `if test -f 'shared/status.c'; then $(CYGPATH_W) 'shared/status.c'; else $(CYGPATH_W) '$(srcdir)/shared/status.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/status.Tpo $(DEPDIR)/status.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/status.c' object='status.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o status.obj `if test -f 'shared/status.c'; then $(CYGPATH_W) 'shared/status.c'; else $(CYGPATH_W) '$(srcdir)/shared/status.c'; fi` util.o: shared/util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT util.o -MD -MP -MF $(DEPDIR)/util.Tpo -c -o util.o `test -f 'shared/util.c' || echo '$(srcdir)/'`shared/util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/util.Tpo $(DEPDIR)/util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/util.c' object='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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o util.o `test -f 'shared/util.c' || echo '$(srcdir)/'`shared/util.c util.obj: shared/util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT util.obj -MD -MP -MF $(DEPDIR)/util.Tpo -c -o util.obj `if test -f 'shared/util.c'; then $(CYGPATH_W) 'shared/util.c'; else $(CYGPATH_W) '$(srcdir)/shared/util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/util.Tpo $(DEPDIR)/util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/util.c' object='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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o util.obj `if test -f 'shared/util.c'; then $(CYGPATH_W) 'shared/util.c'; else $(CYGPATH_W) '$(srcdir)/shared/util.c'; fi` backup.o: signer/backup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backup.o -MD -MP -MF $(DEPDIR)/backup.Tpo -c -o backup.o `test -f 'signer/backup.c' || echo '$(srcdir)/'`signer/backup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backup.Tpo $(DEPDIR)/backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/backup.c' object='backup.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backup.o `test -f 'signer/backup.c' || echo '$(srcdir)/'`signer/backup.c backup.obj: signer/backup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT backup.obj -MD -MP -MF $(DEPDIR)/backup.Tpo -c -o backup.obj `if test -f 'signer/backup.c'; then $(CYGPATH_W) 'signer/backup.c'; else $(CYGPATH_W) '$(srcdir)/signer/backup.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/backup.Tpo $(DEPDIR)/backup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/backup.c' object='backup.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backup.obj `if test -f 'signer/backup.c'; then $(CYGPATH_W) 'signer/backup.c'; else $(CYGPATH_W) '$(srcdir)/signer/backup.c'; fi` denial.o: signer/denial.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT denial.o -MD -MP -MF $(DEPDIR)/denial.Tpo -c -o denial.o `test -f 'signer/denial.c' || echo '$(srcdir)/'`signer/denial.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/denial.Tpo $(DEPDIR)/denial.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/denial.c' object='denial.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o denial.o `test -f 'signer/denial.c' || echo '$(srcdir)/'`signer/denial.c denial.obj: signer/denial.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT denial.obj -MD -MP -MF $(DEPDIR)/denial.Tpo -c -o denial.obj `if test -f 'signer/denial.c'; then $(CYGPATH_W) 'signer/denial.c'; else $(CYGPATH_W) '$(srcdir)/signer/denial.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/denial.Tpo $(DEPDIR)/denial.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/denial.c' object='denial.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o denial.obj `if test -f 'signer/denial.c'; then $(CYGPATH_W) 'signer/denial.c'; else $(CYGPATH_W) '$(srcdir)/signer/denial.c'; fi` domain.o: signer/domain.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT domain.o -MD -MP -MF $(DEPDIR)/domain.Tpo -c -o domain.o `test -f 'signer/domain.c' || echo '$(srcdir)/'`signer/domain.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/domain.Tpo $(DEPDIR)/domain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/domain.c' object='domain.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o domain.o `test -f 'signer/domain.c' || echo '$(srcdir)/'`signer/domain.c domain.obj: signer/domain.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT domain.obj -MD -MP -MF $(DEPDIR)/domain.Tpo -c -o domain.obj `if test -f 'signer/domain.c'; then $(CYGPATH_W) 'signer/domain.c'; else $(CYGPATH_W) '$(srcdir)/signer/domain.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/domain.Tpo $(DEPDIR)/domain.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/domain.c' object='domain.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o domain.obj `if test -f 'signer/domain.c'; then $(CYGPATH_W) 'signer/domain.c'; else $(CYGPATH_W) '$(srcdir)/signer/domain.c'; fi` ixfr.o: signer/ixfr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ixfr.o -MD -MP -MF $(DEPDIR)/ixfr.Tpo -c -o ixfr.o `test -f 'signer/ixfr.c' || echo '$(srcdir)/'`signer/ixfr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ixfr.Tpo $(DEPDIR)/ixfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/ixfr.c' object='ixfr.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ixfr.o `test -f 'signer/ixfr.c' || echo '$(srcdir)/'`signer/ixfr.c ixfr.obj: signer/ixfr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ixfr.obj -MD -MP -MF $(DEPDIR)/ixfr.Tpo -c -o ixfr.obj `if test -f 'signer/ixfr.c'; then $(CYGPATH_W) 'signer/ixfr.c'; else $(CYGPATH_W) '$(srcdir)/signer/ixfr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ixfr.Tpo $(DEPDIR)/ixfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/ixfr.c' object='ixfr.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ixfr.obj `if test -f 'signer/ixfr.c'; then $(CYGPATH_W) 'signer/ixfr.c'; else $(CYGPATH_W) '$(srcdir)/signer/ixfr.c'; fi` keys.o: signer/keys.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keys.o -MD -MP -MF $(DEPDIR)/keys.Tpo -c -o keys.o `test -f 'signer/keys.c' || echo '$(srcdir)/'`signer/keys.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keys.Tpo $(DEPDIR)/keys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/keys.c' object='keys.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keys.o `test -f 'signer/keys.c' || echo '$(srcdir)/'`signer/keys.c keys.obj: signer/keys.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keys.obj -MD -MP -MF $(DEPDIR)/keys.Tpo -c -o keys.obj `if test -f 'signer/keys.c'; then $(CYGPATH_W) 'signer/keys.c'; else $(CYGPATH_W) '$(srcdir)/signer/keys.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/keys.Tpo $(DEPDIR)/keys.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/keys.c' object='keys.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keys.obj `if test -f 'signer/keys.c'; then $(CYGPATH_W) 'signer/keys.c'; else $(CYGPATH_W) '$(srcdir)/signer/keys.c'; fi` namedb.o: signer/namedb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT namedb.o -MD -MP -MF $(DEPDIR)/namedb.Tpo -c -o namedb.o `test -f 'signer/namedb.c' || echo '$(srcdir)/'`signer/namedb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/namedb.Tpo $(DEPDIR)/namedb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/namedb.c' object='namedb.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o namedb.o `test -f 'signer/namedb.c' || echo '$(srcdir)/'`signer/namedb.c namedb.obj: signer/namedb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT namedb.obj -MD -MP -MF $(DEPDIR)/namedb.Tpo -c -o namedb.obj `if test -f 'signer/namedb.c'; then $(CYGPATH_W) 'signer/namedb.c'; else $(CYGPATH_W) '$(srcdir)/signer/namedb.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/namedb.Tpo $(DEPDIR)/namedb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/namedb.c' object='namedb.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o namedb.obj `if test -f 'signer/namedb.c'; then $(CYGPATH_W) 'signer/namedb.c'; else $(CYGPATH_W) '$(srcdir)/signer/namedb.c'; fi` nsec3params.o: signer/nsec3params.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nsec3params.o -MD -MP -MF $(DEPDIR)/nsec3params.Tpo -c -o nsec3params.o `test -f 'signer/nsec3params.c' || echo '$(srcdir)/'`signer/nsec3params.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nsec3params.Tpo $(DEPDIR)/nsec3params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/nsec3params.c' object='nsec3params.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nsec3params.o `test -f 'signer/nsec3params.c' || echo '$(srcdir)/'`signer/nsec3params.c nsec3params.obj: signer/nsec3params.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nsec3params.obj -MD -MP -MF $(DEPDIR)/nsec3params.Tpo -c -o nsec3params.obj `if test -f 'signer/nsec3params.c'; then $(CYGPATH_W) 'signer/nsec3params.c'; else $(CYGPATH_W) '$(srcdir)/signer/nsec3params.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nsec3params.Tpo $(DEPDIR)/nsec3params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/nsec3params.c' object='nsec3params.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nsec3params.obj `if test -f 'signer/nsec3params.c'; then $(CYGPATH_W) 'signer/nsec3params.c'; else $(CYGPATH_W) '$(srcdir)/signer/nsec3params.c'; fi` rrset.o: signer/rrset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrset.o -MD -MP -MF $(DEPDIR)/rrset.Tpo -c -o rrset.o `test -f 'signer/rrset.c' || echo '$(srcdir)/'`signer/rrset.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rrset.Tpo $(DEPDIR)/rrset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/rrset.c' object='rrset.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrset.o `test -f 'signer/rrset.c' || echo '$(srcdir)/'`signer/rrset.c rrset.obj: signer/rrset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rrset.obj -MD -MP -MF $(DEPDIR)/rrset.Tpo -c -o rrset.obj `if test -f 'signer/rrset.c'; then $(CYGPATH_W) 'signer/rrset.c'; else $(CYGPATH_W) '$(srcdir)/signer/rrset.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rrset.Tpo $(DEPDIR)/rrset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/rrset.c' object='rrset.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rrset.obj `if test -f 'signer/rrset.c'; then $(CYGPATH_W) 'signer/rrset.c'; else $(CYGPATH_W) '$(srcdir)/signer/rrset.c'; fi` signconf.o: signer/signconf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconf.o -MD -MP -MF $(DEPDIR)/signconf.Tpo -c -o signconf.o `test -f 'signer/signconf.c' || echo '$(srcdir)/'`signer/signconf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signconf.Tpo $(DEPDIR)/signconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/signconf.c' object='signconf.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signconf.o `test -f 'signer/signconf.c' || echo '$(srcdir)/'`signer/signconf.c signconf.obj: signer/signconf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signconf.obj -MD -MP -MF $(DEPDIR)/signconf.Tpo -c -o signconf.obj `if test -f 'signer/signconf.c'; then $(CYGPATH_W) 'signer/signconf.c'; else $(CYGPATH_W) '$(srcdir)/signer/signconf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signconf.Tpo $(DEPDIR)/signconf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/signconf.c' object='signconf.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signconf.obj `if test -f 'signer/signconf.c'; then $(CYGPATH_W) 'signer/signconf.c'; else $(CYGPATH_W) '$(srcdir)/signer/signconf.c'; fi` stats.o: signer/stats.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.o -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.o `test -f 'signer/stats.c' || echo '$(srcdir)/'`signer/stats.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/stats.c' object='stats.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stats.o `test -f 'signer/stats.c' || echo '$(srcdir)/'`signer/stats.c stats.obj: signer/stats.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.obj -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.obj `if test -f 'signer/stats.c'; then $(CYGPATH_W) 'signer/stats.c'; else $(CYGPATH_W) '$(srcdir)/signer/stats.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/stats.c' object='stats.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stats.obj `if test -f 'signer/stats.c'; then $(CYGPATH_W) 'signer/stats.c'; else $(CYGPATH_W) '$(srcdir)/signer/stats.c'; fi` tools.o: signer/tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tools.o -MD -MP -MF $(DEPDIR)/tools.Tpo -c -o tools.o `test -f 'signer/tools.c' || echo '$(srcdir)/'`signer/tools.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tools.Tpo $(DEPDIR)/tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/tools.c' object='tools.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tools.o `test -f 'signer/tools.c' || echo '$(srcdir)/'`signer/tools.c tools.obj: signer/tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tools.obj -MD -MP -MF $(DEPDIR)/tools.Tpo -c -o tools.obj `if test -f 'signer/tools.c'; then $(CYGPATH_W) 'signer/tools.c'; else $(CYGPATH_W) '$(srcdir)/signer/tools.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tools.Tpo $(DEPDIR)/tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/tools.c' object='tools.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tools.obj `if test -f 'signer/tools.c'; then $(CYGPATH_W) 'signer/tools.c'; else $(CYGPATH_W) '$(srcdir)/signer/tools.c'; fi` zone.o: signer/zone.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zone.o -MD -MP -MF $(DEPDIR)/zone.Tpo -c -o zone.o `test -f 'signer/zone.c' || echo '$(srcdir)/'`signer/zone.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zone.Tpo $(DEPDIR)/zone.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/zone.c' object='zone.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zone.o `test -f 'signer/zone.c' || echo '$(srcdir)/'`signer/zone.c zone.obj: signer/zone.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zone.obj -MD -MP -MF $(DEPDIR)/zone.Tpo -c -o zone.obj `if test -f 'signer/zone.c'; then $(CYGPATH_W) 'signer/zone.c'; else $(CYGPATH_W) '$(srcdir)/signer/zone.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zone.Tpo $(DEPDIR)/zone.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/zone.c' object='zone.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zone.obj `if test -f 'signer/zone.c'; then $(CYGPATH_W) 'signer/zone.c'; else $(CYGPATH_W) '$(srcdir)/signer/zone.c'; fi` zonelist.o: signer/zonelist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelist.o -MD -MP -MF $(DEPDIR)/zonelist.Tpo -c -o zonelist.o `test -f 'signer/zonelist.c' || echo '$(srcdir)/'`signer/zonelist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zonelist.Tpo $(DEPDIR)/zonelist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/zonelist.c' object='zonelist.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zonelist.o `test -f 'signer/zonelist.c' || echo '$(srcdir)/'`signer/zonelist.c zonelist.obj: signer/zonelist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zonelist.obj -MD -MP -MF $(DEPDIR)/zonelist.Tpo -c -o zonelist.obj `if test -f 'signer/zonelist.c'; then $(CYGPATH_W) 'signer/zonelist.c'; else $(CYGPATH_W) '$(srcdir)/signer/zonelist.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/zonelist.Tpo $(DEPDIR)/zonelist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signer/zonelist.c' object='zonelist.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zonelist.obj `if test -f 'signer/zonelist.c'; then $(CYGPATH_W) 'signer/zonelist.c'; else $(CYGPATH_W) '$(srcdir)/signer/zonelist.c'; fi` acl.o: wire/acl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT acl.o -MD -MP -MF $(DEPDIR)/acl.Tpo -c -o acl.o `test -f 'wire/acl.c' || echo '$(srcdir)/'`wire/acl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/acl.Tpo $(DEPDIR)/acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/acl.c' object='acl.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o acl.o `test -f 'wire/acl.c' || echo '$(srcdir)/'`wire/acl.c acl.obj: wire/acl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT acl.obj -MD -MP -MF $(DEPDIR)/acl.Tpo -c -o acl.obj `if test -f 'wire/acl.c'; then $(CYGPATH_W) 'wire/acl.c'; else $(CYGPATH_W) '$(srcdir)/wire/acl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/acl.Tpo $(DEPDIR)/acl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/acl.c' object='acl.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o acl.obj `if test -f 'wire/acl.c'; then $(CYGPATH_W) 'wire/acl.c'; else $(CYGPATH_W) '$(srcdir)/wire/acl.c'; fi` axfr.o: wire/axfr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT axfr.o -MD -MP -MF $(DEPDIR)/axfr.Tpo -c -o axfr.o `test -f 'wire/axfr.c' || echo '$(srcdir)/'`wire/axfr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/axfr.Tpo $(DEPDIR)/axfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/axfr.c' object='axfr.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o axfr.o `test -f 'wire/axfr.c' || echo '$(srcdir)/'`wire/axfr.c axfr.obj: wire/axfr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT axfr.obj -MD -MP -MF $(DEPDIR)/axfr.Tpo -c -o axfr.obj `if test -f 'wire/axfr.c'; then $(CYGPATH_W) 'wire/axfr.c'; else $(CYGPATH_W) '$(srcdir)/wire/axfr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/axfr.Tpo $(DEPDIR)/axfr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/axfr.c' object='axfr.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o axfr.obj `if test -f 'wire/axfr.c'; then $(CYGPATH_W) 'wire/axfr.c'; else $(CYGPATH_W) '$(srcdir)/wire/axfr.c'; fi` buffer.o: wire/buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.o -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.o `test -f 'wire/buffer.c' || echo '$(srcdir)/'`wire/buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/buffer.c' object='buffer.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.o `test -f 'wire/buffer.c' || echo '$(srcdir)/'`wire/buffer.c buffer.obj: wire/buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT buffer.obj -MD -MP -MF $(DEPDIR)/buffer.Tpo -c -o buffer.obj `if test -f 'wire/buffer.c'; then $(CYGPATH_W) 'wire/buffer.c'; else $(CYGPATH_W) '$(srcdir)/wire/buffer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/buffer.Tpo $(DEPDIR)/buffer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/buffer.c' object='buffer.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o buffer.obj `if test -f 'wire/buffer.c'; then $(CYGPATH_W) 'wire/buffer.c'; else $(CYGPATH_W) '$(srcdir)/wire/buffer.c'; fi` edns.o: wire/edns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edns.o -MD -MP -MF $(DEPDIR)/edns.Tpo -c -o edns.o `test -f 'wire/edns.c' || echo '$(srcdir)/'`wire/edns.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/edns.Tpo $(DEPDIR)/edns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/edns.c' object='edns.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o edns.o `test -f 'wire/edns.c' || echo '$(srcdir)/'`wire/edns.c edns.obj: wire/edns.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT edns.obj -MD -MP -MF $(DEPDIR)/edns.Tpo -c -o edns.obj `if test -f 'wire/edns.c'; then $(CYGPATH_W) 'wire/edns.c'; else $(CYGPATH_W) '$(srcdir)/wire/edns.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/edns.Tpo $(DEPDIR)/edns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/edns.c' object='edns.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o edns.obj `if test -f 'wire/edns.c'; then $(CYGPATH_W) 'wire/edns.c'; else $(CYGPATH_W) '$(srcdir)/wire/edns.c'; fi` listener.o: wire/listener.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT listener.o -MD -MP -MF $(DEPDIR)/listener.Tpo -c -o listener.o `test -f 'wire/listener.c' || echo '$(srcdir)/'`wire/listener.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listener.Tpo $(DEPDIR)/listener.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/listener.c' object='listener.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o listener.o `test -f 'wire/listener.c' || echo '$(srcdir)/'`wire/listener.c listener.obj: wire/listener.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT listener.obj -MD -MP -MF $(DEPDIR)/listener.Tpo -c -o listener.obj `if test -f 'wire/listener.c'; then $(CYGPATH_W) 'wire/listener.c'; else $(CYGPATH_W) '$(srcdir)/wire/listener.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listener.Tpo $(DEPDIR)/listener.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/listener.c' object='listener.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o listener.obj `if test -f 'wire/listener.c'; then $(CYGPATH_W) 'wire/listener.c'; else $(CYGPATH_W) '$(srcdir)/wire/listener.c'; fi` netio.o: wire/netio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netio.o -MD -MP -MF $(DEPDIR)/netio.Tpo -c -o netio.o `test -f 'wire/netio.c' || echo '$(srcdir)/'`wire/netio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netio.Tpo $(DEPDIR)/netio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/netio.c' object='netio.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netio.o `test -f 'wire/netio.c' || echo '$(srcdir)/'`wire/netio.c netio.obj: wire/netio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netio.obj -MD -MP -MF $(DEPDIR)/netio.Tpo -c -o netio.obj `if test -f 'wire/netio.c'; then $(CYGPATH_W) 'wire/netio.c'; else $(CYGPATH_W) '$(srcdir)/wire/netio.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/netio.Tpo $(DEPDIR)/netio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/netio.c' object='netio.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netio.obj `if test -f 'wire/netio.c'; then $(CYGPATH_W) 'wire/netio.c'; else $(CYGPATH_W) '$(srcdir)/wire/netio.c'; fi` notify.o: wire/notify.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT notify.o -MD -MP -MF $(DEPDIR)/notify.Tpo -c -o notify.o `test -f 'wire/notify.c' || echo '$(srcdir)/'`wire/notify.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/notify.Tpo $(DEPDIR)/notify.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/notify.c' object='notify.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o notify.o `test -f 'wire/notify.c' || echo '$(srcdir)/'`wire/notify.c notify.obj: wire/notify.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT notify.obj -MD -MP -MF $(DEPDIR)/notify.Tpo -c -o notify.obj `if test -f 'wire/notify.c'; then $(CYGPATH_W) 'wire/notify.c'; else $(CYGPATH_W) '$(srcdir)/wire/notify.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/notify.Tpo $(DEPDIR)/notify.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/notify.c' object='notify.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o notify.obj `if test -f 'wire/notify.c'; then $(CYGPATH_W) 'wire/notify.c'; else $(CYGPATH_W) '$(srcdir)/wire/notify.c'; fi` query.o: wire/query.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT query.o -MD -MP -MF $(DEPDIR)/query.Tpo -c -o query.o `test -f 'wire/query.c' || echo '$(srcdir)/'`wire/query.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/query.Tpo $(DEPDIR)/query.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/query.c' object='query.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o query.o `test -f 'wire/query.c' || echo '$(srcdir)/'`wire/query.c query.obj: wire/query.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT query.obj -MD -MP -MF $(DEPDIR)/query.Tpo -c -o query.obj `if test -f 'wire/query.c'; then $(CYGPATH_W) 'wire/query.c'; else $(CYGPATH_W) '$(srcdir)/wire/query.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/query.Tpo $(DEPDIR)/query.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/query.c' object='query.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o query.obj `if test -f 'wire/query.c'; then $(CYGPATH_W) 'wire/query.c'; else $(CYGPATH_W) '$(srcdir)/wire/query.c'; fi` sock.o: wire/sock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sock.o -MD -MP -MF $(DEPDIR)/sock.Tpo -c -o sock.o `test -f 'wire/sock.c' || echo '$(srcdir)/'`wire/sock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sock.Tpo $(DEPDIR)/sock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/sock.c' object='sock.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sock.o `test -f 'wire/sock.c' || echo '$(srcdir)/'`wire/sock.c sock.obj: wire/sock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sock.obj -MD -MP -MF $(DEPDIR)/sock.Tpo -c -o sock.obj `if test -f 'wire/sock.c'; then $(CYGPATH_W) 'wire/sock.c'; else $(CYGPATH_W) '$(srcdir)/wire/sock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sock.Tpo $(DEPDIR)/sock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/sock.c' object='sock.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sock.obj `if test -f 'wire/sock.c'; then $(CYGPATH_W) 'wire/sock.c'; else $(CYGPATH_W) '$(srcdir)/wire/sock.c'; fi` tcpset.o: wire/tcpset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpset.o -MD -MP -MF $(DEPDIR)/tcpset.Tpo -c -o tcpset.o `test -f 'wire/tcpset.c' || echo '$(srcdir)/'`wire/tcpset.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tcpset.Tpo $(DEPDIR)/tcpset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tcpset.c' object='tcpset.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpset.o `test -f 'wire/tcpset.c' || echo '$(srcdir)/'`wire/tcpset.c tcpset.obj: wire/tcpset.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tcpset.obj -MD -MP -MF $(DEPDIR)/tcpset.Tpo -c -o tcpset.obj `if test -f 'wire/tcpset.c'; then $(CYGPATH_W) 'wire/tcpset.c'; else $(CYGPATH_W) '$(srcdir)/wire/tcpset.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tcpset.Tpo $(DEPDIR)/tcpset.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tcpset.c' object='tcpset.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tcpset.obj `if test -f 'wire/tcpset.c'; then $(CYGPATH_W) 'wire/tcpset.c'; else $(CYGPATH_W) '$(srcdir)/wire/tcpset.c'; fi` tsig.o: wire/tsig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig.o -MD -MP -MF $(DEPDIR)/tsig.Tpo -c -o tsig.o `test -f 'wire/tsig.c' || echo '$(srcdir)/'`wire/tsig.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsig.Tpo $(DEPDIR)/tsig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tsig.c' object='tsig.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsig.o `test -f 'wire/tsig.c' || echo '$(srcdir)/'`wire/tsig.c tsig.obj: wire/tsig.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig.obj -MD -MP -MF $(DEPDIR)/tsig.Tpo -c -o tsig.obj `if test -f 'wire/tsig.c'; then $(CYGPATH_W) 'wire/tsig.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsig.Tpo $(DEPDIR)/tsig.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tsig.c' object='tsig.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsig.obj `if test -f 'wire/tsig.c'; then $(CYGPATH_W) 'wire/tsig.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig.c'; fi` tsig-openssl.o: wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig-openssl.o -MD -MP -MF $(DEPDIR)/tsig-openssl.Tpo -c -o tsig-openssl.o `test -f 'wire/tsig-openssl.c' || echo '$(srcdir)/'`wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsig-openssl.Tpo $(DEPDIR)/tsig-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tsig-openssl.c' object='tsig-openssl.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsig-openssl.o `test -f 'wire/tsig-openssl.c' || echo '$(srcdir)/'`wire/tsig-openssl.c tsig-openssl.obj: wire/tsig-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tsig-openssl.obj -MD -MP -MF $(DEPDIR)/tsig-openssl.Tpo -c -o tsig-openssl.obj `if test -f 'wire/tsig-openssl.c'; then $(CYGPATH_W) 'wire/tsig-openssl.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig-openssl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tsig-openssl.Tpo $(DEPDIR)/tsig-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/tsig-openssl.c' object='tsig-openssl.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tsig-openssl.obj `if test -f 'wire/tsig-openssl.c'; then $(CYGPATH_W) 'wire/tsig-openssl.c'; else $(CYGPATH_W) '$(srcdir)/wire/tsig-openssl.c'; fi` xfrd.o: wire/xfrd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrd.o -MD -MP -MF $(DEPDIR)/xfrd.Tpo -c -o xfrd.o `test -f 'wire/xfrd.c' || echo '$(srcdir)/'`wire/xfrd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfrd.Tpo $(DEPDIR)/xfrd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/xfrd.c' object='xfrd.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xfrd.o `test -f 'wire/xfrd.c' || echo '$(srcdir)/'`wire/xfrd.c xfrd.obj: wire/xfrd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xfrd.obj -MD -MP -MF $(DEPDIR)/xfrd.Tpo -c -o xfrd.obj `if test -f 'wire/xfrd.c'; then $(CYGPATH_W) 'wire/xfrd.c'; else $(CYGPATH_W) '$(srcdir)/wire/xfrd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfrd.Tpo $(DEPDIR)/xfrd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wire/xfrd.c' object='xfrd.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xfrd.obj `if test -f 'wire/xfrd.c'; then $(CYGPATH_W) 'wire/xfrd.c'; else $(CYGPATH_W) '$(srcdir)/wire/xfrd.c'; fi` 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: $(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)" "$(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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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 install-sbinPROGRAMS 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 -rf ./$(DEPDIR) -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 uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS 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-binPROGRAMS 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-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-binPROGRAMS \ uninstall-sbinPROGRAMS .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: opendnssec-1.4.9/signer/src/parser/0000755000175000017500000000000012650166152014245 500000000000000opendnssec-1.4.9/signer/src/parser/addnsparser.c0000644000175000017500000002720412650165732016647 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing DNS Adapter. * */ #include "parser/addnsparser.h" #include "shared/log.h" #include #include #include #include static const char* parser_str = "parser"; /** * Parse the remote servers. * */ static acl_type* parse_addns_remote(allocator_type* allocator, const char* filename, tsig_type* tsig, char* expr) { acl_type* acl = NULL; acl_type* new_acl = NULL; int i = 0; char* address = NULL; char* port = NULL; char* key = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { address = NULL; port = NULL; key = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Address")) { address = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Port")) { port = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Key")) { key = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (address) { new_acl = acl_create(allocator, address, port, key, tsig); if (!new_acl) { ods_log_error("[%s] unable to add server %s:%s %s to list " "%s: acl_create() failed", parser_str, address, port?port:"", key?key:"", (char*) expr); } else { new_acl->next = acl; acl = new_acl; ods_log_debug("[%s] added server %s:%s %s to list %s", parser_str, address, port?port:"", key?key:"", (char*) expr); } } free((void*)address); free((void*)port); free((void*)key); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return acl; } /** * Parse the ACL interfaces. * */ static acl_type* parse_addns_acl(allocator_type* allocator, const char* filename, tsig_type* tsig, char* expr) { acl_type* acl = NULL; acl_type* new_acl = NULL; int i = 0; char* prefix = NULL; char* key = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { prefix = NULL; key = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Prefix")) { prefix = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Key")) { key = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (prefix || key) { new_acl = acl_create(allocator, prefix, NULL, key, tsig); if (!new_acl) { ods_log_error("[%s] unable to add acl for %s %s to list " "%s: acl_create() failed", parser_str, prefix?prefix:"", key?key:"", (char*) expr); } else { new_acl->next = acl; acl = new_acl; ods_log_debug("[%s] added %s %s interface to list %s", parser_str, prefix?prefix:"", key?key:"", (char*) expr); } } free((void*)prefix); free((void*)key); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return acl; } /** * Parse the TSIG credentials. * */ static tsig_type* parse_addns_tsig_static(allocator_type* allocator, const char* filename, char* expr) { tsig_type* tsig = NULL; tsig_type* new_tsig = NULL; int i = 0; char* name = NULL; char* algo = NULL; char* secret = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; if (!allocator || !filename || !expr) { return NULL; } /* Load XML document */ doc = xmlParseFile(filename); if (doc == NULL) { ods_log_error("[%s] could not parse %s: xmlParseFile() failed", parser_str, expr); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathNewContext() failed", parser_str, expr); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse %s: xmlXPathEvalExpression() " "failed", parser_str, expr); return NULL; } /* Parse interfaces */ if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { name = NULL; algo = NULL; secret = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Name")) { name = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Algorithm")) { algo = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Secret")) { secret = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (name && algo && secret) { new_tsig = tsig_create(allocator, name, algo, secret); if (!new_tsig) { ods_log_error("[%s] unable to add tsig %s: " "tsig_create() failed", parser_str, name); } else { new_tsig->next = tsig; tsig = new_tsig; ods_log_debug("[%s] added %s tsig to list %s", parser_str, name, (char*) expr); } } free((void*)name); free((void*)algo); free((void*)secret); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return tsig; } /** * Parse . * */ acl_type* parse_addns_request_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_remote(allocator, filename, tsig, "//Adapter/DNS/Inbound/RequestTransfer/Remote" ); } /** * Parse . * */ acl_type* parse_addns_allow_notify(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_acl(allocator, filename, tsig, "//Adapter/DNS/Inbound/AllowNotify/Peer" ); } /** * Parse . * */ acl_type* parse_addns_provide_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_acl(allocator, filename, tsig, "//Adapter/DNS/Outbound/ProvideTransfer/Peer" ); } /** * Parse . * */ acl_type* parse_addns_do_notify(allocator_type* allocator, const char* filename, tsig_type* tsig) { return parse_addns_remote(allocator, filename, tsig, "//Adapter/DNS/Outbound/Notify/Remote" ); } /** * Parse . * */ tsig_type* parse_addns_tsig(allocator_type* allocator, const char* filename) { return parse_addns_tsig_static(allocator, filename, "//Adapter/DNS/TSIG" ); } opendnssec-1.4.9/signer/src/parser/zonelistparser.h0000644000175000017500000000402112650165732017422 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing zonelist files. * */ #ifndef PARSER_ZONELISTPARSER_H #define PARSER_ZONELISTPARSER_H #include "adapter/adapter.h" #include "shared/allocator.h" #include "shared/status.h" #include #include /** * Parse adapter. * \param[in] xpathCtx XPath Context Pointer * \param[in] expr expression * \param[in] inbound true if Input Adapter * */ adapter_type* parse_zonelist_adapter(xmlXPathContextPtr xpathCtx, xmlChar* expr, int inbound); /** * Parse the zonelist file. * \param[in] zlist zone list storage * \param[in] zlfile zonelist file name * \return ods_status status * */ ods_status parse_zonelist_zones(void* zlist, const char* zlfile); #endif /* PARSER_ZONELISTPARSER_H */ opendnssec-1.4.9/signer/src/parser/signconfparser.c0000644000175000017500000002673712650165732017376 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing signer configuration files. * */ #include "parser/confparser.h" #include "parser/signconfparser.h" #include "shared/duration.h" #include "shared/log.h" #include #include #include #include #include static const char* parser_str = "parser"; /** * Parse keys from the signer configuration file. * */ keylist_type* parse_sc_keys(void* sc, const char* cfgfile) { xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; key_type* new_key = NULL; keylist_type* kl = NULL; char* locator = NULL; char* flags = NULL; char* algorithm = NULL; int ksk, zsk, publish, i, rfc5011; if (!cfgfile || !sc) { return NULL; } /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse : " "xmlParseFile() failed", parser_str); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] unable to parse : " "xmlXPathNewContext() failed", parser_str); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) "//SignerConfiguration/Zone/Keys/Key"; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] unable to parse : " "xmlXPathEvalExpression() failed", parser_str); return NULL; } /* Parse keys */ kl = keylist_create(sc); ods_log_assert(kl); if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { locator = NULL; flags = NULL; algorithm = NULL; ksk = 0; zsk = 0; publish = 0; rfc5011 = 0; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Locator")) { locator = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Algorithm")) { algorithm = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Flags")) { flags = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"KSK")) { ksk = 1; } else if (xmlStrEqual(curNode->name, (const xmlChar *)"ZSK")) { zsk = 1; } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Publish")) { publish = 1; } else if (xmlStrEqual(curNode->name, (const xmlChar *)"RFC5011")) { rfc5011 = 1; } curNode = curNode->next; } if (locator && algorithm && flags) { /* search for duplicates */ new_key = keylist_lookup_by_locator(kl, locator); if (new_key && new_key->algorithm == (uint8_t) atoi(algorithm) && new_key->flags == (uint32_t) atoi(flags) && new_key->publish == publish && new_key->ksk == ksk && new_key->zsk == zsk) { /* duplicate */ ods_log_warning("[%s] unable to push duplicate key %s " "to keylist, skipping", parser_str, locator); } else { (void) keylist_push(kl, locator, (uint8_t) atoi(algorithm), (uint32_t) atoi(flags), publish, ksk, zsk, rfc5011); } } else { ods_log_error("[%s] unable to push key to keylist: " "is missing required elements, skipping", parser_str); } /* free((void*)locator); */ free((void*)algorithm); free((void*)flags); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return kl; } /** * Parse elements from the configuration file. * */ duration_type* parse_sc_sig_resign_interval(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Resign", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_refresh_interval(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Refresh", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_validity_default(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Validity/Default", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_validity_denial(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Validity/Denial", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_jitter(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/Jitter", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_sig_inception_offset(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Signatures/InceptionOffset", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_dnskey_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Keys/TTL", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_nsec3param_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/TTL", 0); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_soa_ttl(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/SOA/TTL", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } duration_type* parse_sc_soa_min(const char* cfgfile) { duration_type* duration = NULL; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/SOA/Minimum", 1); if (!str) { return NULL; } duration = duration_create_from_string(str); free((void*)str); return duration; } /** * Parse elements from the configuration file. * */ ldns_rr_type parse_sc_nsec_type(const char* cfgfile) { const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3", 0); if (str) { free((void*)str); return LDNS_RR_TYPE_NSEC3; } str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC", 0); if (str) { free((void*)str); return LDNS_RR_TYPE_NSEC; } return LDNS_RR_TYPE_FIRST; } /** * Parse elements from the configuration file. * */ uint32_t parse_sc_nsec3_algorithm(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Algorithm", 1); if (str) { if (strlen(str) > 0) { ret = atoi(str); } free((void*)str); } return ret; } uint32_t parse_sc_nsec3_iterations(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Iterations", 1); if (str) { if (strlen(str) > 0) { ret = atoi(str); } free((void*)str); } return ret; } int parse_sc_nsec3_optout(const char* cfgfile) { int ret = 0; const char* str = parse_conf_string(cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/OptOut", 0); if (str) { ret = 1; free((void*)str); } return ret; } /** * Parse elements from the configuration file. * */ const char* parse_sc_soa_serial(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//SignerConfiguration/Zone/SOA/Serial", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_sc_nsec3_salt(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//SignerConfiguration/Zone/Denial/NSEC3/Hash/Salt", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } opendnssec-1.4.9/signer/src/parser/addnsparser.h0000644000175000017500000000544512650165732016657 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing DNS Adapter. * */ #ifndef PARSER_ADDNSPARSER_H #define PARSER_ADDNSPARSER_H #include "wire/acl.h" #include "wire/tsig.h" #include #include /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_request_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_allow_notify(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_provide_xfr(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \param[in] tsig list of TSIGs * \return acl_type* ACL * */ acl_type* parse_addns_do_notify(allocator_type* allocator, const char* filename, tsig_type* tsig); /** * Parse . * \param[in] allocator memory allocator * \param[in] filename filename * \return tsig_type* TSIG * */ tsig_type* parse_addns_tsig(allocator_type* allocator, const char* filename); #endif /* PARSER_ADDNSPARSER_H */ opendnssec-1.4.9/signer/src/parser/zonelistparser.c0000644000175000017500000002240212650165732017420 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing zonelist files. * */ #include "adapter/adapter.h" #include "parser/zonelistparser.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include "signer/zonelist.h" #include "signer/zone.h" #include #include #include #include static const char* parser_str = "parser"; /** * Parse expr inside XPath Context. * */ static const char* parse_zonelist_element(xmlXPathContextPtr xpathCtx, xmlChar* expr) { xmlXPathObjectPtr xpathObj = NULL; const char* str = NULL; ods_log_assert(xpathCtx); ods_log_assert(expr); xpathObj = xmlXPathEvalExpression(expr, xpathCtx); if (xpathObj == NULL) { ods_log_error("[%s] unable to evaluate xpath expression %s", parser_str, expr); return NULL; } str = (const char*) xmlXPathCastToString(xpathObj); xmlXPathFreeObject(xpathObj); return str; } /** * Create adapter from configuration. * */ static adapter_type* zlp_adapter(xmlNode* curNode, adapter_mode type, unsigned inbound) { const char* file = NULL; adapter_type* adapter = NULL; file = (const char*) xmlNodeGetContent(curNode); if (!file) { ods_log_error("[%s] unable to read %s adapter", parser_str, inbound?"input":"output"); return NULL; } adapter = adapter_create(file, type, inbound); free((void*)file); return adapter; } /** * Parse adapter. * */ adapter_type* parse_zonelist_adapter(xmlXPathContextPtr xpathCtx, xmlChar* expr, int inbound) { xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* type = NULL; adapter_type* adapter = NULL; int i = 0; if (!xpathCtx || !expr) { return NULL; } xpathObj = xmlXPathEvalExpression(expr, xpathCtx); if (xpathObj == NULL) { ods_log_error("[%s] unable to parse adapter: xmlPathEvalExpression() " "failed (expr %s)", parser_str, expr); return NULL; } if (xpathObj->nodesetval) { for (i=0; i < xpathObj->nodesetval->nodeNr; i++) { curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar*)"File")) { adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); } else if (xmlStrEqual(curNode->name, (const xmlChar*)"Adapter")) { type = xmlGetProp(curNode, (const xmlChar*)"type"); if (xmlStrEqual(type, (const xmlChar*)"File")) { adapter = zlp_adapter(curNode, ADAPTER_FILE, inbound); } else if (xmlStrEqual(type, (const xmlChar*)"DNS")) { adapter = zlp_adapter(curNode, ADAPTER_DNS, inbound); } else { ods_log_error("[%s] unable to parse %s adapter: " "unknown type", parser_str, (const char*) type); } free((void*)type); type = NULL; } if (adapter) { break; } curNode = curNode->next; } } } xmlXPathFreeObject(xpathObj); return adapter; } /** * Parse the adapters. * */ static void parse_zonelist_adapters(xmlXPathContextPtr xpathCtx, zone_type* zone) { xmlChar* i_expr = (xmlChar*) "//Zone/Adapters/Input"; xmlChar* o_expr = (xmlChar*) "//Zone/Adapters/Output"; if (!xpathCtx || !zone) { return; } zone->adinbound = parse_zonelist_adapter(xpathCtx, i_expr, 1); zone->adoutbound = parse_zonelist_adapter(xpathCtx, o_expr, 0); return; } /** * Parse the zonelist file. * */ ods_status parse_zonelist_zones(void* zlist, const char* zlfile) { char* tag_name = NULL; char* zone_name = NULL; zone_type* new_zone = NULL; int ret = 0; int error = 0; xmlTextReaderPtr reader = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlChar* name_expr = (unsigned char*) "name"; xmlChar* policy_expr = (unsigned char*) "//Zone/Policy"; xmlChar* signconf_expr = (unsigned char*) "//Zone/SignerConfiguration"; if (!zlist || !zlfile) { return ODS_STATUS_ASSERT_ERR; } reader = xmlNewTextReaderFilename(zlfile); if (!reader) { ods_log_error("[%s] unable to parse zonelist: failed to open file %s", parser_str, zlfile); return ODS_STATUS_XML_ERR; } ret = xmlTextReaderRead(reader); while (ret == XML_READER_TYPE_ELEMENT) { tag_name = (char*) xmlTextReaderLocalName(reader); if (ods_strcmp(tag_name, "Zone") == 0 && ods_strcmp(tag_name, "ZoneList") != 0 && xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) { /* Found a zone */ zone_name = (char*) xmlTextReaderGetAttribute(reader, name_expr); if (!zone_name || strlen(zone_name) <= 0) { ods_log_alert("[%s] unable to extract zone name from " "zonelist %s, skipping...", parser_str, zlfile); if (zone_name) { free((void*) zone_name); } free((void*) tag_name); ret = xmlTextReaderRead(reader); continue; } /* Expand this node to get the rest of the info */ xmlTextReaderExpand(reader); doc = xmlTextReaderCurrentDoc(reader); if (doc) { xpathCtx = xmlXPathNewContext(doc); } if (doc == NULL || xpathCtx == NULL) { ods_log_alert("[%s] unable to read zone %s, skipping...", parser_str, zone_name); ret = xmlTextReaderRead(reader); free((void*) zone_name); free((void*) tag_name); continue; } /* That worked, now read out the contents... */ new_zone = zone_create(zone_name, LDNS_RR_CLASS_IN); if (new_zone) { new_zone->policy_name = parse_zonelist_element(xpathCtx, policy_expr); new_zone->signconf_filename = parse_zonelist_element(xpathCtx, signconf_expr); parse_zonelist_adapters(xpathCtx, new_zone); if (!new_zone->policy_name || !new_zone->signconf_filename || !new_zone->adinbound || !new_zone->adoutbound) { zone_cleanup(new_zone); new_zone = NULL; ods_log_crit("[%s] unable to create zone %s", parser_str, zone_name); error = 1; } else if (zonelist_add_zone((zonelist_type*) zlist, new_zone) == NULL) { ods_log_crit("[%s] unable to add zone %s", parser_str, zone_name); zone_cleanup(new_zone); new_zone = NULL; error = 1; } } else { ods_log_crit("[%s] unable to create zone %s", parser_str, zone_name); error = 1; } xmlXPathFreeContext(xpathCtx); xpathCtx = NULL; free((void*) zone_name); if (error) { free((void*) tag_name); tag_name = NULL; ret = 1; break; } ods_log_debug("[%s] zone %s added", parser_str, new_zone->name); } free((void*) tag_name); ret = xmlTextReaderRead(reader); } /* no more zones */ ods_log_debug("[%s] no more zones", parser_str); xmlFreeTextReader(reader); if (doc) { xmlFreeDoc(doc); } if (ret != 0) { ods_log_error("[%s] unable to parse zonelist: parse error in %s", parser_str, zlfile); return ODS_STATUS_PARSE_ERR; } return ODS_STATUS_OK; } opendnssec-1.4.9/signer/src/parser/confparser.c0000644000175000017500000003416512650165732016507 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing configuration files. * */ #include "parser/confparser.h" #include "parser/zonelistparser.h" #include "shared/allocator.h" #include "shared/log.h" #include "shared/status.h" #include "wire/acl.h" #include #include #include #include #include static const char* parser_str = "parser"; /** * Parse elements from the configuration file. * */ ods_status parse_file_check(const char* cfgfile, const char* rngfile) { xmlDocPtr doc = NULL; xmlDocPtr rngdoc = NULL; xmlRelaxNGParserCtxtPtr rngpctx = NULL; xmlRelaxNGValidCtxtPtr rngctx = NULL; xmlRelaxNGPtr schema = NULL; int status = 0; if (!cfgfile || !rngfile) { return ODS_STATUS_ASSERT_ERR; } ods_log_debug("[%s] check cfgfile %s with rngfile %s", parser_str, cfgfile, rngfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse file: failed to load cfgfile %s", parser_str, cfgfile); return ODS_STATUS_XML_ERR; } /* Load rng document */ rngdoc = xmlParseFile(rngfile); if (rngdoc == NULL) { ods_log_error("[%s] unable to parse file: failed to load rngfile %s", parser_str, rngfile); xmlFreeDoc(doc); return ODS_STATUS_XML_ERR; } /* Create an XML RelaxNGs parser context for the relax-ng document. */ rngpctx = xmlRelaxNGNewDocParserCtxt(rngdoc); if (rngpctx == NULL) { ods_log_error("[%s] unable to parse file: " "xmlRelaxNGNewDocParserCtxt() failed", parser_str); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_XML_ERR; } /* Parse a schema definition resource and * build an internal XML schema structure. */ schema = xmlRelaxNGParse(rngpctx); if (schema == NULL) { ods_log_error("[%s] unable to parse file: xmlRelaxNGParse() failed", parser_str); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_PARSE_ERR; } /* Create an XML RelaxNGs validation context. */ rngctx = xmlRelaxNGNewValidCtxt(schema); if (rngctx == NULL) { ods_log_error("[%s] unable to parse file: xmlRelaxNGNewValidCtxt() " "failed", parser_str); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_RNG_ERR; } /* Validate a document tree in memory. */ status = xmlRelaxNGValidateDoc(rngctx,doc); if (status != 0) { ods_log_error("[%s] unable to parse file: xmlRelaxNGValidateDoc() " "failed", parser_str); xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_RNG_ERR; } xmlRelaxNGFreeValidCtxt(rngctx); xmlRelaxNGFree(schema); xmlRelaxNGFreeParserCtxt(rngpctx); xmlFreeDoc(rngdoc); xmlFreeDoc(doc); return ODS_STATUS_OK; } /* TODO: look how the enforcer reads this now */ /** * Parse the listener interfaces. * */ listener_type* parse_conf_listener(allocator_type* allocator, const char* cfgfile) { listener_type* listener = NULL; interface_type* interface = NULL; int i = 0; char* address = NULL; char* port = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlNode* curNode = NULL; xmlChar* xexpr = NULL; ods_log_assert(allocator); ods_log_assert(cfgfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] could not parse : " "xmlParseFile() failed", parser_str); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if(xpathCtx == NULL) { xmlFreeDoc(doc); ods_log_error("[%s] could not parse : " "xmlXPathNewContext() failed", parser_str); return NULL; } /* Evaluate xpath expression */ xexpr = (xmlChar*) "//Configuration/Signer/Listener/Interface"; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if(xpathObj == NULL) { xmlXPathFreeContext(xpathCtx); xmlFreeDoc(doc); ods_log_error("[%s] could not parse : " "xmlXPathEvalExpression failed", parser_str); return NULL; } /* Parse interfaces */ listener = listener_create(allocator); ods_log_assert(listener); if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) { for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { address = NULL; port = NULL; curNode = xpathObj->nodesetval->nodeTab[i]->xmlChildrenNode; while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"Address")) { address = (char *) xmlNodeGetContent(curNode); } else if (xmlStrEqual(curNode->name, (const xmlChar *)"Port")) { port = (char *) xmlNodeGetContent(curNode); } curNode = curNode->next; } if (address) { interface = listener_push(listener, address, acl_parse_family(address), port); } else { interface = listener_push(listener, "", AF_INET, port); if (interface) { interface = listener_push(listener, "", AF_INET6, port); } } if (!interface) { ods_log_error("[%s] unable to add %s:%s interface: " "listener_push() failed", parser_str, address?address:"", port?port:""); } else { ods_log_debug("[%s] added %s:%s interface to listener", parser_str, address?address:"", port?port:""); } free((void*)port); free((void*)address); } } xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); if (doc) { xmlFreeDoc(doc); } return listener; } /** * Parse elements from the configuration file. * */ const char* parse_conf_string(const char* cfgfile, const char* expr, int required) { xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlChar *xexpr = NULL; const char* string = NULL; ods_log_assert(expr); ods_log_assert(cfgfile); /* Load XML document */ doc = xmlParseFile(cfgfile); if (doc == NULL) { ods_log_error("[%s] unable to parse file %s: xmlParseFile() failed", parser_str, cfgfile); return NULL; } /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(doc); if (xpathCtx == NULL) { ods_log_error("[%s] unable to parse file %s: xmlXPathNewContext() " "failed", parser_str, cfgfile); xmlFreeDoc(doc); return NULL; } /* Get string */ xexpr = (unsigned char*) expr; xpathObj = xmlXPathEvalExpression(xexpr, xpathCtx); if (xpathObj == NULL || xpathObj->nodesetval == NULL || xpathObj->nodesetval->nodeNr <= 0) { if (required) { ods_log_error("[%s] unable to evaluate expression %s in cfgile %s", parser_str, (char*) xexpr, cfgfile); } xmlXPathFreeContext(xpathCtx); if (xpathObj) { xmlXPathFreeObject(xpathObj); } xmlFreeDoc(doc); return NULL; } if (xpathObj->nodesetval != NULL && xpathObj->nodesetval->nodeNr > 0) { string = (const char*) xmlXPathCastToString(xpathObj); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); xmlFreeDoc(doc); return string; } xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); xmlFreeDoc(doc); return NULL; } const char* parse_conf_zonelist_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Common/ZoneListFile", 1); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_log_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Syslog/Facility", 0); if (!str) { str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/File/Filename", 0); } if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; /* NULL, Facility or Filename */ } const char* parse_conf_pid_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/PidFile", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_PIDFILE); } return dup; } const char* parse_conf_notify_command(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/NotifyCommand", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_clisock_filename(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/SocketFile", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_SOCKFILE); } return dup; } const char* parse_conf_working_dir(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/WorkingDirectory", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } else { dup = allocator_strdup(allocator, ODS_SE_WORKDIR); } ods_log_assert(dup); return dup; } const char* parse_conf_username(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/User", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_group(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/Group", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } const char* parse_conf_chroot(allocator_type* allocator, const char* cfgfile) { const char* dup = NULL; const char* str = parse_conf_string( cfgfile, "//Configuration/Signer/Privileges/Directory", 0); if (str) { dup = allocator_strdup(allocator, str); free((void*)str); } return dup; } /** * Parse elements from the configuration file. * */ int parse_conf_use_syslog(const char* cfgfile) { const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Syslog/Facility", 0); if (str) { free((void*)str); return 1; } return 0; } int parse_conf_verbosity(const char* cfgfile) { int verbosity = ODS_SE_VERBOSITY; const char* str = parse_conf_string(cfgfile, "//Configuration/Common/Logging/Verbosity", 0); if (str) { if (strlen(str) > 0) { verbosity = atoi(str); } free((void*)str); } return verbosity; } int parse_conf_worker_threads(const char* cfgfile) { int numwt = ODS_SE_WORKERTHREADS; const char* str = parse_conf_string(cfgfile, "//Configuration/Signer/WorkerThreads", 0); if (str) { if (strlen(str) > 0) { numwt = atoi(str); } free((void*)str); } return numwt; } int parse_conf_signer_threads(const char* cfgfile) { int numwt = ODS_SE_WORKERTHREADS; const char* str = parse_conf_string(cfgfile, "//Configuration/Signer/SignerThreads", 0); if (str) { if (strlen(str) > 0) { numwt = atoi(str); } free((void*)str); return numwt; } /* no SignerThreads value configured, look at WorkerThreads */ return parse_conf_worker_threads(cfgfile); } opendnssec-1.4.9/signer/src/parser/signconfparser.h0000644000175000017500000000700212650165732017363 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing signer configuration files. * */ #ifndef PARSER_SIGNCONFPARSER_H #define PARSER_SIGNCONFPARSER_H #include "parser/confparser.h" #include "shared/allocator.h" #include "shared/duration.h" #include "signer/keys.h" #include "config.h" #include /** * Parse keys from the signer configuration file. * \param[in] sc signer configuration reference * \param[in] cfgfile the configuration file name. * \return keylist_type* key list * */ keylist_type* parse_sc_keys(void* sc, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return duration_type* duration * */ duration_type* parse_sc_sig_resign_interval(const char* cfgfile); duration_type* parse_sc_sig_refresh_interval(const char* cfgfile); duration_type* parse_sc_sig_validity_default(const char* cfgfile); duration_type* parse_sc_sig_validity_denial(const char* cfgfile); duration_type* parse_sc_sig_jitter(const char* cfgfile); duration_type* parse_sc_sig_inception_offset(const char* cfgfile); duration_type* parse_sc_dnskey_ttl(const char* cfgfile); duration_type* parse_sc_nsec3param_ttl(const char* cfgfile); duration_type* parse_sc_soa_ttl(const char* cfgfile); duration_type* parse_sc_soa_min(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return ldns_rr_type rr type * */ ldns_rr_type parse_sc_nsec_type(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return uint32_t integer * */ uint32_t parse_sc_nsec3_algorithm(const char* cfgfile); uint32_t parse_sc_nsec3_iterations(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return int integer * */ int parse_sc_nsec3_optout(const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name. * \return const char* string * */ const char* parse_sc_soa_serial(allocator_type* allocator, const char* cfgfile); const char* parse_sc_nsec3_salt(allocator_type* allocator, const char* cfgfile); #endif /* PARSER_SIGNCONFPARSER_H */ opendnssec-1.4.9/signer/src/parser/confparser.h0000644000175000017500000000736112650165732016512 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * Parsing configuration files. * */ #ifndef PARSER_CONFPARSER_H #define PARSER_CONFPARSER_H #include "config.h" #include "wire/listener.h" #include "shared/allocator.h" #include "shared/status.h" #define ADMAX 6 /* Maximum number of adapters that can be initialized */ /** * Check config file with rng file. * \param[in] cfgfile the configuration file name * \param[in] rngfile the rng file name * \return ods_status status * */ ods_status parse_file_check(const char* cfgfile, const char* rngfile); /** * Parse elements from the configuration file. * \param[in] cfgfile configuration file * \param[in] expr xml expression * \param[in] required if the element is required * \return const char* string value * */ const char* parse_conf_string(const char* cfgfile, const char* expr, int required); /** * Parse the listener interfaces. * \param[in] allocator the allocator * \param[in] cfgfile the configuration file name * \return listener_type* listener interfaces * */ listener_type* parse_conf_listener(allocator_type* allocator, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] allocator the allocator * \param[in] cfgfile the configuration file name * \return const char* string * */ /** Common */ const char* parse_conf_zonelist_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_log_filename(allocator_type* allocator, const char* cfgfile); /** Signer specific */ const char* parse_conf_pid_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_notify_command(allocator_type* allocator, const char* cfgfile); const char* parse_conf_clisock_filename(allocator_type* allocator, const char* cfgfile); const char* parse_conf_working_dir(allocator_type* allocator, const char* cfgfile); const char* parse_conf_username(allocator_type* allocator, const char* cfgfile); const char* parse_conf_group(allocator_type* allocator, const char* cfgfile); const char* parse_conf_chroot(allocator_type* allocator, const char* cfgfile); /** * Parse elements from the configuration file. * \param[in] cfgfile the configuration file name * \return int integer * */ /** Common */ int parse_conf_use_syslog(const char* cfgfile); int parse_conf_verbosity(const char* cfgfile); /** Signer specific */ int parse_conf_worker_threads(const char* cfgfile); int parse_conf_signer_threads(const char* cfgfile); #endif /* PARSE_CONFPARSER_H */ opendnssec-1.4.9/signer/src/ods-signer.c0000644000175000017500000003335112650165732015117 00000000000000/* * Copyright (c) 2009 NLNet Labs. 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 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. * */ /** * OpenDNSSEC signer engine client. * */ #include "config.h" #include "daemon/cfg.h" #include "parser/confparser.h" #include "shared/allocator.h" #include "shared/file.h" #include "shared/log.h" #include "shared/status.h" #include #include #include /* fcntl() */ #include /* fprintf() */ #include /* strerror(), strncmp(), strlen(), strcpy(), strncat() */ #include /* bzero() */ #include /* select(), FD_ZERO(), FD_SET(), FD_ISSET(), FD_CLR() */ #include /* socket(), connect(), shutdown() */ #include #include /* exit(), read(), write() */ /* According to earlier standards, we need sys/time.h, sys/types.h, unistd.h for select() */ #include #include #define SE_CLI_CMDLEN 6 static const char* cli_str = "client"; /** * Prints usage. * */ static void usage(FILE* out) { fprintf(out, "Usage: %s []\n", "ods-signer"); fprintf(out, "Simple command line interface to control the signer " "engine daemon.\nIf no cmd is given, the tool is going " "into interactive mode.\n\n"); fprintf(out, "Supported options:\n"); fprintf(out, " -c | --config Read configuration from file.\n"); fprintf(out, " -h | --help Show this help and exit.\n"); fprintf(out, " -V | --version Show version and exit.\n"); fprintf(out, "\nBSD licensed, see LICENSE in source package for " "details.\n"); fprintf(out, "Version %s. Report bugs to <%s>.\n", PACKAGE_VERSION, PACKAGE_BUGREPORT); } /** * Prints version. * */ static void version(FILE* out) { fprintf(out, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); exit(0); } /** * Return largest value. * */ static int max(int a, int b) { return a= SE_CLI_CMDLEN : and so it is safe to do buffer manipulations below. */ if (strncmp(buf+n-SE_CLI_CMDLEN,"\ncmd> ",SE_CLI_CMDLEN) == 0) { /* we have the full response */ n -= SE_CLI_CMDLEN; buf[n] = '\0'; cmd_response = 1; } } else { /* always null terminate string */ buf[n] = '\0'; } /* n > 0 : when we get to this line... */ for (written=0; written < n; written += ret) { /* write what we got to stdout */ ret = (int) write(fileno(stdout), &buf[written], n-written); /* error and shutdown handling */ if (ret == 0) { fprintf(stderr, "no write\n"); break; } if (ret < 0) { if (errno == EINTR || errno == EWOULDBLOCK) { ret = 0; continue; /* try again... */ } fprintf(stderr, "\n\nwrite error: %s\n", strerror(errno)); break; } /* ret > 0 : when we get here... */ if (written+ret > n) { fprintf(stderr, "\n\nwrite error: more bytes (%d) written " "than required (%d)\n", written+ret, n); break; } /* written+ret < n : means partial write, requires us to loop... */ } if (ods_strcmp(buf, ODS_SE_STOP_RESPONSE) == 0 || cmd_response) { fprintf(stdout, "\n"); return 0; } } if (FD_ISSET(fileno(fp), &rset)) { /* input is readable */ if (cmd && cmd_written) { /* passive mode */ stdineof = 1; ret = shutdown(sockfd, SHUT_WR); if (ret != 0) { fprintf(stderr, "shutdown failed: %s\n", strerror(errno)); return 1; } FD_CLR(fileno(fp), &rset); continue; } /* clear buffer */ for (i=0; i< ODS_SE_MAXLINE; i++) { buf[i] = 0; } /* interactive mode */ if ((n = read(fileno(fp), buf, ODS_SE_MAXLINE)) == 0) { stdineof = 1; ret = shutdown(sockfd, SHUT_WR); if (ret != 0) { fprintf(stderr, "shutdown failed: %s\n", strerror(errno)); return 1; } FD_CLR(fileno(fp), &rset); continue; } buf[ODS_SE_MAXLINE-1] = '\0'; if (strncmp(buf, "exit", 4) == 0 || strncmp(buf, "quit", 4) == 0) { return 0; } ods_str_trim(buf); n = strlen(buf); ods_writen(sockfd, buf, n); } } return 0; } /** * Start interface. * */ static int interface_start(char* cmd, engineconfig_type* config) { int sockfd, ret, flags; struct sockaddr_un servaddr; const char* servsock_filename = config->clisock_filename; char start_cmd[256]; /* client ignores syslog facility or log filename */ ods_log_init(NULL, 0, config->verbosity); /* new socket */ sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd < 0) { fprintf(stderr, "Unable to connect to engine. " "socket() failed: %s\n", strerror(errno)); return 1; } /* no suprises */ bzero(&servaddr, sizeof(servaddr)); servaddr.sun_family = AF_UNIX; strncpy(servaddr.sun_path, servsock_filename, sizeof(servaddr.sun_path) - 1); /* connect */ ret = connect(sockfd, (const struct sockaddr*) &servaddr, sizeof(servaddr)); if (ret != 0) { if (cmd && ods_strcmp(cmd, "start\n") == 0) { size_t len = strlen(ODS_SE_ENGINE) + strlen(config->cfg_filename) + 5; if (len < 256) { (void) snprintf(start_cmd, len, "%s -c %s", ODS_SE_ENGINE, config->cfg_filename); close(sockfd); return system(start_cmd); } else { fprintf(stderr, "Unable to start engine: cmd too long\n"); close(sockfd); return 1; } } if (cmd && ods_strcmp(cmd, "running\n") == 0) { fprintf(stderr, "Engine not running.\n"); } else { fprintf(stderr, "Unable to connect to engine: " "connect() failed: %s\n", strerror(errno)); } close(sockfd); return 1; } /* set socket to non-blocking */ flags = fcntl(sockfd, F_GETFL, 0); if (flags < 0) { ods_log_error("[%s] unable to start interface, fcntl(F_GETFL) " "failed: %s", cli_str, strerror(errno)); close(sockfd); return 1; } flags |= O_NONBLOCK; if (fcntl(sockfd, F_SETFL, flags) < 0) { ods_log_error("[%s] unable to start interface, fcntl(F_SETFL) " "failed: %s", cli_str, strerror(errno)); close(sockfd); return 1; } /* some sort of interface */ if (!cmd) { fprintf(stderr, "cmd> "); } /* run */ ret = interface_run(stdin, sockfd, cmd); close(sockfd); return ret; } /** * Main. start interface tool. * */ int main(int argc, char* argv[]) { int c; int options_size = 0; int options_count = 0; const char* options[10]; const char* cfgfile = ODS_SE_CFGFILE; int cfgfile_expected = 0; engineconfig_type* config = NULL; allocator_type* clialloc = NULL; ods_status status; char* cmd = NULL; int ret = 0; /* command line options */ if (argc > 10) { fprintf(stderr,"error, too many arguments (%d)\n", argc); exit(1); } for (c = 1; c < argc; c++) { /* leave out --options */ if (cfgfile_expected) { cfgfile = argv[c]; cfgfile_expected = 0; } else if (!ods_strcmp(argv[c], "-h")) { usage(stdout); exit(0); } else if (!ods_strcmp(argv[c], "--help")) { usage(stdout); exit(0); } else if (!ods_strcmp(argv[c], "-V")) { version(stdout); exit(0); } else if (!ods_strcmp(argv[c], "--version")) { version(stdout); exit(0); } else if (!ods_strcmp(argv[c], "-c")) { cfgfile_expected = 1; } else if (!ods_strcmp(argv[c], "--cfgfile")) { cfgfile_expected = 1; } else { options[options_count] = argv[c]; options_size += strlen(argv[c]) + 1; options_count++; } } if (cfgfile_expected) { fprintf(stderr,"error, missing config file\n"); exit(1); } clialloc = allocator_create(malloc, free); if (!clialloc) { fprintf(stderr,"error, malloc failed for client\n"); exit(1); } /* create signer command */ if (options_count) { cmd = (char*) allocator_alloc(clialloc, (options_size+2)*sizeof(char)); if (!cmd) { fprintf(stderr, "error, memory allocation failed\n"); exit(1); } (void)strncpy(cmd, "", 1); for (c = 0; c < options_count; c++) { (void)strncat(cmd, options[c], strlen(options[c])); (void)strncat(cmd, " ", 1); } cmd[options_size-1] = '\n'; } /* parse conf */ config = engine_config(clialloc, cfgfile, 0); status = engine_config_check(config); if (status != ODS_STATUS_OK) { ods_log_error("[%s] cfgfile %s has errors", cli_str, cfgfile); engine_config_cleanup(config); if (cmd) allocator_deallocate(clialloc, (void*) cmd); allocator_cleanup(clialloc); return 1; } /* main stuff */ ret = interface_start(cmd, config); /* done */ engine_config_cleanup(config); if (cmd) allocator_deallocate(clialloc, (void*) cmd); allocator_cleanup(clialloc); return ret; } opendnssec-1.4.9/signer/Makefile.in0000644000175000017500000005332712650165765014172 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = signer ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/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 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)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS README 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src man 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 signer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign signer/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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: $(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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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 doxygen: rm -fr $(top_builddir)/signer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-signer" \ SRCDIR=$(top_srcdir)/signer \ OUTPUTDIR=$(top_builddir)/signer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) # 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: opendnssec-1.4.9/signer/README0000644000175000017500000002347612650165732013001 00000000000000The signer engine and its tools are part of the OpenDNSSEC project. For more information, visit http://www.opendnssec.org CONTENTS: INTRODUCTION DEPENDENCIES INSTALLATION INTERACTION FROM THE COMMAND LINE RUNNING THE ENGINE RUNNING WITHOUT THE KASP DEBUGGING ------------------------------------------------------------------- INTRODUCTION ------------------------------------------------------------------- As part of the OpenDNSSEC project, the task of the signer engine is to schedule signing operation on DNS zones. Taking input from the KASP, it will automatically sign zones and keep their signatures up-to-date. Until version 1.3, OpenDNSSEC could only handle file-to-file signing. With the Zonefetcher enabled, AXFR-to-file signing was possible. Version 1.4 and up can handle unsigned zones in file, AXFR and IXFR format, as well as output signed zones as file, AXFR and IXFR. When a zone has changed, the engine can run a specified command, for instance to signal an actual DNS server that it should reload its zones (useful for file output). The signer engine has a scheduler, including a set of workers to do zone manipulation, and zone in- and output is handled by different types of adapters. The signer is written in c is run as a daemon. When a zone needs to be sorted or (re)signed, the workers will report for duty and perform the job. It uses a worker/task-queue design, where the worker threads will suspend until there is something to do. ------------------------------------------------------------------- DEPENDENCIES ------------------------------------------------------------------- The signer depends on the ldns library: http://www.NLnetLabs.nl/projects/ldns and can only be used in conjuction with a PKCS#11 library (a software version of which, softHSM, is supplied with the OpenDNSSEC). ------------------------------------------------------------------- INSTALLATION ------------------------------------------------------------------- The signer is installed as part of the OpenDNSSEC install. To build and install the signer engine separately, the following steps are needed: From the base directory /signer autoreconf --install ./configure make make install The options provided with configure: --with-ldns= The base directory (prefix) of your ldns installation, if it isn't in your standard path. --prefix= Installation directory. All files will be installed relative to this path, and default search paths will be relative to the prefix. Defaults to /usr/local The signer engine will be installed in /sbin ------------------------------------------------------------------- INTERACTION FROM THE COMMAND LINE ------------------------------------------------------------------- If the engine is running (see the next section on how to run one manually), you can interact with it using the tool ods-signer. If you give no arguments, it will connect to the engine and go to interactive mode. Only the start command cannot be called in interactive mode. The command 'help' shows a list of possible commands: $ ods-signer cmd> help Commands: zones show the currently known zones. sign schedule zone for immediate (re-)signing. sign --all schedule all zones for immediate (re-)signing. clear delete the internal storage of this zone. All signatures will be regenerated on the next re-sign. queue show the current task queue. flush execute all scheduled tasks immediately. update update this zone signer configurations. update [--all] update zone list and all signer configurations. retransfer retransfer zone from the master server. start start the engine. reload reload the engine. running test if the engine is running. stop stop the engine. verbosity set verbosity. cmd> quit You can also use these commands directly from your shell, by giving them as arguments to ods-signer. If you do this, the client will execute the command and quit. ------------------------------------------------------------------- RUNNING THE ENGINE ------------------------------------------------------------------- You can run the engine by calling /sbin/ods-signer start If everything is ok, you should see the following output: $ ./ods-signer start OpenDNSSEC signer engine version 1.4.0 $ The engine has daemonized itself and should be running. You can check that it does by using ods-signer as specified in the section INTERACTION FROM THE COMMAND LINE. ------------------------------------------------------------------- RUNNING WITHOUT THE KASP ------------------------------------------------------------------- If you want to test the engine on its own, or run it without using the KASP module, you will need to perform the following steps. Of course it has to be installed using the steps from section INSTALLATION. HSM --- You will need to set up an HSM module. If you use SoftHSM, you will need to make sure that a token is initialized, and that the correct softhsm.conf file is set in the environment variable $SOFTHSM_CONF. Some keys should be present in the token. If not, you can generate them with the hsm-toolkit from OpenDNSSEC. conf.xml -------- You will need to either create or update the /etc/opendnssec/conf.xml file to your settings; the element should contain the name of the token you have initialized in your HSM, the complete path of the module library (e.g. /lib/libsofthsm.so). Optionally you can use a PIN value here too. If you do not specify it, the engine will prompt for it. If you run a nameserver, you will need to create a little script that tells that server to reload its zones, and point to that script with the element below . The rest of the values can be left to their defaults. The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/conf.rnc zonelist.xml ------------ You can tell the engine what zones to sign with /etc/zonelist.xml An example zone list file can be found at http://www.opendnssec.se/browser/trunk/conf/opendnssec/zonelist.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/zonelist.rnc This file will specify the specific zone configuration, and its in- and output-files. addns.xml ------------ If you use AXFR or IXFR as zone input/output, you can tell the engine where and how to get the zones from the master servers with /etc/addns.xml This can be configured on a per-zone basis in the zonelist.xml file. An example zone list file can be found at http://www.opendnssec.se/browser/trunk/conf/opendnssec/addns.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/addns.rnc This file will specify the interface to listen NOTIFY messages on, the master servers that are allowed to send NOTIFY messages and to contact for zone transfers and optionally, the TSIG credentials. zone file --------- If you use files as input, you obviously will need to give the engine an actual zone file to work on. You will have already specified the location of this file in the zonelist.xml file above. zone configuration ------------------ Finally, at the location pointed to in your zonelist.xml, you should create a signer configuration xml file. An example can be found at: http://www.opendnssec.se/browser/trunk/conf/opendnssec/signconf.xml The elements and their exact meanings are described here: http://www.opendnssec.se/browser/trunk/conf/opendnssec/signconf.rnc Diagnostics ----------- The signer prints statistics about the signed zones into the logs. [STATS] opendnssec.org RR[count=32 time=1(sec)] NSEC[count=32 time=1(sec)] RRSIG[new=1 reused=31 time=1(sec) avg=1(sig/sec)] TOTAL[time=5(sec)] RR[count] is the number of records read in the unsigned zone. It is zero if the zone was not re-read. This happens for example when only re-signing. RR[time] is the time it took to read the unsigned zone. NSEC[count] is the number of NSEC or NSEC3 records added to the zone. This can be zero too, when only re-signing. NSEC[time] is the time it took to create all the Denial of Existence records. RRSIG[new] is the number of signatures newly created. RRSIG[reused] is the number of signatures that were created on a previous run, but are fresh enough that they may be remained in the zone. RRSIG[time] is the time it took to gather all the new and reused signatures. RRSIG[avg] is the average number of created signatures per second. TOTAL[time] is the total time it took for the signer engine to sign the latest version of the zone. ------------------------------------------------------------------- DNS FILE ADAPTERS ------------------------------------------------------------------- As mentioned above, you can use DNS adapters instead of File adapters. Put something like this in your zonelist.xml: ... example.com.dns.xml example.com.dns.xml The example.com.dns.xml holds all master and slave configurations for transfers. ------------------------------------------------------------------- DEBUGGING ------------------------------------------------------------------- Warning: DO NOT TRY THIS EXCEPT FOR DEBUGGING PURPOSES If the signer is build with the '--enable-timeshift' option, one can override the system clock using the ENFORCER_TIMESHIFT environment variable. ENFORCER_TIMESHIFT should be set to the timestamp (in YYYYMMDDHHMMSS format). When running with timeshift, the program will run once only and exit. opendnssec-1.4.9/signer/AUTHORS0000644000175000017500000000021412650165675013160 00000000000000Main developers: Jelte Jansen (jelte@NLnetLabs.nl) http://www.NLnetLabs.nl Matthijs Mekking (matthijs@NLnetLabs.nl) http://www.NLnetLabs.nl opendnssec-1.4.9/LICENSE0000644000175000017500000000275312650165732011632 00000000000000Copyright (c) 2012 OpenDNSSEC AB (svb). All rights reserved. Copyright (c) 2011 SURFnet bv. All rights reserved. Copyright (c) 2008 .SE (The Internet Infrastructure Foundation). All rights reserved. Copyright (c) 2008 NLnet Labs. All rights reserved. Copyright (c) 2008 Nominet UK. 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 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. opendnssec-1.4.9/README.md0000644000175000017500000000222512650165675012104 00000000000000# OpenDNSSEC ## Introduction OpenDNSSEC was created as an open-source turn-key solution for DNSSEC. It secures zone data just before it is published in an authoritative name server. ## More Information More informnation can be found at the project website available at http://www.opendnssec.org/ and on the development WIKI at http://wiki.opendnssec.org/. Information about announcements, bug reporting and mailing lists can be found at http://www.opendnssec.org/support/. ## Dependencies OpenDNSSEC depends on a number of external packages: - libxml2 (including xmllint) - LDNS - SQLite3 To run OpenDNSSEC, one must have at least one crypto module providing a PKCS#11 library, e.g. SoftHSM (http://www.opendnssec.org/softHSM) When building from the source code repository, the following dependencies are also needed: - A Java runtime environment (JRE/JDK) ## Building from the source code respository If the code is downloaded directly from the source code respository (git), you have to prepare the configuration scripts before continuing with build: 1. Install automake, autoconf and libtool. 2. Run the command autogen.sh to build configure scripts etc. opendnssec-1.4.9/test-driver0000755000175000017500000001104012650165765013016 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: opendnssec-1.4.9/configure.ac0000644000175000017500000001760212650165732013112 00000000000000m4_sinclude([version.m4]) AC_PREREQ(2.61) AC_INIT([opendnssec], OPENDNSSEC_VERSION, [http://bugs.opendnssec.org/]) AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(foreign) ACX_PREFIXHACK OPENDNSSEC_COMMON # extensions AC_USE_SYSTEM_EXTENSIONS # standard programs AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PROG_RANLIB # additional programs AC_PATH_PROG(XMLLINT, xmllint) AC_PATH_PROG(XSLTPROC, xsltproc) AC_PATH_PROG(JAVA, java) AC_PATH_PROG(CP, cp) AC_DEFINE_UNQUOTED(CP_COMMAND, "$CP", [System cp(3) command]) # building ACX_ARG_RPATH ACX_RUNTIME_PATH_ADD ACX_PEDANTIC ACX_STRICT # compiler flags CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"]) CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"]) CHECK_COMPILER_FLAG_NEEDED($C99FLAG, [#include ], [CFLAGS="$CFLAGS $C99FLAG"]) CHECK_COMPILER_FLAG_NEEDED(-D__EXTENSIONS__, [ #include "confdefs.h" #include #include int test() { int a; char **opts = NULL; a = getopt(2, opts, "a"); return a; } ], [CFLAGS="-D__EXTENSIONS__ $CFLAGS"]) # checks for header files AC_HEADER_STDC AC_HEADER_STDBOOL AC_HEADER_TIME AC_CHECK_HEADERS([fcntl.h inttypes.h stdio.h stdlib.h string.h syslog.h unistd.h]) AC_CHECK_HEADERS(getopt.h,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([errno.h getopt.h pthread.h signal.h stdarg.h stdint.h strings.h]) AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h]) AC_CHECK_HEADERS([libxml/parser.h libxml/relaxng.h libxml/xmlreader.h libxml/xpath.h]) # checks for typedefs, structures, and compiler characteristics AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_TYPE_UINT16_T AC_MSG_CHECKING(for union semun) AC_TRY_COMPILE([#include #include #include ], [union semun arg;], [have_union_semun=1], [have_union_semun=0] ) if test $have_union_semun = 1; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun is defined]) else AC_MSG_RESULT(no) fi # pthread ACX_PTHREAD LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" # checks for library functions AC_CHECK_FUNCS([arc4random arc4random_uniform]) AC_CHECK_FUNCS([dup2 endpwent select strerror strtol]) AC_CHECK_FUNCS([getpass getpassphrase memset]) AC_CHECK_FUNCS([localtime_r memset strdup strerror strstr strtol strtoul]) AC_CHECK_FUNCS([setregid setreuid]) AC_CHECK_FUNCS([chown stat exit time atoi getpid waitpid sigfillset]) AC_CHECK_FUNCS([malloc calloc realloc free]) AC_CHECK_FUNCS([strlen strncmp strncat strncpy strerror strncasecmp strdup]) AC_CHECK_FUNCS([fgetc fopen fclose ferror fprintf vsnprintf snprintf fflush]) AC_CHECK_FUNCS([openlog closelog syslog]) AC_CHECK_FUNCS([openlog_r closelog_r syslog_r vsyslog_r]) AC_CHECK_FUNCS([chroot getgroups setgroups initgroups]) AC_CHECK_FUNCS([close unlink fcntl socket listen bzero]) AC_CHECK_FUNCS([va_start va_end]) AC_CHECK_FUNCS([xmlInitParser xmlCleanupParser xmlCleanupThreads]) AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock]) AC_CHECK_FUNCS([pthread_cond_init pthread_cond_signal pthread_cond_destroy pthread_cond_wait pthread_cond_timedwait]) AC_CHECK_FUNCS([pthread_create pthread_detach pthread_self pthread_join pthread_sigmask]) AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MKTIME AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_VPRINTF AC_REPLACE_FUNCS(strlcat) AC_REPLACE_FUNCS(strlcpy) AC_REPLACE_FUNCS(b64_pton) AC_REPLACE_FUNCS(b64_ntop) ACX_BROKEN_SETRES AC_CHECK_STRPTIME # check for some target-specific stuff case "$host" in *-*-darwin*) AC_DEFINE(SETEUID_BREAKS_SETUID, 1, [Define if your platform breaks doing a seteuid before a setuid]) AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken]) AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken]) ;; esac # check for the sockaddr_un.sun_len member AC_CHECK_MEMBER([struct sockaddr_un.sun_len], [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])], [], [ #include #include ]) # timeshift AC_ARG_ENABLE(timeshift, AC_HELP_STRING([--enable-timeshift], [Enable timeshift debug]), [enable_timeshift="${enableval}"], [enable_timeshift="no"]) AC_MSG_CHECKING(if we should enable timeshift debugging) if test "x${enable_timeshift}" = "xyes"; then AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(ENFORCER_TIMESHIFT, 1, [timeshift debug]) else AC_MSG_RESULT(no) fi # common dependencies ACX_LIBXML2 ACX_LDNS(1,6,12) ACX_LDNS_NOT(1,6,14, [binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html]) ACX_LDNS_NOT(1,6,15, [fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html]) ACX_PKCS11_MODULES ACX_RT ACX_LIBC ACX_SSL # libhsm ACX_DLOPEN AC_DEFINE_UNQUOTED([HSM_DEFAULT_CONFIG],["$OPENDNSSEC_CONFIG_FILE"],[Default configuration file.]) # enforcer AC_PATH_PROG(PERL, perl) if test -z "$PERL"; then AC_MSG_ERROR([perl not found]) fi ACX_DBPARAMS ACX_DATABASE_BACKEND ACX_CUNIT AC_DEFINE_UNQUOTED(SIGNER_CLI_UPDATE, "$OPENDNSSEC_SIGNER_CLI update", [Path to the OpenDNSSEC signer engine cli]) AM_CONDITIONAL([ENABLE_ENFORCER], [test "${enable_signer}" = "yes"]) # cunit AM_CONDITIONAL([WITH_CUNIT], [test "${with_cunit}" != "no" -a -n "$CUNIT_LIBS"]) # signer AC_ARG_ENABLE(signer, AC_HELP_STRING([--disable-signer], [Disable signer build (default enabled)]), [enable_signer="${enableval}"], [enable_signer="yes"]) AH_BOTTOM([ /* define before includes as it specifies what standard to use. */ #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \ || !defined (HAVE_CTIME_R_PROTO) \ || defined (STRPTIME_NEEDS_DEFINES) # ifndef _BSD_SOURCE # define _BSD_SOURCE 1 # endif # ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 # endif # ifndef _STDC_C99 # define _STDC_C99 1 # endif # ifndef _ALL_SOURCE # define _ALL_SOURCE 1 # endif #endif ]) AM_CONDITIONAL([ENABLE_SIGNER], [test "${enable_signer}" = "yes"]) # check for a green cucumber (but only if we can shift time) if test "x${enable_timeshift}" = "xyes"; then AC_PATH_PROG(CUCUMBER, cucumber) fi AM_CONDITIONAL([WITH_CUCUMBER], [test -x "${CUCUMBER}"]) # doxygen DX_PDF_FEATURE(OFF) DX_PS_FEATURE(OFF) DX_INIT_DOXYGEN(${PACKAGE_NAME}, [Doxyfile], [doxygen-doc]) AC_CONFIG_HEADER([common/config.h]) AC_CONFIG_FILES([ Makefile Doxyfile common/Makefile conf/Makefile conf/addns.xml conf/conf.xml conf/enforcerstate.xml conf/kasp.xml conf/signconf.xml conf/zonelist.xml enforcer/Makefile enforcer/common/Makefile enforcer/enforcerd/Makefile enforcer/enforcerd/ods-enforcerd.8 enforcer/ksm/Makefile enforcer/ksm/include/Makefile enforcer/ksm/include/ksm/Makefile enforcer/test/Makefile enforcer/test/cucumber/Makefile enforcer/test/cucumber/c_conf.xml enforcer/test/cucumber/c_kasp.xml enforcer/test/cucumber/c_zonelist.base.xml enforcer/test/cunit/Makefile enforcer/test/cunit/database_setup_mysql.sh enforcer/test/cunit/database_setup_sqlite3.sh enforcer/utils/Makefile enforcer/utils/ods-kaspcheck.1 enforcer/utils/ods-ksmutil.1 libhsm/Makefile libhsm/src/Makefile libhsm/src/bin/Makefile libhsm/src/bin/ods-hsmspeed.1 libhsm/src/bin/ods-hsmutil.1 libhsm/src/lib/Makefile libhsm/checks/Makefile libhsm/checks/conf-softhsm.xml libhsm/checks/conf-sca6000.xml libhsm/checks/conf-etoken.xml libhsm/checks/conf-multi.xml libhsm/checks/conf-opensc.xml libhsm/checks/conf-ncipher.xml libhsm/checks/conf-aepkeyper.xml signer/Makefile signer/man/Makefile signer/man/ods-getconf.8 signer/man/ods-signer.8 signer/man/ods-signerd.8 signer/src/Makefile tools/Makefile tools/ods-control tools/solaris/Makefile tools/solaris/ods-enforcerd.init tools/solaris/ods-signerd.init tools/ods-timing.5 tools/opendnssec.7 tools/ods-control.8 tools/ods-kasp2html ]) AC_OUTPUT opendnssec-1.4.9/missing0000755000175000017500000001533012650165764012224 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: opendnssec-1.4.9/install-sh0000755000175000017500000003546312650165764012642 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # 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 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 the last 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. -s $stripprog installed files. -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 " 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;; -s) stripcmd=$stripprog;; -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=$? 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; won't work # if double slashes aren't ignored. 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 dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # 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 case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. 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;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or 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=$dstdir/_inst.$$_ rmtmp=$dstdir/_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 && $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 # 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 -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: opendnssec-1.4.9/common/0000755000175000017500000000000012650166151012162 500000000000000opendnssec-1.4.9/common/Makefile.am0000644000175000017500000000024112650165732014137 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LIBRARIES = libcompat.a libcompat_a_SOURCES = strlcat.c strlcpy.c b64_ntop.c b64_pton.c pselect.c compat.h opendnssec-1.4.9/common/compat.h0000644000175000017500000000346612650165675013561 00000000000000/* * Copyright (c) 2010 .SE (The Internet Infrastructure Foundation). * 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 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. */ #include "config.h" #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz); #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); #endif #ifndef B64_PTON int b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize); #endif #ifndef B64_NTOP int b64_pton(char const *src, uint8_t *target, size_t targsize); #endif opendnssec-1.4.9/common/config.h.in0000644000175000017500000004163412650165763014145 00000000000000/* common/config.h.in. Generated from configure.ac by autoheader. */ /* Define if your setregid() is broken */ #undef BROKEN_SETREGID /* Define if your setresgid() is broken */ #undef BROKEN_SETRESGID /* Define if your setresuid() is broken */ #undef BROKEN_SETRESUID /* Define if your setreuid() is broken */ #undef BROKEN_SETREUID /* System cp(3) command */ #undef CP_COMMAND /* timeshift debug */ #undef ENFORCER_TIMESHIFT /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the `arc4random' function. */ #undef HAVE_ARC4RANDOM /* Define to 1 if you have the `arc4random_uniform' function. */ #undef HAVE_ARC4RANDOM_UNIFORM /* Define to 1 if you have the `atoi' function. */ #undef HAVE_ATOI /* Define to 1 if you have the `b64_ntop' function. */ #undef HAVE_B64_NTOP /* Define to 1 if you have the `b64_pton' function. */ #undef HAVE_B64_PTON /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if you have the `calloc' function. */ #undef HAVE_CALLOC /* Define to 1 if your system has a working `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if you have the `chroot' function. */ #undef HAVE_CHROOT /* Define if you have clock_gettime */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the `close' function. */ #undef HAVE_CLOSE /* Define to 1 if you have the `closelog' function. */ #undef HAVE_CLOSELOG /* Define to 1 if you have the `closelog_r' function. */ #undef HAVE_CLOSELOG_R /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have dlopen */ #undef HAVE_DLOPEN /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `EVP_sha1' function. */ #undef HAVE_EVP_SHA1 /* Define to 1 if you have the `EVP_sha256' function. */ #undef HAVE_EVP_SHA256 /* Define to 1 if you have the `exit' function. */ #undef HAVE_EXIT /* Define to 1 if you have the `fclose' function. */ #undef HAVE_FCLOSE /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `ferror' function. */ #undef HAVE_FERROR /* Define to 1 if you have the `fflush' function. */ #undef HAVE_FFLUSH /* Define to 1 if you have the `fgetc' function. */ #undef HAVE_FGETC /* Define to 1 if you have the `fopen' function. */ #undef HAVE_FOPEN /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `fprintf' function. */ #undef HAVE_FPRINTF /* Define to 1 if you have the `free' function. */ #undef HAVE_FREE /* Define to 1 if you have the `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getpass' function. */ #undef HAVE_GETPASS /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE /* Define to 1 if you have the `getpid' function. */ #undef HAVE_GETPID /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `cunit' library (-lcunit). */ #undef HAVE_LIBCUNIT /* Define to 1 if you have the `ldns' library (-lldns). */ #undef HAVE_LIBLDNS /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ #undef HAVE_LIBSQLITE3 /* Define to 1 if you have the `xml2' library (-lxml2). */ #undef HAVE_LIBXML2 /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_PARSER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_RELAXNG_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XMLREADER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XPATH_H /* Define to 1 if you have the `listen' function. */ #undef HAVE_LISTEN /* Define if you have LoadLibrary */ #undef HAVE_LOADLIBRARY /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MYSQL_H /* Define to 1 if you have the `openlog' function. */ #undef HAVE_OPENLOG /* Define to 1 if you have the `openlog_r' function. */ #undef HAVE_OPENLOG_R /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the `pthread_cond_destroy' function. */ #undef HAVE_PTHREAD_COND_DESTROY /* Define to 1 if you have the `pthread_cond_init' function. */ #undef HAVE_PTHREAD_COND_INIT /* Define to 1 if you have the `pthread_cond_signal' function. */ #undef HAVE_PTHREAD_COND_SIGNAL /* Define to 1 if you have the `pthread_cond_timedwait' function. */ #undef HAVE_PTHREAD_COND_TIMEDWAIT /* Define to 1 if you have the `pthread_cond_wait' function. */ #undef HAVE_PTHREAD_COND_WAIT /* Define to 1 if you have the `pthread_create' function. */ #undef HAVE_PTHREAD_CREATE /* Define to 1 if you have the `pthread_detach' function. */ #undef HAVE_PTHREAD_DETACH /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `pthread_join' function. */ #undef HAVE_PTHREAD_JOIN /* Define to 1 if you have the `pthread_mutex_destroy' function. */ #undef HAVE_PTHREAD_MUTEX_DESTROY /* Define to 1 if you have the `pthread_mutex_init' function. */ #undef HAVE_PTHREAD_MUTEX_INIT /* Define to 1 if you have the `pthread_mutex_lock' function. */ #undef HAVE_PTHREAD_MUTEX_LOCK /* Define to 1 if you have the `pthread_mutex_unlock' function. */ #undef HAVE_PTHREAD_MUTEX_UNLOCK /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the `pthread_self' function. */ #undef HAVE_PTHREAD_SELF /* Define to 1 if you have the `pthread_sigmask' function. */ #undef HAVE_PTHREAD_SIGMASK /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setgroups' function. */ #undef HAVE_SETGROUPS /* Define to 1 if you have the `setregid' function. */ #undef HAVE_SETREGID /* 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 `sigfillset' function. */ #undef HAVE_SIGFILLSET /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Have the sockaddr_un.sun_len member. */ #undef HAVE_SOCKADDR_SUN_LEN /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_SQLITE3_H /* Define if you have the SSL libraries installed. */ #undef HAVE_SSL /* Define to 1 if you have the `stat' function. */ #undef HAVE_STAT /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* 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 `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* 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 `strlen' function. */ #undef HAVE_STRLEN /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strncat' function. */ #undef HAVE_STRNCAT /* Define to 1 if you have the `strncmp' function. */ #undef HAVE_STRNCMP /* Define to 1 if you have the `strncpy' function. */ #undef HAVE_STRNCPY /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the `syslog_r' function. */ #undef HAVE_SYSLOG_R /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_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_WAIT_H /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* union semun is defined */ #undef HAVE_UNION_SEMUN /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlink' function. */ #undef HAVE_UNLINK /* Define to 1 if you have the `va_end' function. */ #undef HAVE_VA_END /* Define to 1 if you have the `va_start' function. */ #undef HAVE_VA_START /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `vsyslog_r' function. */ #undef HAVE_VSYSLOG_R /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the `xmlCleanupParser' function. */ #undef HAVE_XMLCLEANUPPARSER /* Define to 1 if you have the `xmlCleanupThreads' function. */ #undef HAVE_XMLCLEANUPTHREADS /* Define to 1 if you have the `xmlInitParser' function. */ #undef HAVE_XMLINITPARSER /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Default configuration file. */ #undef HSM_DEFAULT_CONFIG /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Path to the OpenDNSSEC ods-control binary */ #undef ODS_EN_CONTROL /* Path to the OpenDNSSEC kaspcheck binary */ #undef ODS_EN_KASPCHECK /* Command to send a SIGHUP to the ods-enforcerd process */ #undef ODS_EN_NOTIFY /* Path to the OpenDNSSEC config file */ #undef ODS_SE_CFGFILE /* Path to the OpenDNSSEC signer client binary */ #undef ODS_SE_CLI /* Path to the OpenDNSSEC signer engine binary */ #undef ODS_SE_ENGINE /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V1 /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V2 /* File magic for storing backups from the OpenDNSSEC signer engine */ #undef ODS_SE_FILE_MAGIC_V3 /* Maximum line length that the OpenDNSSEC signer client can handle */ #undef ODS_SE_MAXLINE /* Number of seconds the OpenDNSSEC signer engine should backoff when a task failed */ #undef ODS_SE_MAX_BACKOFF /* Path to the OpenDNSSEC signer engine pid file */ #undef ODS_SE_PIDFILE /* Path to the OpenDNSSEC data files */ #undef ODS_SE_RNGDIR /* Path to the OpenDNSSEC signer engine socket file */ #undef ODS_SE_SOCKFILE /* Shutdown message for the OpenDNSSEC signer client */ #undef ODS_SE_STOP_RESPONSE /* Default verbosity */ #undef ODS_SE_VERBOSITY /* Path to the OpenDNSSEC signer engine working directory */ #undef ODS_SE_WORKDIR /* Default number of worker threads for the OpenDNSSEC signer engine */ #undef ODS_SE_WORKERTHREADS /* Path to the OpenDNSSEC signer engine pid file */ #undef ODS_ZF_PIDFILE /* Path to the OpenDNSSEC configuration files */ #undef OPENDNSSEC_CONFIG_DIR /* Path to the main OpenDNSSEC configuration file */ #undef OPENDNSSEC_CONFIG_FILE /* Path to the OpenDNSSEC enforcer pid file */ #undef OPENDNSSEC_ENFORCER_PIDFILE /* Path to the OpenDNSSEC zone fetcher pid file */ #undef OPENDNSSEC_FETCH_PIDFILE /* Path to the OpenDNSSEC data files */ #undef OPENDNSSEC_SCHEMA_DIR /* Path to the OpenDNSSEC signer cli */ #undef OPENDNSSEC_SIGNER_CLI /* Path to the OpenDNSSEC signer engine */ #undef OPENDNSSEC_SIGNER_ENGINE /* Path to the OpenDNSSEC signer pid file */ #undef OPENDNSSEC_SIGNER_PIDFILE /* Path to the OpenDNSSEC signer socket */ #undef OPENDNSSEC_SIGNER_SOCKET /* Path to the OpenDNSSEC var directory */ #undef OPENDNSSEC_STATE_DIR /* 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 /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define if your platform breaks doing a seteuid before a setuid */ #undef SETEUID_BREAKS_SETUID /* Path to the OpenDNSSEC signer engine cli */ #undef SIGNER_CLI_UPDATE /* database binary */ #undef SQL_BIN /* database setup script */ #undef SQL_SETUP /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* strptime is available from time.h with some defines. */ #undef STRPTIME_NEEDS_DEFINES /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `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 as `fork' if `vfork' does not work. */ #undef vfork /* define before includes as it specifies what standard to use. */ #if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \ || !defined (HAVE_CTIME_R_PROTO) \ || defined (STRPTIME_NEEDS_DEFINES) # ifndef _BSD_SOURCE # define _BSD_SOURCE 1 # endif # ifndef __EXTENSIONS__ # define __EXTENSIONS__ 1 # endif # ifndef _STDC_C99 # define _STDC_C99 1 # endif # ifndef _ALL_SOURCE # define _ALL_SOURCE 1 # endif #endif opendnssec-1.4.9/common/strlcat.c0000644000175000017500000000357412650165675013745 00000000000000/* $OpenBSD: strlcat.c,v 1.11 2005/11/10 05:18:56 dtucker 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. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */ #include "config.h" #ifndef HAVE_STRLCAT #include #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NULL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } #endif /* !HAVE_STRLCAT */ opendnssec-1.4.9/common/b64_pton.c0000644000175000017500000002622012650165675013715 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM 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. */ /* * 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. */ #include #include #include #include #include #include #include #include #include #include #define Assert(Cond) if (!(Cond)) abort() static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ /* skips all whitespace anywhere. converts characters, four at a time, starting at (or after) src from base - 64 numbers into three 8 bit bytes in the target area. it returns the number of data bytes stored at the target, or -1 on error. */ static int b64rmap_initialized = 0; static uint8_t b64rmap[256]; static const uint8_t b64rmap_special = 0xf0; static const uint8_t b64rmap_end = 0xfd; static const uint8_t b64rmap_space = 0xfe; static const uint8_t b64rmap_invalid = 0xff; /** * Initializing the reverse map is not thread safe. * Which is fine for NSD. For now... **/ static void b64_initialize_rmap () { int i; char ch; /* Null: end of string, stop parsing */ b64rmap[0] = b64rmap_end; for (i = 1; i < 256; ++i) { ch = (char)i; /* Whitespaces */ if (isspace(ch)) b64rmap[i] = b64rmap_space; /* Padding: stop parsing */ else if (ch == Pad64) b64rmap[i] = b64rmap_end; /* Non-base64 char */ else b64rmap[i] = b64rmap_invalid; } /* Fill reverse mapping for base64 chars */ for (i = 0; Base64[i] != '\0'; ++i) b64rmap[(uint8_t)Base64[i]] = i; b64rmap_initialized = 1; } static int b64_pton_do(char const *src, uint8_t *target, size_t targsize) { int tarindex, state, ch; uint8_t ofs; state = 0; tarindex = 0; while (1) { ch = *src++; ofs = b64rmap[ch]; if (ofs >= b64rmap_special) { /* Ignore whitespaces */ if (ofs == b64rmap_space) continue; /* End of base64 characters */ if (ofs == b64rmap_end) break; /* A non-base64 character. */ return (-1); } switch (state) { case 0: if ((size_t)tarindex >= targsize) return (-1); target[tarindex] = ofs << 2; state = 1; break; case 1: if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= ofs >> 4; target[tarindex+1] = (ofs & 0x0f) << 4 ; tarindex++; state = 2; break; case 2: if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= ofs >> 2; target[tarindex+1] = (ofs & 0x03) << 6; tarindex++; state = 3; break; case 3: if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= ofs; tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = *src++; /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) return (-1); /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (target[tarindex] != 0) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } static int b64_pton_len(char const *src) { int tarindex, state, ch; uint8_t ofs; state = 0; tarindex = 0; while (1) { ch = *src++; ofs = b64rmap[ch]; if (ofs >= b64rmap_special) { /* Ignore whitespaces */ if (ofs == b64rmap_space) continue; /* End of base64 characters */ if (ofs == b64rmap_end) break; /* A non-base64 character. */ return (-1); } switch (state) { case 0: state = 1; break; case 1: tarindex++; state = 2; break; case 2: tarindex++; state = 3; break; case 3: tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = *src++; /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = *src++; /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; ch != '\0'; ch = *src++) if (b64rmap[ch] != b64rmap_space) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } int b64_pton(char const *src, uint8_t *target, size_t targsize) { if (!b64rmap_initialized) b64_initialize_rmap (); if (target) return b64_pton_do (src, target, targsize); else return b64_pton_len (src); } opendnssec-1.4.9/common/strlcpy.c0000644000175000017500000000342712650165675013766 00000000000000/* $OpenBSD: strlcpy.c,v 1.10 2005/11/10 05:26:17 dtucker 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. */ /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ #include "config.h" #ifndef HAVE_STRLCPY #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } #endif /* !HAVE_STRLCPY */ opendnssec-1.4.9/common/b64_ntop.c0000644000175000017500000001626312650165675013723 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * 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 INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM 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. */ /* * 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. */ #include #include #include #include #include #include #include #include #include #include #define Assert(Cond) if (!(Cond)) abort() static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) The following encoding technique is taken from RFC 1521 by Borenstein and Freed. It is reproduced here in a slightly edited form for convenience. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a quantity. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. */ int b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) { size_t datalength = 0; uint8_t input[3]; uint8_t output[4]; size_t i; while (2 < srclength) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclength -= 3; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = input[2] & 0x3f; Assert(output[0] < 64); Assert(output[1] < 64); Assert(output[2] < 64); Assert(output[3] < 64); if (datalength + 4 > targsize) return (-1); target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; target[datalength++] = Base64[output[2]]; target[datalength++] = Base64[output[3]]; } /* Now we worry about padding. */ if (0 != srclength) { /* Get what's left. */ input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclength; i++) input[i] = *src++; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); Assert(output[0] < 64); Assert(output[1] < 64); Assert(output[2] < 64); if (datalength + 4 > targsize) return (-1); target[datalength++] = Base64[output[0]]; target[datalength++] = Base64[output[1]]; if (srclength == 1) target[datalength++] = Pad64; else target[datalength++] = Base64[output[2]]; target[datalength++] = Pad64; } if (datalength >= targsize) return (-1); target[datalength] = '\0'; /* Returned value doesn't count \0. */ return (datalength); } opendnssec-1.4.9/common/pselect.c0000644000175000017500000000204512650165675013720 00000000000000/* * Copyright (c) 2001-2011, NLnet Labs. All rights reserved. * * Like select(2) but set the signals to block while waiting in * select. This version is not entirely race condition safe. Only * operating system support can make it so. */ #include #include #include #ifdef HAVE_SYS_SELECT_H #include #endif #include #include int pselect (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask) { int result; sigset_t saved_sigmask; struct timeval saved_timeout; if (sigmask && sigprocmask(SIG_SETMASK, sigmask, &saved_sigmask) == -1) return -1; if (timeout) { saved_timeout.tv_sec = timeout->tv_sec; saved_timeout.tv_usec = timeout->tv_nsec / 1000; result = select(n, readfds, writefds, exceptfds, &saved_timeout); } else { result = select(n, readfds, writefds, exceptfds, NULL); } if (sigmask && sigprocmask(SIG_SETMASK, &saved_sigmask, NULL) == -1) return -1; return result; } opendnssec-1.4.9/common/Makefile.in0000644000175000017500000005267212650165764014174 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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 = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libcompat_a_AR = $(AR) $(ARFLAGS) libcompat_a_LIBADD = am_libcompat_a_OBJECTS = strlcat.$(OBJEXT) strlcpy.$(OBJEXT) \ b64_ntop.$(OBJEXT) b64_pton.$(OBJEXT) pselect.$(OBJEXT) libcompat_a_OBJECTS = $(am_libcompat_a_OBJECTS) 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@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 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 = 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 = $(libcompat_a_SOURCES) DIST_SOURCES = $(libcompat_a_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)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)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LIBRARIES = libcompat.a libcompat_a_SOURCES = strlcat.c strlcpy.c b64_ntop.c b64_pton.c pselect.c compat.h all: config.h $(MAKE) $(AM_MAKEFLAGS) 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 common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): 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 common/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 clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcompat.a: $(libcompat_a_OBJECTS) $(libcompat_a_DEPENDENCIES) $(EXTRA_libcompat_a_DEPENDENCIES) $(AM_V_at)-rm -f libcompat.a $(AM_V_AR)$(libcompat_a_AR) libcompat.a $(libcompat_a_OBJECTS) $(libcompat_a_LIBADD) $(AM_V_at)$(RANLIB) libcompat.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b64_ntop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b64_pton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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: $(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 $(LIBRARIES) config.h installdirs: 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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr 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-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 -rf ./$(DEPDIR) -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: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-hdr 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ 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: opendnssec-1.4.9/depcomp0000755000175000017500000005601612650165765012211 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: opendnssec-1.4.9/libhsm/0000755000175000017500000000000012650166151012150 500000000000000opendnssec-1.4.9/libhsm/Makefile.am0000644000175000017500000000045412650165675014141 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src checks doxygen: rm -fr $(top_builddir)/libhsm/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-libhsm" \ SRCDIR=$(top_srcdir)/libhsm \ OUTPUTDIR=$(top_builddir)/libhsm/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) opendnssec-1.4.9/libhsm/src/0000755000175000017500000000000012650166151012737 500000000000000opendnssec-1.4.9/libhsm/src/bin/0000755000175000017500000000000012650166151013507 500000000000000opendnssec-1.4.9/libhsm/src/bin/hsmtest.h0000644000175000017500000000261512650165675015305 00000000000000/* * Copyright (c) 2009 Nominet UK. * 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 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. */ #ifndef HSMTEST_H #define HSMTEST_H 1 int hsm_test (const char *repository); #endif /* HSMTEST_H */ opendnssec-1.4.9/libhsm/src/bin/Makefile.am0000644000175000017500000000107512650165732015472 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../lib \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 bin_PROGRAMS = ods-hsmutil ods-hsmspeed man1_MANS = ods-hsmutil.1 ods-hsmspeed.1 ods_hsmutil_SOURCES = hsmutil.c hsmtest.c hsmtest.h ods_hsmutil_LDADD = ../lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) ods_hsmspeed_SOURCES = hsmspeed.c ods_hsmspeed_LDADD = ../lib/libhsm.a -lpthread @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) opendnssec-1.4.9/libhsm/src/bin/hsmtest.c0000644000175000017500000002106212650165732015267 00000000000000/* * Copyright (c) 2009 Nominet UK. * 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 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. */ #include "config.h" #include "hsmtest.h" #include #include #include #include #include #include static int hsm_test_sign (hsm_ctx_t *ctx, hsm_key_t *key, ldns_algorithm alg) { int result; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "example.com. IN A 192.168.0.1", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "example.com. IN A 192.168.0.2", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = alg; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "example.com."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); sig = hsm_sign_rrset(ctx, rrset, key, sign_params); if (sig) { result = 0; ldns_rr_free(sig); } else { result = 1; } ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); return result; } static int hsm_test_random() { hsm_ctx_t *ctx = NULL; int result; unsigned char rnd_buf[1024]; uint32_t r32; uint64_t r64; printf("Generating %lu bytes of random data... ", (unsigned long) sizeof(rnd_buf)); result = hsm_random_buffer(ctx, rnd_buf, sizeof(rnd_buf)); if (result) { printf("Failed, error: %d\n", result); hsm_print_error(ctx); return 1; } else { printf("OK\n"); } printf("Generating 32-bit random data... "); r32 = hsm_random32(ctx); printf("%u\n", r32); printf("Generating 64-bit random data... "); r64 = hsm_random64(ctx); printf("%llu\n", (long long unsigned int)r64); return 0; } int hsm_test (const char *repository) { int result; const unsigned int rsa_keysizes[] = { 512, 768, 1024, 1536, 2048, 4096 }; const unsigned int dsa_keysizes[] = { 512, 768, 1024 }; unsigned int keysize; hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; char *id; int errors = 0; unsigned int i = 0; /* Check for repository before starting any tests */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<(sizeof(rsa_keysizes)/sizeof(unsigned int)); i++) { keysize = rsa_keysizes[i]; printf("Generating %d-bit RSA key... ", keysize); key = hsm_generate_rsa_key(ctx, repository, keysize); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (RSA/SHA1) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA1); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Signing (RSA/SHA256) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA256); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } if ( keysize >= 1024) { printf("Signing (RSA/SHA512) with key... "); result = hsm_test_sign(ctx, key, LDNS_RSASHA512); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<(sizeof(dsa_keysizes)/sizeof(unsigned int)); i++) { keysize = dsa_keysizes[i]; printf("Generating %d-bit DSA key... ", keysize); key = hsm_generate_dsa_key(ctx, repository, keysize); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (DSA/SHA1) with key... "); result = hsm_test_sign(ctx, key, LDNS_DSA); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } /* * Test key generation, signing and deletion for a number of key size */ for (i=0; i<1; i++) { printf("Generating 512-bit GOST key... "); key = hsm_generate_gost_key(ctx, repository); if (!key) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); continue; } else { printf("OK\n"); } printf("Extracting key identifier... "); id = hsm_get_key_id(ctx, key); if (!id) { errors++; printf("Failed\n"); hsm_print_error(ctx); printf("\n"); } else { printf("OK, %s\n", id); } free(id); printf("Signing (GOST) with key... "); result = hsm_test_sign(ctx, key, LDNS_ECC_GOST); if (result) { errors++; printf("Failed, error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } printf("Deleting key... "); result = hsm_remove_key(ctx, key); if (result) { errors++; printf("Failed: error: %d\n", result); hsm_print_error(ctx); } else { printf("OK\n"); } free(key); printf("\n"); } if (hsm_test_random()) { errors++; } return errors; } opendnssec-1.4.9/libhsm/src/bin/ods-hsmutil.1.in0000644000175000017500000000447212650165732016401 00000000000000.TH "ods-hsmutil" "1" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-hsmutil" .SH "NAME" .LP .B ods\-hsmutil \- OpenDNSSEC HSM utility .SH "SYNOPSIS" .LP .B ods\-hsmutil .RB [ \-c .IR config ] .RB [ \-v ] .B command .RB [ options ] .SH "DESCRIPTION" .LP The ods\-hsmutil utility is mainly used for debugging or testing. It is designed to interact directly with your HSM and can be used to manually list, create or delete keys. It can also be used to perform a set of basics HSM tests. Be careful before creating or deleting keys using ods\-hsmutil, as the changes are not synchronized with the KASP Enforcer. The repositories are configured by the user in the OpenDNSSEC configuration file. The configuration contains the name of the repository, the token label, the user PIN, and the path to its shared library. .SH "COMMANDS" .LP .TP \fBlogin\fR If there is no PIN in conf.xml, then this command will ask for it and login. The PINs are stored in a shared memory and are accessible to the other daemons. .TP \fBlogout\fR Will erase the semaphore and the shared memory containing any credentials. Authenticated processes will still be able to interact with the HSM. .TP \fBlist\fR [\fIrepository\fR] List the keys that are available in all or one \fIrepository\fR .TP \fBgenerate\fR \fIrepository\fR \fBrsa\fR \fIkeysize\fR Generate a new RSA key with the given \fIkeysize\fR in the \fIrepository\fR .TP \fBremove\fR \fIid\fR Delete the key with the given \fIid\fR .TP \fBpurge\fR \fIrepository\fR Delete all keys in one \fIrepository\fR .TP \fBdnskey\fR \fIid\fR \fIname\fR Create a DNSKEY RR for the given owner \fIname\fR based on the key with this \fIid\fR .TP \fBtest\fR \fIrepository\fR Perform a number of tests on a \fIrepository\fR .TP \fBinfo\fR Show detailed information about all repositories .SH "OPTIONS" .LP .TP \fB\-c\fR \fIconfig\fR Path to an OpenDNSSEC configuration file (defaults to @OPENDNSSEC_CONFIG_FILE@) .TP \fB\-h\fR Show the help screen .TP \fB\-v\fR Output more information by increasing the verbosity level .SH "SEE ALSO" .LP ods\-auditor(1), ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-hsmutil was written by Jakob Schlyter as part of the OpenDNSSEC project. opendnssec-1.4.9/libhsm/src/bin/hsmspeed.c0000644000175000017500000001756712650165732015427 00000000000000/* * Copyright (c) 2009 Nominet UK. * 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 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. */ #include "config.h" #include #include #include #include #include #include #include #define HSMSPEED_THREADS_MAX 2048 /* Algorithm identifier and name */ ldns_algorithm algorithm = LDNS_RSASHA1; const char *algoname = "RSA/SHA1"; extern char *optarg; char *progname = NULL; typedef struct { unsigned int id; hsm_ctx_t *ctx; hsm_key_t *key; unsigned int iterations; } sign_arg_t; void usage () { fprintf(stderr, "usage: %s " "[-c config] -r repository [-i iterations] [-s keysize] [-t threads]\n", progname); } void * sign (void *arg) { hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; size_t i; unsigned int iterations = 0; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; sign_arg_t *sign_arg = arg; ctx = sign_arg->ctx; key = sign_arg->key; iterations = sign_arg->iterations; fprintf(stderr, "Signer thread #%d started...\n", sign_arg->id); /* Prepare dummy RRset for signing */ rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 123.123.123.123", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 124.124.124.124", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = algorithm; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "opendnssec.se."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); /* Do some signing */ for (i=0; ierror_message, ctx->error_action ); break; } ldns_rr_free(sig); } /* Clean up */ ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); hsm_destroy_context(ctx); fprintf(stderr, "Signer thread #%d done.\n", sign_arg->id); pthread_exit(NULL); return NULL; } int main (int argc, char *argv[]) { int result; hsm_ctx_t *ctx = NULL; hsm_key_t *key = NULL; unsigned int keysize = 1024; unsigned int iterations = 1; unsigned int threads = 1; static struct timeval start,end; char *config = NULL; const char *repository = NULL; sign_arg_t sign_arg_array[HSMSPEED_THREADS_MAX]; pthread_t thread_array[HSMSPEED_THREADS_MAX]; pthread_attr_t thread_attr; void *thread_status; int ch; unsigned int n; double elapsed, speed; progname = argv[0]; while ((ch = getopt(argc, argv, "c:i:r:s:t:")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'i': iterations = atoi(optarg); break; case 'r': repository = strdup(optarg); break; case 's': keysize = atoi(optarg); break; case 't': threads = atoi(optarg); break; default: usage(); exit(1); } } if (!repository) { usage(); exit(1); } if (threads > HSMSPEED_THREADS_MAX) { fprintf(stderr, "Number of threads specified over max, force using %d threads!\n", HSMSPEED_THREADS_MAX); threads = HSMSPEED_THREADS_MAX; } #if 0 if (!config) { usage(); exit(1); } #endif /* Open HSM library */ fprintf(stderr, "Opening HSM Library...\n"); result = hsm_open(config, hsm_prompt_pin); if (result) { fprintf(stderr, "hsm_open() returned %d\n", result); exit(-1); } /* Create HSM context */ ctx = hsm_create_context(); if (! ctx) { fprintf(stderr, "hsm_create_context() returned error\n"); exit(-1); } /* Generate a temporary key */ fprintf(stderr, "Generating temporary key...\n"); key = hsm_generate_rsa_key(ctx, repository, keysize); if (key) { char *id = hsm_get_key_id(ctx, key); fprintf(stderr, "Temporary key created: %s\n", id); free(id); } else { fprintf(stderr, "Could not generate a key pair in repository \"%s\"\n", repository); exit(-1); } /* Prepare threads */ pthread_attr_init(&thread_attr); pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); for (n=0; n 1 ? "threads" : "thread")); gettimeofday(&start, NULL); /* Create threads for signing */ for (n=0; n 1 ? "threads" : "thread"), iterations, speed, keysize); /* Delete temporary key */ fprintf(stderr, "Deleting temporary key...\n"); result = hsm_remove_key(ctx, key); if (result) { fprintf(stderr, "hsm_remove_key() returned %d\n", result); exit(-1); } /* Clean up */ hsm_destroy_context(ctx); (void) hsm_close(); if (config) free(config); return 0; } opendnssec-1.4.9/libhsm/src/bin/ods-hsmspeed.1.in0000644000175000017500000000355412650165675016532 00000000000000.TH "ods-hsmspeed" "1" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-hsmspeed" .SH "NAME" .LP .B ods\-hsmspeed \- OpenDNSSEC HSM speed tester .SH "SYNOPSIS" .LP .B ods\-hsmspeed .RB [ \-c .IR config ] .B \-r .I repository .RB [ \-i .IR iterations ] .RB [ \-s .IR keysize ] .RB [ \-t .IR threads ] .SH "DESCRIPTION" .LP The ods\-hsmspeed utility is part of OpenDNSSEC and can be used to test the performance of the configured HSMs. The components of OpenDNSSEC do not talk directly to the HSMs, but uses an internal library called libhsm. It then talks to the HSMs using PKCS#11. The libhsm simplifies the process of creating keys and signatures for the other components of OpenDNSSEC. ods\-hsmspeed will measure the speed by using the libhsm. The result that you get is somewhat lower than what the manufactures promises, because the libhsm creates some overhead to the pure PKCS#11 environment. .SH "OPTIONS" .LP .TP \fB\-c\fR \fIconfig\fR Path to an OpenDNSSEC configuration file. (defaults to @OPENDNSSEC_CONFIG_FILE@) .TP \fB\-i\fR \fIiterations\fR Specify the number of \fIiterations\fR for signing an RRset. A higher number of iterations will increase the performance. (defaults to 1 iteration) .TP \fB\-r\fR \fIrepository\fR The speed test will be performed on this \fIrepository\fR. .TP \fB\-s\fR \fIkeysize\fR A temporary RSA key with the given \fIkeysize\fR will be used for signing. (defaults to 1024 bit) .TP \fB\-t\fR \fIthreads\fR The number of \fIthreads\fR to use. Most HSMs will be utilized better with multiple threads. (defaults to 1 thread) .SH "SEE ALSO" .LP ods\-auditor(1), ods\-control(8), ods\-enforcerd(8), ods\-hsmutil(1), ods\-kaspcheck(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-hsmspeed was written by Jakob Schlyter and Nominet as part of the OpenDNSSEC project. opendnssec-1.4.9/libhsm/src/bin/hsmutil.c0000644000175000017500000002746212650165732015277 00000000000000/* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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 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. */ #include "config.h" #include "hsmtest.h" #include #include #include #include #include #include #include extern char *optarg; char *progname = NULL; unsigned int verbose = 0; void version () { fprintf(stderr, "%s (%s) version %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); } void usage () { fprintf(stderr, "usage: %s [-c config] [-vV] command [options]\n", progname); fprintf(stderr," login\n"); fprintf(stderr," logout\n"); fprintf(stderr," list [repository]\n"); fprintf(stderr," generate rsa \n"); fprintf(stderr," remove \n"); fprintf(stderr," purge \n"); fprintf(stderr," dnskey \n"); fprintf(stderr," test \n"); fprintf(stderr," info\n"); #if 0 fprintf(stderr," debug\n"); #endif } int cmd_login () { printf("The tokens are now logged in.\n"); return 0; } int cmd_logout () { if (hsm_logout_pin() != HSM_OK) { printf("Failed to erase the credentials.\n"); hsm_print_error(NULL); return 1; } printf("The credentials has been erased.\n"); return 0; } int cmd_list (int argc, char *argv[]) { size_t i; char *repository = NULL; size_t key_count = 0; size_t key_count_valid = 0; hsm_key_t **keys; hsm_ctx_t *ctx = NULL; const char *key_info_format = "%-20s %-32s %-10s\n"; if (argc) { repository = strdup(argv[0]); argc--; argv++; /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } fprintf(stdout, "\nListing keys in repository: %s\n", repository); keys = hsm_list_keys_repository(NULL, &key_count, repository); } else { fprintf(stdout, "\nListing keys in all repositories.\n"); keys = hsm_list_keys(NULL, &key_count); } fprintf(stdout, "%u %s found.\n\n", (unsigned int) key_count, (key_count > 1 || key_count == 0 ? "keys" : "key")); if (!keys) { return -1; } /* print fancy header */ fprintf(stdout, key_info_format, "Repository", "ID", "Type"); fprintf(stdout, key_info_format, "----------", "--", "----"); for (i = 0; i < key_count; i++) { hsm_key_info_t *key_info; hsm_key_t *key = NULL; char key_type[HSM_MAX_ALGONAME + 8]; char *key_id = NULL; key = keys[i]; if (key == NULL) { /* Skip NULL key for now */ continue; } key_count_valid++; key_info = hsm_get_key_info(NULL, key); if (key_info) { snprintf(key_type, sizeof(key_type), "%s/%lu", key_info->algorithm_name, key_info->keysize); key_id = key_info->id; } else { snprintf(key_type, sizeof(key_type), "UNKNOWN"); key_id = "UNKNOWN"; } printf(key_info_format, key->module->name, key_id, key_type); hsm_key_info_free(key_info); } hsm_key_list_free(keys, key_count); if (key_count != key_count_valid) { size_t invalid_keys; invalid_keys = key_count - key_count_valid; printf("\n"); fprintf(stderr, "Warning: %u %s not usable by OpenDNSSEC was found.\n", (unsigned int) invalid_keys, invalid_keys > 1 ? "keys" : "key"); } return 0; } int cmd_generate (int argc, char *argv[]) { char *repository = NULL; char *algorithm = NULL; unsigned int keysize = 1024; hsm_key_t *key = NULL; hsm_ctx_t *ctx = NULL; if (argc != 3) { usage(); return -1; } repository = strdup(argv[0]); /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } algorithm = argv[1]; keysize = atoi(argv[2]); if (!strcasecmp(algorithm, "rsa")) { printf("Generating %d bit RSA key in repository: %s\n", keysize, repository); key = hsm_generate_rsa_key(NULL, repository, keysize); if (key) { hsm_key_info_t *key_info; key_info = hsm_get_key_info(NULL, key); printf("Key generation successful: %s\n", key_info ? key_info->id : "NULL"); hsm_key_info_free(key_info); if (verbose) hsm_print_key(key); hsm_key_free(key); } else { printf("Key generation failed.\n"); return -1; } } else { printf("Unknown algorithm: %s\n", algorithm); return -1; } return 0; } int cmd_remove (int argc, char *argv[]) { char *id; int result; hsm_key_t *key = NULL; if (argc != 1) { usage(); return -1; } id = strdup(argv[0]); key = hsm_find_key_by_id(NULL, id); if (!key) { printf("Key not found: %s\n", id); return -1; } result = hsm_remove_key(NULL, key); if (!result) { printf("Key remove successful.\n"); } else { printf("Key remove failed.\n"); } hsm_key_free(key); return result; } int cmd_purge (int argc, char *argv[]) { int result; int final_result = 0; char *fresult; size_t i; char *repository = NULL; char confirm[16]; size_t key_count = 0; hsm_key_t **keys; hsm_ctx_t *ctx = NULL; if (argc != 1) { usage(); return -1; } repository = strdup(argv[0]); argc--; argv++; /* Check for repository before starting using it */ if (hsm_token_attached(ctx, repository) == 0) { hsm_print_error(ctx); return 1; } printf("Purging all keys from repository: %s\n", repository); keys = hsm_list_keys_repository(NULL, &key_count, repository); printf("%u %s found.\n\n", (unsigned int) key_count, (key_count > 1 || key_count == 0 ? "keys" : "key")); if (!keys) { return -1; } if (key_count == 0) { return -1; } printf("Are you sure you want to remove ALL keys from repository %s ? (YES/NO) ", repository); fresult = fgets(confirm, sizeof(confirm) - 1, stdin); if (fresult == NULL || strncasecmp(confirm, "yes", 3) != 0) { printf("\nPurge cancelled.\n"); hsm_key_list_free(keys, key_count); return -1; } else { printf("\nStarting purge...\n"); } for (i = 0; i < key_count; i++) { hsm_key_info_t *key_info; hsm_key_t *key = keys[i]; key_info = hsm_get_key_info(NULL, key); result = hsm_remove_key(NULL, key); if (!result) { printf("Key remove successful: %s\n", key_info ? key_info->id : "NULL"); } else { printf("Key remove failed: %s\n", key_info ? key_info->id : "NULL"); final_result++; } hsm_key_info_free(key_info); } hsm_key_list_free(keys, key_count); printf("Purge done.\n"); return final_result; } int cmd_dnskey (int argc, char *argv[]) { char *id; char *name; hsm_key_t *key = NULL; ldns_rr *dnskey_rr; hsm_sign_params_t *sign_params; if (argc != 2) { usage(); return -1; } id = strdup(argv[0]); name = strdup(argv[1]); key = hsm_find_key_by_id(NULL, id); if (!key) { printf("Key not found: %s\n", id); free(name); free(id); return -1; } sign_params = hsm_sign_params_new(); sign_params->algorithm = LDNS_RSASHA1; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, name); dnskey_rr = hsm_get_dnskey(NULL, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); ldns_rr_print(stdout, dnskey_rr); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); hsm_key_free(key); free(name); free(id); return 0; } int cmd_test (int argc, char *argv[]) { char *repository = NULL; if (argc) { repository = strdup(argv[0]); argc--; argv++; printf("Testing repository: %s\n\n", repository); return hsm_test(repository); } else { usage(); } return 0; } int cmd_info () { hsm_print_tokeninfo(NULL); return 0; } int cmd_debug () { hsm_print_ctx(NULL); return 0; } int main (int argc, char *argv[]) { int result; char *config = NULL; int ch; progname = argv[0]; while ((ch = getopt(argc, argv, "c:vVh")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'v': verbose++; break; case 'V': version(); exit(0); break; case 'h': usage(); exit(0); break; default: usage(); exit(1); } } argc -= optind; argv += optind; if (!argc) { usage(); exit(1); } if (!strcasecmp(argv[0], "logout")) { if (config) free(config); exit(cmd_logout()); } result = hsm_open(config, hsm_prompt_pin); if (result) { hsm_print_error(NULL); exit(-1); } openlog("hsmutil", LOG_PID, LOG_USER); if (!strcasecmp(argv[0], "login")) { argc --; argv ++; result = cmd_login(); } else if (!strcasecmp(argv[0], "list")) { argc --; argv ++; result = cmd_list(argc, argv); } else if (!strcasecmp(argv[0], "generate")) { argc --; argv ++; result = cmd_generate(argc, argv); } else if (!strcasecmp(argv[0], "remove")) { argc --; argv ++; result = cmd_remove(argc, argv); } else if (!strcasecmp(argv[0], "purge")) { argc --; argv ++; result = cmd_purge(argc, argv); } else if (!strcasecmp(argv[0], "dnskey")) { argc --; argv ++; result = cmd_dnskey(argc, argv); } else if (!strcasecmp(argv[0], "test")) { argc --; argv ++; result = cmd_test(argc, argv); } else if (!strcasecmp(argv[0], "info")) { argc --; argv ++; result = cmd_info(); } else if (!strcasecmp(argv[0], "debug")) { argc --; argv ++; result = cmd_debug(); } else { usage(); result = -1; } (void) hsm_close(); if (config) free(config); closelog(); exit(result); } opendnssec-1.4.9/libhsm/src/bin/Makefile.in0000644000175000017500000006532312650165765015517 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = ods-hsmutil$(EXEEXT) ods-hsmspeed$(EXEEXT) subdir = libhsm/src/bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = ods-hsmspeed.1 ods-hsmutil.1 CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_ods_hsmspeed_OBJECTS = hsmspeed.$(OBJEXT) ods_hsmspeed_OBJECTS = $(am_ods_hsmspeed_OBJECTS) ods_hsmspeed_DEPENDENCIES = ../lib/libhsm.a $(LIBCOMPAT) 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_ods_hsmutil_OBJECTS = hsmutil.$(OBJEXT) hsmtest.$(OBJEXT) ods_hsmutil_OBJECTS = $(am_ods_hsmutil_OBJECTS) ods_hsmutil_DEPENDENCIES = ../lib/libhsm.a $(LIBCOMPAT) 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)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles 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 = $(ods_hsmspeed_SOURCES) $(ods_hsmutil_SOURCES) DIST_SOURCES = $(ods_hsmspeed_SOURCES) $(ods_hsmutil_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 = $(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)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ods-hsmspeed.1.in \ $(srcdir)/ods-hsmutil.1.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/../lib \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 man1_MANS = ods-hsmutil.1 ods-hsmspeed.1 ods_hsmutil_SOURCES = hsmutil.c hsmtest.c hsmtest.h ods_hsmutil_LDADD = ../lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) ods_hsmspeed_SOURCES = hsmspeed.c ods_hsmspeed_LDADD = ../lib/libhsm.a -lpthread @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) 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 libhsm/src/bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/src/bin/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): ods-hsmspeed.1: $(top_builddir)/config.status $(srcdir)/ods-hsmspeed.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ods-hsmutil.1: $(top_builddir)/config.status $(srcdir)/ods-hsmutil.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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 ods-hsmspeed$(EXEEXT): $(ods_hsmspeed_OBJECTS) $(ods_hsmspeed_DEPENDENCIES) $(EXTRA_ods_hsmspeed_DEPENDENCIES) @rm -f ods-hsmspeed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ods_hsmspeed_OBJECTS) $(ods_hsmspeed_LDADD) $(LIBS) ods-hsmutil$(EXEEXT): $(ods_hsmutil_OBJECTS) $(ods_hsmutil_DEPENDENCIES) $(EXTRA_ods_hsmutil_DEPENDENCIES) @rm -f ods-hsmutil$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ods_hsmutil_OBJECTS) $(ods_hsmutil_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmspeed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmutil.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(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='$(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: $(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)$(bindir)" "$(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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-binPROGRAMS 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 -rf ./$(DEPDIR) -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 uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am 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-html install-html-am \ install-info install-info-am install-man install-man1 \ 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-man uninstall-man1 .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: opendnssec-1.4.9/libhsm/src/Makefile.am0000644000175000017500000000010012650165675014714 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = lib bin opendnssec-1.4.9/libhsm/src/lib/0000755000175000017500000000000012650166151013505 500000000000000opendnssec-1.4.9/libhsm/src/lib/Makefile.am0000644000175000017500000000050012650165675015466 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/cryptoki_compat \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 noinst_LIBRARIES = libhsm.a libhsm_a_SOURCES = libhsm.c libhsm.h libhsmdns.h pin.c \ cryptoki_compat/pkcs11.h opendnssec-1.4.9/libhsm/src/lib/pin.c0000644000175000017500000003175712650165675014406 00000000000000/* * Copyright (c) 2011 .SE (The Internet Infrastructure Foundation). * 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 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. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "libhsm.h" /*! Global (initial) context */ extern hsm_ctx_t *_hsm_ctx; /* Function from libhsm.c */ void hsm_ctx_set_error(hsm_ctx_t *ctx, int error, const char *action, const char *message, ...); /* Constants */ #define SHM_KEY (key_t)0x0d50d5ec #define SEM_KEY (key_t)0x0d50d5ec #define SHM_PERM S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP #define SEM_PERM S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP #ifndef HAVE_UNION_SEMUN /* From man page for semctl */ union semun { int val; /* Value for SETVAL */ struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ unsigned short *array; /* Array for GETALL, SETALL */ }; #endif /* Remember PIN that we can save */ static char pin[HSM_MAX_PIN_LENGTH+1]; char * prompt_pass(char *prompt) { int c, i = 0; static char pass[HSM_MAX_PIN_LENGTH+1]; struct termios oldt, newt; if (prompt == NULL) return NULL; printf("%s", prompt); /* Turn echoing off */ if (isatty(fileno(stdin))) { if (tcgetattr(fileno(stdin), &oldt) != 0) return NULL; newt = oldt; newt.c_lflag &= ~ECHO; if (tcsetattr(fileno(stdin), TCSAFLUSH, &newt) != 0) return NULL; } /* Get the password */ do { c = fgetc(stdin); pass[i] = c; i++; } while (c != EOF && c != '\n' && c != '\r' && i < HSM_MAX_PIN_LENGTH+1); pass[i-1] = '\0'; /* Restore echoing */ if (isatty(fileno(stdin))) { tcsetattr(fileno(stdin), TCSAFLUSH, &oldt); } printf("\n"); return pass; } int hsm_sem_open() { int semid; struct semid_ds buf; union semun arg; /* Create/get the semaphore */ semid = semget(SEM_KEY, 1, IPC_CREAT|IPC_EXCL|SEM_PERM); if (semid == -1) { semid = semget(SEM_KEY, 1, IPC_CREAT|SEM_PERM); if (semid == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not access the semaphore: %s", strerror(errno)); return -1; } } else { /* Set value to 1 if we created it */ arg.val = 1; if (semctl(semid, 0, SETVAL, arg) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not set value on the semaphore: %s", strerror(errno)); return -1; } } /* Get information about the semaphore */ arg.buf = &buf; if (semctl(semid, 0, IPC_STAT, arg) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Could not stat the semaphore: %s", strerror(errno)); return -1; } /* Check permission to avoid an attack */ if ((buf.sem_perm.mode & (SEM_PERM)) != (SEM_PERM) || buf.sem_perm.gid != getegid()) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_open()", "Bad permissions on the semaphore, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } return semid; } int hsm_sem_wait(int semid) { struct sembuf sb = { 0, -1, 0 }; if (semop(semid, &sb, 1) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_wait()", "Could not lock the semaphore: %s", strerror(errno)); return -1; } return 0; } int hsm_sem_post(int semid) { struct sembuf sb = { 0, 1, 0 }; if (semop(semid, &sb, 1) == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_sem_post()", "Could not unlock the semaphore: %s", strerror(errno)); return -1; } return 0; } int hsm_shm_open() { int shmid; size_t shmsize; struct shmid_ds buf; /* Create/get the shared memory */ shmsize = sizeof(char)*HSM_MAX_SESSIONS*(HSM_MAX_PIN_LENGTH+1); shmid = shmget(SHM_KEY, shmsize, IPC_CREAT|IPC_EXCL|SHM_PERM); if (shmid == -1) { shmid = shmget(SHM_KEY, shmsize, IPC_CREAT|SHM_PERM); if (shmid == -1) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Could not access the shared memory: %s", strerror(errno)); return -1; } } else { /* Zeroize if we created the memory area */ /* The data should be set to zero according to man page */ } /* Get information about the shared memory */ if (shmctl(shmid, IPC_STAT, &buf) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Could not stat the semaphore: %s", strerror(errno)); return -1; } /* Check the size of the memory segment */ if ((size_t)buf.shm_segsz != shmsize) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Bad memory size, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } /* Check permission to avoid an attack */ if ((buf.shm_perm.mode & (SHM_PERM)) != (SHM_PERM) || buf.shm_perm.gid != getegid()) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_shm_open()", "Bad permissions on the shared memory, please read Getting Help/Troubleshooting on OpenDNSSEC Wiki about this."); return -1; } return shmid; } char * hsm_prompt_pin(unsigned int id, const char *repository, unsigned int mode) { /* Shared memory */ int shmid; int semid; char *pins = NULL; int index = id * (HSM_MAX_PIN_LENGTH + 1); /* PIN from getpass */ char prompt[64]; char *prompt_pin = NULL; unsigned int size = 0; /* Check input data */ if (id >= HSM_MAX_SESSIONS) return NULL; if (repository == NULL) return NULL; if (mode != HSM_PIN_FIRST && mode != HSM_PIN_RETRY && mode != HSM_PIN_SAVE) return NULL; /* Create/get the semaphore */ semid = hsm_sem_open(); if (semid == -1) return NULL; /* Lock the semaphore */ if (hsm_sem_wait(semid) != 0) return NULL; /* Create/get the shared memory */ shmid = hsm_shm_open(); if (shmid == -1) { hsm_sem_post(semid); return NULL; } /* Attach to the shared memory */ pins = (char *)shmat(shmid, NULL, 0); if (pins == (char *)-1) { pins = NULL; hsm_sem_post(semid); return NULL; } /* Get the PIN */ if (mode != HSM_PIN_SAVE) { /* Do we have a PIN in the shared memory? */ if (mode == HSM_PIN_FIRST && pins[index] != '\0') { size = strlen(&pins[index]); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memcpy(pin, &pins[index], size); pin[size] = '\0'; } else { /* Zeroize bad PIN in shared memory */ if (mode == HSM_PIN_RETRY && pins[index] != '\0') { memset(&pins[index], '\0', HSM_MAX_PIN_LENGTH+1); } /* Unlock the semaphore if someone would do Ctrl+C */ hsm_sem_post(semid); /* Get PIN */ snprintf(prompt, 64, "Enter PIN for token %s: ", repository); prompt_pin = prompt_pass(prompt); if (prompt_pin == NULL) { shmdt(pins); pins = NULL; return NULL; } /* Lock the semaphore */ hsm_sem_wait(semid); /* Remember PIN */ size = strlen(prompt_pin); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); memcpy(pin, prompt_pin, size); /* Zeroize the prompt_pass PIN */ memset(prompt_pin, '\0', strlen(prompt_pin)); } } else { /* Save the PIN */ memcpy(&pins[index], pin, HSM_MAX_PIN_LENGTH+1); /* Zeroize the PIN */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); } /* Detach from the shared memory */ shmdt(pins); pins = NULL; /* Unlock the semaphore */ hsm_sem_post(semid); return pin; } char * hsm_check_pin(unsigned int id, const char *repository, unsigned int mode) { /* Shared memory */ int shmid; int semid; char *pins = NULL; int index = id * (HSM_MAX_PIN_LENGTH + 1); unsigned int size = 0; /* Check input data */ if (id >= HSM_MAX_SESSIONS) return NULL; if (repository == NULL) return NULL; if (mode != HSM_PIN_FIRST && mode != HSM_PIN_RETRY && mode != HSM_PIN_SAVE) return NULL; if (mode == HSM_PIN_SAVE) { /* Nothing to save */ /* Zeroize the PIN */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); return pin; } /* Create/get the semaphore */ semid = hsm_sem_open(); if (semid == -1) return NULL; /* Lock the semaphore */ if (hsm_sem_wait(semid) != 0) return NULL; /* Create/get the shared memory */ shmid = hsm_shm_open(); if (shmid == -1) { hsm_sem_post(semid); return NULL; } /* Attach to the shared memory */ pins = (char *)shmat(shmid, NULL, 0); if (pins == (char *)-1) { pins = NULL; hsm_sem_post(semid); return NULL; } /* Zeroize PIN buffer */ memset(pin, '\0', HSM_MAX_PIN_LENGTH+1); /* Check if there is no PIN */ if (pins[index] == '\0') { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_check_pin()", "No PIN in shared memory. " "Please login with \"ods-hsmutil login\""); shmdt(pins); pins = NULL; hsm_sem_post(semid); return NULL; } /* Zeroize bad PIN in shared memory */ if (mode == HSM_PIN_RETRY) { memset(&pins[index], '\0', HSM_MAX_PIN_LENGTH+1); hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_check_pin()", "Removed bad PIN in shared memory. " "Please login again with \"ods-hsmutil login\""); shmdt(pins); pins = NULL; hsm_sem_post(semid); return NULL; } /* Get the PIN */ size = strlen(&pins[index]); if (size > HSM_MAX_PIN_LENGTH) size = HSM_MAX_PIN_LENGTH; memcpy(pin, &pins[index], size); pin[size] = '\0'; /* Detach from the shared memory */ shmdt(pins); pins = NULL; /* Unlock the semaphore */ hsm_sem_post(semid); return pin; } int hsm_logout_pin() { int semid; int shmid; union semun arg; struct shmid_ds buf; /* Get the semaphore */ semid = semget(SEM_KEY, 1, 0); if (semid == -1) { if (errno != ENOENT) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not access the semaphore: %s", strerror(errno)); return HSM_ERROR; } } else { /* Remove the semaphore */ if (semctl(semid, 0, IPC_RMID, arg) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not delete the semaphore: %s", strerror(errno)); return HSM_ERROR; } } /* Get the shared memory */ shmid = shmget(SHM_KEY, 0, 0); if (shmid == -1) { if (errno != ENOENT) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not access the shared memory: %s", strerror(errno)); return HSM_ERROR; } } else { /* Remove the shared memory */ if (shmctl(shmid, IPC_RMID, &buf) != 0) { hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_logout_pin()", "Could not stat the semaphore: %s", strerror(errno)); return HSM_ERROR; } } return HSM_OK; } opendnssec-1.4.9/libhsm/src/lib/libhsm.c0000644000175000017500000031445312650165732015065 00000000000000/* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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 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. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "libhsm.h" #include "libhsmdns.h" #include "compat.h" #include /*! Fixed length from PKCS#11 specification */ #define HSM_TOKEN_LABEL_LENGTH 32 /*! Global (initial) context */ hsm_ctx_t *_hsm_ctx; /*! General PKCS11 helper functions */ static char * ldns_pkcs11_rv_str(CK_RV rv) { switch (rv) { case CKR_OK: return "CKR_OK"; case CKR_CANCEL: return "CKR_CANCEL"; case CKR_HOST_MEMORY: return "CKR_HOST_MEMORY"; case CKR_GENERAL_ERROR: return "CKR_GENERAL_ERROR"; case CKR_FUNCTION_FAILED: return "CKR_FUNCTION_FAILED"; case CKR_SLOT_ID_INVALID: return "CKR_SLOT_ID_INVALID"; case CKR_ATTRIBUTE_READ_ONLY: return "CKR_ATTRIBUTE_READ_ONLY"; case CKR_ATTRIBUTE_SENSITIVE: return "CKR_ATTRIBUTE_SENSITIVE"; case CKR_ATTRIBUTE_TYPE_INVALID: return "CKR_ATTRIBUTE_TYPE_INVALID"; case CKR_ATTRIBUTE_VALUE_INVALID: return "CKR_ATTRIBUTE_VALUE_INVALID"; case CKR_DATA_INVALID: return "CKR_DATA_INVALID"; case CKR_DATA_LEN_RANGE: return "CKR_DATA_LEN_RANGE"; case CKR_DEVICE_ERROR: return "CKR_DEVICE_ERROR"; case CKR_DEVICE_MEMORY: return "CKR_DEVICE_MEMORY"; case CKR_DEVICE_REMOVED: return "CKR_DEVICE_REMOVED"; case CKR_ENCRYPTED_DATA_INVALID: return "CKR_ENCRYPTED_DATA_INVALID"; case CKR_ENCRYPTED_DATA_LEN_RANGE: return "CKR_ENCRYPTED_DATA_LEN_RANGE"; case CKR_FUNCTION_CANCELED: return "CKR_FUNCTION_CANCELED"; case CKR_FUNCTION_NOT_PARALLEL: return "CKR_FUNCTION_NOT_PARALLEL"; case CKR_FUNCTION_NOT_SUPPORTED: return "CKR_FUNCTION_NOT_SUPPORTED"; case CKR_KEY_HANDLE_INVALID: return "CKR_KEY_HANDLE_INVALID"; case CKR_KEY_SIZE_RANGE: return "CKR_KEY_SIZE_RANGE"; case CKR_KEY_TYPE_INCONSISTENT: return "CKR_KEY_TYPE_INCONSISTENT"; case CKR_MECHANISM_INVALID: return "CKR_MECHANISM_INVALID"; case CKR_MECHANISM_PARAM_INVALID: return "CKR_MECHANISM_PARAM_INVALID"; case CKR_OBJECT_HANDLE_INVALID: return "CKR_OBJECT_HANDLE_INVALID"; case CKR_OPERATION_ACTIVE: return "CKR_OPERATION_ACTIVE"; case CKR_OPERATION_NOT_INITIALIZED: return "CKR_OPERATION_NOT_INITIALIZED"; case CKR_PIN_INCORRECT: return "CKR_PIN_INCORRECT"; case CKR_PIN_INVALID: return "CKR_PIN_INVALID"; case CKR_PIN_LEN_RANGE: return "CKR_PIN_LEN_RANGE"; case CKR_SESSION_CLOSED: return "CKR_SESSION_CLOSED"; case CKR_SESSION_COUNT: return "CKR_SESSION_COUNT"; case CKR_SESSION_HANDLE_INVALID: return "CKR_SESSION_HANDLE_INVALID"; case CKR_SESSION_PARALLEL_NOT_SUPPORTED: return "CKR_SESSION_PARALLEL_NOT_SUPPORTED"; case CKR_SESSION_READ_ONLY: return "CKR_SESSION_READ_ONLY"; case CKR_SESSION_EXISTS: return "CKR_SESSION_EXISTS"; case CKR_SIGNATURE_INVALID: return "CKR_SIGNATURE_INVALID"; case CKR_SIGNATURE_LEN_RANGE: return "CKR_SIGNATURE_LEN_RANGE"; case CKR_TEMPLATE_INCOMPLETE: return "CKR_TEMPLATE_INCOMPLETE"; case CKR_TEMPLATE_INCONSISTENT: return "CKR_TEMPLATE_INCONSISTENT"; case CKR_TOKEN_NOT_PRESENT: return "CKR_TOKEN_NOT_PRESENT"; case CKR_TOKEN_NOT_RECOGNIZED: return "CKR_TOKEN_NOT_RECOGNIZED"; case CKR_TOKEN_WRITE_PROTECTED: return "CKR_TOKEN_WRITE_PROTECTED"; case CKR_UNWRAPPING_KEY_HANDLE_INVALID: return "CKR_UNWRAPPING_KEY_HANDLE_INVALID"; case CKR_UNWRAPPING_KEY_SIZE_RANGE: return "CKR_UNWRAPPING_KEY_SIZE_RANGE"; case CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: return "CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT"; case CKR_USER_ALREADY_LOGGED_IN: return "CKR_USER_ALREADY_LOGGED_IN"; case CKR_USER_NOT_LOGGED_IN: return "CKR_USER_NOT_LOGGED_IN"; case CKR_USER_PIN_NOT_INITIALIZED: return "CKR_USER_PIN_NOT_INITIALIZED"; case CKR_USER_TYPE_INVALID: return "CKR_USER_TYPE_INVALID"; case CKR_WRAPPED_KEY_INVALID: return "CKR_WRAPPED_KEY_INVALID"; case CKR_WRAPPED_KEY_LEN_RANGE: return "CKR_WRAPPED_KEY_LEN_RANGE"; case CKR_WRAPPING_KEY_HANDLE_INVALID: return "CKR_WRAPPING_KEY_HANDLE_INVALID"; case CKR_WRAPPING_KEY_SIZE_RANGE: return "CKR_WRAPPING_KEY_SIZE_RANGE"; case CKR_WRAPPING_KEY_TYPE_INCONSISTENT: return "CKR_WRAPPING_KEY_TYPE_INCONSISTENT"; case CKR_RANDOM_SEED_NOT_SUPPORTED: return "CKR_RANDOM_SEED_NOT_SUPPORTED"; case CKR_VENDOR_DEFINED: return "CKR_VENDOR_DEFINED"; case CKR_BUFFER_TOO_SMALL: return "CKR_BUFFER_TOO_SMALL"; case CKR_SAVED_STATE_INVALID: return "CKR_SAVED_STATE_INVALID"; case CKR_INFORMATION_SENSITIVE: return "CKR_INFORMATION_SENSITIVE"; case CKR_STATE_UNSAVEABLE: return "CKR_STATE_UNSAVEABLE"; case CKR_CRYPTOKI_NOT_INITIALIZED: return "CKR_CRYPTOKI_NOT_INITIALIZED"; case CKR_CRYPTOKI_ALREADY_INITIALIZED: return "CKR_CRYPTOKI_ALREADY_INITIALIZED"; case CKR_MUTEX_BAD: return "CKR_MUTEX_BAD"; case CKR_MUTEX_NOT_LOCKED: return "CKR_MUTEX_NOT_LOCKED"; default: return "Unknown error"; } } /*! Set HSM Context Error If the ctx is given, and it's error value is still 0, the value will be set to 'error', and the error_message and error_action will be set to the given strings. \param ctx HSM context \param error error code \param action action for which the error occured \param message error message format string */ void hsm_ctx_set_error(hsm_ctx_t *ctx, int error, const char *action, const char *message, ...) { va_list args; if (ctx && ctx->error == 0) { ctx->error = error; ctx->error_action = action; va_start(args, message); vsnprintf(ctx->error_message, sizeof(ctx->error_message), message, args); va_end(args); } } /*! Check HSM Context for Error If the rv is not CKR_OK, and there is not previous error registered in the context, to set the context error based on PKCS#11 return value. \param ctx HSM context \param rv PKCS#11 return value \param action action for which the error occured \param message error message format string \return 0 if rv == CKR_OK, otherwise 1 */ static int hsm_pkcs11_check_error(hsm_ctx_t *ctx, CK_RV rv, const char *action) { if (rv != CKR_OK) { if (ctx && ctx->error == 0) { ctx->error = (int) rv; ctx->error_action = action; strlcpy(ctx->error_message, ldns_pkcs11_rv_str(rv), sizeof(ctx->error_message)); } return 1; } return 0; } /*! Unload PKCS#11 provider */ static void hsm_pkcs11_unload_functions(void *handle) { if (handle) { #if defined(HAVE_LOADLIBRARY) /* no idea */ #elif defined(HAVE_DLOPEN) (void) dlclose(handle); #endif } } /*! Load PKCS#11 provider */ static CK_RV hsm_pkcs11_load_functions(hsm_module_t *module) { CK_C_GetFunctionList pGetFunctionList = NULL; if (module && module->path) { /* library provided by application or user */ #if defined(HAVE_LOADLIBRARY) /* Load PKCS #11 library */ HINSTANCE hDLL = LoadLibrary(_T(module->path)); if (hDLL == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the entry point for C_GetFunctionList */ pGetFunctionList = (CK_C_GetFunctionList) GetProcAddress(hDLL, _T("C_GetFunctionList")); #elif defined(HAVE_DLOPEN) /* Load PKCS #11 library */ void* pDynLib = dlopen(module->path, RTLD_NOW | RTLD_LOCAL); if (pDynLib == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the entry point for C_GetFunctionList */ pGetFunctionList = (CK_C_GetFunctionList) dlsym(pDynLib, "C_GetFunctionList"); /* Store the handle so we can dlclose it later */ module->handle = pDynLib; #else return CKR_FUNCTION_FAILED; #endif } else { /* No library provided, use the statically compiled softHSM */ #ifdef HAVE_PKCS11_MODULE return C_GetFunctionList(pkcs11_functions); #else return CKR_FUNCTION_FAILED; #endif } if (pGetFunctionList == NULL) { /* Failed to load the PKCS #11 library */ return CKR_FUNCTION_FAILED; } /* Retrieve the function list */ (pGetFunctionList)((CK_FUNCTION_LIST_PTR_PTR)(&module->sym)); return CKR_OK; } static void hsm_remove_leading_zeroes(CK_BYTE_PTR data, CK_ULONG *len) { CK_BYTE_PTR p = data; CK_ULONG l; if (data == NULL || len == NULL) return; l = *len; while ((unsigned short int)(*p) == 0 && l > 1) { p++; l--; } if (p != data) { memmove(data, p, l); *len = l; } } static int hsm_pkcs11_check_token_name(hsm_ctx_t *ctx, CK_FUNCTION_LIST_PTR pkcs11_functions, CK_SLOT_ID slotId, const char *token_name) { /* token label is always 32 bytes */ char token_name_bytes[HSM_TOKEN_LABEL_LENGTH]; int result = 0; CK_RV rv; CK_TOKEN_INFO token_info; rv = pkcs11_functions->C_GetTokenInfo(slotId, &token_info); if (hsm_pkcs11_check_error(ctx, rv, "C_GetTokenInfo")) { return 0; } memset(token_name_bytes, ' ', HSM_TOKEN_LABEL_LENGTH); if (strlen(token_name) < HSM_TOKEN_LABEL_LENGTH) { memcpy(token_name_bytes, token_name, strlen(token_name)); } else { memcpy(token_name_bytes, token_name, HSM_TOKEN_LABEL_LENGTH); } result = memcmp(token_info.label, token_name_bytes, HSM_TOKEN_LABEL_LENGTH) == 0; return result; } int hsm_get_slot_id(hsm_ctx_t *ctx, CK_FUNCTION_LIST_PTR pkcs11_functions, const char *token_name, CK_SLOT_ID *slotId) { CK_RV rv; CK_ULONG slotCount; CK_SLOT_ID cur_slot; CK_SLOT_ID *slotIds; int found = 0; if (token_name == NULL || slotId == NULL) return HSM_ERROR; rv = pkcs11_functions->C_GetSlotList(CK_TRUE, NULL_PTR, &slotCount); if (hsm_pkcs11_check_error(ctx, rv, "get slot list")) { return HSM_ERROR; } if (slotCount < 1) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_get_slot_id()", "No slots found in HSM"); return HSM_ERROR; } else if (slotCount > (SIZE_MAX / sizeof(CK_SLOT_ID))) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_get_slot_id()", "Too many slots found in HSM"); return HSM_ERROR; } slotIds = malloc(sizeof(CK_SLOT_ID) * slotCount); if(slotIds == NULL) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_get_slot_id()", "Could not allocate slot ID table"); return HSM_ERROR; } rv = pkcs11_functions->C_GetSlotList(CK_TRUE, slotIds, &slotCount); if (hsm_pkcs11_check_error(ctx, rv, "get slot list")) { return HSM_ERROR; } for (cur_slot = 0; cur_slot < slotCount; cur_slot++) { if (hsm_pkcs11_check_token_name(ctx, pkcs11_functions, slotIds[cur_slot], token_name)) { *slotId = slotIds[cur_slot]; found = 1; break; } } free(slotIds); if (!found) { hsm_ctx_set_error(ctx, -1, "hsm_get_slot_id()", "could not find token with the name %s", token_name); return HSM_ERROR; } return HSM_OK; } /* internal functions */ static hsm_module_t * hsm_module_new(const char *repository, const char *token_label, const char *path, const hsm_config_t *config) { hsm_module_t *module; if (!repository || !path) return NULL; module = malloc(sizeof(hsm_module_t)); if (!module) return NULL; if (config) { module->config = malloc(sizeof(hsm_config_t)); if (!module->config) { free(module); return NULL; } memcpy(module->config, config, sizeof(hsm_config_t)); } else { module->config = NULL; } module->id = 0; /*TODO i think we can remove this*/ module->name = strdup(repository); module->token_label = strdup(token_label); module->path = strdup(path); module->handle = NULL; module->sym = NULL; return module; } static void hsm_module_free(hsm_module_t *module) { if (module) { if (module->name) free(module->name); if (module->token_label) free(module->token_label); if (module->path) free(module->path); if (module->config) free(module->config); free(module); } } static hsm_session_t * hsm_session_new(hsm_module_t *module, CK_SESSION_HANDLE session_handle) { hsm_session_t *session; session = malloc(sizeof(hsm_session_t)); session->module = module; session->session = session_handle; return session; } static void hsm_session_free(hsm_session_t *session) { if (session) { free(session); } } /*! Set default HSM configuration */ static void hsm_config_default(hsm_config_t *config) { config->use_pubkey = 1; config->allow_extract = 0; } /* creates a session_t structure, and automatically adds and initializes * a module_t struct for it */ static int hsm_session_init(hsm_ctx_t *ctx, hsm_session_t **session, const char *repository, const char *token_label, const char *module_path, const char *pin, const hsm_config_t *config) { CK_RV rv; CK_RV rv_login; hsm_module_t *module; CK_SLOT_ID slot_id; CK_SESSION_HANDLE session_handle; int first = 1, result; CK_C_INITIALIZE_ARGS InitArgs = {NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL }; if (pin == NULL) return HSM_ERROR; module = hsm_module_new(repository, token_label, module_path, config); if (!module) return HSM_ERROR; rv = hsm_pkcs11_load_functions(module); if (rv != CKR_OK) { hsm_ctx_set_error(ctx, HSM_MODULE_NOT_FOUND, "hsm_session_init()", "PKCS#11 module load failed: %s", module_path); hsm_module_free(module); return HSM_MODULE_NOT_FOUND; } rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Initialize((CK_VOID_PTR) &InitArgs); /* ALREADY_INITIALIZED is ok, apparently we are using a second * device with the same library */ if (rv != CKR_CRYPTOKI_ALREADY_INITIALIZED) { if (hsm_pkcs11_check_error(ctx, rv, "Initialization")) { hsm_module_free(module); return HSM_ERROR; } } else { first = 0; } result = hsm_get_slot_id(ctx, module->sym, token_label, &slot_id); if (result != HSM_OK) { hsm_module_free(module); return HSM_ERROR; } rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_OpenSession(slot_id, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "Open first session")) { hsm_module_free(module); return HSM_ERROR; } rv_login = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Login(session_handle, CKU_USER, (unsigned char *) pin, strlen((char *)pin)); if (rv_login == CKR_OK) { *session = hsm_session_new(module, session_handle); return HSM_OK; } else { /* uninitialize the session again */ if (session_handle) { rv = ((CK_FUNCTION_LIST_PTR) module->sym)-> C_CloseSession(session_handle); if (hsm_pkcs11_check_error(ctx, rv, "finalize after failed login")) { hsm_module_free(module); return HSM_ERROR; } } /* if this was not the first, don't close the library for * the rest of us */ if (first) { rv = ((CK_FUNCTION_LIST_PTR) module->sym)->C_Finalize(NULL); if (hsm_pkcs11_check_error(ctx, rv, "finalize after failed login")) { hsm_module_free(module); return HSM_ERROR; } } hsm_module_free(module); *session = NULL; switch(rv_login) { case CKR_PIN_INCORRECT: hsm_ctx_set_error(ctx, HSM_PIN_INCORRECT, "hsm_session_init()", "Incorrect PIN for repository %s", repository); return HSM_PIN_INCORRECT; default: return HSM_ERROR; } } } /* open a second session from the given one */ static hsm_session_t * hsm_session_clone(hsm_ctx_t *ctx, hsm_session_t *session) { CK_RV rv; CK_SLOT_ID slot_id; CK_SESSION_HANDLE session_handle; hsm_session_t *new_session; int result; result = hsm_get_slot_id(ctx, session->module->sym, session->module->token_label, &slot_id); if (result != HSM_OK) return NULL; rv = ((CK_FUNCTION_LIST_PTR) session->module->sym)->C_OpenSession(slot_id, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "Clone session")) { return NULL; } new_session = hsm_session_new(session->module, session_handle); return new_session; } static hsm_ctx_t * hsm_ctx_new() { hsm_ctx_t *ctx; ctx = malloc(sizeof(hsm_ctx_t)); memset(ctx->session, 0, HSM_MAX_SESSIONS); ctx->session_count = 0; ctx->error = 0; return ctx; } /* ctx_free frees the structure */ static void hsm_ctx_free(hsm_ctx_t *ctx) { unsigned int i; if (ctx) { for (i = 0; i < ctx->session_count; i++) { hsm_session_free(ctx->session[i]); } free(ctx); } } /* close the session, and free the allocated data * * if unload is non-zero, C_Logout() is called, * the dlopen()d module is closed and unloaded * (only call this on the last session for each * module, ie. the one in the global ctx) */ static void hsm_session_close(hsm_ctx_t *ctx, hsm_session_t *session, int unload) { /* If we loaded this library more than once, we may have * already finalized it before, so we can safely ignore * NOT_INITIALIZED */ CK_RV rv; if (unload) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Logout(session->session); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Logout"); } } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_CloseSession(session->session); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Close session"); } if (unload) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Finalize(NULL); if (rv != CKR_CRYPTOKI_NOT_INITIALIZED) { (void) hsm_pkcs11_check_error(ctx, rv, "Finalize"); hsm_pkcs11_unload_functions(session->module->handle); } hsm_module_free(session->module); session->module = NULL; } hsm_session_free(session); } /* ctx_close closes all session, and free * the structures. * * if unload is non-zero, the associated dynamic libraries are unloaded * (hence only use that on the last, global, ctx) */ static void hsm_ctx_close(hsm_ctx_t *ctx, int unload) { unsigned int i; if (ctx) { for (i = 0; i < ctx->session_count; i++) { /* todo syslog? */ /*printf("close session %u (unload: %d)\n", i, unload);*/ /*hsm_print_ctx(ctx);*/ hsm_session_close(ctx, ctx->session[i], unload); ctx->session[i] = NULL; /* if this was the last session in the array, decrease * the session counter of the context */ if (i == _hsm_ctx->session_count) { while(ctx->session_count > 0 && !ctx->session[i]) { ctx->session_count--; } } } free(ctx); } } /* adds a session to the context. * returns 0 on success * 1 if the maximum number of sessions (HSM_MAX_SESSIONS) was * reached * -1 if one of the arguments is NULL */ static int hsm_ctx_add_session(hsm_ctx_t *ctx, hsm_session_t *session) { if (!ctx || !session) return -1; if (ctx->session_count >= HSM_MAX_SESSIONS) return 1; ctx->session[ctx->session_count] = session; ctx->session_count++; return 0; } static hsm_ctx_t * hsm_ctx_clone(hsm_ctx_t *ctx) { unsigned int i; hsm_ctx_t *new_ctx; hsm_session_t *new_session; new_ctx = NULL; if (ctx) { new_ctx = hsm_ctx_new(); for (i = 0; i < ctx->session_count; i++) { new_session = hsm_session_clone(ctx, ctx->session[i]); if (!new_session) { /* one of the sessions failed to clone. Clear the * new ctx and return NULL */ hsm_ctx_close(new_ctx, 0); return NULL; } hsm_ctx_add_session(new_ctx, new_session); } } return new_ctx; } static hsm_key_t * hsm_key_new() { hsm_key_t *key; key = malloc(sizeof(hsm_key_t)); key->module = NULL; key->private_key = 0; key->public_key = 0; return key; } /* find the session belonging to a key, by iterating over the modules * in the context */ static hsm_session_t * hsm_find_key_session(hsm_ctx_t *ctx, const hsm_key_t *key) { unsigned int i; if (!key || !key->module) return NULL; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && ctx->session[i]->module == key->module) { return ctx->session[i]; } } return NULL; } /* Returns the key type (algorithm) of the given key */ static CK_KEY_TYPE hsm_get_key_algorithm(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_KEY_TYPE key_type; CK_ATTRIBUTE template[] = { {CKA_KEY_TYPE, &key_type, sizeof(CK_KEY_TYPE)} }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value algorithm type")) { /* this is actually not a good return value; * CKK_RSA is also 0. But we can't return a negative * value. Should we #define a specific 'key type' that * indicates an error? (TODO) */ return 0; } if ((CK_LONG)template[0].ulValueLen < 1) { /* this is actually not a good return value; * CKK_RSA is also 0. But we can't return a negative * value. Should we #define a specific 'key type' that * indicates an error? (TODO) */ return 0; } return key_type; } /* returns a CK_ULONG with the key size of the given RSA key. The * key is not checked for type. For RSA, the number of bits in the * modulus is the key size (CKA_MODULUS_BITS) */ static CK_ULONG hsm_get_key_size_rsa(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_ULONG modulus_bits; /* Template for public keys */ CK_ATTRIBUTE template[] = { {CKA_MODULUS_BITS, &modulus_bits, sizeof(CK_KEY_TYPE)} }; /* Template for private keys */ CK_BYTE_PTR modulus = NULL; int mask; CK_ATTRIBUTE template2[] = { {CKA_MODULUS, NULL, 0} }; if (session->module->config->use_pubkey) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value algorithm type")) { return 0; } if ((CK_ULONG)template[0].ulValueLen < 1) { return 0; } } else { // Get buffer size rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the size of the modulus of the private key")) { return 0; } // Allocate memory modulus = (CK_BYTE_PTR)malloc(template2[0].ulValueLen); template2[0].pValue = modulus; if (modulus == NULL) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_size_rsa()", "Error allocating memory for modulus"); return 0; } // Get attribute rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the modulus of the private key")) { free(modulus); return 0; } // Calculate size modulus_bits = template2[0].ulValueLen * 8; mask = 0x80; for (int i = 0; modulus_bits && (modulus[i] & mask) == 0; modulus_bits--) { mask >>= 1; if (mask == 0) { i++; mask = 0x80; } } free(modulus); } return modulus_bits; } /* returns a CK_ULONG with the key size of the given DSA key. The * key is not checked for type. For DSA, the number of bits in the * prime is the key size (CKA_PRIME) */ static CK_ULONG hsm_get_key_size_dsa(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; /* Template */ CK_ATTRIBUTE template2[] = { {CKA_PRIME, NULL, 0} }; // Get buffer size rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->private_key, template2, 1); if (hsm_pkcs11_check_error(ctx, rv, "Could not get the size of the prime of the private key")) { return 0; } return template2[0].ulValueLen * 8; } /* Wrapper for specific key size functions */ static CK_ULONG hsm_get_key_size(hsm_ctx_t *ctx, const hsm_session_t *session, const hsm_key_t *key, const unsigned long algorithm) { /* TODO: Add ECDSA */ switch (algorithm) { case CKK_RSA: return hsm_get_key_size_rsa(ctx, session, key); break; case CKK_DSA: return hsm_get_key_size_dsa(ctx, session, key); break; case CKK_GOSTR3410: /* GOST public keys always have a size of 512 bits */ return 512; break; default: return 0; } } static CK_OBJECT_HANDLE hsm_find_object_handle_for_id(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_CLASS key_class, CK_BYTE *id, CK_ULONG id_len) { CK_ULONG objectCount; CK_OBJECT_HANDLE object; CK_RV rv; CK_ATTRIBUTE template[] = { { CKA_CLASS, &key_class, sizeof(key_class) }, { CKA_ID, id, id_len }, }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsInit(session->session, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "Find objects init")) { return 0; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjects(session->session, &object, 1, &objectCount); if (hsm_pkcs11_check_error(ctx, rv, "Find object")) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); (void)hsm_pkcs11_check_error(ctx, rv, "Find objects cleanup"); return 0; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); if (hsm_pkcs11_check_error(ctx, rv, "Find object final")) { return 0; } if (objectCount > 0) { return object; } else { return 0; } } /* * Parses the null-terminated string hex as hex values, * Returns allocated data that needs to be freed (or NULL on error) * len will contain the number of bytes allocated, or 0 on error */ static unsigned char * hsm_hex_parse(const char *hex, size_t *len) { unsigned char *bytes; /* length of the hex input */ size_t hex_len; size_t i; if (!len) return NULL; *len = 0; if (!hex) return NULL; hex_len = strlen(hex); if (hex_len % 2 != 0) { return NULL; } *len = hex_len / 2; bytes = malloc(*len); for (i = 0; i < *len; i++) { bytes[i] = ldns_hexdigit_to_int(hex[2*i]) * 16 + ldns_hexdigit_to_int(hex[2*i+1]); } return bytes; } /* put a hexadecimal representation of the data from src into dst * len is the number of bytes to read from src * dst must have allocated enough space (len*2 + 1) */ static void hsm_hex_unparse(char *dst, const unsigned char *src, size_t len) { size_t dst_len = len*2 + 1; size_t i; for (i = 0; i < len; i++) { snprintf(dst + (2*i), dst_len, "%02x", src[i]); } dst[len*2] = '\0'; } /* returns an allocated byte array with the CKA_ID for the given object * len will contain the result size * returns NULL and size zero if not found in this session */ static CK_BYTE * hsm_get_id_for_object(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_HANDLE object, size_t *len) { CK_RV rv; CK_BYTE *id = NULL; CK_ATTRIBUTE template[] = { {CKA_ID, id, 0} }; /* find out the size of the id first */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, object, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value")) { *len = 0; return NULL; } if ((CK_LONG)template[0].ulValueLen < 1) { /* No CKA_ID found, return NULL */ *len = 0; return NULL; } template[0].pValue = malloc(template[0].ulValueLen); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, object, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Get attr value 2")) { *len = 0; free(template[0].pValue); return NULL; } *len = template[0].ulValueLen; return template[0].pValue; } /* returns an hsm_key_t object for the given *private key* object handle * the module, private key, and public key handle are set * The session needs to be free to perform a search for the public key */ static hsm_key_t * hsm_key_new_privkey_object_handle(hsm_ctx_t *ctx, const hsm_session_t *session, CK_OBJECT_HANDLE object) { hsm_key_t *key; CK_BYTE *id; size_t len; id = hsm_get_id_for_object(ctx, session, object, &len); if (!id) return NULL; key = hsm_key_new(); key->module = session->module; key->private_key = object; if (session->module->config->use_pubkey) { key->public_key = hsm_find_object_handle_for_id( ctx, session, CKO_PUBLIC_KEY, id, len); } else { key->public_key = 0; } free(id); return key; } /* helper function to find both key counts or the keys themselves * if the argument store is 0, results are not returned; the * function will only set the count and return NULL * Otherwise, a newly allocated key array will be returned * (on error, the count will also be zero and NULL returned) */ static hsm_key_t ** hsm_list_keys_session_internal(hsm_ctx_t *ctx, const hsm_session_t *session, size_t *count, int store) { hsm_key_t **keys = NULL, **keys_prev; hsm_key_t *key; CK_RV rv; CK_OBJECT_CLASS key_class = CKO_PRIVATE_KEY; CK_ATTRIBUTE template[] = { { CKA_CLASS, &key_class, sizeof(key_class) }, }; CK_ULONG total_count = 0; CK_ULONG objectCount = 1; /* find 100 keys at a time (and loop until there are none left) */ CK_ULONG max_object_count = 100; CK_ULONG i, j; CK_OBJECT_HANDLE object[max_object_count]; CK_OBJECT_HANDLE *key_handles = NULL, *key_handles_prev; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsInit(session->session, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "Find objects init")) { *count = 0; return NULL; } j = 0; while (objectCount > 0) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjects(session->session, object, max_object_count, &objectCount); if (hsm_pkcs11_check_error(ctx, rv, "Find first object")) { free(key_handles); *count = 0; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); (void)hsm_pkcs11_check_error(ctx, rv, "Find objects cleanup"); return NULL; } total_count += objectCount; if (objectCount > 0 && store) { key_handles_prev = key_handles; if (!(key_handles = realloc(key_handles_prev, total_count * sizeof(CK_OBJECT_HANDLE)))) { free(key_handles_prev); *count = 0; return NULL; } for (i = 0; i < objectCount; i++) { key_handles[j] = object[i]; j++; } } } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_FindObjectsFinal(session->session); if (hsm_pkcs11_check_error(ctx, rv, "Find objects final")) { free(key_handles); *count = 0; return NULL; } if (store) { keys_prev = keys; if (!(keys = realloc(keys_prev, total_count * sizeof(hsm_key_t *)))) { free(key_handles); free(keys_prev); *count = 0; return NULL; } for (i = 0; i < total_count; i++) { key = hsm_key_new_privkey_object_handle(ctx, session, key_handles[i]); /* todo, if we get NULL, free all and return error? */ keys[i] = key; } } free(key_handles); *count = total_count; return keys; } /* returns an array of all keys available to the given session * * \param session the session to find the keys in * \param count this value will contain the number of keys found * * \return the list of keys */ hsm_key_t ** hsm_list_keys_session(hsm_ctx_t *ctx, const hsm_session_t *session, size_t *count) { return hsm_list_keys_session_internal(ctx, session, count, 1); } /* returns a count all keys available to the given session * * \param session the session to find the keys in * * \return the number of keys */ size_t hsm_count_keys_session(hsm_ctx_t *ctx, const hsm_session_t *session) { size_t count = 0; (void) hsm_list_keys_session_internal(ctx, session, &count, 0); return count; } /* returns a newly allocated key structure containing the key data * for the given CKA_ID available in the session. Returns NULL if not * found */ static hsm_key_t * hsm_find_key_by_id_session(hsm_ctx_t *ctx, const hsm_session_t *session, const unsigned char *id, size_t len) { hsm_key_t *key; CK_OBJECT_HANDLE private_key_handle; private_key_handle = hsm_find_object_handle_for_id( ctx, session, CKO_PRIVATE_KEY, (CK_BYTE *) id, (CK_ULONG) len); if (private_key_handle != 0) { key = hsm_key_new_privkey_object_handle(ctx, session, private_key_handle); return key; } else { return NULL; } } /* Find a key pair by CKA_ID (as byte array) The returned key structure can be freed with hsm_key_free() \param context HSM context \param id CKA_ID of key to find (array of bytes) \param len number of bytes in the id \return key identifier or NULL if not found */ static hsm_key_t * hsm_find_key_by_id_bin(hsm_ctx_t *ctx, const unsigned char *id, size_t len) { hsm_key_t *key; unsigned int i; if (!ctx) ctx = _hsm_ctx; if (!id) return NULL; for (i = 0; i < ctx->session_count; i++) { key = hsm_find_key_by_id_session(ctx, ctx->session[i], id, len); if (key) return key; } return NULL; } /** * returns the first session found if repository is null, otherwise * finds the session belonging to the repository with the given name * returns NULL if not found */ static hsm_session_t * hsm_find_repository_session(hsm_ctx_t *ctx, const char *repository) { unsigned int i; if (!repository) { for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i]) { return ctx->session[i]; } } } else { for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && strcmp(repository, ctx->session[i]->module->name) == 0) { return ctx->session[i]; } } } hsm_ctx_set_error(ctx, HSM_REPOSITORY_NOT_FOUND, "hsm_find_repository_session()", "Can't find repository: %s", repository); return NULL; } static ldns_rdf * hsm_get_key_rdata_rsa(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR public_exponent = NULL; CK_ULONG public_exponent_len = 0; CK_BYTE_PTR modulus = NULL; CK_ULONG modulus_len = 0; unsigned long hKey = 0; unsigned char *data = NULL; size_t data_size = 0; CK_ATTRIBUTE template[] = { {CKA_PUBLIC_EXPONENT, NULL, 0}, {CKA_MODULUS, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } if (session->module->config->use_pubkey) { hKey = key->public_key; } else { hKey = key->private_key; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, hKey, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } public_exponent_len = template[0].ulValueLen; modulus_len = template[1].ulValueLen; public_exponent = template[0].pValue = malloc(public_exponent_len); if (!public_exponent) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for public exponent"); return NULL; } modulus = template[1].pValue = malloc(modulus_len); if (!modulus) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for modulus"); free(public_exponent); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, hKey, template, 2); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(template[0].pValue); free(template[1].pValue); return NULL; } // Remove leading zeroes hsm_remove_leading_zeroes(public_exponent, &public_exponent_len); hsm_remove_leading_zeroes(modulus, &modulus_len); data_size = public_exponent_len + modulus_len + 1; if (public_exponent_len <= 255) { data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for pub key rr data"); free(public_exponent); free(modulus); return NULL; } data[0] = public_exponent_len; memcpy(&data[1], public_exponent, public_exponent_len); memcpy(&data[1 + public_exponent_len], modulus, modulus_len); } else if (public_exponent_len <= 65535) { data_size += 2; data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Error allocating memory for pub key rr data"); free(public_exponent); free(modulus); return NULL; } data[0] = 0; ldns_write_uint16(&data[1], (uint16_t) public_exponent_len); memcpy(&data[3], public_exponent, public_exponent_len); memcpy(&data[3 + public_exponent_len], modulus, modulus_len); } else { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_rsa()", "Public exponent too big"); free(public_exponent); free(modulus); return NULL; } rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, data_size, data); free(public_exponent); free(modulus); return rdf; } static ldns_rdf * hsm_get_key_rdata_dsa(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR prime = NULL; CK_ULONG prime_len = 0; CK_BYTE_PTR subprime = NULL; CK_ULONG subprime_len = 0; CK_BYTE_PTR base = NULL; CK_ULONG base_len = 0; CK_BYTE_PTR value = NULL; CK_ULONG value_len = 0; unsigned char *data = NULL; size_t data_size = 0; CK_ATTRIBUTE template[] = { {CKA_PRIME, NULL, 0}, {CKA_SUBPRIME, NULL, 0}, {CKA_BASE, NULL, 0}, {CKA_VALUE, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } /* DSA needs the public key compared with RSA */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 4); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } prime_len = template[0].ulValueLen; subprime_len = template[1].ulValueLen; base_len = template[2].ulValueLen; value_len = template[3].ulValueLen; prime = template[0].pValue = malloc(prime_len); if (!prime) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for prime"); return NULL; } subprime = template[1].pValue = malloc(subprime_len); if (!subprime) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for subprime"); free(prime); return NULL; } base = template[2].pValue = malloc(base_len); if (!base) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for base"); free(prime); free(subprime); return NULL; } value = template[3].pValue = malloc(value_len); if (!value) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for value"); free(prime); free(subprime); free(base); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 4); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(prime); free(subprime); free(base); free(value); return NULL; } data_size = prime_len + subprime_len + base_len + value_len + 1; data = malloc(data_size); if (!data) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for pub key rr data"); free(prime); free(subprime); free(base); free(value); return NULL; } data[0] = (prime_len - 64) / 8; memcpy(&data[1], subprime, subprime_len); memcpy(&data[1 + subprime_len], prime, prime_len); memcpy(&data[1 + subprime_len + prime_len], base, base_len); memcpy(&data[1 + subprime_len + prime_len + base_len], value, value_len); rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, data_size, data); free(prime); free(subprime); free(base); free(value); return rdf; } static ldns_rdf * hsm_get_key_rdata_gost(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { CK_RV rv; CK_BYTE_PTR value = NULL; CK_ULONG value_len = 0; CK_ATTRIBUTE template[] = { {CKA_VALUE, NULL, 0}, }; ldns_rdf *rdf; if (!session || !session->module) { return NULL; } /* GOST needs the public key compared with RSA */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "C_GetAttributeValue")) { return NULL; } value_len = template[0].ulValueLen; value = template[0].pValue = malloc(value_len); if (!value) { hsm_ctx_set_error(ctx, -1, "hsm_get_key_rdata_dsa()", "Error allocating memory for value"); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue( session->session, key->public_key, template, 1); if (hsm_pkcs11_check_error(ctx, rv, "get attribute value")) { free(value); return NULL; } rdf = ldns_rdf_new(LDNS_RDF_TYPE_B64, value_len, value); return rdf; } static ldns_rdf * hsm_get_key_rdata(hsm_ctx_t *ctx, hsm_session_t *session, const hsm_key_t *key) { /* TODO: Add ECDSA */ switch (hsm_get_key_algorithm(ctx, session, key)) { case CKK_RSA: return hsm_get_key_rdata_rsa(ctx, session, key); break; case CKK_DSA: return hsm_get_key_rdata_dsa(ctx, session, key); break; case CKK_GOSTR3410: return hsm_get_key_rdata_gost(ctx, session, key); break; default: return 0; } } /* this function allocates memory for the mechanism ID and enough room * to leave the upcoming digest data. It fills in the mechanism id * use with care. The returned data must be free'd by the caller. * Only used by RSA PKCS. */ static CK_BYTE * hsm_create_prefix(CK_ULONG digest_len, ldns_algorithm algorithm, CK_ULONG *data_size) { CK_BYTE *data; const CK_BYTE RSA_MD5_ID[] = { 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 }; const CK_BYTE RSA_SHA1_ID[] = { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14 }; const CK_BYTE RSA_SHA256_ID[] = { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }; const CK_BYTE RSA_SHA512_ID[] = { 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }; switch(algorithm) { case LDNS_SIGN_RSAMD5: *data_size = sizeof(RSA_MD5_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_MD5_ID, sizeof(RSA_MD5_ID)); break; case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: *data_size = sizeof(RSA_SHA1_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA1_ID, sizeof(RSA_SHA1_ID)); break; case LDNS_SIGN_RSASHA256: *data_size = sizeof(RSA_SHA256_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA256_ID, sizeof(RSA_SHA256_ID)); break; case LDNS_SIGN_RSASHA512: *data_size = sizeof(RSA_SHA512_ID) + digest_len; data = malloc(*data_size); memcpy(data, RSA_SHA512_ID, sizeof(RSA_SHA512_ID)); break; case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: case LDNS_SIGN_ECC_GOST: #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif *data_size = digest_len; data = malloc(*data_size); break; default: return NULL; } return data; } static CK_BYTE * hsm_digest_through_hsm(hsm_ctx_t *ctx, hsm_session_t *session, CK_MECHANISM_TYPE mechanism_type, CK_ULONG digest_len, ldns_buffer *sign_buf) { CK_MECHANISM digest_mechanism; CK_BYTE *digest; CK_RV rv; digest_mechanism.pParameter = NULL; digest_mechanism.ulParameterLen = 0; digest_mechanism.mechanism = mechanism_type; digest = malloc(digest_len); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DigestInit(session->session, &digest_mechanism); if (hsm_pkcs11_check_error(ctx, rv, "HSM digest init")) { free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest, &digest_len); if (hsm_pkcs11_check_error(ctx, rv, "HSM digest")) { free(digest); return NULL; } return digest; } static ldns_rdf * hsm_sign_buffer(hsm_ctx_t *ctx, ldns_buffer *sign_buf, const hsm_key_t *key, ldns_algorithm algorithm) { CK_RV rv; CK_ULONG signatureLen = HSM_MAX_SIGNATURE_LENGTH; CK_BYTE signature[HSM_MAX_SIGNATURE_LENGTH]; CK_MECHANISM sign_mechanism; ldns_rdf *sig_rdf; CK_BYTE *digest = NULL; CK_ULONG digest_len; CK_BYTE *data = NULL; CK_ULONG data_len = 0; hsm_session_t *session; session = hsm_find_key_session(ctx, key); if (!session) return NULL; /* some HSMs don't really handle CKM_SHA1_RSA_PKCS well, so * we'll do the hashing manually */ /* When adding algorithms, remember there is another switch below */ switch (algorithm) { case LDNS_SIGN_RSAMD5: digest_len = 16; digest = hsm_digest_through_hsm(ctx, session, CKM_MD5, digest_len, sign_buf); break; case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: digest_len = LDNS_SHA1_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha1(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; case LDNS_SIGN_RSASHA256: #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: #endif digest_len = LDNS_SHA256_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha256(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP384SHA384: digest_len = LDNS_SHA384_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha384(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; #endif case LDNS_SIGN_RSASHA512: digest_len = LDNS_SHA512_DIGEST_LENGTH; digest = malloc(digest_len); digest = ldns_sha512(ldns_buffer_begin(sign_buf), ldns_buffer_position(sign_buf), digest); break; case LDNS_SIGN_ECC_GOST: digest_len = 32; digest = hsm_digest_through_hsm(ctx, session, CKM_GOSTR3411, digest_len, sign_buf); break; default: /* log error? or should we not even get here for * unsupported algorithms? */ return NULL; } if (!digest) { return NULL; } /* CKM_RSA_PKCS does the padding, but cannot know the identifier * prefix, so we need to add that ourselves. * The other algorithms will just get the digest buffer returned. */ data = hsm_create_prefix(digest_len, algorithm, &data_len); memcpy(data + data_len - digest_len, digest, digest_len); sign_mechanism.pParameter = NULL; sign_mechanism.ulParameterLen = 0; switch(algorithm) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: sign_mechanism.mechanism = CKM_RSA_PKCS; break; case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: sign_mechanism.mechanism = CKM_DSA; break; case LDNS_SIGN_ECC_GOST: sign_mechanism.mechanism = CKM_GOSTR3410; break; #if LDNS_BUILD_CONFIG_USE_ECDSA /* TODO: Add ECDSA */ case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif default: /* log error? or should we not even get here for * unsupported algorithms? */ free(data); free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_SignInit( session->session, &sign_mechanism, key->private_key); if (hsm_pkcs11_check_error(ctx, rv, "sign init")) { free(data); free(digest); return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Sign(session->session, data, data_len, signature, &signatureLen); if (hsm_pkcs11_check_error(ctx, rv, "sign final")) { free(data); free(digest); return NULL; } sig_rdf = ldns_rdf_new_frm_data(LDNS_RDF_TYPE_B64, signatureLen, signature); free(data); free(digest); return sig_rdf; } static int hsm_dname_is_wildcard(const ldns_rdf* dname) { return ( ldns_dname_label_count(dname) > 0 && ldns_rdf_data(dname)[0] == 1 && ldns_rdf_data(dname)[1] == '*'); } static ldns_rr * hsm_create_empty_rrsig(const ldns_rr_list *rrset, const hsm_sign_params_t *sign_params) { ldns_rr *rrsig; uint32_t orig_ttl; uint32_t orig_class; time_t now; uint8_t label_count; label_count = ldns_dname_label_count( ldns_rr_owner(ldns_rr_list_rr(rrset, 0))); /* RFC 4035 section 2.2: dnssec label length and wildcards */ if (hsm_dname_is_wildcard(ldns_rr_owner(ldns_rr_list_rr(rrset, 0)))) { label_count--; } rrsig = ldns_rr_new_frm_type(LDNS_RR_TYPE_RRSIG); /* set the type on the new signature */ orig_ttl = ldns_rr_ttl(ldns_rr_list_rr(rrset, 0)); orig_class = ldns_rr_get_class(ldns_rr_list_rr(rrset, 0)); ldns_rr_set_class(rrsig, orig_class); ldns_rr_set_ttl(rrsig, orig_ttl); ldns_rr_set_owner(rrsig, ldns_rdf_clone( ldns_rr_owner( ldns_rr_list_rr(rrset, 0)))); /* fill in what we know of the signature */ /* set the orig_ttl */ (void)ldns_rr_rrsig_set_origttl( rrsig, ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, orig_ttl)); /* the signers name */ (void)ldns_rr_rrsig_set_signame( rrsig, ldns_rdf_clone(sign_params->owner)); /* label count - get it from the first rr in the rr_list */ (void)ldns_rr_rrsig_set_labels( rrsig, ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, label_count)); /* inception, expiration */ now = time(NULL); if (sign_params->inception != 0) { (void)ldns_rr_rrsig_set_inception( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, sign_params->inception)); } else { (void)ldns_rr_rrsig_set_inception( rrsig, ldns_native2rdf_int32(LDNS_RDF_TYPE_TIME, now)); } if (sign_params->expiration != 0) { (void)ldns_rr_rrsig_set_expiration( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, sign_params->expiration)); } else { (void)ldns_rr_rrsig_set_expiration( rrsig, ldns_native2rdf_int32( LDNS_RDF_TYPE_TIME, now + LDNS_DEFAULT_EXP_TIME)); } (void)ldns_rr_rrsig_set_keytag( rrsig, ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, sign_params->keytag)); (void)ldns_rr_rrsig_set_algorithm( rrsig, ldns_native2rdf_int8( LDNS_RDF_TYPE_ALG, sign_params->algorithm)); (void)ldns_rr_rrsig_set_typecovered( rrsig, ldns_native2rdf_int16( LDNS_RDF_TYPE_TYPE, ldns_rr_get_type(ldns_rr_list_rr(rrset, 0)))); return rrsig; } /* * API functions */ int hsm_open(const char *config, char *(pin_callback)(unsigned int, const char *, unsigned int)) { xmlDocPtr doc; xmlXPathContextPtr xpath_ctx; xmlXPathObjectPtr xpath_obj; xmlNode *curNode; xmlChar *xexpr; int i; char *config_file; char *repository; char *token_label; char *module_path; char *module_pin; hsm_config_t module_config; int result = HSM_OK; int tries; int repositories = 0; /* create an internal context with an attached session for each * configured HSM. */ _hsm_ctx = hsm_ctx_new(); if (config) { config_file = strdup(config); } else{ config_file = strdup(HSM_DEFAULT_CONFIG); } /* Load XML document */ doc = xmlParseFile(config_file); free(config_file); if (doc == NULL) { return HSM_CONFIG_FILE_ERROR; } /* Create xpath evaluation context */ xpath_ctx = xmlXPathNewContext(doc); if(xpath_ctx == NULL) { xmlFreeDoc(doc); hsm_ctx_free(_hsm_ctx); _hsm_ctx = NULL; return -1; } /* Evaluate xpath expression */ xexpr = (xmlChar *)"//Configuration/RepositoryList/Repository"; xpath_obj = xmlXPathEvalExpression(xexpr, xpath_ctx); if(xpath_obj == NULL) { xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); hsm_ctx_free(_hsm_ctx); _hsm_ctx = NULL; return -1; } if (xpath_obj->nodesetval) { for (i = 0; i < xpath_obj->nodesetval->nodeNr; i++) { /*module = hsm_module_new();*/ token_label = NULL; module_path = NULL; module_pin = NULL; hsm_config_default(&module_config); curNode = xpath_obj->nodesetval->nodeTab[i]->xmlChildrenNode; repository = (char *) xmlGetProp(xpath_obj->nodesetval->nodeTab[i], (const xmlChar *)"name"); while (curNode) { if (xmlStrEqual(curNode->name, (const xmlChar *)"TokenLabel")) token_label = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"Module")) module_path = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"PIN")) module_pin = (char *) xmlNodeGetContent(curNode); if (xmlStrEqual(curNode->name, (const xmlChar *)"SkipPublicKey")) module_config.use_pubkey = 0; if (xmlStrEqual(curNode->name, (const xmlChar *)"AllowExtraction")) module_config.allow_extract = 1; curNode = curNode->next; } if (repository && token_label && module_path) { if (module_pin) { result = hsm_attach(repository, token_label, module_path, module_pin, &module_config); free(module_pin); } else { if (pin_callback) { result = HSM_PIN_INCORRECT; tries = 0; while (result == HSM_PIN_INCORRECT && tries < 3) { if (tries == 0) { module_pin = pin_callback(_hsm_ctx->session_count, repository, HSM_PIN_FIRST); } else { module_pin = pin_callback(_hsm_ctx->session_count, repository, HSM_PIN_RETRY); } if (module_pin == NULL) break; result = hsm_attach(repository, token_label, module_path, module_pin, &module_config); if (result == HSM_OK) { pin_callback(_hsm_ctx->session_count - 1, repository, HSM_PIN_SAVE); } memset(module_pin, 0, strlen(module_pin)); tries++; } } else { /* no pin, no callback */ hsm_ctx_set_error(_hsm_ctx, HSM_ERROR, "hsm_open()", "No pin or callback function"); result = HSM_ERROR; } } free(repository); free(token_label); free(module_path); if (result != HSM_OK) { break; } repositories++; } } } xmlXPathFreeObject(xpath_obj); xmlXPathFreeContext(xpath_ctx); xmlFreeDoc(doc); if (result == HSM_OK && repositories == 0) { hsm_ctx_set_error(_hsm_ctx, HSM_NO_REPOSITORIES, "hsm_open()", "No repositories found"); return HSM_NO_REPOSITORIES; } return result; } int hsm_close() { hsm_ctx_close(_hsm_ctx, 1); return 0; } hsm_ctx_t * hsm_create_context() { return hsm_ctx_clone(_hsm_ctx); } int hsm_check_context(hsm_ctx_t *ctx) { unsigned int i; hsm_session_t *session; CK_SESSION_INFO info; CK_RV rv; CK_SESSION_HANDLE session_handle; if (ctx == NULL) { ctx = _hsm_ctx; } for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; if (session == NULL) continue; /* Get session info */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetSessionInfo( session->session, &info); if (hsm_pkcs11_check_error(ctx, rv, "get session info")) { return HSM_ERROR; } /* Check session info */ if (info.state != CKS_RW_USER_FUNCTIONS) { hsm_ctx_set_error(ctx, HSM_ERROR, "hsm_check_context()", "Session not logged in"); return HSM_ERROR; } /* Try open and close a session with the token */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_OpenSession(info.slotID, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_handle); if (hsm_pkcs11_check_error(ctx, rv, "test open session")) { return HSM_ERROR; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_CloseSession(session_handle); if (hsm_pkcs11_check_error(ctx, rv, "test close session")) { return HSM_ERROR; } } return HSM_OK; } void hsm_destroy_context(hsm_ctx_t *ctx) { hsm_ctx_close(ctx, 0); } /** * Returns an allocated hsm_sign_params_t with some defaults */ hsm_sign_params_t * hsm_sign_params_new() { hsm_sign_params_t *params; params = malloc(sizeof(hsm_sign_params_t)); if (!params) { return NULL; } params->algorithm = LDNS_RSASHA256; params->flags = LDNS_KEY_ZONE_KEY; params->inception = 0; params->expiration = 0; params->keytag = 0; params->owner = NULL; return params; } void hsm_sign_params_free(hsm_sign_params_t *params) { if (params) { if (params->owner) ldns_rdf_deep_free(params->owner); free(params); } } hsm_key_t ** hsm_list_keys(hsm_ctx_t *ctx, size_t *count) { hsm_key_t **keys = NULL, **keys_prev; size_t key_count = 0; size_t cur_key_count; hsm_key_t **session_keys; unsigned int i, j; if (!ctx) { ctx = _hsm_ctx; } for (i = 0; i < ctx->session_count; i++) { session_keys = hsm_list_keys_session(ctx, ctx->session[i], &cur_key_count); keys_prev = keys; keys = realloc(keys_prev, (key_count + cur_key_count) * sizeof(hsm_key_t *)); if (!keys) { free(keys_prev); return NULL; } for (j = 0; j < cur_key_count; j++) { keys[key_count + j] = session_keys[j]; } key_count += cur_key_count; free(session_keys); } if (count) { *count = key_count; } return keys; } hsm_key_t ** hsm_list_keys_repository(hsm_ctx_t *ctx, size_t *count, const char *repository) { hsm_session_t *session; if (!repository) return NULL; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) { *count = 0; return NULL; } return hsm_list_keys_session(ctx, session, count); } size_t hsm_count_keys(hsm_ctx_t *ctx) { size_t count = 0; unsigned int i; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { count += hsm_count_keys_session(ctx, ctx->session[i]); } return count; } size_t hsm_count_keys_repository(hsm_ctx_t *ctx, const char *repository) { hsm_session_t *session; if (!repository) return 0; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) { return 0; } return hsm_count_keys_session(ctx, session); } hsm_key_t * hsm_find_key_by_id(hsm_ctx_t *ctx, const char *id) { unsigned char *id_bytes; size_t len; hsm_key_t *key; id_bytes = hsm_hex_parse(id, &len); if (!id_bytes) return NULL; key = hsm_find_key_by_id_bin(ctx, id_bytes, len); free(id_bytes); return key; } hsm_key_t * hsm_generate_rsa_key(hsm_ctx_t *ctx, const char *repository, unsigned long keysize) { hsm_key_t *new_key, *key; hsm_session_t *session; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_RV rv; CK_OBJECT_HANDLE publicKey, privateKey; CK_KEY_TYPE keyType = CKK_RSA; CK_MECHANISM mechanism = { CKM_RSA_PKCS_KEY_PAIR_GEN, NULL_PTR, 0 }; CK_BYTE publicExponent[] = { 1, 0, 1 }; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; CK_BBOOL ctoken = CK_TRUE; CK_BBOOL cextractable = CK_FALSE; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; cextractable = session->module->config->allow_extract ? CK_TRUE : CK_FALSE; /* check whether this key doesn't happen to exist already */ key = NULL; do { free(key); hsm_random_buffer(ctx, id, 16); } while ((key = hsm_find_key_by_id_bin(ctx, id, 16))); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); if (! session->module->config->use_pubkey) { ctoken = CK_FALSE; } CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctoken, sizeof(ctoken) }, { CKA_MODULUS_BITS, &keysize, sizeof(keysize) }, { CKA_PUBLIC_EXPONENT, &publicExponent, sizeof(publicExponent)} }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR *) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof (ctrue) }, { CKA_DECRYPT, &cfalse, sizeof (cfalse) }, { CKA_UNWRAP, &cfalse, sizeof (cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof (ctrue) }, { CKA_TOKEN, &ctrue, sizeof (ctrue) }, { CKA_PRIVATE, &ctrue, sizeof (ctrue) }, { CKA_EXTRACTABLE, &cextractable, sizeof (cextractable) } }; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism, publicKeyTemplate, 9, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; if (session->module->config->use_pubkey) { new_key->public_key = publicKey; } else { /* Destroy the object directly in order to optimize storage in HSM */ /* Ignore return value, it is just a session object and will be destroyed later */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, publicKey); new_key->public_key = 0; } new_key->private_key = privateKey; return new_key; } hsm_key_t * hsm_generate_dsa_key(hsm_ctx_t *ctx, const char *repository, unsigned long keysize) { CK_RV rv; hsm_key_t *new_key, *key; hsm_session_t *session; CK_OBJECT_HANDLE domainPar, publicKey, privateKey; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; CK_BBOOL cextractable = CK_FALSE; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_KEY_TYPE keyType = CKK_DSA; CK_MECHANISM mechanism1 = { CKM_DSA_PARAMETER_GEN, NULL_PTR, 0 }; CK_MECHANISM mechanism2 = { CKM_DSA_KEY_PAIR_GEN, NULL_PTR, 0 }; /* The maximum size for DSA in DNSSEC */ CK_BYTE dsa_p[128]; CK_BYTE dsa_q[20]; CK_BYTE dsa_g[128]; CK_ATTRIBUTE domainTemplate[] = { { CKA_PRIME_BITS, &keysize, sizeof(keysize) } }; CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_PRIME, dsa_p, sizeof(dsa_p) }, { CKA_SUBPRIME, dsa_q, sizeof(dsa_q) }, { CKA_BASE, dsa_g, sizeof(dsa_g) }, { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) } }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof(ctrue) }, { CKA_DECRYPT, &cfalse, sizeof(cfalse) }, { CKA_UNWRAP, &cfalse, sizeof(cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof(ctrue) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) }, { CKA_PRIVATE, &ctrue, sizeof(ctrue) }, { CKA_EXTRACTABLE, &cextractable, sizeof (cextractable) } }; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; cextractable = session->module->config->allow_extract ? CK_TRUE : CK_FALSE; /* check whether this key doesn't happen to exist already */ key = NULL; do { hsm_key_free(key); hsm_random_buffer(ctx, id, 16); } while ((key = hsm_find_key_by_id_bin(ctx, id, 16))); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); /* Generate the domain parameters */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKey(session->session, &mechanism1, domainTemplate, 1, &domainPar); if (hsm_pkcs11_check_error(ctx, rv, "generate domain parameters")) { return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GetAttributeValue(session->session, domainPar, publicKeyTemplate, 3); if (hsm_pkcs11_check_error(ctx, rv, "get domain parameters")) { return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, domainPar); if (hsm_pkcs11_check_error(ctx, rv, "destroy domain parameters")) { return NULL; } /* Generate key pair */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism2, publicKeyTemplate, 10, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; new_key->public_key = publicKey; new_key->private_key = privateKey; return new_key; } hsm_key_t * hsm_generate_gost_key(hsm_ctx_t *ctx, const char *repository) { CK_RV rv; hsm_key_t *new_key, *key; hsm_session_t *session; CK_OBJECT_HANDLE publicKey, privateKey; CK_BBOOL ctrue = CK_TRUE; CK_BBOOL cfalse = CK_FALSE; CK_BBOOL cextractable = CK_FALSE; /* ids we create are 16 bytes of data */ unsigned char id[16]; /* that's 33 bytes in string (16*2 + 1 for \0) */ char id_str[33]; CK_KEY_TYPE keyType = CKK_GOSTR3410; CK_MECHANISM mechanism = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL_PTR, 0 }; CK_BYTE oid1[] = { 0x06, 0x07, 0x2A, 0x85, 0x03, 0x02, 0x02, 0x23, 0x01 }; CK_BYTE oid2[] = { 0x06, 0x07, 0x2A, 0x85, 0x03, 0x02, 0x02, 0x1E, 0x01 }; CK_ATTRIBUTE publicKeyTemplate[] = { { CKA_GOSTR3410PARAMS, oid1, sizeof(oid1) }, { CKA_GOSTR3411PARAMS, oid2, sizeof(oid2) }, { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen(id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_VERIFY, &ctrue, sizeof(ctrue) }, { CKA_ENCRYPT, &cfalse, sizeof(cfalse) }, { CKA_WRAP, &cfalse, sizeof(cfalse) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) } }; CK_ATTRIBUTE privateKeyTemplate[] = { { CKA_LABEL,(CK_UTF8CHAR*) id_str, strlen (id_str) }, { CKA_ID, id, 16 }, { CKA_KEY_TYPE, &keyType, sizeof(keyType) }, { CKA_SIGN, &ctrue, sizeof(ctrue) }, { CKA_DECRYPT, &cfalse, sizeof(cfalse) }, { CKA_UNWRAP, &cfalse, sizeof(cfalse) }, { CKA_SENSITIVE, &ctrue, sizeof(ctrue) }, { CKA_TOKEN, &ctrue, sizeof(ctrue) }, { CKA_PRIVATE, &ctrue, sizeof(ctrue) }, { CKA_EXTRACTABLE, &cextractable, sizeof (cextractable) } }; if (!ctx) ctx = _hsm_ctx; session = hsm_find_repository_session(ctx, repository); if (!session) return NULL; cextractable = session->module->config->allow_extract ? CK_TRUE : CK_FALSE; /* check whether this key doesn't happen to exist already */ key = NULL; do { hsm_key_free(key); hsm_random_buffer(ctx, id, 16); } while ((key = hsm_find_key_by_id_bin(ctx, id, 16))); /* the CKA_LABEL will contain a hexadecimal string representation * of the id */ hsm_hex_unparse(id_str, id, 16); /* Generate key pair */ rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateKeyPair(session->session, &mechanism, publicKeyTemplate, 9, privateKeyTemplate, 10, &publicKey, &privateKey); if (hsm_pkcs11_check_error(ctx, rv, "generate key pair")) { return NULL; } new_key = hsm_key_new(); new_key->module = session->module; new_key->public_key = publicKey; new_key->private_key = privateKey; return new_key; } int hsm_remove_key(hsm_ctx_t *ctx, hsm_key_t *key) { CK_RV rv; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; if (!key) return -1; session = hsm_find_key_session(ctx, key); if (!session) return -2; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, key->private_key); if (hsm_pkcs11_check_error(ctx, rv, "Destroy private key")) { return -3; } key->private_key = 0; if (session->module->config->use_pubkey) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DestroyObject(session->session, key->public_key); if (hsm_pkcs11_check_error(ctx, rv, "Destroy public key")) { return -4; } } key->public_key = 0; return 0; } void hsm_key_free(hsm_key_t *key) { if (key) { free(key); } } void hsm_key_list_free(hsm_key_t **key_list, size_t count) { size_t i; for (i = 0; i < count; i++) { hsm_key_free(key_list[i]); } free(key_list); } char * hsm_get_key_id(hsm_ctx_t *ctx, const hsm_key_t *key) { unsigned char *id; char *id_str; size_t len; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; if (!key) return NULL; session = hsm_find_key_session(ctx, key); if (!session) return NULL; id = hsm_get_id_for_object(ctx, session, key->private_key, &len); if (!id) return NULL; /* this is plain binary data, we need to convert it to hex */ id_str = malloc(len * 2 + 1); if (!id_str) { free(id); return NULL; } hsm_hex_unparse(id_str, id, len); free(id); return id_str; } hsm_key_info_t * hsm_get_key_info(hsm_ctx_t *ctx, const hsm_key_t *key) { hsm_key_info_t *key_info; hsm_session_t *session; if (!ctx) ctx = _hsm_ctx; session = hsm_find_key_session(ctx, key); if (!session) return NULL; key_info = malloc(sizeof(hsm_key_info_t)); key_info->id = hsm_get_key_id(ctx, key); if (key_info->id == NULL) { key_info->id = strdup(""); } key_info->algorithm = (unsigned long) hsm_get_key_algorithm(ctx, session, key); key_info->keysize = (unsigned long) hsm_get_key_size(ctx, session, key, key_info->algorithm); /* TODO: Add ECDSA */ switch(key_info->algorithm) { case CKK_RSA: key_info->algorithm_name = strdup("RSA"); break; case CKK_DSA: key_info->algorithm_name = strdup("DSA"); break; case CKK_GOSTR3410: key_info->algorithm_name = strdup("GOST"); break; default: key_info->algorithm_name = malloc(HSM_MAX_ALGONAME); snprintf(key_info->algorithm_name, HSM_MAX_ALGONAME, "%lu", key_info->algorithm); break; } return key_info; } void hsm_key_info_free(hsm_key_info_t *key_info) { if (key_info) { if (key_info->id) { free(key_info->id); } if (key_info->algorithm_name) { free(key_info->algorithm_name); } free(key_info); } } ldns_rr* hsm_sign_rrset(hsm_ctx_t *ctx, const ldns_rr_list* rrset, const hsm_key_t *key, const hsm_sign_params_t *sign_params) { ldns_rr *signature; ldns_buffer *sign_buf; ldns_rdf *b64_rdf; size_t i; if (!key) return NULL; if (!sign_params) return NULL; if (!ctx) ctx = _hsm_ctx; signature = hsm_create_empty_rrsig((ldns_rr_list *)rrset, sign_params); /* right now, we have: a key, a semi-sig and an rrset. For * which we can create the sig and base64 encode that and * add that to the signature */ sign_buf = ldns_buffer_new(LDNS_MAX_PACKETLEN); if (ldns_rrsig2buffer_wire(sign_buf, signature) != LDNS_STATUS_OK) { ldns_buffer_free(sign_buf); /* ERROR */ ldns_rr_free(signature); return NULL; } /* make it canonical */ for(i = 0; i < ldns_rr_list_rr_count(rrset); i++) { ldns_rr2canonical(ldns_rr_list_rr(rrset, i)); } /* add the rrset in sign_buf */ if (ldns_rr_list2buffer_wire(sign_buf, rrset) != LDNS_STATUS_OK) { ldns_buffer_free(sign_buf); ldns_rr_free(signature); return NULL; } b64_rdf = hsm_sign_buffer(ctx, sign_buf, key, sign_params->algorithm); ldns_buffer_free(sign_buf); if (!b64_rdf) { /* signing went wrong */ ldns_rr_free(signature); return NULL; } ldns_rr_rrsig_set_sig(signature, b64_rdf); return signature; } /* returns a newly allocated (not null-terminated!) string containing * the message digest of the given source string * digest length contains the length of the result * caller must free returned data with free() * returns NULL (and zero digest length) on error */ static CK_BYTE * hsm_digest(hsm_ctx_t *ctx, hsm_session_t *session, CK_MECHANISM digest_mechanism, char *source, size_t length, size_t *digest_length) { CK_RV rv; CK_BYTE *digest; CK_ULONG d = 0; rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_DigestInit(session->session, &digest_mechanism); if (hsm_pkcs11_check_error(ctx, rv, "digest init")) { *digest_length = 0; return NULL; } rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, (CK_BYTE *)source, length, NULL, &d); if (hsm_pkcs11_check_error(ctx, rv, "digest to determine result size")) { *digest_length = 0; return NULL; } digest = malloc(d); rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_Digest(session->session, (CK_BYTE *)source, length, digest, &d); if (hsm_pkcs11_check_error(ctx, rv, "digest")) { *digest_length = 0; free(digest); return NULL; } *digest_length = d; return digest; } ldns_rdf * hsm_nsec3_hash_name(hsm_ctx_t *ctx, ldns_rdf *name, uint8_t algorithm, uint16_t iterations, uint8_t salt_length, uint8_t *salt) { char *orig_owner_str; size_t hashed_owner_str_len; ldns_rdf *hashed_owner; char *hashed_owner_str; char *hashed_owner_b32; int hashed_owner_b32_len; uint32_t cur_it; char *hash = NULL; size_t hash_length = 0; ldns_status status; CK_MECHANISM mechanism; unsigned int i; hsm_session_t *session = NULL; char *error_name; switch(algorithm) { case 1: mechanism.mechanism = CKM_SHA_1; mechanism.pParameter = NULL; mechanism.ulParameterLen = 0; break; default: printf("unknown algo: %u\n", (unsigned int)algorithm); return NULL; break; } /* just use the first available session */ if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i]) session = ctx->session[i]; } if (!session) { return NULL; } /* prepare the owner name according to the draft section bla */ orig_owner_str = ldns_rdf2str(name); hashed_owner_str_len = salt_length + ldns_rdf_size(name); hashed_owner_str = LDNS_XMALLOC(char, hashed_owner_str_len); memcpy(hashed_owner_str, ldns_rdf_data(name), ldns_rdf_size(name)); memcpy(hashed_owner_str + ldns_rdf_size(name), salt, salt_length); for (cur_it = iterations + 1; cur_it > 0; cur_it--) { if (hash != NULL) free(hash); hash = (char *) hsm_digest(ctx, session, mechanism, hashed_owner_str, hashed_owner_str_len, &hash_length); LDNS_FREE(hashed_owner_str); hashed_owner_str_len = salt_length + hash_length; hashed_owner_str = LDNS_XMALLOC(char, hashed_owner_str_len); if (!hashed_owner_str) { hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Memory error"); return NULL; } memcpy(hashed_owner_str, hash, hash_length); memcpy(hashed_owner_str + hash_length, salt, salt_length); } LDNS_FREE(hashed_owner_str); hashed_owner_str = hash; hashed_owner_str_len = hash_length; hashed_owner_b32 = LDNS_XMALLOC(char, ldns_b32_ntop_calculate_size( hashed_owner_str_len) + 1); LDNS_FREE(orig_owner_str); hashed_owner_b32_len = (size_t) ldns_b32_ntop_extended_hex((uint8_t *) hashed_owner_str, hashed_owner_str_len, hashed_owner_b32, ldns_b32_ntop_calculate_size( hashed_owner_str_len)); if (hashed_owner_b32_len < 1) { error_name = ldns_rdf2str(name); hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Error in base32 extended hex encoding " "of hashed owner name (name: %s, return code: %d)", error_name, hashed_owner_b32_len); LDNS_FREE(error_name); LDNS_FREE(hashed_owner_b32); return NULL; } hashed_owner_str_len = hashed_owner_b32_len; hashed_owner_b32[hashed_owner_b32_len] = '\0'; status = ldns_str2rdf_dname(&hashed_owner, hashed_owner_b32); if (status != LDNS_STATUS_OK) { hsm_ctx_set_error(ctx, -1, "hsm_nsec3_hash_name()", "Error creating rdf from %s", hashed_owner_b32); LDNS_FREE(hashed_owner_b32); return NULL; } free(hash); LDNS_FREE(hashed_owner_b32); return hashed_owner; } ldns_rr * hsm_get_dnskey(hsm_ctx_t *ctx, const hsm_key_t *key, const hsm_sign_params_t *sign_params) { /* CK_RV rv; */ ldns_rr *dnskey; hsm_session_t *session; ldns_rdf *rdata; if (!ctx) ctx = _hsm_ctx; if (!key) { hsm_ctx_set_error(ctx, -1, "hsm_get_dnskey()", "Got NULL key"); return NULL; } if (!sign_params) { hsm_ctx_set_error(ctx, -1, "hsm_get_dnskey()", "Got NULL sign_params"); return NULL; } session = hsm_find_key_session(ctx, key); if (!session) return NULL; dnskey = ldns_rr_new(); ldns_rr_set_type(dnskey, LDNS_RR_TYPE_DNSKEY); ldns_rr_set_owner(dnskey, ldns_rdf_clone(sign_params->owner)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int16(LDNS_RDF_TYPE_INT16, sign_params->flags)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int8(LDNS_RDF_TYPE_INT8, LDNS_DNSSEC_KEYPROTO)); ldns_rr_push_rdf(dnskey, ldns_native2rdf_int8(LDNS_RDF_TYPE_ALG, sign_params->algorithm)); rdata = hsm_get_key_rdata(ctx, session, key); if (rdata == NULL) { ldns_rr_free(dnskey); return NULL; } ldns_rr_push_rdf(dnskey, rdata); return dnskey; } int hsm_random_buffer(hsm_ctx_t *ctx, unsigned char *buffer, unsigned long length) { CK_RV rv; unsigned int i; hsm_session_t *session; if (!buffer) return -1; if (!ctx) ctx = _hsm_ctx; /* just try every attached token. If one errors (be it NO_RNG, or * any other error, simply try the next */ for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; if (session) { rv = ((CK_FUNCTION_LIST_PTR)session->module->sym)->C_GenerateRandom( session->session, buffer, length); if (rv == CKR_OK) { return 0; } } } return 1; } uint32_t hsm_random32(hsm_ctx_t *ctx) { uint32_t rnd; int result; unsigned char rnd_buf[4]; result = hsm_random_buffer(ctx, rnd_buf, 4); if (result == 0) { memcpy(&rnd, rnd_buf, 4); return rnd; } else { return 0; } } uint64_t hsm_random64(hsm_ctx_t *ctx) { uint64_t rnd; int result; unsigned char rnd_buf[8]; result = hsm_random_buffer(ctx, rnd_buf, 8); if (result == 0) { memcpy(&rnd, rnd_buf, 8); return rnd; } else { return 0; } } /* * Additional functions */ int hsm_attach(const char *repository, const char *token_label, const char *path, const char *pin, const hsm_config_t *config) { hsm_session_t *session; int result; result = hsm_session_init(_hsm_ctx, &session, repository, token_label, path, pin, config); if (result == HSM_OK) { return hsm_ctx_add_session(_hsm_ctx, session); } else { return result; } } /*! Detach a named HSM */ int hsm_detach(const char *repository) { unsigned int i; for (i = 0; i < _hsm_ctx->session_count; i++) { if (_hsm_ctx->session[i] && strcmp(_hsm_ctx->session[i]->module->name, repository) == 0) { hsm_session_close(_hsm_ctx, _hsm_ctx->session[i], 1); _hsm_ctx->session[i] = NULL; /* if this was the last session in the list, decrease the * session count */ if (i == _hsm_ctx->session_count) { while(_hsm_ctx->session_count > 0 && !_hsm_ctx->session[i]) { _hsm_ctx->session_count--; } } return 0; } } return -1; } int hsm_token_attached(hsm_ctx_t *ctx, const char *repository) { unsigned int i; if (!ctx) ctx = _hsm_ctx; for (i = 0; i < ctx->session_count; i++) { if (ctx->session[i] && strcmp(ctx->session[i]->module->name, repository) == 0) { return 1; } } hsm_ctx_set_error(ctx, HSM_REPOSITORY_NOT_FOUND, "hsm_token_attached()", "Can't find repository: %s", repository); return 0; } int hsm_supported_algorithm(ldns_algorithm algorithm) { switch(algorithm) { case LDNS_SIGN_RSAMD5: case LDNS_SIGN_RSASHA1: case LDNS_SIGN_RSASHA1_NSEC3: case LDNS_SIGN_RSASHA256: case LDNS_SIGN_RSASHA512: case LDNS_SIGN_DSA: case LDNS_SIGN_DSA_NSEC3: case LDNS_SIGN_ECC_GOST: return 0; break; #if LDNS_BUILD_CONFIG_USE_ECDSA case LDNS_SIGN_ECDSAP256SHA256: case LDNS_SIGN_ECDSAP384SHA384: #endif default: return -1; } } char * hsm_get_error(hsm_ctx_t *gctx) { hsm_ctx_t *ctx; char *message; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } if (ctx->error) { ctx->error = 0; message = malloc(HSM_ERROR_MSGSIZE); if (message == NULL) { return strdup("libhsm memory allocation failed"); } snprintf(message, HSM_ERROR_MSGSIZE, "%s: %s", ctx->error_action ? ctx->error_action : "unknown()", ctx->error_message[0] ? ctx->error_message : "unknown error"); return message; }; return NULL; } void hsm_print_session(hsm_session_t *session) { printf("\t\tmodule at %p (sym %p)\n", (void *) session->module, (void *) session->module->sym); printf("\t\tmodule path: %s\n", session->module->path); printf("\t\trepository name: %s\n", session->module->name); printf("\t\ttoken label: %s\n", session->module->token_label); printf("\t\tsess handle: %u\n", (unsigned int) session->session); } void hsm_print_ctx(hsm_ctx_t *gctx) { hsm_ctx_t *ctx; unsigned int i; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } printf("CTX Sessions: %lu\n", (long unsigned int) ctx->session_count); for (i = 0; i < ctx->session_count; i++) { printf("\tSession at %p\n", (void *) ctx->session[i]); hsm_print_session(ctx->session[i]); } } void hsm_print_key(hsm_key_t *key) { hsm_key_info_t *key_info; if (key) { key_info = hsm_get_key_info(NULL, key); if (key_info) { printf("key:\n"); printf("\tmodule: %p\n", (void *) key->module); printf("\tprivkey handle: %u\n", (unsigned int) key->private_key); if (key->module->config->use_pubkey) { printf("\tpubkey handle: %u\n", (unsigned int) key->public_key); } else { printf("\tpubkey handle: %s\n", "NULL"); } printf("\trepository: %s\n", key->module->name); printf("\talgorithm: %s\n", key_info->algorithm_name); printf("\tsize: %lu\n", key_info->keysize); printf("\tid: %s\n", key_info->id); hsm_key_info_free(key_info); } else { printf("key: hsm_get_key_info() returned NULL\n"); } } else { printf("key: \n"); } } void hsm_print_error(hsm_ctx_t *gctx) { char *message; message = hsm_get_error(gctx); if (message) { fprintf(stderr, "%s\n", message); free(message); } else { fprintf(stderr, "Unknown error\n"); } } void hsm_print_tokeninfo(hsm_ctx_t *gctx) { CK_RV rv; CK_SLOT_ID slot_id; CK_TOKEN_INFO token_info; hsm_ctx_t *ctx; unsigned int i; hsm_session_t *session; int result; if (!gctx) { ctx = _hsm_ctx; } else { ctx = gctx; } for (i = 0; i < ctx->session_count; i++) { session = ctx->session[i]; result = hsm_get_slot_id(ctx, session->module->sym, session->module->token_label, &slot_id); if (result != HSM_OK) return; rv = ((CK_FUNCTION_LIST_PTR) session->module->sym)->C_GetTokenInfo(slot_id, &token_info); if (hsm_pkcs11_check_error(ctx, rv, "C_GetTokenInfo")) { return; } printf("Repository: %s\n",session->module->name); printf("\tModule: %s\n", session->module->path); printf("\tSlot: %lu\n", slot_id); printf("\tToken Label: %.*s\n", (int) sizeof(token_info.label), token_info.label); printf("\tManufacturer: %.*s\n", (int) sizeof(token_info.manufacturerID), token_info.manufacturerID); printf("\tModel: %.*s\n", (int) sizeof(token_info.model), token_info.model); printf("\tSerial: %.*s\n", (int) sizeof(token_info.serialNumber), token_info.serialNumber); if (i + 1 != ctx->session_count) printf("\n"); } } opendnssec-1.4.9/libhsm/src/lib/libhsmdns.h0000644000175000017500000000732012650165732015567 00000000000000/* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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 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. */ #ifndef HSMDNS_H #define HSMDNS_H 1 #include /*! Extra information for signing rrsets (algorithm, expiration, etc) */ typedef struct { /** The DNS signing algorithm identifier */ ldns_algorithm algorithm; /** Key flags */ uint16_t flags; /** The inception date of signatures made with this key. */ uint32_t inception; /** The expiration date of signatures made with this key. */ uint32_t expiration; /** The keytag of the key (is this necessary?) */ uint16_t keytag; /** The owner name of the key */ ldns_rdf *owner; } hsm_sign_params_t; /*! * Returns an allocated hsm_sign_params_t with some defaults */ hsm_sign_params_t * hsm_sign_params_new(); /*! Free the signer parameters structure If params->owner has been set, ldns_rdf_deep_free() will be called on it. \param params The signer parameters to free */ void hsm_sign_params_free(hsm_sign_params_t *params); /*! Sign RRset using key The returned ldns_rr structure can be freed with ldns_rr_free() \param context HSM context \param rrset RRset to sign \param key Key pair used to sign \return ldns_rr* Signed RRset */ ldns_rr* hsm_sign_rrset(hsm_ctx_t *ctx, const ldns_rr_list* rrset, const hsm_key_t *key, const hsm_sign_params_t *sign_params); /*! Generate a base32 encoded hashed NSEC3 name \param ctx HSM context \param name Domain name to hash \param algorithm NSEC3 algorithm (must be 1 atm) \param iteration number of hash iterations \param salt_length the length of the salt \param salt the salt */ ldns_rdf * hsm_nsec3_hash_name(hsm_ctx_t *ctx, ldns_rdf *name, uint8_t algorithm, uint16_t iterations, uint8_t salt_length, uint8_t *salt); /*! Get DNSKEY RR The returned ldns_rr structure can be freed with ldns_rr_free() \param context HSM context \param key Key to get DNSKEY RR from \param sign_params the signing parameters (flags, algorithm, etc) \return ldns_rr* */ ldns_rr* hsm_get_dnskey(hsm_ctx_t *ctx, const hsm_key_t *key, const hsm_sign_params_t *sign_params); /*! Check if a given DNSSEC algorithm is supported \param ldns_algorithm algorithm number \return 0 if supported, -1 otherwise */ int hsm_supported_algorithm(ldns_algorithm algorithm); #endif /* HSMDNS_H */ opendnssec-1.4.9/libhsm/src/lib/libhsm.h0000644000175000017500000003503512650165732015066 00000000000000/* * Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2009 NLNet Labs. * 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 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. */ #ifndef HSM_H #define HSM_H 1 #include /* Note that currently the MySQL kasp schema limits the number of HSMs to * 127; so to increase it beyond that requires some database changes similar * to when keypairs(id) was increased, see svn r4465. * * Note that this constant also determines the size of the shared PIN memory. * Increasing this size requires any existing memory to be removed and should * be part of a migration script. */ #define HSM_MAX_SESSIONS 100 #define HSM_MAX_ALGONAME 16 #define HSM_ERROR_MSGSIZE 512 /* TODO: depends on type and key, or just leave it at current * maximum? */ #define HSM_MAX_SIGNATURE_LENGTH 512 /* Note that this constant also determines the size of the shared PIN memory. * Increasing this size requires any existing memory to be removed and should * be part of a migration script. */ #define HSM_MAX_PIN_LENGTH 255 /*! Return codes for some of the functions */ /*! These should be different than the list of CKR_ values defined * by pkcs11 (for easier debugging purposes of calling applications) */ #define HSM_OK 0 #define HSM_ERROR 0x10000001 #define HSM_PIN_INCORRECT 0x10000002 #define HSM_CONFIG_FILE_ERROR 0x10000003 #define HSM_REPOSITORY_NOT_FOUND 0x10000004 #define HSM_NO_REPOSITORIES 0x10000005 #define HSM_MODULE_NOT_FOUND 0x10000006 /*! The mode for the PIN callback functions */ #define HSM_PIN_FIRST 0 /* Used when getting the PIN for the first time. */ #define HSM_PIN_RETRY 1 /* Used when we failed to login the first time. */ #define HSM_PIN_SAVE 2 /* The latest PIN can be saved for future use. Called after a successful login. */ /*! HSM configuration */ typedef struct { unsigned int use_pubkey; /*!< Maintain public keys in HSM */ unsigned int allow_extract; /*!< Generate CKA_EXTRACTABLE private keys */ } hsm_config_t; /*! Data type to describe an HSM */ typedef struct { unsigned int id; /*!< HSM numerical identifier */ char *name; /*!< name of repository */ char *token_label; /*!< label of the token */ char *path; /*!< path to PKCS#11 library */ void *handle; /*!< handle from dlopen()*/ void *sym; /*!< Function list from dlsym */ hsm_config_t *config; /*!< optional per HSM configuration */ } hsm_module_t; /*! HSM Session */ typedef struct { hsm_module_t *module; unsigned long session; } hsm_session_t; /*! HSM Key Pair */ typedef struct { const hsm_module_t *module; /*!< pointer to module */ unsigned long private_key; /*!< private key within module */ unsigned long public_key; /*!< public key within module */ } hsm_key_t; /*! HSM Key Pair Information */ typedef struct { char *id; /*!< key id */ unsigned long algorithm; /*!< key algorithm (cast from CKK_*)*/ char *algorithm_name; /*!< key algorithm name */ unsigned long keysize; /*!< key size */ } hsm_key_info_t; /*! HSM context to keep track of sessions */ typedef struct { hsm_session_t *session[HSM_MAX_SESSIONS]; /*!< HSM sessions */ size_t session_count; /*!< number of configured HSMs */ /*!< non-zero if the last operation failed (only the first error will be set) */ int error; /*!< static string describing the action we were trying to do when the first error happened */ const char *error_action; /*!< static string describing the first error */ char error_message[HSM_ERROR_MSGSIZE]; } hsm_ctx_t; /*! Open HSM library \param config path to OpenDNSSEC XML configuration file \param pin_callback This function will be called for tokens that have no PIN configured. The default hsm_prompt_pin() can be used. If this value is NULL, these tokens will be skipped \return 0 if successful, !0 if failed Attaches all configured HSMs, querying for PINs (using the given callback function) if not known. Also creates initial sessions (not part of any context; every API function that takes a context can be passed NULL, in which case the global context will be used) and log into each HSM. */ int hsm_open(const char *config, char *(pin_callback)(unsigned int, const char *, unsigned int)); /*! Function that queries for a PIN, can be used as callback for hsm_open(). Stores the PIN in the shared memory. \param id Used for identifying the repository. Will have a value between zero and HSM_MAX_SESSIONS. \param repository The repository name will be included in the prompt \param mode The type of mode the function should run in. \return The string the user enters */ char * hsm_prompt_pin(unsigned int id, const char *repository, unsigned int mode); /*! Function that will check if there is a PIN in the shared memory and returns it. \param id Used for identifying the repository. Will have a value between zero and HSM_MAX_SESSIONS. \param repository The repository name will be included in the prompt \param mode The type of mode the function should run in. \return The string the user enters */ char * hsm_check_pin(unsigned int id, const char *repository, unsigned int mode); /*! Logout Function that will logout the user by deleting the shared memory and semaphore. Any authenticated process will still be able to interact with the HSM. */ int hsm_logout_pin(); /*! Close HSM library Log out and detach from all configured HSMs This cleans up all data for libhsm, and should be the last function called. */ int hsm_close(); /*! Create new HSM context Creates a new session for each attached HSM. The returned hsm_ctx_t * can be freed with hsm_destroy_context() */ hsm_ctx_t * hsm_create_context(void); /*! Check HSM context Check if the associated sessions are still alive. If they are not alive, then try re-open libhsm. \param context HSM context \return 0 if successful, !0 if failed */ int hsm_check_context(hsm_ctx_t *context); /*! Destroy HSM context \param context HSM context Also destroys any associated sessions. */ void hsm_destroy_context(hsm_ctx_t *context); /*! List all known keys in all attached HSMs After the function has run, the value at count contains the number of keys found. The resulting key list can be freed with hsm_key_list_free() Alternatively, each individual key structure in the list could be freed with hsm_key_free() \param context HSM context \param count location to store the number of keys found */ hsm_key_t ** hsm_list_keys(hsm_ctx_t *context, size_t *count); /*! List all known keys in a HSM After the function has run, the value at count contains the number of keys found. The resulting key list can be freed with hsm_key_list_free() Alternatively, each individual key structure in the list could be freed with hsm_key_free() \param context HSM context \param count location to store the number of keys found \param repository repository to list the keys in */ hsm_key_t ** hsm_list_keys_repository(hsm_ctx_t *context, size_t *count, const char *repository); /*! Count all known keys in all attached HSMs \param context HSM context */ size_t hsm_count_keys(hsm_ctx_t *context); /*! Count all known keys in a HSM \param context HSM context \param repository repository in where to count the keys */ size_t hsm_count_keys_repository(hsm_ctx_t *context, const char *repository); /*! Find a key pair by CKA_ID (as hex string) The returned key structure can be freed with hsm_key_free() \param context HSM context \param id CKA_ID of key to find (null-terminated string of hex characters) \return key identifier or NULL if not found (or invalid input) */ hsm_key_t * hsm_find_key_by_id(hsm_ctx_t *context, const char *id); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. Other stuff, like exponent, may be needed here as well. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \param keysize Size of RSA key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_rsa_key(hsm_ctx_t *context, const char *repository, unsigned long keysize); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \param keysize Size of DSA key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_dsa_key(hsm_ctx_t *context, const char *repository, unsigned long keysize); /*! Generate new key pair in HSM Keys generated by libhsm will have a 16-byte identifier set as CKA_ID and the hexadecimal representation of it set as CKA_LABEL. The returned key structure can be freed with hsm_key_free() \param context HSM context \param repository repository in where to create the key \return return key identifier or NULL if key generation failed */ hsm_key_t * hsm_generate_gost_key(hsm_ctx_t *context, const char *repository); /*! Remove a key pair from HSM When a key is removed, the module pointer is set to NULL, and the public and private key handles are set to 0. The structure still needs to be freed. \param context HSM context \param key Key pair to be removed \return 0 if successful, !0 if failed */ int hsm_remove_key(hsm_ctx_t *context, hsm_key_t *key); /*! Free the memory for a key structure. \param key The key structure to free */ void hsm_key_free(hsm_key_t *key); /*! Free the memory of an array of key structures, as returned by hsm_list_keys() \param key_list The array of keys to free \param count The number of keys in the array */ void hsm_key_list_free(hsm_key_t **key_list, size_t count); /*! Get id as null-terminated hex string using key identifier The returned id is allocated data, and must be free()d by the caller \param context HSM context \param key Key pair to get the ID from \return id of key pair */ char * hsm_get_key_id(hsm_ctx_t *context, const hsm_key_t *key); /*! Get extended key information The returned id is allocated data, and must be freed by the caller With hsm_key_info_free() \param context HSM context \param key Key pair to get information about \return key information */ hsm_key_info_t * hsm_get_key_info(hsm_ctx_t *context, const hsm_key_t *key); /*! Frees the hsm_key_info_t structure \param key_info The structure to free */ void hsm_key_info_free(hsm_key_info_t *key_info); /*! Fill a buffer with random data from any attached HSM \param context HSM context \param buffer Buffer to fill with random data \param length Size of random buffer \return 0 if successful, !0 if failed */ int hsm_random_buffer(hsm_ctx_t *ctx, unsigned char *buffer, unsigned long length); /*! Return unsigned 32-bit random number from any attached HSM \param context HSM context \return 32-bit random number, or 0 if no HSM with a random generator is attached */ uint32_t hsm_random32(hsm_ctx_t *ctx); /*! Return unsigned 64-bit random number from any attached HSM \param context HSM context \return 64-bit random number, or 0 if no HSM with a random generator is attached */ uint64_t hsm_random64(hsm_ctx_t *ctx); /* * Additional functions for debugging, and non-general use-cases. */ /*! Attached a named HSM using a PKCS#11 shared library and optional credentials (may be NULL, but then undefined) This function changes the global state, and is not threadsafe \param repository the name of the repository \param token_label the name of the token to attach \param path the path of the shared PKCS#11 library \param pin the PIN to log into the token \param config optional configuration \return 0 on success, -1 on error */ int hsm_attach(const char *repository, const char *token_name, const char *path, const char *pin, const hsm_config_t *config); /*! Detach a named HSM This function changes the global state, and is not threadsafe \param token_name the token to detach \return 0 on success, -1 on error */ int hsm_detach(const char *repository); /*! Check whether a named token has been initialized in this context \param ctx HSM context \param token_name The name of the token \return 1 if the token is attached, 0 if not found */ int hsm_token_attached(hsm_ctx_t *ctx, const char *repository); /*! Return the current error message The returned message is allocated data, and must be free()d by the caller \param ctx HSM context \return error message string */ char * hsm_get_error(hsm_ctx_t *gctx); /* a few debug functions for applications */ void hsm_print_session(hsm_session_t *session); void hsm_print_ctx(hsm_ctx_t *gctx); void hsm_print_key(hsm_key_t *key); void hsm_print_error(hsm_ctx_t *ctx); void hsm_print_tokeninfo(hsm_ctx_t *gctx); #endif /* HSM_H */ opendnssec-1.4.9/libhsm/src/lib/Makefile.in0000644000175000017500000005151412650165765015512 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = libhsm/src/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libhsm_a_AR = $(AR) $(ARFLAGS) libhsm_a_LIBADD = am_libhsm_a_OBJECTS = libhsm.$(OBJEXT) pin.$(OBJEXT) libhsm_a_OBJECTS = $(am_libhsm_a_OBJECTS) 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)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 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 = 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 = $(libhsm_a_SOURCES) DIST_SOURCES = $(libhsm_a_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)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(srcdir)/cryptoki_compat \ @LDNS_INCLUDES@ @XML2_INCLUDES@ AM_CFLAGS = -std=c99 noinst_LIBRARIES = libhsm.a libhsm_a_SOURCES = libhsm.c libhsm.h libhsmdns.h pin.c \ cryptoki_compat/pkcs11.h 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 libhsm/src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/src/lib/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libhsm.a: $(libhsm_a_OBJECTS) $(libhsm_a_DEPENDENCIES) $(EXTRA_libhsm_a_DEPENDENCIES) $(AM_V_at)-rm -f libhsm.a $(AM_V_AR)$(libhsm_a_AR) libhsm.a $(libhsm_a_OBJECTS) $(libhsm_a_LIBADD) $(AM_V_at)$(RANLIB) libhsm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pin.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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: $(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 $(LIBRARIES) installdirs: 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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-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 -rf ./$(DEPDIR) -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES 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-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 .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: opendnssec-1.4.9/libhsm/src/lib/cryptoki_compat/0000755000175000017500000000000012650166151016714 500000000000000opendnssec-1.4.9/libhsm/src/lib/cryptoki_compat/pkcs11.h0000644000175000017500000012370512650165732020123 00000000000000/* pkcs11.h Copyright 2006, 2007 g10 Code GmbH Copyright 2006 Andreas Jellinghaus This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file 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. */ /* Please submit changes back to the Scute project at http://www.scute.org/ (or send them to marcus@g10code.com), so that they can be picked up by other projects from there as well. */ /* This file is a modified implementation of the PKCS #11 standard by RSA Security Inc. It is mostly a drop-in replacement, with the following change: This header file does not require any macro definitions by the user (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros for you (if useful, some are missing, let me know if you need more). There is an additional API available that does comply better to the GNU coding standard. It can be switched on by defining CRYPTOKI_GNU before including this header file. For this, the following changes are made to the specification: All structure types are changed to a "struct ck_foo" where CK_FOO is the type name in PKCS #11. All non-structure types are changed to ck_foo_t where CK_FOO is the lowercase version of the type name in PKCS #11. The basic types (CK_ULONG et al.) are removed without substitute. All members of structures are modified in the following way: Type indication prefixes are removed, and underscore characters are inserted before words. Then the result is lowercased. Note that function names are still in the original case, as they need for ABI compatibility. CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use . If CRYPTOKI_COMPAT is defined before including this header file, then none of the API changes above take place, and the API is the one defined by the PKCS #11 standard. */ #ifndef PKCS11_H #define PKCS11_H 1 #if defined(__cplusplus) extern "C" { #endif /* The version of cryptoki we implement. The revision is changed with each modification of this file. If you do not use the "official" version of this file, please consider deleting the revision macro (you may use a macro with a different name to keep track of your versions). */ #define CRYPTOKI_VERSION_MAJOR 2 #define CRYPTOKI_VERSION_MINOR 20 #define CRYPTOKI_VERSION_REVISION 6 /* Compatibility interface is default, unless CRYPTOKI_GNU is given. */ #ifndef CRYPTOKI_GNU #ifndef CRYPTOKI_COMPAT #define CRYPTOKI_COMPAT 1 #endif #endif /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) /* There is a matching pop below. */ #pragma pack(push, cryptoki, 1) #ifdef CRYPTOKI_EXPORTS #define CK_SPEC __declspec(dllexport) #else #define CK_SPEC __declspec(dllimport) #endif #else #define CK_SPEC #endif #ifdef CRYPTOKI_COMPAT /* If we are in compatibility mode, switch all exposed names to the PKCS #11 variant. There are corresponding #undefs below. */ #define ck_flags_t CK_FLAGS #define ck_version _CK_VERSION #define ck_info _CK_INFO #define cryptoki_version cryptokiVersion #define manufacturer_id manufacturerID #define library_description libraryDescription #define library_version libraryVersion #define ck_notification_t CK_NOTIFICATION #define ck_slot_id_t CK_SLOT_ID #define ck_slot_info _CK_SLOT_INFO #define slot_description slotDescription #define hardware_version hardwareVersion #define firmware_version firmwareVersion #define ck_token_info _CK_TOKEN_INFO #define serial_number serialNumber #define max_session_count ulMaxSessionCount #define session_count ulSessionCount #define max_rw_session_count ulMaxRwSessionCount #define rw_session_count ulRwSessionCount #define max_pin_len ulMaxPinLen #define min_pin_len ulMinPinLen #define total_public_memory ulTotalPublicMemory #define free_public_memory ulFreePublicMemory #define total_private_memory ulTotalPrivateMemory #define free_private_memory ulFreePrivateMemory #define utc_time utcTime #define ck_session_handle_t CK_SESSION_HANDLE #define ck_user_type_t CK_USER_TYPE #define ck_state_t CK_STATE #define ck_session_info _CK_SESSION_INFO #define slot_id slotID #define device_error ulDeviceError #define ck_object_handle_t CK_OBJECT_HANDLE #define ck_object_class_t CK_OBJECT_CLASS #define ck_hw_feature_type_t CK_HW_FEATURE_TYPE #define ck_key_type_t CK_KEY_TYPE #define ck_certificate_type_t CK_CERTIFICATE_TYPE #define ck_attribute_type_t CK_ATTRIBUTE_TYPE #define ck_attribute _CK_ATTRIBUTE #define value pValue #define value_len ulValueLen #define ck_date _CK_DATE #define ck_mechanism_type_t CK_MECHANISM_TYPE #define ck_mechanism _CK_MECHANISM #define parameter pParameter #define parameter_len ulParameterLen #define ck_mechanism_info _CK_MECHANISM_INFO #define min_key_size ulMinKeySize #define max_key_size ulMaxKeySize #define ck_rv_t CK_RV #define ck_notify_t CK_NOTIFY #define ck_function_list _CK_FUNCTION_LIST #define ck_createmutex_t CK_CREATEMUTEX #define ck_destroymutex_t CK_DESTROYMUTEX #define ck_lockmutex_t CK_LOCKMUTEX #define ck_unlockmutex_t CK_UNLOCKMUTEX #define ck_c_initialize_args _CK_C_INITIALIZE_ARGS #define create_mutex CreateMutex #define destroy_mutex DestroyMutex #define lock_mutex LockMutex #define unlock_mutex UnlockMutex #define reserved pReserved #endif /* CRYPTOKI_COMPAT */ typedef unsigned long ck_flags_t; struct ck_version { unsigned char major; unsigned char minor; }; struct ck_info { struct ck_version cryptoki_version; unsigned char manufacturer_id[32]; ck_flags_t flags; unsigned char library_description[32]; struct ck_version library_version; }; typedef unsigned long ck_notification_t; #define CKN_SURRENDER (0) typedef unsigned long ck_slot_id_t; struct ck_slot_info { unsigned char slot_description[64]; unsigned char manufacturer_id[32]; ck_flags_t flags; struct ck_version hardware_version; struct ck_version firmware_version; }; #define CKF_TOKEN_PRESENT (1 << 0) #define CKF_REMOVABLE_DEVICE (1 << 1) #define CKF_HW_SLOT (1 << 2) #define CKF_ARRAY_ATTRIBUTE (1 << 30) struct ck_token_info { unsigned char label[32]; unsigned char manufacturer_id[32]; unsigned char model[16]; unsigned char serial_number[16]; ck_flags_t flags; unsigned long max_session_count; unsigned long session_count; unsigned long max_rw_session_count; unsigned long rw_session_count; unsigned long max_pin_len; unsigned long min_pin_len; unsigned long total_public_memory; unsigned long free_public_memory; unsigned long total_private_memory; unsigned long free_private_memory; struct ck_version hardware_version; struct ck_version firmware_version; unsigned char utc_time[16]; }; #define CKF_RNG (1 << 0) #define CKF_WRITE_PROTECTED (1 << 1) #define CKF_LOGIN_REQUIRED (1 << 2) #define CKF_USER_PIN_INITIALIZED (1 << 3) #define CKF_RESTORE_KEY_NOT_NEEDED (1 << 5) #define CKF_CLOCK_ON_TOKEN (1 << 6) #define CKF_PROTECTED_AUTHENTICATION_PATH (1 << 8) #define CKF_DUAL_CRYPTO_OPERATIONS (1 << 9) #define CKF_TOKEN_INITIALIZED (1 << 10) #define CKF_SECONDARY_AUTHENTICATION (1 << 11) #define CKF_USER_PIN_COUNT_LOW (1 << 16) #define CKF_USER_PIN_FINAL_TRY (1 << 17) #define CKF_USER_PIN_LOCKED (1 << 18) #define CKF_USER_PIN_TO_BE_CHANGED (1 << 19) #define CKF_SO_PIN_COUNT_LOW (1 << 20) #define CKF_SO_PIN_FINAL_TRY (1 << 21) #define CKF_SO_PIN_LOCKED (1 << 22) #define CKF_SO_PIN_TO_BE_CHANGED (1 << 23) #define CK_UNAVAILABLE_INFORMATION ((unsigned long) -1) #define CK_EFFECTIVELY_INFINITE (0) typedef unsigned long ck_session_handle_t; #define CK_INVALID_HANDLE (0) typedef unsigned long ck_user_type_t; #define CKU_SO (0) #define CKU_USER (1) #define CKU_CONTEXT_SPECIFIC (2) typedef unsigned long ck_state_t; #define CKS_RO_PUBLIC_SESSION (0) #define CKS_RO_USER_FUNCTIONS (1) #define CKS_RW_PUBLIC_SESSION (2) #define CKS_RW_USER_FUNCTIONS (3) #define CKS_RW_SO_FUNCTIONS (4) struct ck_session_info { ck_slot_id_t slot_id; ck_state_t state; ck_flags_t flags; unsigned long device_error; }; #define CKF_RW_SESSION (1 << 1) #define CKF_SERIAL_SESSION (1 << 2) typedef unsigned long ck_object_handle_t; typedef unsigned long ck_object_class_t; #define CKO_DATA (0) #define CKO_CERTIFICATE (1) #define CKO_PUBLIC_KEY (2) #define CKO_PRIVATE_KEY (3) #define CKO_SECRET_KEY (4) #define CKO_HW_FEATURE (5) #define CKO_DOMAIN_PARAMETERS (6) #define CKO_MECHANISM (7) #define CKO_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_hw_feature_type_t; #define CKH_MONOTONIC_COUNTER (1) #define CKH_CLOCK (2) #define CKH_USER_INTERFACE (3) #define CKH_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_key_type_t; #define CKK_RSA (0) #define CKK_DSA (1) #define CKK_DH (2) #define CKK_ECDSA (3) #define CKK_EC (3) #define CKK_X9_42_DH (4) #define CKK_KEA (5) #define CKK_GENERIC_SECRET (0x10) #define CKK_RC2 (0x11) #define CKK_RC4 (0x12) #define CKK_DES (0x13) #define CKK_DES2 (0x14) #define CKK_DES3 (0x15) #define CKK_CAST (0x16) #define CKK_CAST3 (0x17) #define CKK_CAST128 (0x18) #define CKK_RC5 (0x19) #define CKK_IDEA (0x1a) #define CKK_SKIPJACK (0x1b) #define CKK_BATON (0x1c) #define CKK_JUNIPER (0x1d) #define CKK_CDMF (0x1e) #define CKK_AES (0x1f) #define CKK_BLOWFISH (0x20) #define CKK_TWOFISH (0x21) #define CKK_GOSTR3410 (0x30) /* From PKCS#11 v2.30 - draft 7 */ #define CKK_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_certificate_type_t; #define CKC_X_509 (0) #define CKC_X_509_ATTR_CERT (1) #define CKC_WTLS (2) #define CKC_VENDOR_DEFINED ((unsigned long) (1 << 31)) typedef unsigned long ck_attribute_type_t; #define CKA_CLASS (0) #define CKA_TOKEN (1) #define CKA_PRIVATE (2) #define CKA_LABEL (3) #define CKA_APPLICATION (0x10) #define CKA_VALUE (0x11) #define CKA_OBJECT_ID (0x12) #define CKA_CERTIFICATE_TYPE (0x80) #define CKA_ISSUER (0x81) #define CKA_SERIAL_NUMBER (0x82) #define CKA_AC_ISSUER (0x83) #define CKA_OWNER (0x84) #define CKA_ATTR_TYPES (0x85) #define CKA_TRUSTED (0x86) #define CKA_CERTIFICATE_CATEGORY (0x87) #define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88) #define CKA_URL (0x89) #define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8a) #define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8b) #define CKA_CHECK_VALUE (0x90) #define CKA_KEY_TYPE (0x100) #define CKA_SUBJECT (0x101) #define CKA_ID (0x102) #define CKA_SENSITIVE (0x103) #define CKA_ENCRYPT (0x104) #define CKA_DECRYPT (0x105) #define CKA_WRAP (0x106) #define CKA_UNWRAP (0x107) #define CKA_SIGN (0x108) #define CKA_SIGN_RECOVER (0x109) #define CKA_VERIFY (0x10a) #define CKA_VERIFY_RECOVER (0x10b) #define CKA_DERIVE (0x10c) #define CKA_START_DATE (0x110) #define CKA_END_DATE (0x111) #define CKA_MODULUS (0x120) #define CKA_MODULUS_BITS (0x121) #define CKA_PUBLIC_EXPONENT (0x122) #define CKA_PRIVATE_EXPONENT (0x123) #define CKA_PRIME_1 (0x124) #define CKA_PRIME_2 (0x125) #define CKA_EXPONENT_1 (0x126) #define CKA_EXPONENT_2 (0x127) #define CKA_COEFFICIENT (0x128) #define CKA_PRIME (0x130) #define CKA_SUBPRIME (0x131) #define CKA_BASE (0x132) #define CKA_PRIME_BITS (0x133) #define CKA_SUB_PRIME_BITS (0x134) #define CKA_VALUE_BITS (0x160) #define CKA_VALUE_LEN (0x161) #define CKA_EXTRACTABLE (0x162) #define CKA_LOCAL (0x163) #define CKA_NEVER_EXTRACTABLE (0x164) #define CKA_ALWAYS_SENSITIVE (0x165) #define CKA_KEY_GEN_MECHANISM (0x166) #define CKA_MODIFIABLE (0x170) #define CKA_ECDSA_PARAMS (0x180) #define CKA_EC_PARAMS (0x180) #define CKA_EC_POINT (0x181) #define CKA_SECONDARY_AUTH (0x200) #define CKA_AUTH_PIN_FLAGS (0x201) #define CKA_ALWAYS_AUTHENTICATE (0x202) #define CKA_WRAP_WITH_TRUSTED (0x210) #define CKA_GOSTR3410PARAMS (0x250) /* From PKCS#11 v2.30 - draft 7 */ #define CKA_GOSTR3411PARAMS (0x251) /* From PKCS#11 v2.30 - draft 7 */ #define CKA_HW_FEATURE_TYPE (0x300) #define CKA_RESET_ON_INIT (0x301) #define CKA_HAS_RESET (0x302) #define CKA_PIXEL_X (0x400) #define CKA_PIXEL_Y (0x401) #define CKA_RESOLUTION (0x402) #define CKA_CHAR_ROWS (0x403) #define CKA_CHAR_COLUMNS (0x404) #define CKA_COLOR (0x405) #define CKA_BITS_PER_PIXEL (0x406) #define CKA_CHAR_SETS (0x480) #define CKA_ENCODING_METHODS (0x481) #define CKA_MIME_TYPES (0x482) #define CKA_MECHANISM_TYPE (0x500) #define CKA_REQUIRED_CMS_ATTRIBUTES (0x501) #define CKA_DEFAULT_CMS_ATTRIBUTES (0x502) #define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503) #define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211) #define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212) #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600) #define CKA_VENDOR_DEFINED ((unsigned long) (1 << 31)) struct ck_attribute { ck_attribute_type_t type; void *value; unsigned long value_len; }; struct ck_date { unsigned char year[4]; unsigned char month[2]; unsigned char day[2]; }; typedef unsigned long ck_mechanism_type_t; #define CKM_RSA_PKCS_KEY_PAIR_GEN (0) #define CKM_RSA_PKCS (1) #define CKM_RSA_9796 (2) #define CKM_RSA_X_509 (3) #define CKM_MD2_RSA_PKCS (4) #define CKM_MD5_RSA_PKCS (5) #define CKM_SHA1_RSA_PKCS (6) #define CKM_RIPEMD128_RSA_PKCS (7) #define CKM_RIPEMD160_RSA_PKCS (8) #define CKM_RSA_PKCS_OAEP (9) #define CKM_RSA_X9_31_KEY_PAIR_GEN (0xa) #define CKM_RSA_X9_31 (0xb) #define CKM_SHA1_RSA_X9_31 (0xc) #define CKM_RSA_PKCS_PSS (0xd) #define CKM_SHA1_RSA_PKCS_PSS (0xe) #define CKM_DSA_KEY_PAIR_GEN (0x10) #define CKM_DSA (0x11) #define CKM_DSA_SHA1 (0x12) #define CKM_DH_PKCS_KEY_PAIR_GEN (0x20) #define CKM_DH_PKCS_DERIVE (0x21) #define CKM_X9_42_DH_KEY_PAIR_GEN (0x30) #define CKM_X9_42_DH_DERIVE (0x31) #define CKM_X9_42_DH_HYBRID_DERIVE (0x32) #define CKM_X9_42_MQV_DERIVE (0x33) #define CKM_SHA256_RSA_PKCS (0x40) #define CKM_SHA384_RSA_PKCS (0x41) #define CKM_SHA512_RSA_PKCS (0x42) #define CKM_SHA256_RSA_PKCS_PSS (0x43) #define CKM_SHA384_RSA_PKCS_PSS (0x44) #define CKM_SHA512_RSA_PKCS_PSS (0x45) #define CKM_RC2_KEY_GEN (0x100) #define CKM_RC2_ECB (0x101) #define CKM_RC2_CBC (0x102) #define CKM_RC2_MAC (0x103) #define CKM_RC2_MAC_GENERAL (0x104) #define CKM_RC2_CBC_PAD (0x105) #define CKM_RC4_KEY_GEN (0x110) #define CKM_RC4 (0x111) #define CKM_DES_KEY_GEN (0x120) #define CKM_DES_ECB (0x121) #define CKM_DES_CBC (0x122) #define CKM_DES_MAC (0x123) #define CKM_DES_MAC_GENERAL (0x124) #define CKM_DES_CBC_PAD (0x125) #define CKM_DES2_KEY_GEN (0x130) #define CKM_DES3_KEY_GEN (0x131) #define CKM_DES3_ECB (0x132) #define CKM_DES3_CBC (0x133) #define CKM_DES3_MAC (0x134) #define CKM_DES3_MAC_GENERAL (0x135) #define CKM_DES3_CBC_PAD (0x136) #define CKM_CDMF_KEY_GEN (0x140) #define CKM_CDMF_ECB (0x141) #define CKM_CDMF_CBC (0x142) #define CKM_CDMF_MAC (0x143) #define CKM_CDMF_MAC_GENERAL (0x144) #define CKM_CDMF_CBC_PAD (0x145) #define CKM_MD2 (0x200) #define CKM_MD2_HMAC (0x201) #define CKM_MD2_HMAC_GENERAL (0x202) #define CKM_MD5 (0x210) #define CKM_MD5_HMAC (0x211) #define CKM_MD5_HMAC_GENERAL (0x212) #define CKM_SHA_1 (0x220) #define CKM_SHA_1_HMAC (0x221) #define CKM_SHA_1_HMAC_GENERAL (0x222) #define CKM_RIPEMD128 (0x230) #define CKM_RIPEMD128_HMAC (0x231) #define CKM_RIPEMD128_HMAC_GENERAL (0x232) #define CKM_RIPEMD160 (0x240) #define CKM_RIPEMD160_HMAC (0x241) #define CKM_RIPEMD160_HMAC_GENERAL (0x242) #define CKM_SHA256 (0x250) #define CKM_SHA256_HMAC (0x251) #define CKM_SHA256_HMAC_GENERAL (0x252) #define CKM_SHA384 (0x260) #define CKM_SHA384_HMAC (0x261) #define CKM_SHA384_HMAC_GENERAL (0x262) #define CKM_SHA512 (0x270) #define CKM_SHA512_HMAC (0x271) #define CKM_SHA512_HMAC_GENERAL (0x272) #define CKM_CAST_KEY_GEN (0x300) #define CKM_CAST_ECB (0x301) #define CKM_CAST_CBC (0x302) #define CKM_CAST_MAC (0x303) #define CKM_CAST_MAC_GENERAL (0x304) #define CKM_CAST_CBC_PAD (0x305) #define CKM_CAST3_KEY_GEN (0x310) #define CKM_CAST3_ECB (0x311) #define CKM_CAST3_CBC (0x312) #define CKM_CAST3_MAC (0x313) #define CKM_CAST3_MAC_GENERAL (0x314) #define CKM_CAST3_CBC_PAD (0x315) #define CKM_CAST5_KEY_GEN (0x320) #define CKM_CAST128_KEY_GEN (0x320) #define CKM_CAST5_ECB (0x321) #define CKM_CAST128_ECB (0x321) #define CKM_CAST5_CBC (0x322) #define CKM_CAST128_CBC (0x322) #define CKM_CAST5_MAC (0x323) #define CKM_CAST128_MAC (0x323) #define CKM_CAST5_MAC_GENERAL (0x324) #define CKM_CAST128_MAC_GENERAL (0x324) #define CKM_CAST5_CBC_PAD (0x325) #define CKM_CAST128_CBC_PAD (0x325) #define CKM_RC5_KEY_GEN (0x330) #define CKM_RC5_ECB (0x331) #define CKM_RC5_CBC (0x332) #define CKM_RC5_MAC (0x333) #define CKM_RC5_MAC_GENERAL (0x334) #define CKM_RC5_CBC_PAD (0x335) #define CKM_IDEA_KEY_GEN (0x340) #define CKM_IDEA_ECB (0x341) #define CKM_IDEA_CBC (0x342) #define CKM_IDEA_MAC (0x343) #define CKM_IDEA_MAC_GENERAL (0x344) #define CKM_IDEA_CBC_PAD (0x345) #define CKM_GENERIC_SECRET_KEY_GEN (0x350) #define CKM_CONCATENATE_BASE_AND_KEY (0x360) #define CKM_CONCATENATE_BASE_AND_DATA (0x362) #define CKM_CONCATENATE_DATA_AND_BASE (0x363) #define CKM_XOR_BASE_AND_DATA (0x364) #define CKM_EXTRACT_KEY_FROM_KEY (0x365) #define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370) #define CKM_SSL3_MASTER_KEY_DERIVE (0x371) #define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372) #define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373) #define CKM_TLS_PRE_MASTER_KEY_GEN (0x374) #define CKM_TLS_MASTER_KEY_DERIVE (0x375) #define CKM_TLS_KEY_AND_MAC_DERIVE (0x376) #define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377) #define CKM_SSL3_MD5_MAC (0x380) #define CKM_SSL3_SHA1_MAC (0x381) #define CKM_MD5_KEY_DERIVATION (0x390) #define CKM_MD2_KEY_DERIVATION (0x391) #define CKM_SHA1_KEY_DERIVATION (0x392) #define CKM_PBE_MD2_DES_CBC (0x3a0) #define CKM_PBE_MD5_DES_CBC (0x3a1) #define CKM_PBE_MD5_CAST_CBC (0x3a2) #define CKM_PBE_MD5_CAST3_CBC (0x3a3) #define CKM_PBE_MD5_CAST5_CBC (0x3a4) #define CKM_PBE_MD5_CAST128_CBC (0x3a4) #define CKM_PBE_SHA1_CAST5_CBC (0x3a5) #define CKM_PBE_SHA1_CAST128_CBC (0x3a5) #define CKM_PBE_SHA1_RC4_128 (0x3a6) #define CKM_PBE_SHA1_RC4_40 (0x3a7) #define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8) #define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9) #define CKM_PBE_SHA1_RC2_128_CBC (0x3aa) #define CKM_PBE_SHA1_RC2_40_CBC (0x3ab) #define CKM_PKCS5_PBKD2 (0x3b0) #define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0) #define CKM_KEY_WRAP_LYNKS (0x400) #define CKM_KEY_WRAP_SET_OAEP (0x401) #define CKM_SKIPJACK_KEY_GEN (0x1000) #define CKM_SKIPJACK_ECB64 (0x1001) #define CKM_SKIPJACK_CBC64 (0x1002) #define CKM_SKIPJACK_OFB64 (0x1003) #define CKM_SKIPJACK_CFB64 (0x1004) #define CKM_SKIPJACK_CFB32 (0x1005) #define CKM_SKIPJACK_CFB16 (0x1006) #define CKM_SKIPJACK_CFB8 (0x1007) #define CKM_SKIPJACK_WRAP (0x1008) #define CKM_SKIPJACK_PRIVATE_WRAP (0x1009) #define CKM_SKIPJACK_RELAYX (0x100a) #define CKM_KEA_KEY_PAIR_GEN (0x1010) #define CKM_KEA_KEY_DERIVE (0x1011) #define CKM_FORTEZZA_TIMESTAMP (0x1020) #define CKM_BATON_KEY_GEN (0x1030) #define CKM_BATON_ECB128 (0x1031) #define CKM_BATON_ECB96 (0x1032) #define CKM_BATON_CBC128 (0x1033) #define CKM_BATON_COUNTER (0x1034) #define CKM_BATON_SHUFFLE (0x1035) #define CKM_BATON_WRAP (0x1036) #define CKM_ECDSA_KEY_PAIR_GEN (0x1040) #define CKM_EC_KEY_PAIR_GEN (0x1040) #define CKM_ECDSA (0x1041) #define CKM_ECDSA_SHA1 (0x1042) #define CKM_ECDH1_DERIVE (0x1050) #define CKM_ECDH1_COFACTOR_DERIVE (0x1051) #define CKM_ECMQV_DERIVE (0x1052) #define CKM_JUNIPER_KEY_GEN (0x1060) #define CKM_JUNIPER_ECB128 (0x1061) #define CKM_JUNIPER_CBC128 (0x1062) #define CKM_JUNIPER_COUNTER (0x1063) #define CKM_JUNIPER_SHUFFLE (0x1064) #define CKM_JUNIPER_WRAP (0x1065) #define CKM_FASTHASH (0x1070) #define CKM_AES_KEY_GEN (0x1080) #define CKM_AES_ECB (0x1081) #define CKM_AES_CBC (0x1082) #define CKM_AES_MAC (0x1083) #define CKM_AES_MAC_GENERAL (0x1084) #define CKM_AES_CBC_PAD (0x1085) #define CKM_GOSTR3410_KEY_PAIR_GEN (0x1200) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3410 (0x1201) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3410_WITH_GOSTR3411 (0x1202) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_GOSTR3411 (0x1210) /* From PKCS#11 v2.30 - draft 7 */ #define CKM_DSA_PARAMETER_GEN (0x2000) #define CKM_DH_PKCS_PARAMETER_GEN (0x2001) #define CKM_X9_42_DH_PARAMETER_GEN (0x2002) #define CKM_VENDOR_DEFINED ((unsigned long) (1 << 31)) struct ck_mechanism { ck_mechanism_type_t mechanism; void *parameter; unsigned long parameter_len; }; struct ck_mechanism_info { unsigned long min_key_size; unsigned long max_key_size; ck_flags_t flags; }; #define CKF_HW (1 << 0) #define CKF_ENCRYPT (1 << 8) #define CKF_DECRYPT (1 << 9) #define CKF_DIGEST (1 << 10) #define CKF_SIGN (1 << 11) #define CKF_SIGN_RECOVER (1 << 12) #define CKF_VERIFY (1 << 13) #define CKF_VERIFY_RECOVER (1 << 14) #define CKF_GENERATE (1 << 15) #define CKF_GENERATE_KEY_PAIR (1 << 16) #define CKF_WRAP (1 << 17) #define CKF_UNWRAP (1 << 18) #define CKF_DERIVE (1 << 19) #define CKF_EXTENSION ((unsigned long) (1 << 31)) /* Flags for C_WaitForSlotEvent. */ #define CKF_DONT_BLOCK (1) typedef unsigned long ck_rv_t; typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, ck_notification_t event, void *application); /* Forward reference. */ struct ck_function_list; #define _CK_DECLARE_FUNCTION(name, args) \ typedef ck_rv_t (*CK_ ## name) args; \ ck_rv_t CK_SPEC name args _CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); _CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); _CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); _CK_DECLARE_FUNCTION (C_GetFunctionList, (struct ck_function_list **function_list)); _CK_DECLARE_FUNCTION (C_GetSlotList, (unsigned char token_present, ck_slot_id_t *slot_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetSlotInfo, (ck_slot_id_t slot_id, struct ck_slot_info *info)); _CK_DECLARE_FUNCTION (C_GetTokenInfo, (ck_slot_id_t slot_id, struct ck_token_info *info)); _CK_DECLARE_FUNCTION (C_WaitForSlotEvent, (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); _CK_DECLARE_FUNCTION (C_GetMechanismList, (ck_slot_id_t slot_id, ck_mechanism_type_t *mechanism_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetMechanismInfo, (ck_slot_id_t slot_id, ck_mechanism_type_t type, struct ck_mechanism_info *info)); _CK_DECLARE_FUNCTION (C_InitToken, (ck_slot_id_t slot_id, unsigned char *pin, unsigned long pin_len, unsigned char *label)); _CK_DECLARE_FUNCTION (C_InitPIN, (ck_session_handle_t session, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_SetPIN, (ck_session_handle_t session, unsigned char *old_pin, unsigned long old_len, unsigned char *new_pin, unsigned long new_len)); _CK_DECLARE_FUNCTION (C_OpenSession, (ck_slot_id_t slot_id, ck_flags_t flags, void *application, ck_notify_t notify, ck_session_handle_t *session)); _CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); _CK_DECLARE_FUNCTION (C_GetSessionInfo, (ck_session_handle_t session, struct ck_session_info *info)); _CK_DECLARE_FUNCTION (C_GetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long *operation_state_len)); _CK_DECLARE_FUNCTION (C_SetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long operation_state_len, ck_object_handle_t encryption_key, ck_object_handle_t authentiation_key)); _CK_DECLARE_FUNCTION (C_Login, (ck_session_handle_t session, ck_user_type_t user_type, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CreateObject, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *object)); _CK_DECLARE_FUNCTION (C_CopyObject, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *new_object)); _CK_DECLARE_FUNCTION (C_DestroyObject, (ck_session_handle_t session, ck_object_handle_t object)); _CK_DECLARE_FUNCTION (C_GetObjectSize, (ck_session_handle_t session, ck_object_handle_t object, unsigned long *size)); _CK_DECLARE_FUNCTION (C_GetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_SetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjectsInit, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjects, (ck_session_handle_t session, ck_object_handle_t *object, unsigned long max_object_count, unsigned long *object_count)); _CK_DECLARE_FUNCTION (C_FindObjectsFinal, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_EncryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Encrypt, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *encrypted_data, unsigned long *encrypted_data_len)); _CK_DECLARE_FUNCTION (C_EncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_EncryptFinal, (ck_session_handle_t session, unsigned char *last_encrypted_part, unsigned long *last_encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Decrypt, (ck_session_handle_t session, unsigned char *encrypted_data, unsigned long encrypted_data_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DecryptUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_DecryptFinal, (ck_session_handle_t session, unsigned char *last_part, unsigned long *last_part_len)); _CK_DECLARE_FUNCTION (C_DigestInit, (ck_session_handle_t session, struct ck_mechanism *mechanism)); _CK_DECLARE_FUNCTION (C_Digest, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_DigestUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_DigestKey, (ck_session_handle_t session, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_DigestFinal, (ck_session_handle_t session, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_SignInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Sign, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_SignFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_SignRecover, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_VerifyInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Verify, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_VerifyFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_VerifyRecover, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_SignEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_GenerateKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_GenerateKeyPair, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *public_key_template, unsigned long public_key_attribute_count, struct ck_attribute *private_key_template, unsigned long private_key_attribute_count, ck_object_handle_t *public_key, ck_object_handle_t *private_key)); _CK_DECLARE_FUNCTION (C_WrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t wrapping_key, ck_object_handle_t key, unsigned char *wrapped_key, unsigned long *wrapped_key_len)); _CK_DECLARE_FUNCTION (C_UnwrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t unwrapping_key, unsigned char *wrapped_key, unsigned long wrapped_key_len, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_DeriveKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t base_key, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_SeedRandom, (ck_session_handle_t session, unsigned char *seed, unsigned long seed_len)); _CK_DECLARE_FUNCTION (C_GenerateRandom, (ck_session_handle_t session, unsigned char *random_data, unsigned long random_len)); _CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); struct ck_function_list { struct ck_version version; CK_C_Initialize C_Initialize; CK_C_Finalize C_Finalize; CK_C_GetInfo C_GetInfo; CK_C_GetFunctionList C_GetFunctionList; CK_C_GetSlotList C_GetSlotList; CK_C_GetSlotInfo C_GetSlotInfo; CK_C_GetTokenInfo C_GetTokenInfo; CK_C_GetMechanismList C_GetMechanismList; CK_C_GetMechanismInfo C_GetMechanismInfo; CK_C_InitToken C_InitToken; CK_C_InitPIN C_InitPIN; CK_C_SetPIN C_SetPIN; CK_C_OpenSession C_OpenSession; CK_C_CloseSession C_CloseSession; CK_C_CloseAllSessions C_CloseAllSessions; CK_C_GetSessionInfo C_GetSessionInfo; CK_C_GetOperationState C_GetOperationState; CK_C_SetOperationState C_SetOperationState; CK_C_Login C_Login; CK_C_Logout C_Logout; CK_C_CreateObject C_CreateObject; CK_C_CopyObject C_CopyObject; CK_C_DestroyObject C_DestroyObject; CK_C_GetObjectSize C_GetObjectSize; CK_C_GetAttributeValue C_GetAttributeValue; CK_C_SetAttributeValue C_SetAttributeValue; CK_C_FindObjectsInit C_FindObjectsInit; CK_C_FindObjects C_FindObjects; CK_C_FindObjectsFinal C_FindObjectsFinal; CK_C_EncryptInit C_EncryptInit; CK_C_Encrypt C_Encrypt; CK_C_EncryptUpdate C_EncryptUpdate; CK_C_EncryptFinal C_EncryptFinal; CK_C_DecryptInit C_DecryptInit; CK_C_Decrypt C_Decrypt; CK_C_DecryptUpdate C_DecryptUpdate; CK_C_DecryptFinal C_DecryptFinal; CK_C_DigestInit C_DigestInit; CK_C_Digest C_Digest; CK_C_DigestUpdate C_DigestUpdate; CK_C_DigestKey C_DigestKey; CK_C_DigestFinal C_DigestFinal; CK_C_SignInit C_SignInit; CK_C_Sign C_Sign; CK_C_SignUpdate C_SignUpdate; CK_C_SignFinal C_SignFinal; CK_C_SignRecoverInit C_SignRecoverInit; CK_C_SignRecover C_SignRecover; CK_C_VerifyInit C_VerifyInit; CK_C_Verify C_Verify; CK_C_VerifyUpdate C_VerifyUpdate; CK_C_VerifyFinal C_VerifyFinal; CK_C_VerifyRecoverInit C_VerifyRecoverInit; CK_C_VerifyRecover C_VerifyRecover; CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; CK_C_SignEncryptUpdate C_SignEncryptUpdate; CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; CK_C_GenerateKey C_GenerateKey; CK_C_GenerateKeyPair C_GenerateKeyPair; CK_C_WrapKey C_WrapKey; CK_C_UnwrapKey C_UnwrapKey; CK_C_DeriveKey C_DeriveKey; CK_C_SeedRandom C_SeedRandom; CK_C_GenerateRandom C_GenerateRandom; CK_C_GetFunctionStatus C_GetFunctionStatus; CK_C_CancelFunction C_CancelFunction; CK_C_WaitForSlotEvent C_WaitForSlotEvent; }; typedef ck_rv_t (*ck_createmutex_t) (void **mutex); typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); struct ck_c_initialize_args { ck_createmutex_t create_mutex; ck_destroymutex_t destroy_mutex; ck_lockmutex_t lock_mutex; ck_unlockmutex_t unlock_mutex; ck_flags_t flags; void *reserved; }; #define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1 << 0) #define CKF_OS_LOCKING_OK (1 << 1) #define CKR_OK (0) #define CKR_CANCEL (1) #define CKR_HOST_MEMORY (2) #define CKR_SLOT_ID_INVALID (3) #define CKR_GENERAL_ERROR (5) #define CKR_FUNCTION_FAILED (6) #define CKR_ARGUMENTS_BAD (7) #define CKR_NO_EVENT (8) #define CKR_NEED_TO_CREATE_THREADS (9) #define CKR_CANT_LOCK (0xa) #define CKR_ATTRIBUTE_READ_ONLY (0x10) #define CKR_ATTRIBUTE_SENSITIVE (0x11) #define CKR_ATTRIBUTE_TYPE_INVALID (0x12) #define CKR_ATTRIBUTE_VALUE_INVALID (0x13) #define CKR_DATA_INVALID (0x20) #define CKR_DATA_LEN_RANGE (0x21) #define CKR_DEVICE_ERROR (0x30) #define CKR_DEVICE_MEMORY (0x31) #define CKR_DEVICE_REMOVED (0x32) #define CKR_ENCRYPTED_DATA_INVALID (0x40) #define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41) #define CKR_FUNCTION_CANCELED (0x50) #define CKR_FUNCTION_NOT_PARALLEL (0x51) #define CKR_FUNCTION_NOT_SUPPORTED (0x54) #define CKR_KEY_HANDLE_INVALID (0x60) #define CKR_KEY_SIZE_RANGE (0x62) #define CKR_KEY_TYPE_INCONSISTENT (0x63) #define CKR_KEY_NOT_NEEDED (0x64) #define CKR_KEY_CHANGED (0x65) #define CKR_KEY_NEEDED (0x66) #define CKR_KEY_INDIGESTIBLE (0x67) #define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68) #define CKR_KEY_NOT_WRAPPABLE (0x69) #define CKR_KEY_UNEXTRACTABLE (0x6a) #define CKR_MECHANISM_INVALID (0x70) #define CKR_MECHANISM_PARAM_INVALID (0x71) #define CKR_OBJECT_HANDLE_INVALID (0x82) #define CKR_OPERATION_ACTIVE (0x90) #define CKR_OPERATION_NOT_INITIALIZED (0x91) #define CKR_PIN_INCORRECT (0xa0) #define CKR_PIN_INVALID (0xa1) #define CKR_PIN_LEN_RANGE (0xa2) #define CKR_PIN_EXPIRED (0xa3) #define CKR_PIN_LOCKED (0xa4) #define CKR_SESSION_CLOSED (0xb0) #define CKR_SESSION_COUNT (0xb1) #define CKR_SESSION_HANDLE_INVALID (0xb3) #define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4) #define CKR_SESSION_READ_ONLY (0xb5) #define CKR_SESSION_EXISTS (0xb6) #define CKR_SESSION_READ_ONLY_EXISTS (0xb7) #define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8) #define CKR_SIGNATURE_INVALID (0xc0) #define CKR_SIGNATURE_LEN_RANGE (0xc1) #define CKR_TEMPLATE_INCOMPLETE (0xd0) #define CKR_TEMPLATE_INCONSISTENT (0xd1) #define CKR_TOKEN_NOT_PRESENT (0xe0) #define CKR_TOKEN_NOT_RECOGNIZED (0xe1) #define CKR_TOKEN_WRITE_PROTECTED (0xe2) #define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0) #define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1) #define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2) #define CKR_USER_ALREADY_LOGGED_IN (0x100) #define CKR_USER_NOT_LOGGED_IN (0x101) #define CKR_USER_PIN_NOT_INITIALIZED (0x102) #define CKR_USER_TYPE_INVALID (0x103) #define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104) #define CKR_USER_TOO_MANY_TYPES (0x105) #define CKR_WRAPPED_KEY_INVALID (0x110) #define CKR_WRAPPED_KEY_LEN_RANGE (0x112) #define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113) #define CKR_WRAPPING_KEY_SIZE_RANGE (0x114) #define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115) #define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120) #define CKR_RANDOM_NO_RNG (0x121) #define CKR_DOMAIN_PARAMS_INVALID (0x130) #define CKR_BUFFER_TOO_SMALL (0x150) #define CKR_SAVED_STATE_INVALID (0x160) #define CKR_INFORMATION_SENSITIVE (0x170) #define CKR_STATE_UNSAVEABLE (0x180) #define CKR_CRYPTOKI_NOT_INITIALIZED (0x190) #define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191) #define CKR_MUTEX_BAD (0x1a0) #define CKR_MUTEX_NOT_LOCKED (0x1a1) #define CKR_FUNCTION_REJECTED (0x200) #define CKR_VENDOR_DEFINED ((unsigned long) (1 << 31)) /* Compatibility layer. */ #ifdef CRYPTOKI_COMPAT #undef CK_DEFINE_FUNCTION #define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name /* For NULL. */ #include typedef unsigned char CK_BYTE; typedef unsigned char CK_CHAR; typedef unsigned char CK_UTF8CHAR; typedef unsigned char CK_BBOOL; typedef unsigned long int CK_ULONG; typedef long int CK_LONG; typedef CK_BYTE *CK_BYTE_PTR; typedef CK_CHAR *CK_CHAR_PTR; typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; typedef CK_ULONG *CK_ULONG_PTR; typedef void *CK_VOID_PTR; typedef void **CK_VOID_PTR_PTR; #define CK_FALSE 0 #define CK_TRUE 1 #ifndef CK_DISABLE_TRUE_FALSE #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #endif typedef struct ck_version CK_VERSION; typedef struct ck_version *CK_VERSION_PTR; typedef struct ck_info CK_INFO; typedef struct ck_info *CK_INFO_PTR; typedef ck_slot_id_t *CK_SLOT_ID_PTR; typedef struct ck_slot_info CK_SLOT_INFO; typedef struct ck_slot_info *CK_SLOT_INFO_PTR; typedef struct ck_token_info CK_TOKEN_INFO; typedef struct ck_token_info *CK_TOKEN_INFO_PTR; typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; typedef struct ck_session_info CK_SESSION_INFO; typedef struct ck_session_info *CK_SESSION_INFO_PTR; typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; typedef struct ck_attribute CK_ATTRIBUTE; typedef struct ck_attribute *CK_ATTRIBUTE_PTR; typedef struct ck_date CK_DATE; typedef struct ck_date *CK_DATE_PTR; typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; typedef struct ck_mechanism CK_MECHANISM; typedef struct ck_mechanism *CK_MECHANISM_PTR; typedef struct ck_mechanism_info CK_MECHANISM_INFO; typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; typedef struct ck_function_list CK_FUNCTION_LIST; typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; #define NULL_PTR NULL /* Delete the helper macros defined at the top of the file. */ #undef ck_flags_t #undef ck_version #undef ck_info #undef cryptoki_version #undef manufacturer_id #undef library_description #undef library_version #undef ck_notification_t #undef ck_slot_id_t #undef ck_slot_info #undef slot_description #undef hardware_version #undef firmware_version #undef ck_token_info #undef serial_number #undef max_session_count #undef session_count #undef max_rw_session_count #undef rw_session_count #undef max_pin_len #undef min_pin_len #undef total_public_memory #undef free_public_memory #undef total_private_memory #undef free_private_memory #undef utc_time #undef ck_session_handle_t #undef ck_user_type_t #undef ck_state_t #undef ck_session_info #undef slot_id #undef device_error #undef ck_object_handle_t #undef ck_object_class_t #undef ck_hw_feature_type_t #undef ck_key_type_t #undef ck_certificate_type_t #undef ck_attribute_type_t #undef ck_attribute #undef value #undef value_len #undef ck_date #undef ck_mechanism_type_t #undef ck_mechanism #undef parameter #undef parameter_len #undef ck_mechanism_info #undef min_key_size #undef max_key_size #undef ck_rv_t #undef ck_notify_t #undef ck_function_list #undef ck_createmutex_t #undef ck_destroymutex_t #undef ck_lockmutex_t #undef ck_unlockmutex_t #undef ck_c_initialize_args #undef create_mutex #undef destroy_mutex #undef lock_mutex #undef unlock_mutex #undef reserved #endif /* CRYPTOKI_COMPAT */ /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #pragma pack(pop, cryptoki) #endif #if defined(__cplusplus) } #endif #endif /* PKCS11_H */ opendnssec-1.4.9/libhsm/src/Makefile.in0000644000175000017500000005275312650165765014752 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = libhsm/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/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 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)` ETAGS = etags CTAGS = ctags 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = lib bin 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 libhsm/src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/src/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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: $(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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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: opendnssec-1.4.9/libhsm/Makefile.in0000644000175000017500000005331312650165765014154 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = libhsm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/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 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)` ETAGS = etags CTAGS = ctags 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = src checks 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 libhsm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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: $(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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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 doxygen: rm -fr $(top_builddir)/libhsm/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-libhsm" \ SRCDIR=$(top_srcdir)/libhsm \ OUTPUTDIR=$(top_builddir)/libhsm/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) # 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: opendnssec-1.4.9/libhsm/checks/0000755000175000017500000000000012650166151013410 500000000000000opendnssec-1.4.9/libhsm/checks/Makefile.am0000644000175000017500000000250512650165732015372 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in CLEANFILES = token.db othertoken.db LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_builddir)/common \ -I$(srcdir)/../src/lib \ @LDNS_INCLUDES@ AM_CFLAGS = -std=c99 EXTRA_DIST = *.xml $(srcdir)/softhsm.conf noinst_PROGRAMS = hsmcheck hsmcheck_LDADD = ../src/lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) hsmcheck_LDFLAGS = -no-install SOFTHSM_ENV = SOFTHSM_CONF=$(srcdir)/softhsm.conf token.db othertoken.db: env $(SOFTHSM_ENV) \ softhsm --slot 0 --init-token --label softHSM \ --so-pin 12345678 --pin 123456 env $(SOFTHSM_ENV) \ softhsm --slot 1 --init-token --label xyzzy \ --so-pin 12345678 --pin 123456 check: regress-softhsm regress: @echo use target 'regress-{aepkeyper,sca6000,softhsm,etoken,opensc,ncipher,multi}' regress-aepkeyper: hsmcheck ./hsmcheck -c conf-aepkeyper.xml -gsdr regress-sca6000: hsmcheck ./hsmcheck -c conf-sca6000.xml -gsdr regress-softhsm: hsmcheck token.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-softhsm.xml -gsdr regress-etoken: hsmcheck ./hsmcheck -c conf-etoken.xml -gsdr regress-opensc: hsmcheck ./hsmcheck -c conf-opensc.xml -gsdr regress-ncipher: hsmcheck ./hsmcheck -c conf-ncipher.xml -gsdr regress-multi: hsmcheck token.db othertoken.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-multi.xml -gsdr opendnssec-1.4.9/libhsm/checks/conf-softhsm.xml0000644000175000017500000000041612650166001016453 00000000000000 /usr/local/lib/softhsm/libsofthsm.so softHSM 123456 opendnssec-1.4.9/libhsm/checks/conf-aepkeyper.xml.in0000644000175000017500000000040612650165675017401 00000000000000 @pkcs11_aepkeyper_module@ OpenDNSSEC 123456 opendnssec-1.4.9/libhsm/checks/conf-etoken.xml0000644000175000017500000000045012650166001016253 00000000000000 /usr/local/lib/libeTPkcs11.so OpenDNSSEC test.1234 10 opendnssec-1.4.9/libhsm/checks/conf-multi.xml.in0000644000175000017500000000062212650165675016546 00000000000000 @pkcs11_softhsm_module@ softHSM 123456 @pkcs11_softhsm_module@ xyzzy 123456 opendnssec-1.4.9/libhsm/checks/conf-softhsm.xml.in0000644000175000017500000000040112650165675017072 00000000000000 @pkcs11_softhsm_module@ softHSM 123456 opendnssec-1.4.9/libhsm/checks/softhsm.conf0000644000175000017500000000003312650165675015670 000000000000000:token.db 1:othertoken.db opendnssec-1.4.9/libhsm/checks/conf-ncipher.xml.in0000644000175000017500000000041012650165675017037 00000000000000 @pkcs11_ncipher_module@ OpenDNSSEC 1234567890 opendnssec-1.4.9/libhsm/checks/hsmcheck.c0000644000175000017500000001473012650165732015272 00000000000000/* * Copyright (c) 2009 Nominet UK. * 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 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. */ #include "config.h" #include #include #include #include #include #include extern char *optarg; char *progname = NULL; void usage () { fprintf(stderr, "usage: %s [-c config] [-gsdr]\n", progname); } int main (int argc, char *argv[]) { int result; hsm_ctx_t *ctx; hsm_key_t **keys; hsm_key_t *key = NULL; char *id; size_t key_count = 0; size_t i; ldns_rr_list *rrset; ldns_rr *rr, *sig, *dnskey_rr; ldns_status status; hsm_sign_params_t *sign_params; int do_generate = 0; int do_sign = 0; int do_delete = 0; int do_random = 0; int res; uint32_t r32; uint64_t r64; char *config = NULL; const char *repository = "default"; int ch; progname = argv[0]; while ((ch = getopt(argc, argv, "hgsdrc:")) != -1) { switch (ch) { case 'c': config = strdup(optarg); break; case 'g': do_generate = 1; break; case 'h': usage(); exit(0); break; case 's': do_sign = 1; break; case 'd': do_delete = 1; break; case 'r': do_random = 1; break; default: usage(); exit(1); } } if (!config) { usage(); exit(1); } /* * Open HSM library */ fprintf(stdout, "Starting HSM lib test\n"); result = hsm_open(config, hsm_prompt_pin); fprintf(stdout, "hsm_open result: %d\n", result); /* * Create HSM context */ ctx = hsm_create_context(); printf("global: "); hsm_print_ctx(NULL); printf("my: "); hsm_print_ctx(ctx); /* * Generate a new key OR find any key with an ID */ if (do_generate) { key = hsm_generate_rsa_key(ctx, repository, 1024); if (key) { printf("\nCreated key!\n"); hsm_print_key(key); printf("\n"); } else { printf("Error creating key, bad token name?\n"); hsm_print_error(ctx); exit(1); } } else if (do_sign || do_delete) { keys = hsm_list_keys(ctx, &key_count); printf("I have found %u keys\n", (unsigned int) key_count); /* let's just use the very first key we find and throw away the rest */ for (i = 0; i < key_count && !key; i++) { printf("\nFound key!\n"); hsm_print_key(keys[i]); id = hsm_get_key_id(ctx, keys[i]); if (id) { printf("Using key ID: %s\n", id); if (key) hsm_key_free(key); key = hsm_find_key_by_id(ctx, id); printf("ptr: 0x%p\n", (void *) key); free(id); } else { printf("Got no key ID (broken key?), skipped...\n"); } hsm_key_free(keys[i]); } free(keys); if (!key) { printf("Failed to find useful key\n"); exit(1); } } /* * Do some signing */ if (do_sign) { printf("\nSigning with:\n"); hsm_print_key(key); printf("\n"); rrset = ldns_rr_list_new(); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 123.123.123.123", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); status = ldns_rr_new_frm_str(&rr, "regress.opendnssec.se. IN A 124.124.124.124", 0, NULL, NULL); if (status == LDNS_STATUS_OK) ldns_rr_list_push_rr(rrset, rr); sign_params = hsm_sign_params_new(); sign_params->algorithm = LDNS_RSASHA1; sign_params->owner = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "opendnssec.se."); dnskey_rr = hsm_get_dnskey(ctx, key, sign_params); sign_params->keytag = ldns_calc_keytag(dnskey_rr); sig = hsm_sign_rrset(ctx, rrset, key, sign_params); if (sig) { ldns_rr_list_print(stdout, rrset); ldns_rr_print(stdout, sig); ldns_rr_print(stdout, dnskey_rr); ldns_rr_free(sig); } else { hsm_print_error(ctx); exit(-1); } /* cleanup */ ldns_rr_list_deep_free(rrset); hsm_sign_params_free(sign_params); ldns_rr_free(dnskey_rr); } /* * Delete key */ if (do_delete) { printf("\nDelete key:\n"); hsm_print_key(key); /* res = hsm_remove_key(ctx, key); */ res = hsm_remove_key(ctx, key); printf("Deleted key. Result: %d\n", res); printf("\n"); } if (key) hsm_key_free(key); /* * Test random{32,64} functions */ if (do_random) { r32 = hsm_random32(ctx); printf("random 32: %u\n", r32); r64 = hsm_random64(ctx); printf("random 64: %llu\n", (long long unsigned int)r64); } /* * Destroy HSM context */ if (ctx) { hsm_destroy_context(ctx); } /* * Close HSM library */ result = hsm_close(); fprintf(stdout, "all done! hsm_close result: %d\n", result); if (config) free(config); return 0; } opendnssec-1.4.9/libhsm/checks/conf-aepkeyper.xml0000644000175000017500000000042112650166001016751 00000000000000 /opt/Keyper/PKCS11Provider/pkcs11.so OpenDNSSEC 123456 opendnssec-1.4.9/libhsm/checks/conf-sca6000.xml.in0000644000175000017500000000040712650165675016471 00000000000000 @pkcs11_sca6000_module@ OpenDNSSEC test:1234 opendnssec-1.4.9/libhsm/checks/conf-etoken.xml.in0000644000175000017500000000044112650165675016700 00000000000000 @pkcs11_etoken_module@ OpenDNSSEC test.1234 10 opendnssec-1.4.9/libhsm/checks/conf-opensc.xml.in0000644000175000017500000000040112650165675016676 00000000000000 @pkcs11_opensc_module@ OpenDNSSEC 1234 opendnssec-1.4.9/libhsm/checks/conf-opensc.xml0000644000175000017500000000041312650166001016254 00000000000000 /usr/lib/pkcs11/opensc-pkcs11.so OpenDNSSEC 1234 opendnssec-1.4.9/libhsm/checks/conf-multi.xml0000644000175000017500000000065412650166001016126 00000000000000 /usr/local/lib/softhsm/libsofthsm.so softHSM 123456 /usr/local/lib/softhsm/libsofthsm.so xyzzy 123456 opendnssec-1.4.9/libhsm/checks/Makefile.in0000644000175000017500000005641312650165765015420 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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@ noinst_PROGRAMS = hsmcheck$(EXEEXT) subdir = libhsm/checks ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.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)/common/config.h CONFIG_CLEAN_FILES = conf-softhsm.xml conf-sca6000.xml conf-etoken.xml \ conf-multi.xml conf-opensc.xml conf-ncipher.xml \ conf-aepkeyper.xml CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) hsmcheck_SOURCES = hsmcheck.c hsmcheck_OBJECTS = hsmcheck.$(OBJEXT) hsmcheck_DEPENDENCIES = ../src/lib/libhsm.a $(LIBCOMPAT) 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 = hsmcheck_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(hsmcheck_LDFLAGS) $(LDFLAGS) -o $@ 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)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles 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 = hsmcheck.c DIST_SOURCES = hsmcheck.c 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)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/conf-aepkeyper.xml.in $(srcdir)/conf-etoken.xml.in \ $(srcdir)/conf-multi.xml.in $(srcdir)/conf-ncipher.xml.in \ $(srcdir)/conf-opensc.xml.in $(srcdir)/conf-sca6000.xml.in \ $(srcdir)/conf-softhsm.xml.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in CLEANFILES = token.db othertoken.db LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_builddir)/common \ -I$(srcdir)/../src/lib \ @LDNS_INCLUDES@ AM_CFLAGS = -std=c99 EXTRA_DIST = *.xml $(srcdir)/softhsm.conf hsmcheck_LDADD = ../src/lib/libhsm.a @LDNS_LIBS@ @XML2_LIBS@ $(LIBCOMPAT) hsmcheck_LDFLAGS = -no-install SOFTHSM_ENV = SOFTHSM_CONF=$(srcdir)/softhsm.conf 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 libhsm/checks/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libhsm/checks/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): conf-softhsm.xml: $(top_builddir)/config.status $(srcdir)/conf-softhsm.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-sca6000.xml: $(top_builddir)/config.status $(srcdir)/conf-sca6000.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-etoken.xml: $(top_builddir)/config.status $(srcdir)/conf-etoken.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-multi.xml: $(top_builddir)/config.status $(srcdir)/conf-multi.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-opensc.xml: $(top_builddir)/config.status $(srcdir)/conf-opensc.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-ncipher.xml: $(top_builddir)/config.status $(srcdir)/conf-ncipher.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf-aepkeyper.xml: $(top_builddir)/config.status $(srcdir)/conf-aepkeyper.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstPROGRAMS: @list='$(noinst_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 hsmcheck$(EXEEXT): $(hsmcheck_OBJECTS) $(hsmcheck_DEPENDENCIES) $(EXTRA_hsmcheck_DEPENDENCIES) @rm -f hsmcheck$(EXEEXT) $(AM_V_CCLD)$(hsmcheck_LINK) $(hsmcheck_OBJECTS) $(hsmcheck_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hsmcheck.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.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: $(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: 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: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-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 -rf ./$(DEPDIR) -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS 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-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 .PRECIOUS: Makefile token.db othertoken.db: env $(SOFTHSM_ENV) \ softhsm --slot 0 --init-token --label softHSM \ --so-pin 12345678 --pin 123456 env $(SOFTHSM_ENV) \ softhsm --slot 1 --init-token --label xyzzy \ --so-pin 12345678 --pin 123456 check: regress-softhsm regress: @echo use target 'regress-{aepkeyper,sca6000,softhsm,etoken,opensc,ncipher,multi}' regress-aepkeyper: hsmcheck ./hsmcheck -c conf-aepkeyper.xml -gsdr regress-sca6000: hsmcheck ./hsmcheck -c conf-sca6000.xml -gsdr regress-softhsm: hsmcheck token.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-softhsm.xml -gsdr regress-etoken: hsmcheck ./hsmcheck -c conf-etoken.xml -gsdr regress-opensc: hsmcheck ./hsmcheck -c conf-opensc.xml -gsdr regress-ncipher: hsmcheck ./hsmcheck -c conf-ncipher.xml -gsdr regress-multi: hsmcheck token.db othertoken.db env $(SOFTHSM_ENV) \ ./hsmcheck -c conf-multi.xml -gsdr # 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: opendnssec-1.4.9/libhsm/checks/conf-sca6000.xml0000644000175000017500000000040512650166001016042 00000000000000 /usr/lib/libpkcs11.so OpenDNSSEC test:1234 opendnssec-1.4.9/libhsm/checks/conf-ncipher.xml0000644000175000017500000000043112650166001016415 00000000000000 /opt/nfast/toolkits/pkcs11/libcknfast.so OpenDNSSEC 1234567890 opendnssec-1.4.9/configure0000755000175000017500000235001212650165762012533 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for opendnssec 1.4.9. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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 -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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # 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 test -z "$as_dir" && as_dir=. 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_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 -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 " 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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || 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 as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else 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 test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: http://bugs.opendnssec.org/ about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi 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=`$as_echo "$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 || $as_echo 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 as_fn_append () { eval $1=\$$1\$2 } 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 as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } 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 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$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 || $as_echo 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 ' 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" || { $as_echo "$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 } 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 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_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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='opendnssec' PACKAGE_TARNAME='opendnssec' PACKAGE_VERSION='1.4.9' PACKAGE_STRING='opendnssec 1.4.9' PACKAGE_BUGREPORT='http://bugs.opendnssec.org/' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DOXYGEN_PAPER_SIZE DX_COND_latex_FALSE DX_COND_latex_TRUE DX_COND_pdf_FALSE DX_COND_pdf_TRUE DX_PDFLATEX DX_FLAG_pdf DX_COND_ps_FALSE DX_COND_ps_TRUE DX_EGREP DX_DVIPS DX_MAKEINDEX DX_LATEX DX_FLAG_ps DX_COND_html_FALSE DX_COND_html_TRUE DX_FLAG_html DX_COND_chi_FALSE DX_COND_chi_TRUE DX_FLAG_chi DX_COND_chm_FALSE DX_COND_chm_TRUE DX_HHC DX_FLAG_chm DX_COND_xml_FALSE DX_COND_xml_TRUE DX_FLAG_xml DX_COND_rtf_FALSE DX_COND_rtf_TRUE DX_FLAG_rtf DX_COND_man_FALSE DX_COND_man_TRUE DX_FLAG_man DX_COND_dot_FALSE DX_COND_dot_TRUE DX_DOT DX_FLAG_dot DX_COND_doc_FALSE DX_COND_doc_TRUE DX_PERL DX_DOXYGEN DX_FLAG_doc DX_ENV DX_DOCDIR DX_CONFIG DX_PROJECT WITH_CUCUMBER_FALSE WITH_CUCUMBER_TRUE CUCUMBER ENABLE_SIGNER_FALSE ENABLE_SIGNER_TRUE WITH_CUNIT_FALSE WITH_CUNIT_TRUE ENABLE_ENFORCER_FALSE ENABLE_ENFORCER_TRUE CUNIT_LIBS CUNIT_INCLUDES USE_MYSQL_FALSE USE_MYSQL_TRUE DB_LIBS DB_INCLUDES DB_TYPE MYSQL_LIBS MYSQL_INCLUDES MYSQL MYSQL_CONFIG SQLITE3_LIBS SQLITE3_INCLUDES SQLITE3 DB_PASS DB_USER DB_PORT DB_HOST DB_NAME PERL SSL_LIBS SSL_INCLUDES HAVE_SSL C_LIBS RT_LIBS pkcs11_aepkeyper_module pkcs11_ncipher_module pkcs11_opensc_module pkcs11_etoken_module pkcs11_sca6000_module pkcs11_softhsm_module LDNS_LIBS LDNS_INCLUDES LDNS_CONFIG XML2_LIBS XML2_INCLUDES XML2_CONFIG LIBOBJS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config CP JAVA XSLTPROC XMLLINT OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC OPENDNSSEC_SIGNER_CLI OPENDNSSEC_SIGNER_ENGINE OPENDNSSEC_SIGNER_SOCKET OPENDNSSEC_FETCH_PIDFILE OPENDNSSEC_ENFORCER_PIDFILE OPENDNSSEC_SIGNER_PIDFILE OPENDNSSEC_STATE_DIR OPENDNSSEC_SCHEMA_DIR OPENDNSSEC_CONFIG_FILE OPENDNSSEC_CONFIG_DIR OPENDNSSEC_PID_DIR OPENDNSSEC_LOCALSTATE_DIR OPENDNSSEC_SYSCONF_DIR OPENDNSSEC_DATA_DIR OPENDNSSEC_LIBEXEC_DIR OPENDNSSEC_LIB_DIR OPENDNSSEC_SBIN_DIR OPENDNSSEC_BIN_DIR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 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' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_rpath enable_pedantic enable_strict enable_timeshift with_libxml2 with_ldns with_pkcs11_softhsm with_pkcs11_sca6000 with_pkcs11_etoken with_pkcs11_opensc with_pkcs11_ncipher with_pkcs11_aepkeyper with_ssl with_dbname with_dbhost with_dbport with_dbuser with_dbpass with_database_backend with_sqlite3 with_mysql with_cunit enable_signer enable_doxygen_doc enable_doxygen_dot enable_doxygen_man enable_doxygen_rtf enable_doxygen_xml enable_doxygen_chm enable_doxygen_chi enable_doxygen_html enable_doxygen_ps enable_doxygen_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP DOXYGEN_PAPER_SIZE' # 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$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" ;; *) $as_echo "$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 || $as_echo 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 opendnssec 1.4.9 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/opendnssec] --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 opendnssec 1.4.9:";; 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-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath disable hardcoded rpath (default=enabled) --enable-pedantic enable pedantic compile mode [enabled] --enable-strict enable strict compile mode [enabled] --enable-timeshift Enable timeshift debug --disable-signer Disable signer build (default enabled) --disable-doxygen-doc don't generate any doxygen documentation --disable-doxygen-dot don't generate graphics for doxygen documentation --enable-doxygen-man generate doxygen manual pages --enable-doxygen-rtf generate doxygen RTF documentation --enable-doxygen-xml generate doxygen XML documentation --enable-doxygen-chm generate doxygen compressed HTML help documentation --enable-doxygen-chi generate doxygen seperate compressed HTML help index file --disable-doxygen-html don't generate doxygen plain HTML documentation --enable-doxygen-ps generate doxygen PostScript documentation --enable-doxygen-pdf generate doxygen PDF documentation Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --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). --with-libxml2=DIR look for libxml2 in this dir --with-ldns=PATH specify prefix of path of ldns library to use --with-pkcs11-softhsm=PATH specify path of SoftHSM PKCS#11 library (default PREFIX/lib/softhsm/libsofthsm.so) --with-pkcs11-sca6000=PATH specify path of SCA/6000 PKCS#11 library (default /usr/lib/libpkcs11.so) --with-pkcs11-etoken=PATH specify path of Aladdin eToken PKCS#11 library (default /usr/local/lib/libeTPkcs11.so) --with-pkcs11-opensc=PATH specify path of OpenSC PKCS#11 library (default /usr/lib/pkcs11/opensc-pkcs11.so) --with-pkcs11-ncipher=PATH specify path of nCipher PKCS#11 library (default /opt/nfast/toolkits/pkcs11/libcknfast.so) --with-pkcs11-aepkeyper=PATH specify path of AEP Keyper PKCS#11 library (default /opt/Keyper/PKCS11Provider/pkcs11.so) --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr) --with-dbname=DB_NAME Database name/schema for unit tests --with-dbhost=DB_HOST Database host for unit tests --with-dbport=DB_PORT Database port for unit tests --with-dbuser=DB_USER Database user for unit tests --with-dbpass=DB_PASS Database password for unit tests --with-database-backend Select database backend (sqlite3|mysql) --with-sqlite3=PATH Specify prefix of path of SQLite3 --with-mysql=DIR Specify prefix of path of MySQL --with-cunit=DIR Look for cunit in this dir 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 CPP C preprocessor DOXYGEN_PAPER_SIZE a4wide (default), a4, letter, legal or executive 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 . _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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$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 guested configure. 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 $as_echo "$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 opendnssec configure 1.4.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 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_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------ ## ## Report this to http://bugs.opendnssec.org/ ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$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$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\"" $as_echo "$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 $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #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 (); /* 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 () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { 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 () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { 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.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { 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 eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member 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 opendnssec $as_me 1.4.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " alarm" # 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`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 am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 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. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. 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 fi if test "${ac_cv_path_install+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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=`$as_echo "$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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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 (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ '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 fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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+set}" = set; 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} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$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='opendnssec' VERSION='1.4.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # 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 -' # 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 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='opendnssec' VERSION='1.4.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # 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 -' # 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 case "$prefix" in NONE) case "$sysconfdir" in '${prefix}/etc') sysconfdir=/etc ac_configure_args="$ac_configure_args --sysconfdir=$sysconfdir" { $as_echo "$as_me:${as_lineno-$LINENO}: sysconfdir set to $sysconfdir" >&5 $as_echo "$as_me: sysconfdir set to $sysconfdir" >&6;} ;; esac case "$localstatedir" in '${prefix}/var') localstatedir=/var ac_configure_args="$ac_configure_args --localstatedir=$localstatedir" { $as_echo "$as_me:${as_lineno-$LINENO}: localstate set to $localstatedir" >&5 $as_echo "$as_me: localstate set to $localstatedir" >&6;} ;; esac ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: Detecting common OpenDNSSEC settings" >&5 $as_echo "$as_me: Detecting common OpenDNSSEC settings" >&6;} full_bindir=`eval eval eval eval eval echo "${bindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sbindir=`eval eval eval eval eval echo "${sbindir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libdir=`eval eval eval eval eval echo "${libdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_libexecdir=`eval eval eval eval eval echo "${libexecdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_datadir=`eval eval eval eval eval echo "${datadir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_sysconfdir=`eval eval eval eval eval echo "${sysconfdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` full_localstatedir=`eval eval eval eval eval echo "${localstatedir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"` OPENDNSSEC_BIN_DIR=$full_bindir OPENDNSSEC_SBIN_DIR=$full_sbindir OPENDNSSEC_LIB_DIR=$full_libdir/opendnssec OPENDNSSEC_LIBEXEC_DIR=$full_libexecdir/opendnssec OPENDNSSEC_DATA_DIR=$full_datadir/opendnssec OPENDNSSEC_SYSCONF_DIR=$full_sysconfdir/opendnssec OPENDNSSEC_LOCALSTATE_DIR="$full_localstatedir/opendnssec" OPENDNSSEC_PID_DIR="$full_localstatedir/run/opendnssec" OPENDNSSEC_CONFIG_DIR=$OPENDNSSEC_SYSCONF_DIR OPENDNSSEC_CONFIG_FILE=$OPENDNSSEC_SYSCONF_DIR/conf.xml OPENDNSSEC_SCHEMA_DIR=$OPENDNSSEC_DATA_DIR OPENDNSSEC_STATE_DIR=$OPENDNSSEC_LOCALSTATE_DIR cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_CONFIG_DIR "$OPENDNSSEC_CONFIG_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_CONFIG_FILE "$OPENDNSSEC_CONFIG_FILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SCHEMA_DIR "$OPENDNSSEC_SCHEMA_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_STATE_DIR "$OPENDNSSEC_STATE_DIR" _ACEOF OPENDNSSEC_SIGNER_PIDFILE=$OPENDNSSEC_PID_DIR/signerd.pid OPENDNSSEC_ENFORCER_PIDFILE=$OPENDNSSEC_PID_DIR/enforcerd.pid OPENDNSSEC_FETCH_PIDFILE=$OPENDNSSEC_PID_DIR/zone_fetcher.pid cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_PIDFILE "$OPENDNSSEC_SIGNER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_ENFORCER_PIDFILE "$OPENDNSSEC_ENFORCER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_FETCH_PIDFILE "$OPENDNSSEC_FETCH_PIDFILE" _ACEOF # signer specific OPENDNSSEC_SIGNER_SOCKET=$OPENDNSSEC_PID_DIR/engine.sock OPENDNSSEC_SIGNER_ENGINE=$OPENDNSSEC_SBIN_DIR/ods-signerd OPENDNSSEC_SIGNER_CLI=$OPENDNSSEC_SBIN_DIR/ods-signer OPENDNSSEC_SIGNER_WORKINGDIR=$OPENDNSSEC_STATE_DIR/tmp cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_SOCKET "$OPENDNSSEC_SIGNER_SOCKET" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_ENGINE "$OPENDNSSEC_SIGNER_ENGINE" _ACEOF cat >>confdefs.h <<_ACEOF #define OPENDNSSEC_SIGNER_CLI "$OPENDNSSEC_SIGNER_CLI" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_PIDFILE "$OPENDNSSEC_SIGNER_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_ZF_PIDFILE "$OPENDNSSEC_FETCH_PIDFILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_SOCKFILE "$OPENDNSSEC_SIGNER_SOCKET" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_WORKDIR "$OPENDNSSEC_SIGNER_WORKINGDIR" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_CFGFILE "$OPENDNSSEC_CONFIG_FILE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_RNGDIR "$OPENDNSSEC_SCHEMA_DIR" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_ENGINE "$OPENDNSSEC_SIGNER_ENGINE" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_CLI "$OPENDNSSEC_SIGNER_CLI" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_MAXLINE 1024 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_MAX_BACKOFF 3600 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_WORKERTHREADS 4 _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_STOP_RESPONSE "Engine shut down." _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V3 ";OpenDNSSEC-backup-v3" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V2 ";ODSSE2" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_FILE_MAGIC_V1 ";ODSSE1" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_SE_VERBOSITY 3 _ACEOF # enforcer specific OPENDNSSEC_ENFORCER_CONTROL=$OPENDNSSEC_SBIN_DIR/ods-control OPENDNSSEC_ENFORCER_KASPCHECK=$OPENDNSSEC_BIN_DIR/ods-kaspcheck cat >>confdefs.h <<_ACEOF #define ODS_EN_CONTROL "$OPENDNSSEC_ENFORCER_CONTROL enforcer " _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_EN_NOTIFY "$OPENDNSSEC_ENFORCER_CONTROL enforcer notify" _ACEOF cat >>confdefs.h <<_ACEOF #define ODS_EN_KASPCHECK "$OPENDNSSEC_ENFORCER_KASPCHECK" _ACEOF # extensions DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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; 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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$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 () { FILE *f = fopen ("conftest.out", "w"); 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$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 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$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 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) 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; } /* 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 don't provoke an error unfortunately, instead are silently treated as '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's necessary to write '\x00'==0 to get something that's 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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # standard programs 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$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 fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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. $as_echo "$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; 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\"" $as_echo "$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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) 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; } /* 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 don't provoke an error unfortunately, instead are silently treated as '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's necessary to write '\x00'==0 to get something that's 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 **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _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 test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$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 case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$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 # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "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*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$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+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # 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 "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else 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 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else 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*) # Under GNU Hurd, 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* | 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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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 $i != 17 # 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 fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # 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* ) # 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 fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$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* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else 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. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which 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='/usr/bin/file -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* | 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. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && 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)' 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*) 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=/usr/bin/file 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=/usr/bin/file 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 ;; 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=/usr/bin/file 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 ;; 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 ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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=: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 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 case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # 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* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; 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 # 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 -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$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 -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) 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 # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print 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(){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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 con'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* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$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=$? $as_echo "$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 "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && 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 which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. 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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file 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* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) 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*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_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_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else 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 $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else 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 cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { 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 $_lt_result -eq 0 && $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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$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*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; 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 "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; 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 enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; 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 enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; 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 pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; 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 enable_fast_install=yes fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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 "X${COLLECT_NAMES+set}" != Xset; 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, # which needs '.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 for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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(){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 "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else 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" # 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; 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 "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; 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* | 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' ;; 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | 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' ;; 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' ;; # 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' ;; 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' ;; *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' ;; 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 which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else 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" # 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; 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\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else 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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "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* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; 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 "$with_gnu_ld" = yes; 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 "$lt_use_gnu_ld_interface" = yes; 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 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 "$host_cpu" != ia64; 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* | 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' 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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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=yes ;; 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 "$host_os" = linux-dietlibc; 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 "$tmp_diet" = no 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' ;; 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 "x$supports_anon_versioning" = xyes; 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 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 "x$supports_anon_versioning" = xyes; 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 ;; 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 can not *** 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 "$ld_shlibs" = no; 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 "$GCC" = yes && 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 "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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,' if test "$GCC" = yes; 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 "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi 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_use_runtimelinking" = yes; 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 "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi 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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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 "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi 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 "$with_gnu_ld" = yes; 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 # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' 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* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC 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 -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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, )='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 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 "$lt_cv_ld_force_load" = "yes"; 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*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; 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*) 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 "$GCC" = yes; 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 $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes && test "$with_gnu_ld" = no; 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) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else 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" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else 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 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; 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 ;; 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; 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 "$GCC" = yes; 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=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; 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 "$GCC" = yes; 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 can NOT 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 "$GCC" = yes; 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 x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && 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 "$enable_shared" = yes && test "$GCC" = yes; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $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=$? $as_echo "$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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | 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` 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" else 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* | 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 "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi 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%'\''`; test $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* | 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 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' 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* | 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*) # Native MSVC 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*) 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 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*) # 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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 "$lt_cv_prog_gnu_ld" = yes; 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 ;; # 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 ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else 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 () { ; 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$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir 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 # Append ld.so.conf contents 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 ;; 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 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; 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 "$with_gnu_ld" = yes; 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=freebsd-elf 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 "$with_gnu_ld" = yes; 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 ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # 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 "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; 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* | 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$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 fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && 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" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; 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 -fvisbility=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 () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; 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 -fvisbility=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 () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { 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=$? $as_echo "$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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$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: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else 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 test -z "$as_dir" && as_dir=. 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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$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 # additional programs # Extract the first word of "xmllint", so it can be a program name with args. set dummy xmllint; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLLINT in [\\/]* | ?:[\\/]*) ac_cv_path_XMLLINT="$XMLLINT" # 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 test -z "$as_dir" && as_dir=. 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_XMLLINT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XMLLINT=$ac_cv_path_XMLLINT if test -n "$XMLLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 $as_echo "$XMLLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # 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 test -z "$as_dir" && as_dir=. 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_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "java", so it can be a program name with args. set dummy java; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVA in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA="$JAVA" # 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 test -z "$as_dir" && as_dir=. 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_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVA=$ac_cv_path_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CP+:} false; then : $as_echo_n "(cached) " >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # 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 test -z "$as_dir" && as_dir=. 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_CP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 $as_echo "$CP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat >>confdefs.h <<_ACEOF #define CP_COMMAND "$CP" _ACEOF # building # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; enable_rpath=$enableval else enable_rpath=yes fi if test "x$enable_rpath" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Fixing libtool for -rpath problems." >&5 $as_echo "Fixing libtool for -rpath problems." >&6; } sed < libtool > libtool-2 \ 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/' mv libtool-2 libtool chmod 755 libtool libtool="./libtool" fi if test "x$enable_rpath" = xyes; then if echo "" | grep "^/" >/dev/null; then RUNTIME_PATH="$RUNTIME_PATH -R" fi fi # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; else enable_pedantic="yes" fi if test "${enable_pedantic}" = "yes"; then enable_strict="yes"; CFLAGS="${CFLAGS} -pedantic" fi # Check whether --enable-strict was given. if test "${enable_strict+set}" = set; then : enableval=$enable_strict; else enable_strict="yes" fi if test "${enable_strict}" = "yes"; then CFLAGS="${CFLAGS} -Wall -Wextra" fi # compiler flags { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -std=c99" >&5 $as_echo_n "checking whether $CC supports -std=c99... " >&6; } cache=`echo std=c99 | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(){}' >conftest.c if test -z "`$CC -std=c99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-std=c99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -xc99" >&5 $as_echo_n "checking whether $CC supports -xc99... " >&6; } cache=`echo xc99 | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo 'void f(){}' >conftest.c if test -z "`$CC -xc99 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else eval "cv_prog_cc_flag_$cache=no" fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : C99FLAG="-xc99" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need $C99FLAG as a flag for $CC" >&5 $as_echo_n "checking whether we need $C99FLAG as a flag for $CC... " >&6; } cache=`echo $C99FLAG | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo '#include ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CFLAGS $C99FLAG -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else echo 'Test with flag fails too' fi fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="$CFLAGS $C99FLAG" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D__EXTENSIONS__ as a flag for $CC" >&5 $as_echo_n "checking whether we need -D__EXTENSIONS__ as a flag for $CC... " >&6; } cache=`echo -D__EXTENSIONS__ | sed 'y% .=/+-%____p_%'` if eval \${cv_prog_cc_flag_needed_$cache+:} false; then : $as_echo_n "(cached) " >&6 else echo ' #include "confdefs.h" #include #include int test() { int a; char **opts = NULL; a = getopt(2, opts, "a"); return a; } ' > conftest.c echo 'void f(){}' >>conftest.c if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else if test -z "`$CC $CFLAGS -D__EXTENSIONS__ -Werror -Wall -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else echo 'Test with flag fails too' fi fi rm -f conftest* fi if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : CFLAGS="-D__EXTENSIONS__ $CFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi # checks for header files { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in fcntl.h inttypes.h stdio.h stdlib.h string.h syslog.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_H 1 _ACEOF else $ac_includes_default fi done for ac_header in errno.h getopt.h pthread.h signal.h stdarg.h stdint.h strings.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in libxml/parser.h libxml/relaxng.h libxml/xmlreader.h libxml/xpath.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # checks for typedefs, structures, and compiler characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h 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 cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF 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 cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5 $as_echo_n "checking for union semun... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun arg; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_union_semun=1 else have_union_semun=0 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $have_union_semun = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_UNION_SEMUN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # pthread 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } 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. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case ${host_os} in solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; darwin*) ax_pthread_flags="-pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_ax_pthread_config="yes" $as_echo "$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_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case ${host_os} in aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; osf* | hpux*) flag="-D_REENTRANT";; solaris*) if test "$GCC" = "yes"; then flag="-D_REENTRANT" else flag="-mt -D_REENTRANT" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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 test -z "$as_dir" && as_dir=. 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_PTHREAD_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" # checks for library functions for ac_func in arc4random arc4random_uniform do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in dup2 endpwent select strerror strtol do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpass getpassphrase memset do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in localtime_r memset strdup strerror strstr strtol strtoul do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in setregid setreuid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chown stat exit time atoi getpid waitpid sigfillset do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in malloc calloc realloc free do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strlen strncmp strncat strncpy strerror strncasecmp strdup do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fgetc fopen fclose ferror fprintf vsnprintf snprintf fflush do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in openlog closelog syslog do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in openlog_r closelog_r syslog_r vsyslog_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chroot getgroups setgroups initgroups do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in close unlink fcntl socket listen bzero do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in va_start va_end do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in xmlInitParser xmlCleanupParser xmlCleanupThreads do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_cond_init pthread_cond_signal pthread_cond_destroy pthread_cond_wait pthread_cond_timedwait do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pthread_create pthread_detach pthread_self pthread_join pthread_sigmask do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in $ac_func_list do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } if ${ac_cv_func_working_mktime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static const char *tz_strings[] = { (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (;;) { t = (time_t_max << 1) + 1; if (t <= time_t_max) break; time_t_max = t; } time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; ; j <<= 1) if (! bigtime_test (j)) return 1; else if (INT_MAX / 2 < j) break; if (! bigtime_test (INT_MAX)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else ac_cv_func_working_mktime=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes; then : $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h else case " $LIBOBJS " in *" strlcat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcat.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes; then : $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h else case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "b64_pton" "ac_cv_func_b64_pton" if test "x$ac_cv_func_b64_pton" = xyes; then : $as_echo "#define HAVE_B64_PTON 1" >>confdefs.h else case " $LIBOBJS " in *" b64_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS b64_pton.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "b64_ntop" "ac_cv_func_b64_ntop" if test "x$ac_cv_func_b64_ntop" = xyes; then : $as_echo "#define HAVE_B64_NTOP 1" >>confdefs.h else case " $LIBOBJS " in *" b64_ntop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS b64_ntop.$ac_objext" ;; esac fi for ac_func in setresuid do : ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" if test "x$ac_cv_func_setresuid" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETRESUID 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresuid seems to work" >&5 $as_echo_n "checking if setresuid seems to work... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5 $as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;} else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define BROKEN_SETRESUID 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5 $as_echo "not implemented" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi done for ac_func in setresgid do : ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid" if test "x$ac_cv_func_setresgid" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETRESGID 1 _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking if setresgid seems to work" >&5 $as_echo_n "checking if setresgid seems to work... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking setresuid" >&5 $as_echo "$as_me: WARNING: cross compiling: not checking setresuid" >&2;} else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define BROKEN_SETRESGID 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: not implemented" >&5 $as_echo "not implemented" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strptime needs defines" >&5 $as_echo_n "checking whether strptime needs defines... " >&6; } if ${ac_cv_c_strptime_needs_defs+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.c < void testing (void) { struct tm t; char *timestr; strptime(timestr, "%Y%m", &t); } EOF if test -z "`$CC -Wall -Werror -c conftest.c 2>&1`"; then eval "ac_cv_c_strptime_needs_defs=no" else eval "ac_cv_c_strptime_needs_defs=yes" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_strptime_needs_defs" >&5 $as_echo "$ac_cv_c_strptime_needs_defs" >&6; } if test $ac_cv_c_strptime_needs_defs = yes; then cat >>confdefs.h <<_ACEOF #define STRPTIME_NEEDS_DEFINES 1 _ACEOF fi # check for some target-specific stuff case "$host" in *-*-darwin*) $as_echo "#define SETEUID_BREAKS_SETUID 1" >>confdefs.h $as_echo "#define BROKEN_SETREUID 1" >>confdefs.h $as_echo "#define BROKEN_SETREGID 1" >>confdefs.h ;; esac # check for the sockaddr_un.sun_len member ac_fn_c_check_member "$LINENO" "struct sockaddr_un" "sun_len" "ac_cv_member_struct_sockaddr_un_sun_len" " #include #include " if test "x$ac_cv_member_struct_sockaddr_un_sun_len" = xyes; then : $as_echo "#define HAVE_SOCKADDR_SUN_LEN 1" >>confdefs.h fi # timeshift # Check whether --enable-timeshift was given. if test "${enable_timeshift+set}" = set; then : enableval=$enable_timeshift; enable_timeshift="${enableval}" else enable_timeshift="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should enable timeshift debugging" >&5 $as_echo_n "checking if we should enable timeshift debugging... " >&6; } if test "x${enable_timeshift}" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define ENFORCER_TIMESHIFT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # common dependencies # Check whether --with-libxml2 was given. if test "${with_libxml2+set}" = set; then : withval=$with_libxml2; XML2_PATH="$withval" for ac_prog in xml2-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XML2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $XML2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $XML2_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XML2_CONFIG=$ac_cv_path_XML2_CONFIG if test -n "$XML2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 $as_echo "$XML2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XML2_CONFIG" && break done test -n "$XML2_CONFIG" || XML2_CONFIG="xml2-config" else XML2_PATH="/usr/local" for ac_prog in xml2-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XML2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $XML2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML2_CONFIG="$XML2_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 test -z "$as_dir" && as_dir=. 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_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XML2_CONFIG=$ac_cv_path_XML2_CONFIG if test -n "$XML2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 $as_echo "$XML2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XML2_CONFIG" && break done test -n "$XML2_CONFIG" || XML2_CONFIG="xml2-config" fi if test -x "$XML2_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the xml2 includes" >&5 $as_echo_n "checking what are the xml2 includes... " >&6; } XML2_INCLUDES="`$XML2_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_INCLUDES" >&5 $as_echo "$XML2_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the xml2 libs" >&5 $as_echo_n "checking what are the xml2 libs... " >&6; } XML2_LIBS="`$XML2_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_LIBS" >&5 $as_echo "$XML2_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $XML2_INCLUDES" LIBS="$LIBS $XML2_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlDocGetRootElement in -lxml2" >&5 $as_echo_n "checking for xmlDocGetRootElement in -lxml2... " >&6; } if ${ac_cv_lib_xml2_xmlDocGetRootElement+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml2 $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. */ #ifdef __cplusplus extern "C" #endif char xmlDocGetRootElement (); int main () { return xmlDocGetRootElement (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xml2_xmlDocGetRootElement=yes else ac_cv_lib_xml2_xmlDocGetRootElement=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlDocGetRootElement" >&5 $as_echo "$ac_cv_lib_xml2_xmlDocGetRootElement" >&6; } if test "x$ac_cv_lib_xml2_xmlDocGetRootElement" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXML2 1 _ACEOF LIBS="-lxml2 $LIBS" else as_fn_error $? "Can't find libxml2 library" "$LINENO" 5 fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS else as_fn_error $? "libxml2 required, but not found." "$LINENO" 5 fi # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_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 test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" LIBS="$LIBS $LDNS_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns_rr_new in -lldns" >&5 $as_echo_n "checking for ldns_rr_new in -lldns... " >&6; } if ${ac_cv_lib_ldns_ldns_rr_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldns $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. */ #ifdef __cplusplus extern "C" #endif char ldns_rr_new (); int main () { return ldns_rr_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldns_ldns_rr_new=yes else ac_cv_lib_ldns_ldns_rr_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldns_ldns_rr_new" >&5 $as_echo "$ac_cv_lib_ldns_ldns_rr_new" >&6; } if test "x$ac_cv_lib_ldns_ldns_rr_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDNS 1 _ACEOF LIBS="-lldns $LIBS" else as_fn_error $? "Can't find ldns library" "$LINENO" 5 fi LIBS=$tmp_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version" >&5 $as_echo_n "checking for ldns version... " >&6; } CHECK_LDNS_VERSION=0x01060c 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION >= $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: >= 1.6.12" >&5 $as_echo ">= 1.6.12" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: < 1.6.12" >&5 $as_echo "< 1.6.12" >&6; } as_fn_error $? "ldns library too old (1.6.12 or later required)" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_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 test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version not 1.6.14" >&5 $as_echo_n "checking for ldns version not 1.6.14... " >&6; } CHECK_LDNS_VERSION=0x01060e 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION != $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "ldns version 1.6.14 is not compatible due to binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then : withval=$with_ldns; LDNS_PATH="$withval" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LDNS_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" else LDNS_PATH="/usr/local" for ac_prog in ldns-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LDNS_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDNS_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDNS_CONFIG="$LDNS_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 test -z "$as_dir" && as_dir=. 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_LDNS_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi LDNS_CONFIG=$ac_cv_path_LDNS_CONFIG if test -n "$LDNS_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_CONFIG" >&5 $as_echo "$LDNS_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LDNS_CONFIG" && break done test -n "$LDNS_CONFIG" || LDNS_CONFIG="ldns-config" fi if test -x "$LDNS_CONFIG" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="`$LDNS_CONFIG --cflags`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="`$LDNS_CONFIG --libs`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns includes" >&5 $as_echo_n "checking what are the ldns includes... " >&6; } LDNS_INCLUDES="-I$LDNS_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_INCLUDES" >&5 $as_echo "$LDNS_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the ldns libs" >&5 $as_echo_n "checking what are the ldns libs... " >&6; } LDNS_LIBS="-L$LDNS_PATH/lib -lldns" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDNS_LIBS" >&5 $as_echo "$LDNS_LIBS" >&6; } fi tmp_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldns version not 1.6.15" >&5 $as_echo_n "checking for ldns version not 1.6.15... " >&6; } CHECK_LDNS_VERSION=0x01060f 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 "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { #ifdef LDNS_REVISION if (LDNS_REVISION != $CHECK_LDNS_VERSION) return 0; #endif return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "ldns version 1.6.15 is not compatible due to fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext 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 CPPFLAGS=$tmp_CPPFLAGS # Check whether --with-pkcs11-softhsm was given. if test "${with_pkcs11_softhsm+set}" = set; then : withval=$with_pkcs11_softhsm; pkcs11_softhsm_module="$withval" else pkcs11_softhsm_module="$full_libdir/softhsm/libsofthsm.so" fi # Check whether --with-pkcs11-sca6000 was given. if test "${with_pkcs11_sca6000+set}" = set; then : withval=$with_pkcs11_sca6000; pkcs11_sca6000_module="$withval" else pkcs11_sca6000_module="/usr/lib/libpkcs11.so" fi # Check whether --with-pkcs11-etoken was given. if test "${with_pkcs11_etoken+set}" = set; then : withval=$with_pkcs11_etoken; pkcs11_etoken_module="$withval" else pkcs11_etoken_module="/usr/local/lib/libeTPkcs11.so" fi # Check whether --with-pkcs11-opensc was given. if test "${with_pkcs11_opensc+set}" = set; then : withval=$with_pkcs11_opensc; pkcs11_opensc_module="$withval" else pkcs11_opensc_module="/usr/lib/pkcs11/opensc-pkcs11.so" fi # Check whether --with-pkcs11-ncipher was given. if test "${with_pkcs11_ncipher+set}" = set; then : withval=$with_pkcs11_ncipher; pkcs11_ncipher_module="$withval" else pkcs11_ncipher_module="/opt/nfast/toolkits/pkcs11/libcknfast.so" fi # Check whether --with-pkcs11-aepkeyper was given. if test "${with_pkcs11_aepkeyper+set}" = set; then : withval=$with_pkcs11_aepkeyper; pkcs11_aepkeyper_module="$withval" else pkcs11_aepkeyper_module="/opt/Keyper/PKCS11Provider/pkcs11.so" fi RT_LIBS="-lrt" tmp_LIBS=$LIBS LIBS="$LIBS $RT_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $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. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h else RT_LIBS="" fi LIBS=$tmp_LIBS for ac_header in sys/time.h time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x$RT_LIBS" = "x" ; then ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : else as_fn_error $? "Could not find the function clock_gettime or gettimeofday" "$LINENO" 5 fi fi C_LIBS="-lc" # some checks could go in here # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then : withval=$with_ssl; else withval="yes" fi if test x_$withval != x_no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL" >&5 $as_echo_n "checking for SSL... " >&6; } if test x_$withval = x_ -o x_$withval = x_yes; then withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /usr" fi for dir in $withval; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl="yes"; cat >>confdefs.h <<_ACEOF #define HAVE_SSL /**/ _ACEOF if test x_$ssldir != x_/usr; then SSL_INCLUDES="$SSL_INCLUDES -I$ssldir/include"; fi break; fi done if test x_$found_ssl != x_yes; then as_fn_error $? "Cannot find the SSL libraries in $withval" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in $ssldir" >&5 $as_echo "found in $ssldir" >&6; } HAVE_SSL=yes if test x_$ssldir != x_/usr; then SSL_LIBS="$SSL_LIBS -L$ssldir/lib"; fi if test x_$ssldir = x_/usr/sfw; then SSL_LIBS="$SSL_LIBS -R$ssldir/lib"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_CTX_init in -lcrypto" >&5 $as_echo_n "checking for HMAC_CTX_init in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_HMAC_CTX_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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. */ #ifdef __cplusplus extern "C" #endif char HMAC_CTX_init (); int main () { return HMAC_CTX_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_HMAC_CTX_init=yes else ac_cv_lib_crypto_HMAC_CTX_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5 $as_echo "$ac_cv_lib_crypto_HMAC_CTX_init" >&6; } if test "x$ac_cv_lib_crypto_HMAC_CTX_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else as_fn_error $? "OpenSSL found in $ssldir, but version 0.9.7 or higher is required" "$LINENO" 5 fi for ac_func in EVP_sha1 EVP_sha256 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi # libhsm tmp_SUCCESS="no" # Unix ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h tmp_SUCCESS="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h LIBS="$LIBS -ldl" tmp_SUCCESS="yes" fi fi # Windows if test "$tmp_SUCCESS" = "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LoadLibrary" >&5 $as_echo_n "checking for LoadLibrary... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { LoadLibrary(NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LOADLIBRARY 1" >>confdefs.h tmp_SUCCESS="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tmp_SUCCESS" >&5 $as_echo "$tmp_SUCCESS" >&6; } fi if test "$tmp_SUCCESS" = "no" then as_fn_error $? "No dynamic library loading support" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define HSM_DEFAULT_CONFIG "$OPENDNSSEC_CONFIG_FILE" _ACEOF # enforcer # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # 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 test -z "$as_dir" && as_dir=. 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_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi # Check whether --with-dbname was given. if test "${with_dbname+set}" = set; then : withval=$with_dbname; DB_NAME="$withval" fi # Check whether --with-dbhost was given. if test "${with_dbhost+set}" = set; then : withval=$with_dbhost; DB_HOST="$withval" fi # Check whether --with-dbport was given. if test "${with_dbport+set}" = set; then : withval=$with_dbport; DB_PORT="$withval" fi # Check whether --with-dbuser was given. if test "${with_dbuser+set}" = set; then : withval=$with_dbuser; DB_USER="$withval" fi # Check whether --with-dbpass was given. if test "${with_dbpass+set}" = set; then : withval=$with_dbpass; DB_PASS="$withval" fi # Check whether --with-database-backend was given. if test "${with_database_backend+set}" = set; then : withval=$with_database_backend; database_backend="${withval}" else database_backend="sqlite3" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for database backend" >&5 $as_echo_n "checking for database backend... " >&6; } if test "x${database_backend}" = "xsqlite3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: SQLite3" >&5 $as_echo "SQLite3" >&6; } # Check whether --with-sqlite3 was given. if test "${with_sqlite3+set}" = set; then : withval=$with_sqlite3; SQLITE3_PATH="$withval" for ac_prog in sqlite3 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SQLITE3+:} false; then : $as_echo_n "(cached) " >&6 else case $SQLITE3 in [\\/]* | ?:[\\/]*) ac_cv_path_SQLITE3="$SQLITE3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $withval/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_SQLITE3="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SQLITE3=$ac_cv_path_SQLITE3 if test -n "$SQLITE3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3" >&5 $as_echo "$SQLITE3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SQLITE3" && break done test -n "$SQLITE3" || SQLITE3="sqlite3" else SQLITE3_PATH="/usr/local" for ac_prog in sqlite3 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_SQLITE3+:} false; then : $as_echo_n "(cached) " >&6 else case $SQLITE3 in [\\/]* | ?:[\\/]*) ac_cv_path_SQLITE3="$SQLITE3" # 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 test -z "$as_dir" && as_dir=. 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_SQLITE3="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi SQLITE3=$ac_cv_path_SQLITE3 if test -n "$SQLITE3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3" >&5 $as_echo "$SQLITE3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SQLITE3" && break done test -n "$SQLITE3" || SQLITE3="sqlite3" fi if ! test -x "$SQLITE3"; then as_fn_error $? "sqlite3 command not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the SQLite3 includes" >&5 $as_echo_n "checking what are the SQLite3 includes... " >&6; } SQLITE3_INCLUDES="-I$SQLITE3_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3_INCLUDES" >&5 $as_echo "$SQLITE3_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the SQLite3 libs" >&5 $as_echo_n "checking what are the SQLite3 libs... " >&6; } SQLITE3_LIBS="-L$SQLITE3_PATH/lib -lsqlite3" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SQLITE3_LIBS" >&5 $as_echo "$SQLITE3_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $SQLITE3_INCLUDES" LIBS="$LIBS $SQLITE3_LIBS" for ac_header in sqlite3.h do : ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" if test "x$ac_cv_header_sqlite3_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SQLITE3_H 1 _ACEOF else as_fn_error $? "Can't find SQLite3 headers" "$LINENO" 5 fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_prepare_v2 in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_prepare_v2 in -lsqlite3... " >&6; } if ${ac_cv_lib_sqlite3_sqlite3_prepare_v2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsqlite3 $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. */ #ifdef __cplusplus extern "C" #endif char sqlite3_prepare_v2 (); int main () { return sqlite3_prepare_v2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sqlite3_sqlite3_prepare_v2=yes else ac_cv_lib_sqlite3_sqlite3_prepare_v2=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_prepare_v2" >&5 $as_echo "$ac_cv_lib_sqlite3_sqlite3_prepare_v2" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_prepare_v2" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSQLITE3 1 _ACEOF LIBS="-lsqlite3 $LIBS" else as_fn_error $? "Missing SQLite3 library v3.3.9 or greater" "$LINENO" 5 fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS DB_TYPE=sqlite3 DB_INCLUDES=$SQLITE3_INCLUDES DB_LIBS=$SQLITE3_LIBS cat >>confdefs.h <<_ACEOF #define SQL_BIN "$SQLITE3" _ACEOF cat >>confdefs.h <<_ACEOF #define SQL_SETUP "$OPENDNSSEC_DATA_DIR/database_create.sqlite3" _ACEOF elif test "x${database_backend}" = "xmysql"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: MySQL" >&5 $as_echo "MySQL" >&6; } # Check whether --with-mysql was given. if test "${with_mysql+set}" = set; then : withval=$with_mysql; MYSQL_PATH="$withval" for ac_prog in mysql_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MYSQL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MYSQL_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5 $as_echo "$MYSQL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL_CONFIG" && break done test -n "$MYSQL_CONFIG" || MYSQL_CONFIG="mysql_config" for ac_prog in mysql do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MYSQL+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL="$MYSQL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $MYSQL_PATH/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_MYSQL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MYSQL=$ac_cv_path_MYSQL if test -n "$MYSQL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL" >&5 $as_echo "$MYSQL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL" && break done test -n "$MYSQL" || MYSQL="mysql" else MYSQL_PATH="/usr/local" for ac_prog in mysql_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MYSQL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL_CONFIG="$MYSQL_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 test -z "$as_dir" && as_dir=. 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_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG if test -n "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5 $as_echo "$MYSQL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL_CONFIG" && break done test -n "$MYSQL_CONFIG" || MYSQL_CONFIG="mysql_config" for ac_prog in mysql do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MYSQL+:} false; then : $as_echo_n "(cached) " >&6 else case $MYSQL in [\\/]* | ?:[\\/]*) ac_cv_path_MYSQL="$MYSQL" # 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 test -z "$as_dir" && as_dir=. 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_MYSQL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MYSQL=$ac_cv_path_MYSQL if test -n "$MYSQL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL" >&5 $as_echo "$MYSQL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MYSQL" && break done test -n "$MYSQL" || MYSQL="mysql" fi if test -x "$MYSQL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking mysql version" >&5 $as_echo_n "checking mysql version... " >&6; } MYSQL_VERSION="`$MYSQL_CONFIG --version`" MYSQL_VERSION_MAJOR=`echo "$MYSQL_VERSION" | sed -e 's/\..*//'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_VERSION" >&5 $as_echo "$MYSQL_VERSION" >&6; } if test ${MYSQL_VERSION_MAJOR} -le 4 ; then as_fn_error $? "mysql must be newer than 5.0.0" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the MySQL includes" >&5 $as_echo_n "checking what are the MySQL includes... " >&6; } MYSQL_INCLUDES="`$MYSQL_CONFIG --include` -DBIG_JOINS=1 -DUSE_MYSQL -Wno-long-long" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_INCLUDES" >&5 $as_echo "$MYSQL_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the MySQL libs" >&5 $as_echo_n "checking what are the MySQL libs... " >&6; } MYSQL_LIBS="`$MYSQL_CONFIG --libs_r`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_LIBS" >&5 $as_echo "$MYSQL_LIBS" >&6; } fi if ! test -x "$MYSQL"; then as_fn_error $? "mysql command not found" "$LINENO" 5 fi tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDES" LIBS="$LIBS $MYSQL_LIBS" for ac_header in mysql.h do : ac_fn_c_check_header_mongrel "$LINENO" "mysql.h" "ac_cv_header_mysql_h" "$ac_includes_default" if test "x$ac_cv_header_mysql_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MYSQL_H 1 _ACEOF else as_fn_error $? "Can't find MySQL headers" "$LINENO" 5 fi done CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS DB_TYPE=mysql DB_INCLUDES=$MYSQL_INCLUDES DB_LIBS=$MYSQL_LIBS cat >>confdefs.h <<_ACEOF #define SQL_BIN "$MYSQL" _ACEOF cat >>confdefs.h <<_ACEOF #define SQL_SETUP "$OPENDNSSEC_DATA_DIR/database_create.mysql" _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown" >&5 $as_echo "Unknown" >&6; } as_fn_error $? "Database backend ${database_backend} not supported." "$LINENO" 5 fi if test "x${database_backend}" = "xmysql"; then USE_MYSQL_TRUE= USE_MYSQL_FALSE='#' else USE_MYSQL_TRUE='#' USE_MYSQL_FALSE= fi # Check whether --with-cunit was given. if test "${with_cunit+set}" = set; then : withval=$with_cunit; CUNIT_PATH="$withval" else CUNIT_PATH="/usr/local" fi if test "x$with_cunit" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the cunit includes" >&5 $as_echo_n "checking what are the cunit includes... " >&6; } CUNIT_INCLUDES="-I$CUNIT_PATH/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUNIT_INCLUDES" >&5 $as_echo "$CUNIT_INCLUDES" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking what are the cunit libs" >&5 $as_echo_n "checking what are the cunit libs... " >&6; } CUNIT_LIBS="-L$CUNIT_PATH/lib -lcunit" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUNIT_LIBS" >&5 $as_echo "$CUNIT_LIBS" >&6; } tmp_CPPFLAGS=$CPPFLAGS tmp_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $CUNIT_INCLUDES" LIBS="$LIBS $CUNIT_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CU_run_test in -lcunit" >&5 $as_echo_n "checking for CU_run_test in -lcunit... " >&6; } if ${ac_cv_lib_cunit_CU_run_test+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $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. */ #ifdef __cplusplus extern "C" #endif char CU_run_test (); int main () { return CU_run_test (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cunit_CU_run_test=yes else ac_cv_lib_cunit_CU_run_test=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cunit_CU_run_test" >&5 $as_echo "$ac_cv_lib_cunit_CU_run_test" >&6; } if test "x$ac_cv_lib_cunit_CU_run_test" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCUNIT 1 _ACEOF LIBS="-lcunit $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Can't find cunit library" >&5 $as_echo "$as_me: Can't find cunit library" >&6;} CUNIT_INCLUDES= CUNIT_LIBS= fi CPPFLAGS=$tmp_CPPFLAGS LIBS=$tmp_LIBS else { $as_echo "$as_me:${as_lineno-$LINENO}: cunit disabled" >&5 $as_echo "$as_me: cunit disabled" >&6;} CUNIT_INCLUDES= CUNIT_LIBS= fi cat >>confdefs.h <<_ACEOF #define SIGNER_CLI_UPDATE "$OPENDNSSEC_SIGNER_CLI update" _ACEOF if test "${enable_signer}" = "yes"; then ENABLE_ENFORCER_TRUE= ENABLE_ENFORCER_FALSE='#' else ENABLE_ENFORCER_TRUE='#' ENABLE_ENFORCER_FALSE= fi # cunit if test "${with_cunit}" != "no" -a -n "$CUNIT_LIBS"; then WITH_CUNIT_TRUE= WITH_CUNIT_FALSE='#' else WITH_CUNIT_TRUE='#' WITH_CUNIT_FALSE= fi # signer # Check whether --enable-signer was given. if test "${enable_signer+set}" = set; then : enableval=$enable_signer; enable_signer="${enableval}" else enable_signer="yes" fi if test "${enable_signer}" = "yes"; then ENABLE_SIGNER_TRUE= ENABLE_SIGNER_FALSE='#' else ENABLE_SIGNER_TRUE='#' ENABLE_SIGNER_FALSE= fi # check for a green cucumber (but only if we can shift time) if test "x${enable_timeshift}" = "xyes"; then # Extract the first word of "cucumber", so it can be a program name with args. set dummy cucumber; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CUCUMBER+:} false; then : $as_echo_n "(cached) " >&6 else case $CUCUMBER in [\\/]* | ?:[\\/]*) ac_cv_path_CUCUMBER="$CUCUMBER" # 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 test -z "$as_dir" && as_dir=. 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_CUCUMBER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CUCUMBER=$ac_cv_path_CUCUMBER if test -n "$CUCUMBER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUCUMBER" >&5 $as_echo "$CUCUMBER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -x "${CUCUMBER}"; then WITH_CUCUMBER_TRUE= WITH_CUCUMBER_FALSE='#' else WITH_CUCUMBER_TRUE='#' WITH_CUCUMBER_FALSE= fi # doxygen # Files: DX_PROJECT=${PACKAGE_NAME} DX_CONFIG=Doxyfile DX_DOCDIR=doxygen-doc # Environment variables used inside doxygen.cfg: DX_ENV="$DX_ENV SRCDIR='$srcdir'" DX_ENV="$DX_ENV PROJECT='$DX_PROJECT'" DX_ENV="$DX_ENV DOCDIR='$DX_DOCDIR'" DX_ENV="$DX_ENV VERSION='$PACKAGE_VERSION'" # Doxygen itself: # Check whether --enable-doxygen-doc was given. if test "${enable_doxygen_doc+set}" = set; then : enableval=$enable_doxygen_doc; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_doc=1 ;; #( n|N|no|No|NO) DX_FLAG_doc=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-doc" "$LINENO" 5 ;; esac else DX_FLAG_doc=1 fi if test "$DX_FLAG_doc" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. set dummy ${ac_tool_prefix}doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DOXYGEN="$DX_DOXYGEN" # 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 test -z "$as_dir" && as_dir=. 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_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_DOXYGEN=$ac_cv_path_DX_DOXYGEN if test -n "$DX_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOXYGEN" >&5 $as_echo "$DX_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DOXYGEN"; then ac_pt_DX_DOXYGEN=$DX_DOXYGEN # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DOXYGEN="$ac_pt_DX_DOXYGEN" # 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 test -z "$as_dir" && as_dir=. 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_DX_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_DOXYGEN=$ac_cv_path_ac_pt_DX_DOXYGEN if test -n "$ac_pt_DX_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOXYGEN" >&5 $as_echo "$ac_pt_DX_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DOXYGEN" = x; then DX_DOXYGEN="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_DOXYGEN=$ac_pt_DX_DOXYGEN fi else DX_DOXYGEN="$ac_cv_path_DX_DOXYGEN" fi if test "$DX_FLAG_doc$DX_DOXYGEN" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: doxygen not found - will not generate any doxygen documentation" >&5 $as_echo "$as_me: WARNING: doxygen not found - will not generate any doxygen documentation" >&2;} DX_FLAG_doc=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}perl", so it can be a program name with args. set dummy ${ac_tool_prefix}perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_DX_PERL="$DX_PERL" # 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 test -z "$as_dir" && as_dir=. 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_DX_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_PERL=$ac_cv_path_DX_PERL if test -n "$DX_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PERL" >&5 $as_echo "$DX_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_PERL"; then ac_pt_DX_PERL=$DX_PERL # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_PERL="$ac_pt_DX_PERL" # 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 test -z "$as_dir" && as_dir=. 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_DX_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_PERL=$ac_cv_path_ac_pt_DX_PERL if test -n "$ac_pt_DX_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PERL" >&5 $as_echo "$ac_pt_DX_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_PERL" = x; then DX_PERL="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_PERL=$ac_pt_DX_PERL fi else DX_PERL="$ac_cv_path_DX_PERL" fi if test "$DX_FLAG_doc$DX_PERL" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl not found - will not generate any doxygen documentation" >&5 $as_echo "$as_me: WARNING: perl not found - will not generate any doxygen documentation" >&2;} DX_FLAG_doc=0 fi : fi if test "$DX_FLAG_doc" = 1; then if :; then DX_COND_doc_TRUE= DX_COND_doc_FALSE='#' else DX_COND_doc_TRUE='#' DX_COND_doc_FALSE= fi DX_ENV="$DX_ENV PERL_PATH='$DX_PERL'" : else if false; then DX_COND_doc_TRUE= DX_COND_doc_FALSE='#' else DX_COND_doc_TRUE='#' DX_COND_doc_FALSE= fi : fi # Dot for graphics: # Check whether --enable-doxygen-dot was given. if test "${enable_doxygen_dot+set}" = set; then : enableval=$enable_doxygen_dot; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_dot=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-dot requires doxygen-dot" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_dot=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-dot" "$LINENO" 5 ;; esac else DX_FLAG_dot=1 test "$DX_FLAG_doc" = "1" || DX_FLAG_dot=0 fi if test "$DX_FLAG_dot" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. set dummy ${ac_tool_prefix}dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_DOT+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DOT="$DX_DOT" # 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 test -z "$as_dir" && as_dir=. 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_DX_DOT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_DOT=$ac_cv_path_DX_DOT if test -n "$DX_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DOT" >&5 $as_echo "$DX_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DOT"; then ac_pt_DX_DOT=$DX_DOT # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_DOT+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DOT in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DOT="$ac_pt_DX_DOT" # 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 test -z "$as_dir" && as_dir=. 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_DX_DOT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_DOT=$ac_cv_path_ac_pt_DX_DOT if test -n "$ac_pt_DX_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DOT" >&5 $as_echo "$ac_pt_DX_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DOT" = x; then DX_DOT="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_DOT=$ac_pt_DX_DOT fi else DX_DOT="$ac_cv_path_DX_DOT" fi if test "$DX_FLAG_dot$DX_DOT" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dot not found - will not generate graphics for doxygen documentation" >&5 $as_echo "$as_me: WARNING: dot not found - will not generate graphics for doxygen documentation" >&2;} DX_FLAG_dot=0 fi : fi if test "$DX_FLAG_dot" = 1; then if :; then DX_COND_dot_TRUE= DX_COND_dot_FALSE='#' else DX_COND_dot_TRUE='#' DX_COND_dot_FALSE= fi DX_ENV="$DX_ENV HAVE_DOT='YES'" DX_ENV="$DX_ENV DOT_PATH='`expr ".$DX_DOT" : '\(\.\)[^/]*$' \| "x$DX_DOT" : 'x\(.*\)/[^/]*$'`'" : else if false; then DX_COND_dot_TRUE= DX_COND_dot_FALSE='#' else DX_COND_dot_TRUE='#' DX_COND_dot_FALSE= fi DX_ENV="$DX_ENV HAVE_DOT='NO'" : fi # Man pages generation: # Check whether --enable-doxygen-man was given. if test "${enable_doxygen_man+set}" = set; then : enableval=$enable_doxygen_man; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_man=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-man requires doxygen-man" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_man=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-man" "$LINENO" 5 ;; esac else DX_FLAG_man=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_man=0 fi if test "$DX_FLAG_man" = 1; then : fi if test "$DX_FLAG_man" = 1; then if :; then DX_COND_man_TRUE= DX_COND_man_FALSE='#' else DX_COND_man_TRUE='#' DX_COND_man_FALSE= fi DX_ENV="$DX_ENV GENERATE_MAN='YES'" : else if false; then DX_COND_man_TRUE= DX_COND_man_FALSE='#' else DX_COND_man_TRUE='#' DX_COND_man_FALSE= fi DX_ENV="$DX_ENV GENERATE_MAN='NO'" : fi # RTF file generation: # Check whether --enable-doxygen-rtf was given. if test "${enable_doxygen_rtf+set}" = set; then : enableval=$enable_doxygen_rtf; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_rtf=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-rtf requires doxygen-rtf" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_rtf=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-rtf" "$LINENO" 5 ;; esac else DX_FLAG_rtf=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_rtf=0 fi if test "$DX_FLAG_rtf" = 1; then : fi if test "$DX_FLAG_rtf" = 1; then if :; then DX_COND_rtf_TRUE= DX_COND_rtf_FALSE='#' else DX_COND_rtf_TRUE='#' DX_COND_rtf_FALSE= fi DX_ENV="$DX_ENV GENERATE_RTF='YES'" : else if false; then DX_COND_rtf_TRUE= DX_COND_rtf_FALSE='#' else DX_COND_rtf_TRUE='#' DX_COND_rtf_FALSE= fi DX_ENV="$DX_ENV GENERATE_RTF='NO'" : fi # XML file generation: # Check whether --enable-doxygen-xml was given. if test "${enable_doxygen_xml+set}" = set; then : enableval=$enable_doxygen_xml; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_xml=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-xml requires doxygen-xml" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_xml=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-xml" "$LINENO" 5 ;; esac else DX_FLAG_xml=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_xml=0 fi if test "$DX_FLAG_xml" = 1; then : fi if test "$DX_FLAG_xml" = 1; then if :; then DX_COND_xml_TRUE= DX_COND_xml_FALSE='#' else DX_COND_xml_TRUE='#' DX_COND_xml_FALSE= fi DX_ENV="$DX_ENV GENERATE_XML='YES'" : else if false; then DX_COND_xml_TRUE= DX_COND_xml_FALSE='#' else DX_COND_xml_TRUE='#' DX_COND_xml_FALSE= fi DX_ENV="$DX_ENV GENERATE_XML='NO'" : fi # (Compressed) HTML help generation: # Check whether --enable-doxygen-chm was given. if test "${enable_doxygen_chm+set}" = set; then : enableval=$enable_doxygen_chm; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_chm=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-chm requires doxygen-chm" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_chm=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-chm" "$LINENO" 5 ;; esac else DX_FLAG_chm=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_chm=0 fi if test "$DX_FLAG_chm" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}hhc", so it can be a program name with args. set dummy ${ac_tool_prefix}hhc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_HHC+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_HHC in [\\/]* | ?:[\\/]*) ac_cv_path_DX_HHC="$DX_HHC" # 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 test -z "$as_dir" && as_dir=. 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_DX_HHC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_HHC=$ac_cv_path_DX_HHC if test -n "$DX_HHC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_HHC" >&5 $as_echo "$DX_HHC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_HHC"; then ac_pt_DX_HHC=$DX_HHC # Extract the first word of "hhc", so it can be a program name with args. set dummy hhc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_HHC+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_HHC in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_HHC="$ac_pt_DX_HHC" # 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 test -z "$as_dir" && as_dir=. 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_DX_HHC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_HHC=$ac_cv_path_ac_pt_DX_HHC if test -n "$ac_pt_DX_HHC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_HHC" >&5 $as_echo "$ac_pt_DX_HHC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_HHC" = x; then DX_HHC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_HHC=$ac_pt_DX_HHC fi else DX_HHC="$ac_cv_path_DX_HHC" fi if test "$DX_FLAG_chm$DX_HHC" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&5 $as_echo "$as_me: WARNING: hhc not found - will not generate doxygen compressed HTML help documentation" >&2;} DX_FLAG_chm=0 fi : fi if test "$DX_FLAG_chm" = 1; then if :; then DX_COND_chm_TRUE= DX_COND_chm_FALSE='#' else DX_COND_chm_TRUE='#' DX_COND_chm_FALSE= fi DX_ENV="$DX_ENV HHC_PATH='$DX_HHC'" DX_ENV="$DX_ENV GENERATE_HTML='YES'" DX_ENV="$DX_ENV GENERATE_HTMLHELP='YES'" : else if false; then DX_COND_chm_TRUE= DX_COND_chm_FALSE='#' else DX_COND_chm_TRUE='#' DX_COND_chm_FALSE= fi DX_ENV="$DX_ENV GENERATE_HTMLHELP='NO'" : fi # Seperate CHI file generation. # Check whether --enable-doxygen-chi was given. if test "${enable_doxygen_chi+set}" = set; then : enableval=$enable_doxygen_chi; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_chi=1 test "$DX_FLAG_chm" = "1" \ || as_fn_error $? "doxygen-chi requires doxygen-chi" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_chi=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-chi" "$LINENO" 5 ;; esac else DX_FLAG_chi=0 test "$DX_FLAG_chm" = "1" || DX_FLAG_chi=0 fi if test "$DX_FLAG_chi" = 1; then : fi if test "$DX_FLAG_chi" = 1; then if :; then DX_COND_chi_TRUE= DX_COND_chi_FALSE='#' else DX_COND_chi_TRUE='#' DX_COND_chi_FALSE= fi DX_ENV="$DX_ENV GENERATE_CHI='YES'" : else if false; then DX_COND_chi_TRUE= DX_COND_chi_FALSE='#' else DX_COND_chi_TRUE='#' DX_COND_chi_FALSE= fi DX_ENV="$DX_ENV GENERATE_CHI='NO'" : fi # Plain HTML pages generation: # Check whether --enable-doxygen-html was given. if test "${enable_doxygen_html+set}" = set; then : enableval=$enable_doxygen_html; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_html=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-html requires doxygen-html" "$LINENO" 5 test "$DX_FLAG_chm" = "0" \ || as_fn_error $? "doxygen-html contradicts doxygen-html" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_html=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-html" "$LINENO" 5 ;; esac else DX_FLAG_html=1 test "$DX_FLAG_doc" = "1" || DX_FLAG_html=0 test "$DX_FLAG_chm" = "0" || DX_FLAG_html=0 fi if test "$DX_FLAG_html" = 1; then : fi if test "$DX_FLAG_html" = 1; then if :; then DX_COND_html_TRUE= DX_COND_html_FALSE='#' else DX_COND_html_TRUE='#' DX_COND_html_FALSE= fi DX_ENV="$DX_ENV GENERATE_HTML='YES'" : else if false; then DX_COND_html_TRUE= DX_COND_html_FALSE='#' else DX_COND_html_TRUE='#' DX_COND_html_FALSE= fi test "$DX_FLAG_chm" = 1 || DX_ENV="$DX_ENV GENERATE_HTML='NO'" : fi # PostScript file generation: # Check whether --enable-doxygen-ps was given. if test "${enable_doxygen_ps+set}" = set; then : enableval=$enable_doxygen_ps; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_ps=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-ps requires doxygen-ps" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_ps=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-ps" "$LINENO" 5 ;; esac else DX_FLAG_ps=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_ps=0 fi if test "$DX_FLAG_ps" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}latex", so it can be a program name with args. set dummy ${ac_tool_prefix}latex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_LATEX="$DX_LATEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_LATEX=$ac_cv_path_DX_LATEX if test -n "$DX_LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_LATEX" >&5 $as_echo "$DX_LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_LATEX"; then ac_pt_DX_LATEX=$DX_LATEX # Extract the first word of "latex", so it can be a program name with args. set dummy latex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_LATEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_LATEX="$ac_pt_DX_LATEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_LATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_LATEX=$ac_cv_path_ac_pt_DX_LATEX if test -n "$ac_pt_DX_LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_LATEX" >&5 $as_echo "$ac_pt_DX_LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_LATEX" = x; then DX_LATEX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_LATEX=$ac_pt_DX_LATEX fi else DX_LATEX="$ac_cv_path_DX_LATEX" fi if test "$DX_FLAG_ps$DX_LATEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: latex not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: latex not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. set dummy ${ac_tool_prefix}makeindex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX if test -n "$DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 $as_echo "$DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_MAKEINDEX"; then ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX if test -n "$ac_pt_DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 $as_echo "$ac_pt_DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_MAKEINDEX" = x; then DX_MAKEINDEX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX fi else DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" fi if test "$DX_FLAG_ps$DX_MAKEINDEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dvips", so it can be a program name with args. set dummy ${ac_tool_prefix}dvips; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_DX_DVIPS="$DX_DVIPS" # 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 test -z "$as_dir" && as_dir=. 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_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_DVIPS=$ac_cv_path_DX_DVIPS if test -n "$DX_DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_DVIPS" >&5 $as_echo "$DX_DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_DVIPS"; then ac_pt_DX_DVIPS=$DX_DVIPS # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_DVIPS in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_DVIPS="$ac_pt_DX_DVIPS" # 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 test -z "$as_dir" && as_dir=. 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_DX_DVIPS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_DVIPS=$ac_cv_path_ac_pt_DX_DVIPS if test -n "$ac_pt_DX_DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_DVIPS" >&5 $as_echo "$ac_pt_DX_DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_DVIPS" = x; then DX_DVIPS="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_DVIPS=$ac_pt_DX_DVIPS fi else DX_DVIPS="$ac_cv_path_DX_DVIPS" fi if test "$DX_FLAG_ps$DX_DVIPS" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: dvips not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. set dummy ${ac_tool_prefix}egrep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_DX_EGREP="$DX_EGREP" # 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 test -z "$as_dir" && as_dir=. 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_EGREP=$ac_cv_path_DX_EGREP if test -n "$DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 $as_echo "$DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_EGREP"; then ac_pt_DX_EGREP=$DX_EGREP # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # 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 test -z "$as_dir" && as_dir=. 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP if test -n "$ac_pt_DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 $as_echo "$ac_pt_DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_EGREP" = x; then DX_EGREP="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_EGREP=$ac_pt_DX_EGREP fi else DX_EGREP="$ac_cv_path_DX_EGREP" fi if test "$DX_FLAG_ps$DX_EGREP" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&5 $as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PostScript documentation" >&2;} DX_FLAG_ps=0 fi : fi if test "$DX_FLAG_ps" = 1; then if :; then DX_COND_ps_TRUE= DX_COND_ps_FALSE='#' else DX_COND_ps_TRUE='#' DX_COND_ps_FALSE= fi : else if false; then DX_COND_ps_TRUE= DX_COND_ps_FALSE='#' else DX_COND_ps_TRUE='#' DX_COND_ps_FALSE= fi : fi # PDF file generation: # Check whether --enable-doxygen-pdf was given. if test "${enable_doxygen_pdf+set}" = set; then : enableval=$enable_doxygen_pdf; case "$enableval" in #( y|Y|yes|Yes|YES) DX_FLAG_pdf=1 test "$DX_FLAG_doc" = "1" \ || as_fn_error $? "doxygen-pdf requires doxygen-pdf" "$LINENO" 5 ;; #( n|N|no|No|NO) DX_FLAG_pdf=0 ;; #( *) as_fn_error $? "invalid value '$enableval' given to doxygen-pdf" "$LINENO" 5 ;; esac else DX_FLAG_pdf=0 test "$DX_FLAG_doc" = "1" || DX_FLAG_pdf=0 fi if test "$DX_FLAG_pdf" = 1; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pdflatex", so it can be a program name with args. set dummy ${ac_tool_prefix}pdflatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_PDFLATEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_PDFLATEX="$DX_PDFLATEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_PDFLATEX=$ac_cv_path_DX_PDFLATEX if test -n "$DX_PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_PDFLATEX" >&5 $as_echo "$DX_PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_PDFLATEX"; then ac_pt_DX_PDFLATEX=$DX_PDFLATEX # Extract the first word of "pdflatex", so it can be a program name with args. set dummy pdflatex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_PDFLATEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_PDFLATEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_PDFLATEX="$ac_pt_DX_PDFLATEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_PDFLATEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_PDFLATEX=$ac_cv_path_ac_pt_DX_PDFLATEX if test -n "$ac_pt_DX_PDFLATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_PDFLATEX" >&5 $as_echo "$ac_pt_DX_PDFLATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_PDFLATEX" = x; then DX_PDFLATEX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_PDFLATEX=$ac_pt_DX_PDFLATEX fi else DX_PDFLATEX="$ac_cv_path_DX_PDFLATEX" fi if test "$DX_FLAG_pdf$DX_PDFLATEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: pdflatex not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}makeindex", so it can be a program name with args. set dummy ${ac_tool_prefix}makeindex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_DX_MAKEINDEX="$DX_MAKEINDEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_MAKEINDEX=$ac_cv_path_DX_MAKEINDEX if test -n "$DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_MAKEINDEX" >&5 $as_echo "$DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_MAKEINDEX"; then ac_pt_DX_MAKEINDEX=$DX_MAKEINDEX # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_MAKEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_MAKEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_MAKEINDEX="$ac_pt_DX_MAKEINDEX" # 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 test -z "$as_dir" && as_dir=. 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_DX_MAKEINDEX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_MAKEINDEX=$ac_cv_path_ac_pt_DX_MAKEINDEX if test -n "$ac_pt_DX_MAKEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_MAKEINDEX" >&5 $as_echo "$ac_pt_DX_MAKEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_MAKEINDEX" = x; then DX_MAKEINDEX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_MAKEINDEX=$ac_pt_DX_MAKEINDEX fi else DX_MAKEINDEX="$ac_cv_path_DX_MAKEINDEX" fi if test "$DX_FLAG_pdf$DX_MAKEINDEX" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: makeindex not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}egrep", so it can be a program name with args. set dummy ${ac_tool_prefix}egrep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_DX_EGREP="$DX_EGREP" # 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 test -z "$as_dir" && as_dir=. 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DX_EGREP=$ac_cv_path_DX_EGREP if test -n "$DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DX_EGREP" >&5 $as_echo "$DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DX_EGREP"; then ac_pt_DX_EGREP=$DX_EGREP # Extract the first word of "egrep", so it can be a program name with args. set dummy egrep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DX_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DX_EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DX_EGREP="$ac_pt_DX_EGREP" # 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 test -z "$as_dir" && as_dir=. 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_DX_EGREP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DX_EGREP=$ac_cv_path_ac_pt_DX_EGREP if test -n "$ac_pt_DX_EGREP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DX_EGREP" >&5 $as_echo "$ac_pt_DX_EGREP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DX_EGREP" = x; then DX_EGREP="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DX_EGREP=$ac_pt_DX_EGREP fi else DX_EGREP="$ac_cv_path_DX_EGREP" fi if test "$DX_FLAG_pdf$DX_EGREP" = 1; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: egrep not found - will not generate doxygen PDF documentation" >&5 $as_echo "$as_me: WARNING: egrep not found - will not generate doxygen PDF documentation" >&2;} DX_FLAG_pdf=0 fi : fi if test "$DX_FLAG_pdf" = 1; then if :; then DX_COND_pdf_TRUE= DX_COND_pdf_FALSE='#' else DX_COND_pdf_TRUE='#' DX_COND_pdf_FALSE= fi : else if false; then DX_COND_pdf_TRUE= DX_COND_pdf_FALSE='#' else DX_COND_pdf_TRUE='#' DX_COND_pdf_FALSE= fi : fi # LaTeX generation for PS and/or PDF: if test "$DX_FLAG_ps" = 1 || test "$DX_FLAG_pdf" = 1; then if :; then DX_COND_latex_TRUE= DX_COND_latex_FALSE='#' else DX_COND_latex_TRUE='#' DX_COND_latex_FALSE= fi DX_ENV="$DX_ENV GENERATE_LATEX='YES'" else if false; then DX_COND_latex_TRUE= DX_COND_latex_FALSE='#' else DX_COND_latex_TRUE='#' DX_COND_latex_FALSE= fi DX_ENV="$DX_ENV GENERATE_LATEX='NO'" fi # Paper size for PS and/or PDF: case "$DOXYGEN_PAPER_SIZE" in #( "") DOXYGEN_PAPER_SIZE="" ;; #( a4wide|a4|letter|legal|executive) DX_ENV="$DX_ENV PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" ;; #( *) as_fn_error $? "unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'" "$LINENO" 5 ;; esac #For debugging: #echo DX_FLAG_doc=$DX_FLAG_doc #echo DX_FLAG_dot=$DX_FLAG_dot #echo DX_FLAG_man=$DX_FLAG_man #echo DX_FLAG_html=$DX_FLAG_html #echo DX_FLAG_chm=$DX_FLAG_chm #echo DX_FLAG_chi=$DX_FLAG_chi #echo DX_FLAG_rtf=$DX_FLAG_rtf #echo DX_FLAG_xml=$DX_FLAG_xml #echo DX_FLAG_pdf=$DX_FLAG_pdf #echo DX_FLAG_ps=$DX_FLAG_ps #echo DX_ENV=$DX_ENV ac_config_headers="$ac_config_headers common/config.h" ac_config_files="$ac_config_files Makefile Doxyfile common/Makefile conf/Makefile conf/addns.xml conf/conf.xml conf/enforcerstate.xml conf/kasp.xml conf/signconf.xml conf/zonelist.xml enforcer/Makefile enforcer/common/Makefile enforcer/enforcerd/Makefile enforcer/enforcerd/ods-enforcerd.8 enforcer/ksm/Makefile enforcer/ksm/include/Makefile enforcer/ksm/include/ksm/Makefile enforcer/test/Makefile enforcer/test/cucumber/Makefile enforcer/test/cucumber/c_conf.xml enforcer/test/cucumber/c_kasp.xml enforcer/test/cucumber/c_zonelist.base.xml enforcer/test/cunit/Makefile enforcer/test/cunit/database_setup_mysql.sh enforcer/test/cunit/database_setup_sqlite3.sh enforcer/utils/Makefile enforcer/utils/ods-kaspcheck.1 enforcer/utils/ods-ksmutil.1 libhsm/Makefile libhsm/src/Makefile libhsm/src/bin/Makefile libhsm/src/bin/ods-hsmspeed.1 libhsm/src/bin/ods-hsmutil.1 libhsm/src/lib/Makefile libhsm/checks/Makefile libhsm/checks/conf-softhsm.xml libhsm/checks/conf-sca6000.xml libhsm/checks/conf-etoken.xml libhsm/checks/conf-multi.xml libhsm/checks/conf-opensc.xml libhsm/checks/conf-ncipher.xml libhsm/checks/conf-aepkeyper.xml signer/Makefile signer/man/Makefile signer/man/ods-getconf.8 signer/man/ods-signer.8 signer/man/ods-signerd.8 signer/src/Makefile tools/Makefile tools/ods-control tools/solaris/Makefile tools/solaris/ods-enforcerd.init tools/solaris/ods-signerd.init tools/ods-timing.5 tools/opendnssec.7 tools/ods-control.8 tools/ods-kasp2html" 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$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+set}" = set || &/ 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 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$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=`$as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi 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 "${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 "${USE_MYSQL_TRUE}" && test -z "${USE_MYSQL_FALSE}"; then as_fn_error $? "conditional \"USE_MYSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ENFORCER_TRUE}" && test -z "${ENABLE_ENFORCER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ENFORCER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CUNIT_TRUE}" && test -z "${WITH_CUNIT_FALSE}"; then as_fn_error $? "conditional \"WITH_CUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SIGNER_TRUE}" && test -z "${ENABLE_SIGNER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SIGNER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CUCUMBER_TRUE}" && test -z "${WITH_CUCUMBER_FALSE}"; then as_fn_error $? "conditional \"WITH_CUCUMBER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then as_fn_error $? "conditional \"DX_COND_doc\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_doc_TRUE}" && test -z "${DX_COND_doc_FALSE}"; then as_fn_error $? "conditional \"DX_COND_doc\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then as_fn_error $? "conditional \"DX_COND_dot\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_dot_TRUE}" && test -z "${DX_COND_dot_FALSE}"; then as_fn_error $? "conditional \"DX_COND_dot\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then as_fn_error $? "conditional \"DX_COND_man\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_man_TRUE}" && test -z "${DX_COND_man_FALSE}"; then as_fn_error $? "conditional \"DX_COND_man\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_rtf_TRUE}" && test -z "${DX_COND_rtf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_rtf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then as_fn_error $? "conditional \"DX_COND_xml\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_xml_TRUE}" && test -z "${DX_COND_xml_FALSE}"; then as_fn_error $? "conditional \"DX_COND_xml\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chm\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chm_TRUE}" && test -z "${DX_COND_chm_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chm\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chi\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_chi_TRUE}" && test -z "${DX_COND_chi_FALSE}"; then as_fn_error $? "conditional \"DX_COND_chi\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then as_fn_error $? "conditional \"DX_COND_html\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_html_TRUE}" && test -z "${DX_COND_html_FALSE}"; then as_fn_error $? "conditional \"DX_COND_html\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then as_fn_error $? "conditional \"DX_COND_ps\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_ps_TRUE}" && test -z "${DX_COND_ps_FALSE}"; then as_fn_error $? "conditional \"DX_COND_ps\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_pdf_TRUE}" && test -z "${DX_COND_pdf_FALSE}"; then as_fn_error $? "conditional \"DX_COND_pdf\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then as_fn_error $? "conditional \"DX_COND_latex\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DX_COND_latex_TRUE}" && test -z "${DX_COND_latex_FALSE}"; then as_fn_error $? "conditional \"DX_COND_latex\" 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" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$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 -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 as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # 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 test -z "$as_dir" && as_dir=. 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # 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 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$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 as_fn_append () { eval $1=\$$1\$2 } 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 as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } 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 || $as_echo 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 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 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=`$as_echo "$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 || $as_echo 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_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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 opendnssec $as_me 1.4.9, which was generated by GNU Autoconf 2.69. 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 ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ opendnssec config.status 1.4.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$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=`$as_echo "$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 ) $as_echo "$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 \$as_echo "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 $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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"`' 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"`' 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"`' 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_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"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $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"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $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 \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ 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_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ 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\\"\\\`\\\\\\"" ;; *) 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 \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which 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' TIMESTAMP='$TIMESTAMP' 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" ;; "common/config.h") CONFIG_HEADERS="$CONFIG_HEADERS common/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "conf/Makefile") CONFIG_FILES="$CONFIG_FILES conf/Makefile" ;; "conf/addns.xml") CONFIG_FILES="$CONFIG_FILES conf/addns.xml" ;; "conf/conf.xml") CONFIG_FILES="$CONFIG_FILES conf/conf.xml" ;; "conf/enforcerstate.xml") CONFIG_FILES="$CONFIG_FILES conf/enforcerstate.xml" ;; "conf/kasp.xml") CONFIG_FILES="$CONFIG_FILES conf/kasp.xml" ;; "conf/signconf.xml") CONFIG_FILES="$CONFIG_FILES conf/signconf.xml" ;; "conf/zonelist.xml") CONFIG_FILES="$CONFIG_FILES conf/zonelist.xml" ;; "enforcer/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/Makefile" ;; "enforcer/common/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/common/Makefile" ;; "enforcer/enforcerd/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/enforcerd/Makefile" ;; "enforcer/enforcerd/ods-enforcerd.8") CONFIG_FILES="$CONFIG_FILES enforcer/enforcerd/ods-enforcerd.8" ;; "enforcer/ksm/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/Makefile" ;; "enforcer/ksm/include/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/include/Makefile" ;; "enforcer/ksm/include/ksm/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/ksm/include/ksm/Makefile" ;; "enforcer/test/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/Makefile" ;; "enforcer/test/cucumber/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/Makefile" ;; "enforcer/test/cucumber/c_conf.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_conf.xml" ;; "enforcer/test/cucumber/c_kasp.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_kasp.xml" ;; "enforcer/test/cucumber/c_zonelist.base.xml") CONFIG_FILES="$CONFIG_FILES enforcer/test/cucumber/c_zonelist.base.xml" ;; "enforcer/test/cunit/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/Makefile" ;; "enforcer/test/cunit/database_setup_mysql.sh") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/database_setup_mysql.sh" ;; "enforcer/test/cunit/database_setup_sqlite3.sh") CONFIG_FILES="$CONFIG_FILES enforcer/test/cunit/database_setup_sqlite3.sh" ;; "enforcer/utils/Makefile") CONFIG_FILES="$CONFIG_FILES enforcer/utils/Makefile" ;; "enforcer/utils/ods-kaspcheck.1") CONFIG_FILES="$CONFIG_FILES enforcer/utils/ods-kaspcheck.1" ;; "enforcer/utils/ods-ksmutil.1") CONFIG_FILES="$CONFIG_FILES enforcer/utils/ods-ksmutil.1" ;; "libhsm/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/Makefile" ;; "libhsm/src/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/Makefile" ;; "libhsm/src/bin/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/Makefile" ;; "libhsm/src/bin/ods-hsmspeed.1") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/ods-hsmspeed.1" ;; "libhsm/src/bin/ods-hsmutil.1") CONFIG_FILES="$CONFIG_FILES libhsm/src/bin/ods-hsmutil.1" ;; "libhsm/src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/src/lib/Makefile" ;; "libhsm/checks/Makefile") CONFIG_FILES="$CONFIG_FILES libhsm/checks/Makefile" ;; "libhsm/checks/conf-softhsm.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-softhsm.xml" ;; "libhsm/checks/conf-sca6000.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-sca6000.xml" ;; "libhsm/checks/conf-etoken.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-etoken.xml" ;; "libhsm/checks/conf-multi.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-multi.xml" ;; "libhsm/checks/conf-opensc.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-opensc.xml" ;; "libhsm/checks/conf-ncipher.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-ncipher.xml" ;; "libhsm/checks/conf-aepkeyper.xml") CONFIG_FILES="$CONFIG_FILES libhsm/checks/conf-aepkeyper.xml" ;; "signer/Makefile") CONFIG_FILES="$CONFIG_FILES signer/Makefile" ;; "signer/man/Makefile") CONFIG_FILES="$CONFIG_FILES signer/man/Makefile" ;; "signer/man/ods-getconf.8") CONFIG_FILES="$CONFIG_FILES signer/man/ods-getconf.8" ;; "signer/man/ods-signer.8") CONFIG_FILES="$CONFIG_FILES signer/man/ods-signer.8" ;; "signer/man/ods-signerd.8") CONFIG_FILES="$CONFIG_FILES signer/man/ods-signerd.8" ;; "signer/src/Makefile") CONFIG_FILES="$CONFIG_FILES signer/src/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/ods-control") CONFIG_FILES="$CONFIG_FILES tools/ods-control" ;; "tools/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES tools/solaris/Makefile" ;; "tools/solaris/ods-enforcerd.init") CONFIG_FILES="$CONFIG_FILES tools/solaris/ods-enforcerd.init" ;; "tools/solaris/ods-signerd.init") CONFIG_FILES="$CONFIG_FILES tools/solaris/ods-signerd.init" ;; "tools/ods-timing.5") CONFIG_FILES="$CONFIG_FILES tools/ods-timing.5" ;; "tools/opendnssec.7") CONFIG_FILES="$CONFIG_FILES tools/opendnssec.7" ;; "tools/ods-control.8") CONFIG_FILES="$CONFIG_FILES tools/ods-control.8" ;; "tools/ods-kasp2html") CONFIG_FILES="$CONFIG_FILES tools/ods-kasp2html" ;; *) 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+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || 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=`$as_echo "$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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$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 || $as_echo 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$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@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$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"; } && { $as_echo "$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 $as_echo "$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 { $as_echo "/* $configure_input */" \ && 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 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$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 $as_echo "/* $configure_input */" \ && 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 || $as_echo 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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which 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 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### 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 # 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 # 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. AR_FLAGS=$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 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 # 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 in which our libraries should be installed. lt_sysroot=$lt_sysroot # 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 # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # 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 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 "X${COLLECT_NAMES+set}" != Xset; 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) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi opendnssec-1.4.9/conf/0000755000175000017500000000000012650166152011620 500000000000000opendnssec-1.4.9/conf/kasp.xml.in0000644000175000017500000000627412650165732013641 00000000000000 A default policy that will amaze you and your friends PT2H P3D P14D P14D PT12H PT3600S P100D 1 5 PT3600S PT3600S PT3600S P14D 8 P1Y SoftHSM 8 P90D SoftHSM PT43200S PT3600S PT3600S unixtime PT9999S PT3600S PT172800S PT10800S Quick turnaround policy for lab work PT10M PT30M PT1H PT1H PT1M PT3600S PT300S PT360S PT360S P14D 8 P1Y SoftHSM 8 PT4H SoftHSM PT300S PT300S PT300S unixtime PT9999S PT3600S PT172800S PT10800S opendnssec-1.4.9/conf/kasp.rnc0000644000175000017500000001274112650165732013212 00000000000000# Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element KASP { element Policy { # (short) symbolic name for Policy attribute name { xsd:string }, # description of policy (free text) element Description { xsd:string }, # hold parameters related to signatures # These will go in the signature category in the DB # Most of these will be passed to the signer without # processing. element Signatures { # how often should the zone be (re)signed? element Resign { xsd:duration }, # the signatures are reused for a period of time # how long time before the expiration of the signature # should it be refreshed? element Refresh { xsd:duration }, # for how long should a signature be valid? element Validity { element Default { xsd:duration }, element Denial { xsd:duration } }, # how much should we jitter the signature expiration time? # (e.g. increase the expiration time by X) element Jitter { xsd:duration }, # how much should we predate the signature inception time? element InceptionOffset { xsd:duration } }, # use NSEC or NSEC3? element Denial { (nsec | nsec3) }, element Keys { # TTL for DNSKEYs ttl, # key retirement safety factor element RetireSafety { xsd:duration }, # key publication safety factor element PublishSafety { xsd:duration }, # do the zones share the same keys? element ShareKeys { empty }?, # enforcer may purge keys after this amount of time element Purge { xsd:duration }?, # Key Signing Keys (KSK) parameters element KSK { # generic key definition, see below anykey, # use RFC 5011 for key rollover? # Not implemented yet element RFC5011 { empty }? }*, # Zone Signing Keys (ZSK) parameters element ZSK { # generic key definition, see below anykey }* }, element Zone { # Expected propagation delay in child publication propagationdelay, # Expected zone SOA parameters element SOA { anysoa, serial } }, # Excepted paren parameters for key rollover usage. # These might be guess or obtained by querying the parent zone # NOTE: This assumes that all zones with the same policy have # the same parent or at least parents with the same parameters! element Parent { # Expected propagation delay in parent publication propagationdelay, # Expected TTL of DS in parent element DS { ttl }, # Expected parent SOA parameters element SOA { anysoa } } }* } serial = element Serial { # use increasing counter (sync with unsigned zone if possible) "counter" | # use increasing counter in YYYYMMDDxx format "datecounter" | # use unix timestamp as an 32-bit unsigned integer "unixtime" | # keep the serial from unsigned zone (do not resign unless incremented) "keep" } nsec = element NSEC { empty } nsec3 = element NSEC3 { # what value for NSEC3PARAM TTL to use? Default 0. ttl?, # use global NSEC3 opt-out? element OptOut { empty }?, # how often should we resalt? (e.g. create new NSEC3 chains) element Resalt { xsd:duration }, # NSEC3 hash parameters element Hash { element Algorithm { xsd:nonNegativeInteger { maxInclusive = "255" } }, element Iterations { xsd:nonNegativeInteger { maxInclusive = "65535" } }, # Salt length in octets element Salt { attribute length { xsd:nonNegativeInteger { maxInclusive = "255" } }, # The actual salt is generated by the Enforcer # Note: the enforcer may decide to store the # current salt in the DB and so it could be exported # here. xsd:string? } } } # Generic SOA definition anysoa = ttl, element Minimum { xsd:duration } # Generic key definition anykey = element Algorithm { attribute length { xsd:positiveInteger }?, xsd:nonNegativeInteger { maxInclusive = "255" } }, element Lifetime { xsd:duration }, element Repository { xsd:string }, # Number of Standby keys # Makes the rollover faster, since the key is # already pre-published and ready. element Standby { xsd:nonNegativeInteger }?, # Use manual key rollover? element ManualRollover { empty }? ttl = element TTL { xsd:duration } propagationdelay = element PropagationDelay { xsd:duration } partial = element Partial { empty } opendnssec-1.4.9/conf/Makefile.am0000644000175000017500000000402312650165675013604 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in RNC = addns.rnc conf.rnc kasp.rnc zonelist.rnc signconf.rnc enforcerstate.rnc RNG = addns.rng conf.rng kasp.rng zonelist.rng signconf.rng enforcerstate.rng XML = addns.xml conf.xml kasp.xml zonelist.xml signconf.xml enforcerstate.xml XSL= kasp2html.xsl TRANG= $(srcdir)/trang/trang.jar TRANG_URL "https://code.google.com/p/jing-trang/" sysconfdir = @sysconfdir@/opendnssec datadir = @datadir@/opendnssec noinst_DATA = ${XML} ${XSL} dist_data_DATA = ${RNG} ${RNC} ${XSL} CLEANFILES =+ ${XML} DISTCLEANFILES =+ ${RNG} SUFFIXES = .rng .rnc .xml $(TRANG): @echo You need to manually fetch trang.jar from ${TRANG_URL} @echo and copy trang.jar to ${TRANG} before rebuilding @echo the RelaxNG schemas. .rnc.rng: @test -x "${JAVA}" || \ (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) ${JAVA} -jar ${TRANG} $< $@ regress: $(RNG) @test -x "${XMLLINT}" || \ (echo "xmllint is required for regression tests"; false) @for i in ${XML}; do \ ${XMLLINT} --noout --relaxng \ `basename $$i .xml`.rng $$i || exit 1; \ done @test -x "${XSLTPROC}" || \ (echo "xsltproc is required for regression tests"; false) @${XSLTPROC} -o kasp.html $(srcdir)/kasp2html.xsl kasp.xml && \ (echo "kasp.xml built") install-data-hook: test -d ${DESTDIR}${sysconfdir} || mkdir -p ${DESTDIR}${sysconfdir} test -f ${DESTDIR}${sysconfdir}/conf.xml || \ ${INSTALL_DATA} -m 0640 conf.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} -m 640 conf.xml ${DESTDIR}${sysconfdir}/conf.xml.sample test -f ${DESTDIR}${sysconfdir}/addns.xml || \ ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir}/addns.xml.sample test -f ${DESTDIR}${sysconfdir}/zonelist.xml || \ ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir}/zonelist.xml.sample test -f ${DESTDIR}${sysconfdir}/kasp.xml || \ ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir}/kasp.xml.sample opendnssec-1.4.9/conf/zonelist.rnc0000644000175000017500000000413012650165675014122 00000000000000# Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element ZoneList { element Zone { # Name of zone attribute name { xsd:string }, # What policy applies to this zone? # (matches symbolic name of policy in in kasp.xml) element Policy { xsd:string }, # What file containts the signer configuration for this zone? element SignerConfiguration { xsd:string }, element Adapters { # Where do the signer fetch the unsigned zone? element Input { adapter }, # Where do the signer deliver the signed zone? element Output { adapter } } }* } # adapters adapter = adfile | adother # file adapter adfile = element File { xsd:string } # other adapters adother = element Adapter { # Adapter type attribute type { xsd:string }, # Configuration file xsd:string } opendnssec-1.4.9/conf/enforcerstate.rng0000644000175000017500000001675212650166152015127 00000000000000 KSK ZSK CSK opendnssec-1.4.9/conf/conf.xml.in0000644000175000017500000000460112650165732013620 00000000000000 @pkcs11_softhsm_module@ OpenDNSSEC 1234 3 local0 @OPENDNSSEC_CONFIG_DIR@/kasp.xml @OPENDNSSEC_CONFIG_DIR@/zonelist.xml @OPENDNSSEC_STATE_DIR@/kasp.db PT3600S @OPENDNSSEC_STATE_DIR@/tmp 4 opendnssec-1.4.9/conf/signconf.rnc0000644000175000017500000000666712650165732014074 00000000000000# Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element SignerConfiguration { zone } zone = element Zone { # zone name attribute name { xsd:string }, # this section is taken directly from the corresponding KASP policy element Signatures { element Resign { xsd:duration }, element Refresh { xsd:duration }, element Validity { element Default { xsd:duration }, element Denial { xsd:duration } }, element Jitter { xsd:duration }, element InceptionOffset { xsd:duration } }, # use NSEC or NSEC3? element Denial { (nsec | nsec3) }, element Keys { # TTL for all DNSKEYs ttl, element Key { # DNSKEY flags element Flags { xsd:nonNegativeInteger { maxInclusive = "65535" } }, # DNSKEY algorithm algorithm, # The key locator is matched against the # PKCS#11 CKA_ID and is specified as a string # of hex characters. element Locator { xsd:hexBinary }, # sign all the DNSKEY RRsets with this key? element KSK { empty }?, # sign all non-DNSKEY RRsets with this key? element ZSK { empty }?, # include this key in the zonefile? element Publish { empty }?, # deactivate this key (i.e. do not recycle any signatures) element Deactivate { empty }?, # Ignore DS and use RFC5011 to maintain chain of trust. element RFC5011 { empty }? }+ }, # What parameters to use for the SOA record soa } algorithm = element Algorithm { xsd:nonNegativeInteger { maxInclusive = "255" } } ttl = element TTL { xsd:duration } soa = element SOA { ttl, element Minimum { xsd:duration }, serial } # see kasp.rnc for description serial = element Serial { "counter" | "datecounter" | "unixtime" | "keep" } # This section is taken directly from the corresponding KASP policy nsec = element NSEC { empty } # This section is taken directly from the corresponding KASP policy # (except that the NSEC3 Salt is not optional) nsec3 = element NSEC3 { ttl?, element OptOut { empty }?, element Hash { algorithm, element Iterations { xsd:nonNegativeInteger { maxInclusive = "65535" } }, element Salt { xsd:string } } } opendnssec-1.4.9/conf/kasp2html.xsl0000644000175000017500000004202012650165675014204 00000000000000 KASP

KASP: Key and Signature Policy

Policy:

Signatures

Resign
Refresh
Validity Default
Validity NSEC/NSEC3
Jitter
Inception Offset

Denial of Existence

Method NSEC
Method NSEC3
Opt-Out
Resalt
Hash Algorithm
Hash Iterations
Hash Salt Length

Key Parameters

TTL
Retire Safety
Publish Safety
Share Keys?
Purge dead keys after
KSK
ZSK
Use RFC5011?

Zone Parameters

Propagation Delay
SOA TTL
SOA Minimum
SOA Serial Format

Parent Parameters

Propagation Delay
DS TTL
SOA TTL
SOA Minimum
Reserved ( ) RSA/MD5 (deprecated) Diffie-Hellman DSA/SHA-1 Reserved for ECC RSA/SHA-1 DSA/SHA-1 for NSEC3 RSA/SHA-1 for NSEC3 RSA/SHA-256 RSA/SHA-512 Reserved for indirect keys Private algorithms - domain name Private algorithms - OID Reserved ( ) Unassigned ( ) SHA-1 Counter UNIX Timestamp (as 32-bit Unsigned Integer) YYYYMMDDnn (Date + 2-Digit-Counter) Keep Serial from the Unsigned Zone Yes No Algorithm , bits Lifetime Repository Number of Standby Keys Manual Rollover? day days month months year years second seconds minute minutes hour hours
opendnssec-1.4.9/conf/enforcerstate.xml.in0000644000175000017500000000230412650165675015543 00000000000000 F4F29F9C-7E0A-4D0E-860D-95E3B0550B54 KSK 2008-01-18T08:00:00+01:00 9132541A-4255-4F40-893D-CD76CDF83F58 ZSK 2008-01-18T08:00:00+01:00 656d6d6b7469736169646f677461 2008-01-18T08:00:00+01:00 5 2048 SoftHSM-42 DFE7265B783F418685380AA784C2F31D default 2008-01-18T08:00:00+01:00 5 1024 SoftHSM-42 8D76C0C49FEB4A97B8E920C7552401CE default 2008-01-18T08:00:00+01:00 opendnssec-1.4.9/conf/kasp.rng0000644000175000017500000002335212650166152013213 00000000000000 counter datecounter unixtime keep 255 65535 255 255 opendnssec-1.4.9/conf/addns.xml.in0000644000175000017500000000264312650165675013776 00000000000000 secret.example.com hmac-sha256 sw0nMPCswVbes1tmQTm1pcMmpNRK+oGMYN+qKNR/BwQ=
1.2.3.4
dead:beef::1
5353 secret.example.com
1.2.3.4
1.2.3.5 secret.example.com
1.2.3.5
opendnssec-1.4.9/conf/signconf.xml.in0000644000175000017500000000201312650165675014502 00000000000000 PT2H P3D P7D P14D PT12H PT300S 1 10 656d6d6b7469736169646f677461 PT3600S 257 5 DFE7265B783F418685380AA784C2F31D 256 5 8D76C0C49FEB4A97B8E920C7552401CE PT3600S PT3600S unixtime opendnssec-1.4.9/conf/signconf.rng0000644000175000017500000001405412650166152014062 00000000000000 65535 255 counter datecounter unixtime keep 65535 opendnssec-1.4.9/conf/addns.rnc0000644000175000017500000000433512650165675013353 00000000000000# Copyright (c) 2011 NLnet Labs # 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element Adapter { dns } dns = element DNS { # TSIG secrets tsig*, # inbound zone transfer settings element Inbound { element RequestTransfer { remote+ }?, element AllowNotify { peer+ }? }?, # outbound zone transfer settings element Outbound { element ProvideTransfer { peer+ }?, element Notify { remote+ }? }? } # TSIG secret tsig = element TSIG { element Name { xsd:string }, # http://www.iana.org/assignments/tsig-algorithm-names element Algorithm { xsd:string }, # base64 encoded secret element Secret { xsd:base64Binary } } remote = element Remote { address, port?, key? } peer = element Peer { prefix?, key? } address = element Address { xsd:string } # e.g., 192.0.2.1 or 2001:DB8::1 prefix = element Prefix { xsd:string } # e.g., 192.0.2.0/24 or 2001:DB8::/32 port = element Port { xsd:positiveInteger { maxInclusive = "65535" } } key = element Key { xsd:string } opendnssec-1.4.9/conf/zonelist.rng0000644000175000017500000000604612650166152014125 00000000000000 opendnssec-1.4.9/conf/conf.rnc0000644000175000017500000001253712650165732013204 00000000000000# Copyright (c) 2009 .SE (The Internet Infrastructure Foundation). # 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element Configuration { # List of all known Key Repositories (aka HSM:s) element RepositoryList { element Repository { # Symbolic name of repository attribute name { xsd:string }, # PKCS#11 Module (aka shared library) element Module { xsd:string }, # PKCS#11 Token Label, element TokenLabel { xsd:string }, # PKCS#11 Login Credentials element PIN { xsd:string }?, # Maxmimum number of key pairs in the repository # DEFAULT: infinite element Capacity { xsd:positiveInteger }?, # Require backup of keys before use (optional) element RequireBackup { empty }?, # Do not maintain public keys in the repository (optional) element SkipPublicKey { empty }?, # Generate extractable keys (CKA_EXTRACTABLE = TRUE) (optional) element AllowExtraction { empty }? }* }, # Common configuration options element Common { # Configuration parameters for logging element Logging { element Verbosity { xsd:nonNegativeInteger }?, element Syslog { # syslog facility element Facility { syslogFacility } }? }?, # Location to find the KASP file element PolicyFile { xsd:string }, # Location to store the zonelist XML file element ZoneListFile { xsd:string } }, # Configuration parameters for the KASP Enforcer element Enforcer { # User & group to drop privs to privs?, # Location to store pidfile # DEFAULT: $(localstatedir)/run/opendnssec/enforcerd.pid element PidFile { xsd:string }?, # Number of Worker Threads # DEFAULT: 1 element WorkerThreads { xsd:positiveInteger }?, # Where to store internal Enforcer state element Datastore { (mysql | sqlite) }, # Interval between runs of the key rollover procedure element Interval { xsd:duration }, # Use manual key generation? element ManualKeyGeneration { empty }?, # How long before a KSK Rollover should we start warning (optional) element RolloverNotification { xsd:duration }?, # Command to use for submitting new DS records to a parent - # the command should accept DNSKEY RRsets via STDIN element DelegationSignerSubmitCommand { xsd:string }? }, # Configuration parameters for the Signer element Signer { # User & group to drop privs to privs?, # Location to store pidfile # DEFAULT: $(localstatedir)/run/opendnssec/signerd.pid element PidFile { xsd:string }?, # Location to store commandhandler socket # DEFAULT: $(localstatedir)/run/opendnssec/engine.sock element SocketFile { xsd:string }?, # Location to store intermediate zone information # DEFAULT: $(localstatedir)/opendnssec/tmp element WorkingDirectory { xsd:string }?, # Number of Worker Threads # DEFAULT: 4 element WorkerThreads { xsd:positiveInteger }?, # Number of Signer Threads # DEFAULT: 4 element SignerThreads { xsd:positiveInteger }?, # Listener element Listener { interface* }?, # System command to call after a zone has been (re)signed # # '%zone' in the string will be replaced by the zone name # '%zonefile' in the string will be replaced by the zone file element NotifyCommand { xsd:string }? }? } syslogFacility = ( "kern" | "user" | "mail" | "daemon" | "auth" | "lpr" | "news" | "uucp" | "cron" | "local0" | "local1" | "local2" | "local3" | "local4" | "local5" | "local6" | "local7" ) privs = element Privileges { # DEFAULT: do not drop privs element User { xsd:string }?, # DEFAULT: do not drop privs element Group { xsd:string }? } mysql = element MySQL { element Host { # DEFAULT: 3306 attribute port { xsd:positiveInteger { maxInclusive = "65535" } }?, # DEFAULT: 127.0.0.1 xsd:string }?, # database to use for KASP tables element Database { xsd:string }, # username and password used to connect to database element Username { xsd:string }, element Password { xsd:string } } sqlite = element SQLite { xsd:string } interface = element Interface { address?, port? } address = element Address { xsd:string } # e.g., 192.0.2.1 or 2001:DB8::1 port = element Port { xsd:positiveInteger { maxInclusive = "65535" } } opendnssec-1.4.9/conf/addns.rng0000644000175000017500000001022212650166152013336 00000000000000 65535 opendnssec-1.4.9/conf/Makefile.in0000644000175000017500000005110012650165764013612 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 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@ pkglibexecdir = $(libexecdir)/@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 = conf ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_broken_setres.m4 \ $(top_srcdir)/m4/acx_check_strptime.m4 \ $(top_srcdir)/m4/acx_cunit.m4 \ $(top_srcdir)/m4/acx_database_backend.m4 \ $(top_srcdir)/m4/acx_dbparams.m4 \ $(top_srcdir)/m4/acx_dlopen.m4 $(top_srcdir)/m4/acx_ldns.m4 \ $(top_srcdir)/m4/acx_libc.m4 $(top_srcdir)/m4/acx_libxml2.m4 \ $(top_srcdir)/m4/acx_mysql.m4 $(top_srcdir)/m4/acx_pedantic.m4 \ $(top_srcdir)/m4/acx_pkcs11_modules.m4 \ $(top_srcdir)/m4/acx_prefixhack.m4 \ $(top_srcdir)/m4/acx_rpath.m4 $(top_srcdir)/m4/acx_rt.m4 \ $(top_srcdir)/m4/acx_sqlite3.m4 $(top_srcdir)/m4/acx_ssl.m4 \ $(top_srcdir)/m4/acx_strict.m4 \ $(top_srcdir)/m4/ax_prog_doxygen.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/check_compiler_flag.m4 \ $(top_srcdir)/m4/check_compiler_flag_needed.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)/m4/opendnssec_common.m4 $(top_srcdir)/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_data_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = addns.xml conf.xml enforcerstate.xml kasp.xml \ signconf.xml zonelist.xml 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 = 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; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(dist_data_DATA) $(noinst_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/addns.xml.in \ $(srcdir)/conf.xml.in $(srcdir)/enforcerstate.xml.in \ $(srcdir)/kasp.xml.in $(srcdir)/signconf.xml.in \ $(srcdir)/zonelist.xml.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUCUMBER = @CUCUMBER@ CUNIT_INCLUDES = @CUNIT_INCLUDES@ CUNIT_LIBS = @CUNIT_LIBS@ CYGPATH_W = @CYGPATH_W@ C_LIBS = @C_LIBS@ DB_HOST = @DB_HOST@ DB_INCLUDES = @DB_INCLUDES@ DB_LIBS = @DB_LIBS@ DB_NAME = @DB_NAME@ DB_PASS = @DB_PASS@ DB_PORT = @DB_PORT@ DB_TYPE = @DB_TYPE@ DB_USER = @DB_USER@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ DX_CONFIG = @DX_CONFIG@ DX_DOCDIR = @DX_DOCDIR@ DX_DOT = @DX_DOT@ DX_DOXYGEN = @DX_DOXYGEN@ DX_DVIPS = @DX_DVIPS@ DX_EGREP = @DX_EGREP@ DX_ENV = @DX_ENV@ DX_FLAG_chi = @DX_FLAG_chi@ DX_FLAG_chm = @DX_FLAG_chm@ DX_FLAG_doc = @DX_FLAG_doc@ DX_FLAG_dot = @DX_FLAG_dot@ DX_FLAG_html = @DX_FLAG_html@ DX_FLAG_man = @DX_FLAG_man@ DX_FLAG_pdf = @DX_FLAG_pdf@ DX_FLAG_ps = @DX_FLAG_ps@ DX_FLAG_rtf = @DX_FLAG_rtf@ DX_FLAG_xml = @DX_FLAG_xml@ DX_HHC = @DX_HHC@ DX_LATEX = @DX_LATEX@ DX_MAKEINDEX = @DX_MAKEINDEX@ DX_PDFLATEX = @DX_PDFLATEX@ DX_PERL = @DX_PERL@ DX_PROJECT = @DX_PROJECT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SSL = @HAVE_SSL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAVA = @JAVA@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDNS_CONFIG = @LDNS_CONFIG@ LDNS_INCLUDES = @LDNS_INCLUDES@ LDNS_LIBS = @LDNS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MYSQL = @MYSQL@ MYSQL_CONFIG = @MYSQL_CONFIG@ MYSQL_INCLUDES = @MYSQL_INCLUDES@ MYSQL_LIBS = @MYSQL_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENDNSSEC_BIN_DIR = @OPENDNSSEC_BIN_DIR@ OPENDNSSEC_CONFIG_DIR = @OPENDNSSEC_CONFIG_DIR@ OPENDNSSEC_CONFIG_FILE = @OPENDNSSEC_CONFIG_FILE@ OPENDNSSEC_DATA_DIR = @OPENDNSSEC_DATA_DIR@ OPENDNSSEC_ENFORCER_PIDFILE = @OPENDNSSEC_ENFORCER_PIDFILE@ OPENDNSSEC_FETCH_PIDFILE = @OPENDNSSEC_FETCH_PIDFILE@ OPENDNSSEC_LIBEXEC_DIR = @OPENDNSSEC_LIBEXEC_DIR@ OPENDNSSEC_LIB_DIR = @OPENDNSSEC_LIB_DIR@ OPENDNSSEC_LOCALSTATE_DIR = @OPENDNSSEC_LOCALSTATE_DIR@ OPENDNSSEC_PID_DIR = @OPENDNSSEC_PID_DIR@ OPENDNSSEC_SBIN_DIR = @OPENDNSSEC_SBIN_DIR@ OPENDNSSEC_SCHEMA_DIR = @OPENDNSSEC_SCHEMA_DIR@ OPENDNSSEC_SIGNER_CLI = @OPENDNSSEC_SIGNER_CLI@ OPENDNSSEC_SIGNER_ENGINE = @OPENDNSSEC_SIGNER_ENGINE@ OPENDNSSEC_SIGNER_PIDFILE = @OPENDNSSEC_SIGNER_PIDFILE@ OPENDNSSEC_SIGNER_SOCKET = @OPENDNSSEC_SIGNER_SOCKET@ OPENDNSSEC_STATE_DIR = @OPENDNSSEC_STATE_DIR@ OPENDNSSEC_SYSCONF_DIR = @OPENDNSSEC_SYSCONF_DIR@ 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@ PERL = @PERL@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RT_LIBS = @RT_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SQLITE3 = @SQLITE3@ SQLITE3_INCLUDES = @SQLITE3_INCLUDES@ SQLITE3_LIBS = @SQLITE3_LIBS@ SSL_INCLUDES = @SSL_INCLUDES@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ XML2_CONFIG = @XML2_CONFIG@ XML2_INCLUDES = @XML2_INCLUDES@ XML2_LIBS = @XML2_LIBS@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ 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@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@/opendnssec 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkcs11_aepkeyper_module = @pkcs11_aepkeyper_module@ pkcs11_etoken_module = @pkcs11_etoken_module@ pkcs11_ncipher_module = @pkcs11_ncipher_module@ pkcs11_opensc_module = @pkcs11_opensc_module@ pkcs11_sca6000_module = @pkcs11_sca6000_module@ pkcs11_softhsm_module = @pkcs11_softhsm_module@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@/opendnssec target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in RNC = addns.rnc conf.rnc kasp.rnc zonelist.rnc signconf.rnc enforcerstate.rnc RNG = addns.rng conf.rng kasp.rng zonelist.rng signconf.rng enforcerstate.rng XML = addns.xml conf.xml kasp.xml zonelist.xml signconf.xml enforcerstate.xml XSL = kasp2html.xsl TRANG = $(srcdir)/trang/trang.jar noinst_DATA = ${XML} ${XSL} dist_data_DATA = ${RNG} ${RNC} ${XSL} CLEANFILES = + ${XML} DISTCLEANFILES = + ${RNG} SUFFIXES = .rng .rnc .xml all: all-am .SUFFIXES: .SUFFIXES: .rng .rnc .xml $(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 conf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign conf/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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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): addns.xml: $(top_builddir)/config.status $(srcdir)/addns.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ conf.xml: $(top_builddir)/config.status $(srcdir)/conf.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ enforcerstate.xml: $(top_builddir)/config.status $(srcdir)/enforcerstate.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ kasp.xml: $(top_builddir)/config.status $(srcdir)/kasp.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ signconf.xml: $(top_builddir)/config.status $(srcdir)/signconf.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ zonelist.xml: $(top_builddir)/config.status $(srcdir)/zonelist.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_dataDATA: $(dist_data_DATA) @$(NORMAL_INSTALL) @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dist_dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(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 $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; 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: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_dataDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_dataDATA .MAKE: install-am install-data-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dist_dataDATA 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 \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-dist_dataDATA .PRECIOUS: Makefile TRANG_URL "https://code.google.com/p/jing-trang/" $(TRANG): @echo You need to manually fetch trang.jar from ${TRANG_URL} @echo and copy trang.jar to ${TRANG} before rebuilding @echo the RelaxNG schemas. .rnc.rng: @test -x "${JAVA}" || \ (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) ${JAVA} -jar ${TRANG} $< $@ regress: $(RNG) @test -x "${XMLLINT}" || \ (echo "xmllint is required for regression tests"; false) @for i in ${XML}; do \ ${XMLLINT} --noout --relaxng \ `basename $$i .xml`.rng $$i || exit 1; \ done @test -x "${XSLTPROC}" || \ (echo "xsltproc is required for regression tests"; false) @${XSLTPROC} -o kasp.html $(srcdir)/kasp2html.xsl kasp.xml && \ (echo "kasp.xml built") install-data-hook: test -d ${DESTDIR}${sysconfdir} || mkdir -p ${DESTDIR}${sysconfdir} test -f ${DESTDIR}${sysconfdir}/conf.xml || \ ${INSTALL_DATA} -m 0640 conf.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} -m 640 conf.xml ${DESTDIR}${sysconfdir}/conf.xml.sample test -f ${DESTDIR}${sysconfdir}/addns.xml || \ ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} addns.xml ${DESTDIR}${sysconfdir}/addns.xml.sample test -f ${DESTDIR}${sysconfdir}/zonelist.xml || \ ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} zonelist.xml ${DESTDIR}${sysconfdir}/zonelist.xml.sample test -f ${DESTDIR}${sysconfdir}/kasp.xml || \ ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir} ${INSTALL_DATA} kasp.xml ${DESTDIR}${sysconfdir}/kasp.xml.sample # 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: opendnssec-1.4.9/conf/zonelist.xml.in0000644000175000017500000000150312650165732014540 00000000000000 opendnssec-1.4.9/conf/conf.rng0000644000175000017500000002514012650166152013177 00000000000000 kern user mail daemon auth lpr news uucp cron local0 local1 local2 local3 local4 local5 local6 local7 65535 65535 opendnssec-1.4.9/conf/enforcerstate.rnc0000644000175000017500000001163312650165675015125 00000000000000# Copyright (c) 2012 OpenDNSSEC AB (svb). 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 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. # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" start = element EnforcerState { element Zones { zone+ }, element KeyPairs { keypair+ } } # create table zones( # id integer primary key autoincrement, -- id # name varchar(300) not null , -- name of the parameter # policy_id mediumint not null, # signconf varchar(4096), -- where is the signconf # input varchar(4096), -- where is the input # output varchar(4096), -- where is the output # in_type varchar(512), -- input adapter type # out_type varchar(512), -- output adapter type # # foreign key (policy_id) references policies (id) # ); zone = element Zone { # Name of zone attribute name { xsd:string }, element Keys { key+ }, element NSEC3 { element Salt { xsd:string }, # when was the Salt generated element Generated { xsd:dateTime }? }? } # create table dnsseckeys ( # id integer primary key autoincrement, -- unique id of the key # keypair_id smallint, # zone_id mediumint, # keytype smallint not null, -- zsk or ksk (use code in dnskey record) # state tinyint, -- state of the key (defines valid fields) # publish varchar(64) null default null, -- time when key published into the zone # ready varchar(64) null default null, -- time when the key is ready for use # active varchar(64) null default null, -- time when the key was made active # retire varchar(64) null default null, -- time when the key retires # dead varchar(64) null default null, -- time when key is slated for removal # # # foreign key (zone_id) references zones (id), # foreign key (keypair_id) references keypairs (id) # ); key = element Key { attribute id { xsd:string }, # reference to KeyPair@id element KeyPairId { xsd:string }, element Type { "KSK" | "ZSK" | "CSK" }, element Standby { empty }?, element Publish { xsd:dateTime | empty }?, element Ready { xsd:dateTime | empty }?, element Active { xsd:dateTime | empty }?, element Retire { xsd:dateTime | empty }?, element Dead { xsd:dateTime | empty }? } # create table keypairs( # id integer primary key autoincrement, # HSMkey_id varchar(255) not null, # algorithm tinyint not null, -- algorithm code # size smallint, # securitymodule_id tinyint, -- where the key is stored # generate varchar(64) null default null, -- time key inserted into database # policy_id mediumint, # compromisedflag tinyint, # publickey varchar(1024), -- public key data # pre_backup varchar(64) null default null, -- time when backup was started # backup varchar(64) null default null, -- time when backup was finished # fixedDate tinyint default 0, -- Set to 1 to stop dates from being set according to the policy timings # # foreign key (securitymodule_id) references securitymodules (id), # foreign key (policy_id) references policies (id) # ); keypair = element KeyPair { attribute id { xsd:string }, element Algorithm { xsd:nonNegativeInteger }, element Size { xsd:nonNegativeInteger }, # where to locate the key; HSM and CKA_ID element Repository { xsd:string }, element Locator { xsd:string }, # under what policy was the key pair generated (if applicable) element Policy { xsd:string }?, # when was the key originally generated element Generated { xsd:dateTime }?, # when was the key last backed up element LastBackup { xsd:dateTime }?, # is the key compromised? element Compromised { empty }? } opendnssec-1.4.9/aclocal.m40000644000175000017500000012407412650165761012470 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 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.69],, [m4_warning([this file was generated for autoconf 2.69. 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'.])]) # Copyright (C) 2002-2014 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.15' 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.15], [], [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.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 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_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 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-2014 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-2014 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _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. FIXME. This creates each '.P' file that we will # 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" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 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 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_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([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 ]) 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-2014 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-2014 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-2014 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 to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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-2014 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/acx_broken_setres.m4]) m4_include([m4/acx_check_strptime.m4]) m4_include([m4/acx_cunit.m4]) m4_include([m4/acx_database_backend.m4]) m4_include([m4/acx_dbparams.m4]) m4_include([m4/acx_dlopen.m4]) m4_include([m4/acx_ldns.m4]) m4_include([m4/acx_libc.m4]) m4_include([m4/acx_libxml2.m4]) m4_include([m4/acx_mysql.m4]) m4_include([m4/acx_pedantic.m4]) m4_include([m4/acx_pkcs11_modules.m4]) m4_include([m4/acx_prefixhack.m4]) m4_include([m4/acx_rpath.m4]) m4_include([m4/acx_rt.m4]) m4_include([m4/acx_sqlite3.m4]) m4_include([m4/acx_ssl.m4]) m4_include([m4/acx_strict.m4]) m4_include([m4/ax_prog_doxygen.m4]) m4_include([m4/ax_pthread.m4]) m4_include([m4/check_compiler_flag.m4]) m4_include([m4/check_compiler_flag_needed.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]) m4_include([m4/opendnssec_common.m4]) opendnssec-1.4.9/Doxyfile.in0000644000175000017500000017413712650165675012754 00000000000000# Doxyfile 1.5.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = $(PROJECT_NAME) # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = $(OUTPUTDIR) # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, # Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = $(SRCDIR) # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = checks/* # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = */.svn/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = $(GENERATE_HTML) # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = $(GENERATE_HTMLHELP) # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = $(GENERATE_CHI) # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NONE # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = $(GENERATE_LATEX) # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = $(GENERATE_RTF) # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = $(GENERATE_XML) # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = $(HAVE_DOT) # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = NO # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = $(DOT_PATH) # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Options related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO opendnssec-1.4.9/enforcer/0000755000175000017500000000000012650166151012475 500000000000000opendnssec-1.4.9/enforcer/Makefile.am0000644000175000017500000000051112650165732014452 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = ksm common enforcerd utils test doxygen: rm -fr $(top_builddir)/enforcer/doxygen-doc env $(DX_ENV) \ PROJECT_NAME="OpenDNSSEC-enforcer" \ SRCDIR=$(top_srcdir)/enforcer \ OUTPUTDIR=$(top_builddir)/enforcer/doxygen-doc \ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG) opendnssec-1.4.9/enforcer/utils/0000755000175000017500000000000012650166151013635 500000000000000opendnssec-1.4.9/enforcer/utils/migrate_adapters_1.mysql0000644000175000017500000000033612650165732020405 00000000000000# Migrate existing database for zonelist adapter stuff alter table zones add column in_type varchar(512) default "File"; alter table zones add column out_type varchar(512) default "File"; update dbadmin set version = 3; opendnssec-1.4.9/enforcer/utils/migrate_1_4_8.mysql0000644000175000017500000000164012650165732017173 00000000000000# Migrate existing database to 1.4.8 alter table dnsseckeys add column rfc5011 tinyint default 0; alter table dnsseckeys add column revoked tinyint default 0; drop view if exists KEYDATA_VIEW; create view KEYDATA_VIEW as select k.id as id, d.state as state, k.generate as generate, d.publish as publish, d.ready as ready, d.active as active, d.retire as retire, d.dead as dead, d.keytype as keytype, k.algorithm as algorithm, k.HSMkey_id as location, d.zone_id as zone_id, k.policy_id as policy_id, k.securitymodule_id as securitymodule_id, k.size as size, k.compromisedflag as compromisedflag, k.fixedDate as fixedDate, d.rfc5011 as rfc5011, d.revoked as revoked from keypairs k left outer join dnsseckeys d on k.id = d.keypair_id; insert into parameters (name, description, category_id) select "revoked", "key is revoked?", id from categories where name="ksk"; update dbadmin set version = 4; opendnssec-1.4.9/enforcer/utils/migrate_to_ng_sqlite.pl0000755000175000017500000001266312650165732020330 00000000000000#!/usr/bin/perl #=============================================================================== # # FILE: migrate_to_ng_sqlite.pl # # USAGE: ./migrate_to_ng_sqlite.pl -d # # DESCRIPTION: export state from a kasp.db file to xml. # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Siôn Lloyd (SL), sion@nominet.org.uk # COMPANY: Nominet # VERSION: 1.0 # CREATED: 26/01/12 11:12:07 # REVISION: --- #=============================================================================== use strict; use warnings; use DBI; use DBD::SQLite; use Getopt::Std qw(getopts); my %sm; my %policy; use vars ( q!$opt_d!, # Database file fo convert ); getopts('d:') or die "Please supply a database file to work on with the -d flag"; if (!$opt_d) { print STDERR "Please supply a database file to work on with the -d flag\n"; exit 1; } open my $OUT, '>', "enforcerstate.xml" or die "$0 : failed to open output file 'enforcerstate.xml' : $!\n"; my $date = localtime; print $OUT "\n"; print $OUT "\n\n"; print $OUT "\n"; ### # Make sure that we can connect to this database my $dbh = DBI->connect("dbi:SQLite:dbname=$opt_d","","") or die "Couldn't connect: $!"; ### # Prepare a keys statement that we will need later my $keys_sth = $dbh->prepare("select dk.id, keypair_id, keytype, state, publish, ready, active, retire, dead, fixedDate from dnsseckeys dk, keypairs kp where dk.keypair_id = kp.id and zone_id = ?") or die "Couldn't prepare keys_sth $!"; my $KEYPAIR_ID=1; my $KEYTYPE=2; my $STATE=3; my $PUBLISH=4; my $READY=5; my $ACTIVE=6; my $RETIRE=7; my $DEAD=8; my $FIXED_DATE = 9; ### # Create hashmap of securitymodules table my $sm_sth = $dbh->prepare("select id, name from securitymodules") or die "Couldn't prepare sm_sth $!"; $sm_sth->execute(); while (my @row = $sm_sth->fetchrow_array) { $sm{ $row[0] } = $row[1]; } ### # Create a hashmap of the policy info we need my $ID=0; my $NAME=1; my $SALT=2; my $SALT_STAMP=3; my $NSEC=4; my $policy_sth = $dbh->prepare("select p.id, name, salt, salt_stamp, pp.value from policies p, parameters_policies pp where p.id = pp.policy_id and pp.parameter_id = 9") or die "Couldn't prepare policy_sth $!"; $policy_sth->execute(); while (my @row = $policy_sth->fetchrow_array) { $row[$SALT_STAMP] =~ s/ /T/ if $row[$SALT_STAMP]; @{ $policy { $row[0] }} = @row; } ### # Let's go to work. Loop over zones my $zone_sth = $dbh->prepare("select id, name, policy_id from zones") or die "Couldn't prepare zone_sth $!"; $zone_sth->execute(); print $OUT " \n"; while (my @row = $zone_sth->fetchrow_array) { print $OUT " \n"; # Get and write keys $keys_sth->execute( $row[0] ); print $OUT " \n"; while (my @key = $keys_sth->fetchrow_array) { print $OUT " \n"; print $OUT " $key[$KEYPAIR_ID]\n"; print $OUT " ZSK\n" if $key[$KEYTYPE] == 256; print $OUT " KSK\n" if $key[$KEYTYPE] == 257; print $OUT " \n" if $key[$STATE] > 6; if ($key[$PUBLISH]) { $key[$PUBLISH] =~ s/ /T/; print $OUT " $key[$PUBLISH]\n"; } if ($key[$READY] && $key[$STATE] > 2) { $key[$READY] =~ s/ /T/; print $OUT " $key[$READY]\n"; } if ($key[$ACTIVE] && $key[$STATE] > 3) { $key[$ACTIVE] =~ s/ /T/; print $OUT " $key[$ACTIVE]\n"; } if ($key[$RETIRE] && ($key[$STATE] > 4 || $key[$FIXED_DATE] == 1)) { $key[$RETIRE] =~ s/ /T/; print $OUT " $key[$RETIRE]\n"; } if ($key[$DEAD] && $key[$STATE] > 5) { $key[$DEAD] =~ s/ /T/; print $OUT " $key[$DEAD]\n"; } print $OUT " \n"; } print $OUT " \n"; if (${ $policy{$row[2]} }[$NSEC] == 3) { print $OUT "\n \n"; print $OUT " ${ $policy{$row[2]} }[$SALT]\n"; print $OUT " ${ $policy{$row[2]} }[$SALT_STAMP]\n"; print $OUT " \n"; } print $OUT " \n"; } print $OUT " \n\n"; ### # Now add the keypairs my $keypair_sth = $dbh->prepare("select id, algorithm, size, securitymodule_id, HSMkey_id, policy_id, generate, backup, compromisedflag from keypairs") or die "Couldn't prepare keypair_sth $!"; $keypair_sth->execute(); my $ALGORITHM=1; my $SIZE=2; my $SM_ID=3; my $HSMKEY_ID=4; my $POLICY_ID=5; my $GENERATE=6; my $BACKUP=7; my $COMPROMISED=8; print $OUT " \n"; while (my @row = $keypair_sth->fetchrow_array) { print $OUT " \n"; print $OUT " $row[$ALGORITHM]\n"; print $OUT " $row[$SIZE]\n"; print $OUT " $sm{ $row[$SM_ID] }\n"; print $OUT " $row[$HSMKEY_ID]\n"; print $OUT " ${ $policy{ $row[$POLICY_ID] }}[$NAME]\n"; $row[$GENERATE] =~ s/ /T/; print $OUT " $row[$GENERATE]\n"; if ($row[$BACKUP]) { $row[$BACKUP] =~ s/ /T/; print $OUT " $row[$BACKUP]\n"; } print $OUT " \n" if $row[$COMPROMISED]; print $OUT " \n"; } print $OUT " \n"; print $OUT "\n"; close $OUT; $dbh->disconnect; opendnssec-1.4.9/enforcer/utils/Makefile.am0000644000175000017500000000227312650165732015621 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in LIBHSM = ${top_builddir}/libhsm/src/lib/libhsm.a LIBKSM = ../ksm/libksm.a LIBCOMPAT = ${top_builddir}/common/libcompat.a AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_builddir)/common \ -I$(top_srcdir)/libhsm/src/lib \ -I$(srcdir)/../common \ -I$(builddir)/../common \ -I$(srcdir)/../ksm/include \ -I$(builddir)/../ksm/include \ @XML2_INCLUDES@ \ @DB_INCLUDES@ \ @LDNS_INCLUDES@ opendnssecdatadir = $(datadir)/opendnssec if USE_MYSQL dist_opendnssecdata_DATA = database_create.mysql else dist_opendnssecdata_DATA = database_create.sqlite3 endif bin_PROGRAMS = ods-ksmutil ods-kaspcheck man1_MANS = ods-ksmutil.1 ods-kaspcheck.1 ods_ksmutil_SOURCES = ksmutil.c ods_ksmutil_LDADD = $(LIBKSM) $(LIBHSM) $(LIBCOMPAT) ods_ksmutil_LDADD += @XML2_LIBS@ @DB_LIBS@ @LDNS_LIBS@ ods_kaspcheck_SOURCES = kaspcheck.c kaspcheck.h \ kc_helper.c kc_helper.h ods_kaspcheck_LDADD = $(LIBHSM) $(LIBCOMPAT) ods_kaspcheck_LDADD += @XML2_LIBS@ EXTRA_DIST = $(srcdir)/migrate_*.pl EXTRA_DIST += $(srcdir)/migrate_adapters_1.* EXTRA_DIST += $(srcdir)/convert_database.pl EXTRA_DIST += $(srcdir)/migrate_zone_delete.mysql EXTRA_DIST += $(srcdir)/migrate_1_4_8.* opendnssec-1.4.9/enforcer/utils/kaspcheck.h0000644000175000017500000000274212650165732015673 00000000000000/* * Copyright (c) 2012 Nominet UK. 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 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. */ #ifndef KASPCHECK_H #define KASPCHECK_H typedef struct { char *name; char *module; char *TokenLabel; } KC_REPO; int check_conf(char** kasp); int check_kasp(); #endif /* KASPCHECK_H */ opendnssec-1.4.9/enforcer/utils/convert_database.pl0000755000175000017500000004552012650165732017433 00000000000000#!/usr/bin/env perl # # Copyright (c) 2012 OpenDNSSEC AB (svb). 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 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. use strict; use warnings; use DBI; use Getopt::Long (); use Pod::Usage (); use File::Basename (); # Try to require Term::ReadKey, ignore if it does not exist eval { require Term::ReadKey; }; my ($sth, $row); my $schema_path; my $from; my $from_username; my $from_password; my $to; my $to_username; my $to_password; my $help; Pod::Usage::pod2usage(1) unless (@ARGV); Getopt::Long::GetOptions( 'help|?' => \$help, 'schema-path:s' => \$schema_path, 'from=s' => \$from, 'from-username:s' => \$from_username, 'from-password:s' => \$from_password, 'to=s' => \$to, 'to-username:s' => \$to_username, 'to-password:s' => \$to_password ) or Pod::Usage::pod2usage(2); Pod::Usage::pod2usage(-verbose => 99, -exitval => 1) if $help; # # Check schema path and existence of database creation scripts # unless (defined $schema_path) { $schema_path = File::Basename::dirname($0); } unless (-r $schema_path.'/database_create.sqlite3' and -r $schema_path.'/database_create.mysql') { print STDERR $0, ': Can not find database creation schemas, please set or correct --schema-path.', "\n"; exit(-1); } # # Check --from, let DBI parse it and check that the correct data sources are used # unless (defined $from) { print STDERR $0, ': Missing required option --from.', "\n"; exit(-1); } my (undef, $from_data_source) = DBI->parse_dsn($from); unless (defined $from_data_source and ($from_data_source eq 'mysql' or $from_data_source eq 'SQLite')) { print STDERR $0, ': Invalid data source used in --from DSN, only mysql or SQLite allowed (case sensitive).', "\n"; exit(-1); } # # Check --to, let DBI parse it and check that the correct data sources are used # unless (defined $to) { print STDERR $0, ': Missing required option --to.', "\n"; exit(-1); } my (undef, $to_data_source) = DBI->parse_dsn($to); unless (defined $to_data_source and ($to_data_source eq 'mysql' or $to_data_source eq 'SQLite')) { print STDERR $0, ': Invalid data source used in --to DSN, only mysql or SQLite allowed (case sensitive).', "\n"; exit(-1); } # # Prompt for --from-password if from DSN is MySQL and password not given # if (!defined $from_password and $from_data_source eq 'mysql') { print 'Enter exporting database password (--from-password): '; # Try Term::ReadKey eval { ReadMode('noecho'); $from_password = ReadLine(0); ReadMode('echo'); }; # Fallback if Term::ReadKey does not exist if ($@) { $from_password = ; } unless ($from_password) { print STDERR $0, ': No password given for exporting database.', "\n"; } $from_password =~ s/[\r\n]+$//o; } # # Connect to exporting database and get the schema version # my $from_dbh; my $from_version; unless ($from_dbh = DBI->connect($from, $from_username, $from_password, { AutoCommit => 1 })) { print STDERR $0, ': Unable to connect to exporting database [', $from, ']: ', $DBI::errstr, "\n"; exit(-1); } print 'Connected to exporting database ', $from, "\n"; $sth = prepare_or_die($from_dbh, 'SELECT version FROM dbadmin'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($from_version = $row->{version})) { $sth->finish; print STDERR $0, ': Unable to get schema version from exporting database', "\n"; exit(-1); } $sth->finish; # # Check for supported database schema version # my $from_version_valid = 0; if ($from_version == 3) { $from_version_valid = 1; } unless ($from_version_valid) { print STDERR $0, ': Exporting database schema version is not supported for conversion.', "\n"; exit(-1); } # # Validate existing data depending on importing data source # if ($to_data_source eq 'mysql') { if ($from_version == 3) { my $valid = 1; print 'Validating existing data', "\n"; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM securitymodules WHERE id > 127'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table securitymodules', "\n"; exit(-1); } if ($row->{count}) { print 'Table securitymodules field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM categories WHERE id > 127'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table categories', "\n"; exit(-1); } if ($row->{count}) { print 'Table categories field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM parameters WHERE id > 8388607'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table parameters', "\n"; exit(-1); } if ($row->{count}) { print 'Table parameters field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM serialmodes WHERE id > 127'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table serialmodes', "\n"; exit(-1); } if ($row->{count}) { print 'Table serialmodes field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM policies WHERE id > 8388607'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table policies', "\n"; exit(-1); } if ($row->{count}) { print 'Table policies field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM zones WHERE id > 8388607'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table zones', "\n"; exit(-1); } if ($row->{count}) { print 'Table zones field id contains too large values', "\n"; $valid = 0; } $sth->finish; $sth = prepare_or_die($from_dbh, 'SELECT COUNT(*) AS "count" FROM parameters_policies WHERE id > 8388607'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($row->{count})) { $sth->finish; print STDERR $0, ': Unable to validate table parameters_policies', "\n"; exit(-1); } if ($row->{count}) { print 'Table parameters_policies field id contains too large values', "\n"; $valid = 0; } $sth->finish; unless ($valid) { print STDERR $0, ': Unable to get schema version from exporting database', "\n"; exit(-1); } } } # # Ask the user if he really wants to create the importing database and delete existing data # print 'Create the importing database, this will delete existing data? [NO/yes] '; my $answer = ; chomp($answer); unless ($answer =~ /^yes$/io) { exit(0); } if ($to_data_source eq 'mysql') { $to .= ';mysql_multi_statements=1'; } # # Prompt for --to-password if from DSN is MySQL and password not given # if (!defined $to_password and $to_data_source eq 'mysql') { print 'Enter importing database password (--to-password): '; # Try Term::ReadKey eval { ReadMode('noecho'); $to_password = ReadLine(0); ReadMode('echo'); }; # Fallback if Term::ReadKey does not exist if ($@) { $to_password = ; } unless ($to_password) { print STDERR $0, ': No password given for importing database.', "\n"; } $to_password =~ s/[\r\n]+$//o; } # # Connect to importing database # my $to_dbh; my $to_version; unless ($to_dbh = DBI->connect($to, $to_username, $to_password, { AutoCommit => 1 })) { print STDERR $0, ': Unable to connect to importing database [', $to, ']: ', $DBI::errstr, "\n"; exit(-1); } print 'Connected to importing database ', $to, "\n"; # # Create the importing database tables # if ($to_data_source eq 'mysql') { unless (open(FILE, $schema_path.'/database_create.mysql')) { print STDERR $0, ': ', "\n"; exit(-1); } my $sql = ''; while ((my $line = )) { if ($line =~ /^\s*--/o) { next; } $line =~ s/\r//go; $sql .= $line; if ($sql =~ /\;$/o) { unless ($to_dbh->do($sql)) { print STDERR $0, ': Unable to create importing database, statement "', $sql, '" failed: ', $to_dbh->errstr, "\n"; exit(-1); } $sql = ''; } } } elsif ($to_data_source eq 'SQLite') { unless (open(FILE, $schema_path.'/database_create.sqlite3')) { print STDERR $0, ': ', "\n"; exit(-1); } my $sql = ''; while ((my $line = )) { if ($line =~ /^\s*--/o) { next; } $line =~ s/\r//go; $sql .= $line; if ($sql =~ /\;$/o) { unless ($to_dbh->do($sql)) { print STDERR $0, ': Unable to create importing database, statement "', $sql, '" failed: ', $to_dbh->errstr, "\n"; exit(-1); } $sql = ''; } } } else { print STDERR $0, ': Invalid data source, internal bug? please report this', "\n"; exit(-1); } # # Get the schema version of the importing database # $sth = prepare_or_die($to_dbh, 'SELECT version FROM dbadmin'); unless ($sth->execute and defined ($row = $sth->fetchrow_hashref) and defined ($to_version = $row->{version})) { $sth->finish; print STDERR $0, ': Unable to get schema version from importing database', "\n"; exit(-1); } $sth->finish; # # Validate that we are using the same exporting and importing schema version # unless ($from_version == $to_version) { print STDERR $0, ': Database schema version missmatch [from: ', $from_version, ' to: ', $to_version, '], can not convert databases of different schema versions, please upgrade existing installation first.', "\n"; exit(-1); } # # Convert the database # if ($from_version == 3) { # # Schema version 3 does not need any data modifications so just dump it out and in # my @tables = ( { securitymodules => { delete => 'DELETE FROM securitymodules', select => 'SELECT * FROM securitymodules', insert => 'INSERT INTO securitymodules VALUES ( ?, ?, ?, ? )' }}, { categories => { delete => 'DELETE FROM categories', select => 'SELECT * FROM categories', insert => 'INSERT INTO categories VALUES ( ?, ? )' }}, { parameters => { delete => 'DELETE FROM parameters', select => 'SELECT * FROM parameters', insert => 'INSERT INTO parameters VALUES ( ?, ?, ?, ? )' }}, { serialmodes => { delete => 'DELETE FROM serialmodes', select => 'SELECT * FROM serialmodes', insert => 'INSERT INTO serialmodes VALUES ( ?, ?, ? )' }}, { policies => { delete => 'DELETE FROM policies', select => 'SELECT * FROM policies', insert => 'INSERT INTO policies VALUES ( ?, ?, ?, ?, ?, ? )' }}, { zones => { delete => 'DELETE FROM zones', select => 'SELECT * FROM zones', insert => 'INSERT INTO zones VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )' }}, { keypairs => { delete => 'DELETE FROM keypairs', select => 'SELECT * FROM keypairs', insert => 'INSERT INTO keypairs VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )' }}, { dnsseckeys => { delete => 'DELETE FROM dnsseckeys', select => 'SELECT * FROM dnsseckeys', insert => 'INSERT INTO dnsseckeys VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )' }}, { parameters_policies => { delete => 'DELETE FROM parameters_policies', select => 'SELECT * FROM parameters_policies', insert => 'INSERT INTO parameters_policies VALUES ( ?, ?, ?, ? )' }} ); print 'Initializing conversion', "\n"; foreach my $table (@tables) { my ($name) = keys %$table; $table->{$name}->{del_sth} = prepare_or_die($to_dbh, $table->{$name}->{delete}); $table->{$name}->{sel_sth} = prepare_or_die($from_dbh, $table->{$name}->{select}); $table->{$name}->{ins_sth} = prepare_or_die($to_dbh, $table->{$name}->{insert}); } print 'Deleting existing data in importing database', "\n"; foreach my $table (reverse(@tables)) { my ($name) = keys %$table; unless ($table->{$name}->{del_sth}->execute) { $table->{$name}->{del_sth}->finish; print STDERR $0, ': Unable to delete existing data in importing database table ', $name, ': ', $table->{$name}->{del_sth}->errstr, "\n"; exit(-1); } $table->{$name}->{del_sth}->finish; } print 'Converting database', "\n"; foreach my $table (@tables) { my ($name) = keys %$table; print "\t", $name, "\n"; unless ($table->{$name}->{sel_sth}->execute) { $table->{$name}->{sel_sth}->finish; print STDERR $0, ': Unable to select from exporting database table ', $name, ': ', $table->{$name}->{sel_sth}->errstr, "\n"; exit(-1); } while (defined (my $row = $table->{$name}->{sel_sth}->fetchrow_arrayref)) { unless ($table->{$name}->{ins_sth}->execute(@$row)) { $table->{$name}->{ins_sth}->finish; print STDERR $0, ': Unable to insert into importing database table ', $name, ': ', $table->{$name}->{ins_sth}->errstr, "\n"; exit(-1); } $table->{$name}->{ins_sth}->finish; } $table->{$name}->{sel_sth}->finish; } print 'Optimizing database', "\n"; if ($to_data_source eq 'mysql') { foreach my $table (@tables) { my ($name) = keys %$table; unless ($to_dbh->do('OPTIMIZE TABLE '.$name)) { print STDERR $0, ': Unable to OPTIMIZE TABLE ', $name, ': ', $to_dbh->errstr, "\n"; exit(-1); } } } elsif ($to_data_source eq 'SQLite') { unless ($to_dbh->do('VACUUM')) { print STDERR $0, ': Unable to VACUUM database: ', $to_dbh->errstr, "\n"; exit(-1); } unless ($to_dbh->do('ANALYZE')) { print STDERR $0, ': Unable to ANALYZE database: ', $to_dbh->errstr, "\n"; exit(-1); } } else { print STDERR $0, ': Invalid data source, internal bug? please report this', "\n"; exit(-1); } } print 'Done', "\n"; exit 0; # # Close connections on exit() if they exist # END { if (defined $from_dbh) { $from_dbh->disconnect; } if (defined $to_dbh) { $to_dbh->disconnect; } } # # Prepare a statement or die trying # sub prepare_or_die { my ($dbh, $statement) = @_; my $sth; unless (defined ($sth = $dbh->prepare($statement))) { print STDERR $0, ': Unable to prepare statement "', $statement, '": ', $dbh->errstr, "\n"; exit(-1); } $sth; } __END__ =head1 NAME convert_database.pl - OpenDNSSEC database conversion tool =head1 SYNOPSIS convert_database.pl [options] =head1 OPTIONS =over 8 =item B<--schema-path > Specify the path to the directory containing the database schemas. (default to same path as convert_database.pl) =item B<--from > Specify DBI DSN database connection string to use as the exporting database, see man/perldoc DBD::mysql or DBD::SQLite for more information. (Required) =item B<--from-username > Username for the exporting database (default current logged in user). =item B<--from-password > Password to the exporting database (default prompted if MySQL). =item B<--to > Specify DBI DSN database connection string to use as the importing database, see man/perldoc DBD::mysql or DBD::SQLite for more information. (Required) =item B<--to-username > Username for the importing database (default current logged in user). =item B<--to-password > Password to the importing database (default prompted if MySQL). =item B<--help> Print a brief help message and exits. =back =head1 DESCRIPTION This program converts OpenDNSSEC Enforcer database from one backend to another. =head1 EXAMPLES This example converts from a SQLite to a MySQL database using default installation paths: convert_database.pl --from dbi:SQLite:dbname=/var/opendnssec/kasp.db --to dbi:mysql:database=kasp;host=localhost --to-username kasp --to-password kasp =cut opendnssec-1.4.9/enforcer/utils/database_create.mysql0000644000175000017500000003476512650165732017756 00000000000000# database_create - Create Database # # Description: # This script creates the tables required for the KASP database. # Matches kaspimport.pl at 12/03/2009 # Get rid of tables in reverse order drop table if exists parameters_policies; drop table if exists serialmodes; drop table if exists parameters; drop table if exists categories; drop table if exists dnsseckeys; drop table if exists zones; drop table if exists keypairs; drop table if exists securitymodules; drop table if exists policies; drop table if exists dbadmin; # now create the tables # dbadmin - holds the version of the database CREATE TABLE dbadmin ( version INTEGER NOT NULL, description varchar(255) ); insert into dbadmin values (4, "This needs to be in sync with the version defined in database.h"); # security modules - store information about all the sms used create table securitymodules ( id tinyint not null auto_increment, # id for sm name varchar(30) not null, # name of the sm capacity mediumint not null, requirebackup tinyint default 1, constraint primary key (id) )ENGINE=InnoDB; # categories - stores the possible categories (or uses) of parameters create table categories ( id tinyint not null auto_increment, # id for category_id name varchar(30) not null, # name of the category_id constraint primary key (id) )ENGINE=InnoDB; # parameters - stores the types of parameters available create table parameters ( id mediumint not null auto_increment, # id for parameters name varchar(30) not null, # name of the parameter description varchar(255), # description of the paramter category_id tinyint not null, # category_id of the parameter constraint primary key (id), constraint unique (name, category_id), constraint foreign key (category_id) references categories (id) )ENGINE=InnoDB; create table serialmodes ( id tinyint auto_increment, # id for serial mode name varchar(30), # name of the serial mode description varchar(255), # description of the serial mode constraint primary key (id) )ENGINE=InnoDB; # policies - create table policies ( id mediumint not null auto_increment, # id name varchar(30) not null, # name of the policy description varchar(255), # description of the salt varchar(512), # value of the salt salt_stamp timestamp, # when the salt was generated audit varchar(1024), # contents of constraint primary key (id), constraint unique (name) )ENGINE=InnoDB; # zones - stores the zones create table zones( id mediumint not null auto_increment, # id name varchar(300) not null , # name of the parameter policy_id mediumint not null, signconf varchar(4096), # where is the signconf input varchar(4096), # where is the input output varchar(4096), # where is the output in_type varchar(512), # input adapter type out_type varchar(512), # output adapter type constraint primary key (id), constraint foreign key (policy_id) references policies (id) )ENGINE=InnoDB; # stores the private key info create table keypairs( id int not null auto_increment, HSMkey_id varchar(255) not null, algorithm tinyint not null, # algorithm code size smallint, securitymodule_id tinyint, # where the key is stored generate timestamp null default null, # time key inserted into database policy_id mediumint, compromisedflag tinyint, publickey varchar(1024), # public key data pre_backup timestamp null default null, # time when backup was started backup timestamp null default null, # time when backup was finished fixedDate tinyint default 0, # Set to 1 to stop dates from being set according to the policy timings constraint primary key (id), constraint foreign key (securitymodule_id) references securitymodules (id), constraint foreign key (policy_id) references policies (id) )ENGINE=InnoDB; # stores meta data about keys (actual keys are in a (soft)hsm) create table dnsseckeys ( id int not null auto_increment, # unique id of the key keypair_id int, zone_id mediumint, keytype smallint not null, # zsk or ksk (use code in dnskey record) state tinyint, # state of the key (defines valid fields) publish timestamp null default null, # time when key published into the zone ready timestamp null default null, # time when the key is ready for use active timestamp null default null, # time when the key was made active retire timestamp null default null, # time when the key retires dead timestamp null default null, # time when key is slated for removal rfc5011 tinyint default 0, revoked tinyint default 0, constraint primary key (id), constraint dnsseckeys_keypairs_id foreign key (keypair_id) references keypairs (id) )ENGINE=InnoDB; # parameters_policies - join table to hold the values of parameters create table parameters_policies ( id mediumint auto_increment, # id parameter_id mediumint not null, policy_id mediumint not null, value int, # integer value of this key constraint primary key (id), constraint foreign key (parameter_id) references parameters (id), constraint foreign key (policy_id) references policies (id) )ENGINE=InnoDB; # The VIEWS create or replace view PARAMETER_VIEW as select p.name, c.name as category, pp.parameter_id, pp.value, pp.policy_id from parameters_policies pp, parameters p, categories c where pp.parameter_id = p.id and p.category_id = c.id; create or replace view PARAMETER_LIST as select p.name, c.name as category, p.id as parameter_id from parameters p, categories c where p.category_id = c.id; create or replace view KEYDATA_VIEW as select k.id, d.state, k.generate, d.publish, d.ready, d.active, d.retire, d.dead, d.keytype, k.algorithm, k.HSMkey_id as location, d.zone_id, k.policy_id, k.securitymodule_id, k.size, k.compromisedflag, k.fixedDate, d.rfc5011, d.revoked from keypairs k left outer join dnsseckeys d on k.id = d.keypair_id; create or replace view INT_KEYALLOC_VIEW_FOR_MYSQL as select k.id as id, k.HSMkey_id as location, z.id as zone_id, k.algorithm as algorithm, k.policy_id as policy_id, k.securitymodule_id as securitymodule_id, k.size as size, k.compromisedflag as compromisedflag from keypairs k left join zones z on k.policy_id = z.policy_id; create or replace view KEYALLOC_VIEW as select v.id as id, location, algorithm, policy_id, securitymodule_id, size, compromisedflag, d.zone_id as zone_id from INT_KEYALLOC_VIEW_FOR_MYSQL v left outer join dnsseckeys d on d.zone_id = v.zone_id and d.keypair_id = v.id; # insert default data # default categories insert into categories (id, name) values (1, "signature"); insert into categories (id, name) values (2, "denial"); insert into categories (id, name) values (3, "ksk"); insert into categories (id, name) values (4, "zsk"); insert into categories (id, name) values (5, "keys"); insert into categories (id, name) values (6, "enforcer"); insert into categories (id, name) values (7, "zone"); insert into categories (id, name) values (8, "parent"); insert into categories (id, name) values (9, "audit"); # default serial number modes insert into serialmodes (id, name, description) values (1, "unixtime", "seconds since 1 Jan 1970"); insert into serialmodes (id, name, description) values (2, "counter", "add one everytime updated"); insert into serialmodes (id, name, description) values (3, "datecounter", "YYYYMMDDXX"); insert into serialmodes (id, name, description) values (4, "keep", "Signer should not change the serial"); # default parameters insert into parameters (name, description, category_id) select "resign", "re-signing interval", id from categories where name="signature"; insert into parameters (name, description, category_id) select "refresh", "how old a signature may become before it needs to be re-signed",id from categories where name="signature"; insert into parameters (name, description, category_id) select "jitter", "jitter to use in signature inception and expiration times", id from categories where name="signature"; insert into parameters (name, description, category_id) select "clockskew", "estimated max clockskew expected in clients", id from categories where name="signature"; insert into parameters (name, description, category_id) select "ttl", "ttl for RRSIGS", id from categories where name="signature"; insert into parameters (name, description, category_id) select "valdefault", "signature validity period", id from categories where name="signature"; insert into parameters (name, description, category_id) select "valdenial", "nsec(3) validity period", id from categories where name="signature"; insert into parameters (name, description, category_id) select "ttl", "ttl for nsec(3) rrs", id from categories where name="denial"; insert into parameters (name, description, category_id) select "version", "nsec version (0 or 3)", id from categories where name="denial"; insert into parameters (name, description, category_id) select "optout", "opt out flag for nsec3", id from categories where name="denial"; insert into parameters (name, description, category_id) select "resalt", "re-salting interval", id from categories where name="denial"; insert into parameters (name, description, category_id) select "algorithm", "nsec3 algorithm", id from categories where name="denial"; insert into parameters (name, description, category_id) select "iterations", "nsec3 iterations", id from categories where name="denial"; insert into parameters (name, description, category_id) select "saltlength", "nsec3 salt length", id from categories where name="denial"; insert into parameters (name, description, category_id) select "ttl", "ttl for ksk rrs", id from categories where name="keys"; insert into parameters (name, description, category_id) select "retiresafety", "ksk retirement safety factor", id from categories where name="keys"; insert into parameters (name, description, category_id) select "publishsafety", "ksk publish safety factor", id from categories where name="keys"; insert into parameters (name, description, category_id) select "algorithm", "ksk algorithm", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "bits", "ksk key size", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "lifetime", "ksk lifetime", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "standby", "number of ksks is use at any one time", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "repository", "default ksk sm (for newly generated keys)", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "rfc5011", "are we doing rfc5011?", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "revoked", "key is revoked?", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "algorithm", "zsk algorithm", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "bits", "zsk key size", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "lifetime", "zsk lifetime", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "standby", "number of zsks is use at any one time", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "repository", "default zsk sm (for newly generated keys)", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "propagationdelay", "Dp", id from categories where name="zone"; insert into parameters (name, description, category_id) select "ttl", "ttl of the soa", id from categories where name="zone"; insert into parameters (name, description, category_id) select "min", "min of the soa", id from categories where name="zone"; insert into parameters (name, description, category_id) select "serial", "how serial no are changed", id from categories where name="zone"; insert into parameters (name, description, category_id) select "propagationdelay", "Dp", id from categories where name="parent"; insert into parameters (name, description, category_id) select "ttl", "ttl of the soa", id from categories where name="parent"; insert into parameters (name, description, category_id) select "min", "min of the soa", id from categories where name="parent"; insert into parameters (name, description, category_id) select "ttlds", "ttl of the ds", id from categories where name="parent"; #insert into parameters (name, description, category_id) select "keycreate", "policy for key creation 0=fill the hsm, 1=only generate minimum needed", id from categories where name="enforcer"; insert into parameters (name, description, category_id) select "interval", "run interval", id from categories where name="enforcer"; insert into parameters (name, description, category_id) select "keygeninterval", "interval between key generation runs", id from categories where name="enforcer"; insert into parameters (name, description, category_id) select "backupdelay", "how old must a new key be before it can be assumed to have been backed up", id from categories where name="enforcer"; insert into parameters (name, description, category_id) select "zones_share_keys", "do all zones on this policy share the same keys", id from categories where name="keys"; insert into parameters (name, description, category_id) select "registrationdelay", "Dr", id from categories where name="parent"; insert into parameters (name, description, category_id) select "manual_rollover", "Do not automatically roll ksks when their time is up", id from categories where name="ksk"; insert into parameters (name, description, category_id) select "manual_rollover", "Do not automatically roll zsks when their time is up", id from categories where name="zsk"; insert into parameters (name, description, category_id) select "audit", "placeholder for audit tag", id from categories where name="audit"; insert into parameters (name, description, category_id) select "purge", "interval that dead keys can stay in the database", id from categories where name="keys"; COMMIT; opendnssec-1.4.9/enforcer/utils/ods-kaspcheck.1.in0000644000175000017500000000315612650165732016774 00000000000000.TH "ods-kaspcheck" "1" "February 2010" "OpenDNSSEC" "OpenDNSSEC ods-kaspcheck" .SH "NAME" .LP .B ods\-kaspcheck \- Performs a sanity check of the policy for OpenDNSSEC .SH "SYNOPSIS" .LP .B ods\-kaspcheck .RB [ \-c .I path .B \-k .IR path ] .SH "DESCRIPTION" .LP The OpenDNSSEC XML configuration files (conf.xml and kasp.xml) offer the user many options to configure the OpenDNSSEC signing system. Some syntactic constraints are placed on the configuration by the .rng definition (for example, whether an element is required or optional), but some semantic constraints cannot be defined this way (for example, if NSEC3 is used to secure the zone, then a consistent DNSKEY algorithm choice should be made). ods\-kaspcheck is provided to check that the configuration files (conf.xml and kasp.xml) are semantically sane and contain no inconsistencies. It is advisable to use this tool to check your configuration before starting to use OpenDNSSEC. .SH "OPTIONS" .LP .TP \fB\-c\fR, \fB\-\-conf\fR \fIpath\fR Path to an OpenDNSSEC configuration file (defaults to @OPENDNSSEC_CONFIG_FILE@) .TP \fB\-k\fR, \fB\-\-kasp\fR \fIpath\fR Path to KASP policy file (defaults to the path given in the configuration file) .TP \fB\-v\fR, \fB\-\-version\fR Display version information .TP \fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR Show the help screen .SH "SEE ALSO" .LP ods\-control(8), ods\-enforcerd(8), ods\-hsmspeed(1), ods\-hsmutil(1), ods\-ksmutil(1), ods\-signer(8), ods\-signerd(8), ods\-timing(5), opendnssec(7), .B http://www.opendnssec.org/ .SH "AUTHORS" .LP .B ods\-kaspcheck was written by Alex Dalitz and Nominet as part of the OpenDNSSEC project. opendnssec-1.4.9/enforcer/utils/ksmutil.c0000644000175000017500000120227712650165732015430 00000000000000/* * Copyright (c) 2008-2009 Nominet UK. 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 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. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include "config.h" #include #include #include #include #include #include #include #include #include #include "ksm/database_statement.h" #include "ksm/db_fields.h" #include #include #include #include "ksm/kmemsg.h" #include "ksm/kmedef.h" #include "ksm/dbsmsg.h" #include "ksm/dbsdef.h" #include "ksm/message.h" #include #include #include #include #include #include #include #include #include #include #include #define MAX(a, b) ((a) > (b) ? (a) : (b)) /* Some value type flags */ #define INT_TYPE 0 #define DURATION_TYPE 1 #define BOOL_TYPE 2 #define REPO_TYPE 3 #define SERIAL_TYPE 4 #define ROLLOVER_TYPE 5 #define INT_TYPE_NO_FREE 6 #ifndef MAXPATHLEN # define MAXPATHLEN 4096 #endif /* We write one log message to syslog */ #ifdef LOG_DAEMON #define DEFAULT_LOG_FACILITY LOG_DAEMON #else #define DEFAULT_LOG_FACILITY LOG_USER #endif /* LOG_DAEMON */ extern char *optarg; extern int optind; const char *progname = NULL; char *config = (char *) OPENDNSSEC_CONFIG_FILE; char *o_keystate = NULL; char *o_algo = NULL; char *o_input = NULL; char *o_in_type = NULL; char *o_cka_id = NULL; char *o_size = NULL; char *o_interval = NULL; char *o_output = NULL; char *o_out_type = NULL; char *o_policy = NULL; char *o_repository = NULL; char *o_signerconf = NULL; char *o_keytype = NULL; char *o_time = NULL; char *o_retire = NULL; char *o_tdead = NULL; char *o_zone = NULL; char *o_zonetotal = NULL; char *o_keytag = NULL; static int all_flag = 0; static int auto_accept_flag = 0; static int ds_flag = 0; static int retire_flag = 1; static int notify_flag = 1; static int verbose_flag = 0; static int xml_flag = 1; static int td_flag = 0; static int force_flag = 0; static int hsm_flag = 1; static int check_repository_flag = 0; static int rfc5011_flag = 0; static int restart_enforcerd(void); /** * Use _r() functions on platforms that have. They are thread safe versions of * the normal syslog functions. Platforms without _r() usually have thread safe * normal functions. */ #if defined(HAVE_SYSLOG_R) && defined(HAVE_OPENLOG_R) && defined(HAVE_CLOSELOG_R) struct syslog_data sdata = SYSLOG_DATA_INIT; #else #undef HAVE_SYSLOG_R #undef HAVE_OPENLOG_R #undef HAVE_CLOSELOG_R #endif void usage_general () { fprintf(stderr, " help\n" " --version aka -V\n"); } void usage_setup () { fprintf(stderr, " setup\n" "\tImport config into a database (deletes current contents)\n"); } void usage_control () { fprintf(stderr, " start|stop|notify\n" "\tStart, stop or SIGHUP the ods-enforcerd\n"); } void usage_update () { fprintf(stderr, " update kasp\n" " update zonelist\n" " update conf\n" " update all\n" "\tUpdate database from config\n"); } void usage_zoneadd () { fprintf(stderr, " zone add\n" "\t--zone aka -z\n" "\t[--policy ] aka -p\n" "\t[--signerconf ] aka -s\n" "\t[--input ] aka -i\n" "\t[--in-type ] aka -j\n" "\t[--output ] aka -o\n" "\t[--out-type ] aka -q\n" "\t[--no-xml] aka -m\n"); } void usage_zonedel () { fprintf(stderr, " zone delete\n" "\t--zone | --all aka -z / -a\n" "\t[--no-xml] aka -m\n"); } void usage_zonelist () { fprintf(stderr, " zone list\n"); } void usage_zone () { fprintf(stderr, "usage: %s [-c | --config ] zone \n\n", progname); usage_zoneadd (); usage_zonedel (); usage_zonelist (); } void usage_repo () { fprintf(stderr, " repository list\n"); } void usage_policyexport () { fprintf(stderr, " policy export\n" "\t--policy [policy_name] | --all aka -p / -a\n"); } void usage_policyimport () { fprintf(stderr, " policy import\n"); } void usage_policylist () { fprintf(stderr, " policy list\n"); } void usage_policypurge () { fprintf(stderr, " policy purge\n"); } void usage_policy () { fprintf(stderr, "usage: %s [-c | --config ] \n\n", progname); usage_policyexport (); usage_policyimport (); usage_policylist (); usage_policypurge (); } void usage_keylist () { fprintf(stderr, " key list\n" "\t[--verbose] aka -v\n" "\t[--zone ] aka -z\n" "\t[--keystate | --all] aka -e / -a\n" "\t[--keytype ] aka -t\n" ); } void usage_keyexport () { fprintf(stderr, " key export\n" "\t--zone | --all aka -z / -a\n" "\t[--keystate ] aka -e\n" "\t[--keytype ] aka -t\n" "\t[--ds] aka -d\n"); } void usage_keyimport () { fprintf(stderr, " key import\n" "\t--cka_id aka -k\n" "\t--repository aka -r\n" "\t--zone aka -z\n" "\t--bits aka -b\n" "\t--algorithm aka -g\n" "\t--keystate aka -e\n" "\t--keytype aka -t\n" "\t--time