oidentd-2.5.0/0000755000175000017500000000000013646057327010162 500000000000000oidentd-2.5.0/config.h.in0000644000175000017500000001627213646057316012133 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if AF_INET6 is missing */ #undef AF_INET6 /* Set to enable debugging */ #undef ENABLE_DEBUGGING /* Define to 1 if you have the `arc4random_uniform' function. */ #undef HAVE_ARC4RANDOM_UNIFORM /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the 'freeaddrinfo' function. */ #undef HAVE_FREEADDRINFO /* Define to 1 if you have the 'gai_strerror' function. */ #undef HAVE_GAI_STRERROR /* Define to 1 if you have the 'getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the 'getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `inet_aton' function. */ #undef HAVE_INET_ATON /* Define to 1 if you have the 'inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `netfilter_conntrack' library (-lnetfilter_conntrack). */ #undef HAVE_LIBNETFILTER_CONNTRACK /* Define to 1 if you have the `udb' library (-ludb). */ #undef HAVE_LIBUDB /* Define to 1 if you have the `lrand48' function. */ #undef HAVE_LRAND48 /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET6_IN6_PCB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_H /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM /* 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 header file. */ #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_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strsep' function. */ #undef HAVE_STRSEP /* 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 struct addrinfo */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if you have struct in6_addr */ #undef HAVE_STRUCT_IN6_ADDR /* Define to 1 if you have struct sockaddr_in6 */ #undef HAVE_STRUCT_SOCKADDR_IN6 /* Define to 1 if you have struct sockaddr_storage */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* 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 that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unveil' function. */ #undef HAVE_UNVEIL /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define if your compiler has __attribute__ format */ #undef HAVE___ATTRIBUTE__FORMAT /* Define if your compiler has __attribute__ noreturn */ #undef HAVE___ATTRIBUTE__NORETURN /* Define if your compiler has __attribute__ unused */ #undef HAVE___ATTRIBUTE__UNUSED /* Define if the sockaddr storage struct has the ss_family member */ #undef HAVE___SS_FAMILY /* The name of the detected kernel driver */ #undef KERNEL_DRIVER /* Set to include libnetfilter_conntrack support */ #undef LIBNFCT_SUPPORT /* Set to include NAT/IP masquerading support */ #undef MASQ_SUPPORT /* Set if privileges cannot be dropped */ #undef NEED_ROOT /* Name of package */ #undef PACKAGE /* maintainer */ #undef PACKAGE_AUTHOR /* 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 as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Size of the 'void *' type */ #undef SIZEOF_VOID_P /* Solaris version number */ #undef SOLARIS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Set if using /dev/kmem */ #undef USE_KMEM /* Version number of package */ #undef VERSION /* Set to include IPv6 support */ #undef WANT_IPV6 /* Set to include XDG Base Directory support */ #undef XDGBDIR_SUPPORT /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to unsigned int if in_addr_t is missing */ #undef in_addr_t /* Define to unsigned short if in_port_t is missing */ #undef in_port_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to int if socklen_t is missing */ #undef socklen_t /* Define to `uint16_t' if does not define. */ #undef u_int16_t /* Define to `uint32_t' if does not define. */ #undef u_int32_t /* Define to `uint8_t' if does not define. */ #undef u_int8_t /* Define to `unsigned short' if does not define. */ #undef uint16_t /* Define to `unsigned int' if does not define. */ #undef uint32_t /* Define to `unsigned char' if does not define. */ #undef uint8_t oidentd-2.5.0/install-sh0000755000175000017500000003601013646057317012105 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # 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. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. 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=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: oidentd-2.5.0/src/0000755000175000017500000000000013646057327010751 500000000000000oidentd-2.5.0/src/masq.h0000644000175000017500000000247213545375404012005 00000000000000/* ** masq.h - oidentd IP masquerading handler. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_MASQ_H #define __OIDENTD_MASQ_H #if MASQ_SUPPORT int find_masq_entry(struct sockaddr_storage *host, char *user, size_t user_len, char *os, size_t os_len); int fwd_request(int sock, in_port_t real_lport, in_port_t masq_lport, in_port_t real_fport, in_port_t masq_fport, struct sockaddr_storage *mrelay); #endif int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); #endif oidentd-2.5.0/src/util.c0000644000175000017500000002547513555260367012026 00000000000000/* ** util.c - oidentd utility functions. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" #if HAVE_LIBUDB # include #endif #ifdef HAVE_ARC4RANDOM_UNIFORM /* no rescale required */ #elif defined HAVE_LRAND48 # define O_RAND_UPPER_EXCL_UL (1UL << 31) #else # define O_RAND_UPPER_EXCL_UL ((unsigned long) RAND_MAX + 1UL) #endif /* ** Seed the PRNG. ** A time-based seed is sufficient as oidentd does not require ** cryptographically secure random numbers. ** Returns 0 on success, -1 on failure. */ int seed_prng(void) { #ifndef HAVE_ARC4RANDOM_UNIFORM # ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION struct timespec tp; if (clock_gettime(CLOCK_REALTIME, &tp)) { debug("clock_gettime: %s", strerror(errno)); return -1; } # endif #endif #ifdef HAVE_ARC4RANDOM_UNIFORM /* automatically reseeded upon fork(2) */ #elif defined HAVE_LRAND48 # ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION srand48(0); # else srand48((long) (tp.tv_sec ^ tp.tv_nsec)); # endif #elif defined HAVE_RANDOM # ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION srandom(0); # else srandom((unsigned int) (tp.tv_sec ^ tp.tv_nsec)); # endif #else # ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION srand(0); # else srand((unsigned int) (tp.tv_sec ^ tp.tv_nsec)); # endif #endif return 0; } #ifndef HAVE_ARC4RANDOM_UNIFORM /* ** Return a pseudorandom integer in the interval [0, O_RAND_UPPER_EXCL_UL). */ unsigned long prng_next(void) { #ifdef HAVE_LRAND48 return (unsigned long) lrand48(); #elif defined HAVE_RANDOM return (unsigned long) random(); #else return (unsigned long) rand(); #endif } #endif /* ** Return a pseudorandom integer in the interval [0, i). */ unsigned int randval(unsigned int i) { #ifdef HAVE_ARC4RANDOM_UNIFORM return (unsigned int) arc4random_uniform((uint32_t) i); #else unsigned long blk_size = O_RAND_UPPER_EXCL_UL / (unsigned long) i; unsigned long blk_after_last = blk_size * (unsigned long) i; unsigned long next; do { next = prng_next(); } while (next >= blk_after_last); return (unsigned int) (next / blk_size); #endif } /* ** Find the user specified by "temp_user" ** Returns non-zero on failure. */ int find_user(const char *temp_user, uid_t *uid) { struct passwd *pw; pw = getpwnam(temp_user); if (!pw) { char *end; unsigned long int temp_uid = strtoul(temp_user, &end, 10); if (*end != '\0') return -1; if (temp_uid >= MISSING_UID) return -1; *uid = (uid_t) temp_uid; } else { *uid = pw->pw_uid; } return 0; } /* ** Find the group specified by "temp_group" ** Returns non-zero on failure. */ int find_group(const char *temp_group, gid_t *gid) { struct group *gr; gr = getgrnam(temp_group); if (!gr) { char *end; unsigned long int temp_gid = strtoul(temp_group, &end, 10); if (*end != '\0') return -1; if (temp_gid >= MISSING_GID) return -1; *gid = (gid_t) temp_gid; } else { *gid = gr->gr_gid; } return 0; } /* ** Drop privileges and run with specified UID/GID. ** Returns 0 on success, -1 on failure. */ int drop_privs(uid_t new_uid, gid_t new_gid) { if (opt_enabled(CHANGE_GID)) { if (setgid(new_gid) != 0) { debug("setgid(%lu): %s", (unsigned long) new_gid, strerror(errno)); return -1; } #ifdef HAVE_SETGROUPS if (setgroups(0, NULL)) { debug("setgroups: %s", strerror(errno)); return -1; } #endif } if (opt_enabled(CHANGE_UID)) { struct passwd *pw; gid_t my_gid; int ret; pw = getpwuid(new_uid); if (!pw) { debug("getpwuid(%lu): No such user ID", (unsigned long) new_uid); return -1; } if (opt_enabled(CHANGE_GID)) my_gid = new_gid; else my_gid = pw->pw_gid; ret = initgroups(pw->pw_name, my_gid); if (ret != 0) { debug("initgroups(%s, %lu): %s", pw->pw_name, (unsigned long) my_gid, strerror(errno)); return -1; } if (setuid(new_uid) != 0) { debug("setuid(%lu): %s", (unsigned long) new_uid, strerror(errno)); return -1; } } return 0; } /* ** Safely open "filename" which is located in the home directory ** of the user specified by "pw." This function is safe with respect ** to stat/open races. Only files owned by the user specified by "pw" ** will be opened. ** ** Returns a pointer to the FILE struct returned by fopen on success, ** NULL on failure. */ FILE *safe_open(const struct passwd *pw, const char *filename) { size_t len; char *path; struct stat st; FILE *fp; len = strlen(pw->pw_dir) + strlen(filename) + 2; path = xmalloc(len); snprintf(path, len, "%s/%s", pw->pw_dir, filename); if (stat(path, &st) != 0) goto out_fail; if (st.st_uid != pw->pw_uid) { o_log(LOG_CRIT, "Refused to read %s during request for %s (owner is UID %lu)", path, pw->pw_name, (unsigned long) st.st_uid); goto out_fail; } fp = fopen(path, "r"); if (!fp) { if (errno != ENOENT) debug("open: %s: %s", path, strerror(errno)); goto out_fail; } if (fstat(fileno(fp), &st) != 0) { debug("stat: %s: %s", path, strerror(errno)); fclose(fp); goto out_fail; } if (st.st_uid != pw->pw_uid) { o_log(LOG_CRIT, "Refused to read %s during request for %s (owner is UID %lu)", path, pw->pw_name, (unsigned long) st.st_uid); fclose(fp); goto out_fail; } free(path); return fp; out_fail: free(path); return NULL; } /* ** Go background. */ int go_background(void) { int fd; switch (fork()) { case -1: return -1; case 0: break; default: _exit(EXIT_SUCCESS); } if (setsid() == (pid_t) -1) { debug("setsid: %s", strerror(errno)); return -1; } if (chdir("/") != 0) { debug("chdir: %s", strerror(errno)); return -1; } umask(DEFAULT_UMASK); fd = open("/dev/null", O_RDWR); if (fd == -1) { debug("open: /dev/null: %s", strerror(errno)); return -1; } dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); return 0; } /* ** Same as malloc(3), except exits on failure. */ void *xmalloc(size_t size) { void *ret = malloc(size); if (!ret) { o_log(LOG_CRIT, "Fatal: malloc: %s", strerror(errno)); exit(EXIT_FAILURE); } return ret; } /* ** Same as calloc(3), except exits on failure. */ void *xcalloc(size_t nmemb, size_t size) { void *ret = calloc(nmemb, size); if (!ret) { o_log(LOG_CRIT, "Fatal: calloc: %s", strerror(errno)); exit(EXIT_FAILURE); } return ret; } /* ** Same as realloc(3), except exits on failure. */ void *xrealloc(void *ptr, size_t len) { void *ret = realloc(ptr, len); if (!ret) { o_log(LOG_CRIT, "Fatal: realloc: %s", strerror(errno)); exit(EXIT_FAILURE); } return ret; } /* ** Copy at most n-1 characters from src to dest and NULL-terminate dest. ** Returns a pointer to the destination string. */ char *xstrncpy(char *dest, const char *src, size_t n) { char *ret = dest; if (n == 0) return dest; while (--n > 0 && (*dest++ = *src++) != '\0') ; *dest = '\0'; return ret; } /* ** Same as strdup(3), except exits on failure, and returns NULL ** if passed a NULL pointer. */ char *xstrdup(const char *string) { char *ret; if (!string) return NULL; ret = strdup(string); if (!ret) { o_log(LOG_CRIT, "Fatal: strdup: %s", strerror(errno)); exit(EXIT_FAILURE); } return ret; } /* ** Add a link for "new_data" to the front of the linked list, "list". ** Returns the new list. */ list_t *list_prepend(list_t **list, void *new_data) { list_t *new_entry = xmalloc(sizeof(list_t)); new_entry->next = *list; new_entry->data = new_data; *list = new_entry; return *list; } /* ** Destroy the linked list, "list" */ void list_destroy(list_t *list, void (*free_data)(void *)) { list_t *cur = list; while (cur) { list_t *next = cur->next; if (free_data) free_data(cur->data); free(cur); cur = next; } } /* ** Logging mechanism for oidentd. */ int o_log(int priority, const char *fmt, ...) { va_list ap; int ret; char *buf; if (opt_enabled(QUIET) && priority != LOG_CRIT) return 0; if (priority == LOG_DEBUG && !opt_enabled(DEBUG_MSGS)) return 0; va_start(ap, fmt); ret = vasprintf((char **) &buf, fmt, ap); va_end(ap); if (opt_enabled(NOSYSLOG) || isatty(fileno(stderr))) fprintf(stderr, "%s\n", buf); else syslog(priority, "%s", buf); free(buf); return ret; } #if HAVE_LIBUDB /* ** Look up a connection in the UDB shared memory tables. ** ** This only supports IPv4 right now. */ struct udb_lookup_res get_udb_user( in_port_t lport, in_port_t fport, const struct sockaddr_storage *laddr, const struct sockaddr_storage *faddr, int sock) { struct udb_connection conn; struct udb_conn_user buf; struct udb_lookup_res res = {0, (uid_t) -1}; struct passwd *pw; char faddr_buf[MAX_IPLEN]; char laddr_buf[MAX_IPLEN]; extern char *ret_os; if (laddr->ss_family != AF_INET || faddr->ss_family != AF_INET) return res; memset(&conn, 0, sizeof(conn)); conn.from.sin_family = laddr->ss_family; memcpy(&conn.from.sin_addr, &SIN4(laddr)->sin_addr, sizeof(conn.from.sin_addr)); conn.from.sin_port = htons(lport); conn.to.sin_family = faddr->ss_family; memcpy(&conn.to.sin_addr, &SIN4(faddr)->sin_addr, sizeof(conn.to.sin_addr)); conn.to.sin_port = htons(fport); get_ip(faddr, faddr_buf, sizeof(faddr_buf)); get_ip(laddr, laddr_buf, sizeof(laddr_buf)); debug("UDB lookup: %s:%d->%s:%d", laddr_buf, ntohs(conn.from.sin_port), faddr_buf, ntohs(conn.to.sin_port)); if (!udb_conn_get(&conn, &buf)) return res; /* If the user is local, return their UID */ pw = getpwnam(buf.username); if (pw) { res.status = 1; res.uid = pw->pw_uid; return res; } /* User not local, reply with string from UDB table. */ sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, ret_os, buf.username); o_log(LOG_INFO, "[%s] UDB lookup: %d , %d : (returned %s)", faddr_buf, lport, fport, buf.username); res.status = 2; return res; } #endif oidentd-2.5.0/src/cfg_parse.h0000644000175000017500000000553313646057327013001 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ #ifndef YY_YY_CFG_PARSE_H_INCLUDED # define YY_YY_CFG_PARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { TOK_USER = 258, TOK_DEFAULT = 259, TOK_GLOBAL = 260, TOK_FROM = 261, TOK_TO = 262, TOK_FPORT = 263, TOK_LPORT = 264, TOK_FORCE = 265, TOK_REPLY = 266, TOK_FORWARD = 267, TOK_ALLOWDENY = 268, TOK_CAP = 269, TOK_STRING = 270 }; #endif /* Tokens. */ #define TOK_USER 258 #define TOK_DEFAULT 259 #define TOK_GLOBAL 260 #define TOK_FROM 261 #define TOK_TO 262 #define TOK_FPORT 263 #define TOK_LPORT 264 #define TOK_FORCE 265 #define TOK_REPLY 266 #define TOK_FORWARD 267 #define TOK_ALLOWDENY 268 #define TOK_CAP 269 #define TOK_STRING 270 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 65 "cfg_parse.y" /* yacc.c:1921 */ int value; char *string; #line 93 "cfg_parse.h" /* yacc.c:1921 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CFG_PARSE_H_INCLUDED */ oidentd-2.5.0/src/forward.h0000644000175000017500000000213013545375404012477 00000000000000/* ** forward.h - oidentd request forwarding. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018 Janik Rabe ** Copyright (c) 2018 Jan Steffens ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_FORWARD_H #define __OIDENTD_FORWARD_H int forward_request(const struct sockaddr_storage *host, in_port_t port, in_port_t lport, in_port_t fport, char *reply, size_t len); #endif oidentd-2.5.0/src/options.c0000644000175000017500000003166513555503445012537 00000000000000/* ** options.c - oidentd command-line handler. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "user_db.h" #include "options.h" #if MASQ_SUPPORT # define OPTSTRING "a:c:C:def::g:hiIl:mMo::p:P:qr:R:St:u:Uv" extern in_port_t fwdport; #else # define OPTSTRING "a:c:C:deg:hiIl:o::p:P:qr:R:St:u:Uv" #endif extern struct sockaddr_storage proxy; extern char *failuser; extern char *replyall; extern char *ret_os; extern char *config_file; extern u_int32_t timeout; extern u_int32_t connection_limit; extern in_port_t listen_port; extern struct sockaddr_storage **addr; extern uid_t target_uid; extern gid_t target_gid; static void print_usage(void); static void print_version_str(const char *desc, const char *val); static void print_version_bool(const char *desc, const bool val); static void print_version(bool verbose); static inline void enable_opt(u_int32_t option); static const struct option longopts[] = { {"address", required_argument, 0, 'a'}, {"charset", required_argument, 0, 'c'}, {"config", required_argument, 0, 'C'}, {"debug", no_argument, 0, 'd'}, {"error", no_argument, 0, 'e'}, {"group", required_argument, 0, 'g'}, {"help", no_argument, 0, 'h'}, {"foreground", no_argument, 0, 'i'}, {"stdio", no_argument, 0, 'I'}, {"limit", required_argument, 0, 'l'}, {"other", optional_argument, 0, 'o'}, {"port", required_argument, 0, 'p'}, {"quiet", no_argument, 0, 'q'}, {"reply", required_argument, 0, 'r'}, {"reply-all", required_argument, 0, 'R'}, {"nosyslog", no_argument, 0, 'S'}, {"timeout", required_argument, 0, 't'}, {"user", required_argument, 0, 'u'}, #if HAVE_LIBUDB {"udb", no_argument, 0, 'U'}, #endif {"version", no_argument, 0, 'v'}, #if MASQ_SUPPORT {"forward", optional_argument, 0, 'f'}, {"masquerade", no_argument, 0, 'm'}, {"masquerade-first", no_argument, 0, 'M'}, {"forward-last", no_argument, 0, '0'}, /* deprecated */ #endif {"proxy", required_argument, 0, 'P'}, {NULL, 0, NULL, 0} }; static u_int32_t flags; /* ** Returns true if "option" is enabled, false if it isn't. */ inline bool opt_enabled(u_int32_t option) { return (flags & option) != 0; } /* ** Enables "option." */ static inline void enable_opt(u_int32_t option) { flags |= option; } /* ** Disables "option." */ inline void disable_opt(u_int32_t option) { flags &= ~option; } /* ** Parse any arguments passed to the program. ** Returns 0 on success, -1 on failure. */ int get_options(int argc, char *const argv[]) { int opt; char *temp_os; char *charset = NULL; unsigned int naddrs = 0; #if MASQ_SUPPORT if (get_port(DEFAULT_FPORT, &fwdport) == -1) { o_log(LOG_CRIT, "Fatal: Bad port: \"%s\"", DEFAULT_FPORT); return -1; } #endif connection_limit = 0xffffffff; config_file = xstrdup(CONFFILE); temp_os = xstrdup("UNIX"); if (get_port(DEFAULT_PORT, &listen_port) == -1) { o_log(LOG_CRIT, "Fatal: Bad port: \"%s\"", DEFAULT_PORT); return -1; } while ((opt = getopt_long(argc, argv, OPTSTRING, longopts, NULL)) != EOF) { switch (opt) { case 'a': { struct sockaddr_storage *temp_ss = xmalloc(sizeof(struct sockaddr_storage)); if (naddrs % 16 == 0) addr = xrealloc(addr, sizeof(struct sockaddr_storage *) * (naddrs + 16)); if (get_addr(optarg, temp_ss) == -1) { o_log(LOG_CRIT, "Fatal: Unknown host: \"%s\"", optarg); free(temp_ss); return -1; } addr[naddrs++] = temp_ss; break; } case 'c': free(charset); charset = xstrdup(optarg); break; case 'C': free(config_file); config_file = xstrdup(optarg); break; case 'd': enable_opt(DEBUG_MSGS); #if !ENABLE_DEBUGGING o_log(LOG_CRIT, "Fatal: " PACKAGE_NAME " was compiled without debugging support"); return -1; #endif break; case 'e': enable_opt(HIDE_ERRORS); break; #if MASQ_SUPPORT case 'f': { const char *p = optarg ? optarg : DEFAULT_FPORT; if (get_port(p, &fwdport) == -1) { o_log(LOG_CRIT, "Fatal: Bad port: \"%s\"", p); return -1; } enable_opt(MASQ | FORWARD); break; } case 'm': enable_opt(MASQ); break; case '0': o_log(LOG_CRIT, "Warning: The --forward-last flag is deprecated " "and will be removed in the future. Please use " "--masquerade-first (-M) instead."); /* fall through */ case 'M': enable_opt(MASQ | FORWARD | MASQ_OVERRIDE); break; #endif case 'P': { if (get_addr(optarg, &proxy) == -1) { o_log(LOG_CRIT, "Fatal: Unknown host: \"%s\"", optarg); return -1; } enable_opt(PROXY); break; } case 'g': enable_opt(CHANGE_GID); if (find_group(optarg, &target_gid) != 0) { o_log(LOG_CRIT, "Fatal: Unknown group: \"%s\"", optarg); return -1; } break; /* pre-connected, as when run from inetd */ case 'I': enable_opt(STDIO | FOREGROUND); break; /* do not become a daemon */ case 'i': enable_opt(FOREGROUND); break; case 'l': { u_int32_t temp_limit; char *end; temp_limit = strtoul(optarg, &end, 10); if (*end != '\0') { o_log(LOG_CRIT, "Fatal: Invalid number: \"%s\"", optarg); return -1; } connection_limit = temp_limit; break; } case 'o': free(temp_os); if (optarg) { char *p; temp_os = xstrdup(optarg); p = strchr(temp_os, '\n'); if (p) *p = '\0'; p = strchr(temp_os, '\r'); if (p) *p = '\0'; } else temp_os = xstrdup("OTHER"); break; case 'p': if (get_port(optarg, &listen_port) == -1) { o_log(LOG_CRIT, "Fatal: Bad port: \"%s\"", optarg); return -1; } break; case 'q': enable_opt(QUIET); break; case 'r': free(failuser); failuser = xstrdup(optarg); break; case 'R': free(replyall); replyall = xstrdup(optarg); break; case 'S': enable_opt(NOSYSLOG); break; case 't': { char *end; timeout = strtoul(optarg, &end, 10); if (*end != '\0') { o_log(LOG_CRIT, "Fatal: Bad timeout value: \"%s\"", optarg); return -1; } break; } case 'u': enable_opt(CHANGE_UID); if (find_user(optarg, &target_uid) != 0) { o_log(LOG_CRIT, "Fatal: Unknown user: \"%s\"", optarg); return -1; } break; #if HAVE_LIBUDB case 'U': o_log(LOG_CRIT, "Warning: UDB support is deprecated and will " "be removed in the future."); enable_opt(USEUDB); break; #endif case 'v': print_version(true); exit(EXIT_SUCCESS); case 'h': print_usage(); exit(EXIT_SUCCESS); default: print_usage(); return -1; } } if (addr) addr[naddrs] = NULL; if (charset) { size_t len = strlen(temp_os) + strlen(charset) + 2; ret_os = xmalloc(len); snprintf(ret_os, len, "%s,%s", temp_os, charset); free(temp_os); free(charset); } else { ret_os = temp_os; } if (opt_enabled(DEBUG_MSGS) && opt_enabled(QUIET)) { o_log(LOG_CRIT, "Fatal: The '--debug' and '--quiet' flags are incompatible"); return -1; } #if NEED_ROOT /* ** Warn the user that privileges will not be dropped automatically. */ if (!opt_enabled(CHANGE_UID) || !opt_enabled(CHANGE_GID)) { o_log(LOG_CRIT, "Warning: privileges will not be dropped automatically" " because " PACKAGE_NAME " needs to run as root" " on this system"); } #else /* ** If no user was specified, use a reasonable default. */ if (!opt_enabled(CHANGE_UID) && (getuid() == 0 || geteuid() == 0)) { enable_opt(CHANGE_UID); if (find_user("oidentd", &target_uid) != 0) { if (find_user("nobody", &target_uid) != 0) { o_log(LOG_INFO, "Users \"oidentd\" and \"nobody\" do " "not exist; using %lu as default UID", DEFAULT_UID); target_uid = DEFAULT_UID; } } } /* ** If no group was specified, use a reasonable default. */ if (!opt_enabled(CHANGE_GID) && (getgid() == 0 || getegid() == 0)) { enable_opt(CHANGE_GID); if (find_group("oidentd", &target_gid) != 0) { if (find_group("nobody", &target_gid) != 0) { if (find_group("nogroup", &target_gid) != 0) { o_log(LOG_INFO, "Groups \"oidentd\", \"nobody\" " "and \"nogroup\" do not exist; " "using %lu as default GID", DEFAULT_GID); target_gid = DEFAULT_GID; } } } } #endif return 0; } static void print_usage(void) { const char usage[] = "\nUsage: " PACKAGE_NAME " [options]\n" "-a or --address
Bind to
(can be specified multiple times)\n" "-c or --charset Specify an alternate charset\n" "-C or --config Use the specified configuration file instead of the default\n" #if ENABLE_DEBUGGING "-d or --debug Enable debugging\n" #else "-d or --debug Enable debugging (not available in this build)\n" #endif "-e or --error Return \"UNKNOWN-ERROR\" for all errors\n" #if MASQ_SUPPORT "-f or --forward [] Forward requests for masqueraded hosts to the host on port \n" "-m or --masquerade Enable support for IP masquerading\n" "-M or --masquerade-first Check IP masquerading file before forwarding\n" #endif "-P or --proxy Let act as a proxy, forwarding connections to us\n" "-g or --group Run with specified group or GID\n" "-i or --foreground Don't run as a daemon\n" "-I or --stdio Service a single client connected to stdin/stdout, then exit (use with inetd/xinetd/etc.)\n" "-l or --limit Limit the number of open connections to the specified number\n" "-o or --other [] Return instead of the operating system. Uses \"OTHER\" if no argument is given.\n" "-p or --port Listen for connections on specified port\n" "-q or --quiet Suppress normal logging\n" "-S or --nosyslog Write messages to stderr instead of syslog\n" "-t or --timeout Wait at most before closing connections\n" "-u or --user Run as specified user or UID\n" #if HAVE_LIBUDB "-U or --udb Perform lookups in UDB shared memory tables (deprecated)\n" #endif "-v or --version Display version information and exit\n" "-r or --reply If a query fails, pretend it succeeded, returning \n" "-R or --reply-all Always return without performing connection lookups\n" "-h or --help Display this help and exit\n"; print_version(false); printf("%s", usage); } static inline void print_version_str(const char *desc, const char *val) { printf("\t%s: %*s%s\n", desc, 21 - (int) strlen(desc), "", val); } static inline void print_version_bool(const char *desc, const bool val) { print_version_str(desc, val ? "Yes" : "No"); } static void print_version(bool verbose) { printf("%s by %s <%s>\n", PACKAGE_STRING, PACKAGE_AUTHOR, PACKAGE_BUGREPORT); printf("Originally written by Ryan McCabe \n"); printf("%s\n", PACKAGE_URL); if (verbose) { printf("\nBuild information:\n"); print_version_str ("Kernel driver", KERNEL_DRIVER); print_version_bool("Needs kmem access", USE_KMEM); print_version_bool("Needs root access", NEED_ROOT); print_version_bool("Debug build", ENABLE_DEBUGGING); print_version_bool("Masquerading support", MASQ_SUPPORT); print_version_bool("IPv6 support", WANT_IPV6); print_version_bool("Linux libnfct support", LIBNFCT_SUPPORT); print_version_bool("UDB library support", HAVE_LIBUDB); printf("\nBuild settings:\n"); print_version_str("Configuration directory", SYSCONFDIR); #if XDGBDIR_SUPPORT print_version_str("User configuration file", "~/" USER_CONF_XDG); #endif print_version_str("User configuration file", "~/" USER_CONF); } } oidentd-2.5.0/src/util.h0000644000175000017500000000425513555260367012024 00000000000000/* ** util.h - oidentd utility functions. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_UTIL_H #define __OIDENTD_UTIL_H #ifndef MIN # define MIN(x,y) ((x) < (y) ? (x) : (y)) #endif typedef struct list { struct list *next; void *data; } list_t; struct udb_lookup_res { /* ** 0 if no match was found or an error occurred ** 1 if a local match was found ** 2 if a non-local match was found and the reply sent to the client */ char status; /* ** The matching UID if a local match was found ** Otherwise, MISSING_UID as reserved by POSIX */ uid_t uid; }; int o_log(int priority, const char *fmt, ...) __format((printf, 2, 3)); int drop_privs(uid_t new_uid, gid_t new_gid); int go_background(void); struct udb_lookup_res get_udb_user( in_port_t lport, in_port_t fport, const struct sockaddr_storage *laddr, const struct sockaddr_storage *faddr, int sock); FILE *safe_open(const struct passwd *pw, const char *filename); void *xmalloc(size_t size); void *xcalloc(size_t nmemb, size_t size); void *xrealloc(void *ptr, size_t len); char *xstrncpy(char *dest, const char *src, size_t n); char *xstrdup(const char *string); list_t *list_prepend(list_t **list, void *new_data); void list_destroy(list_t *list, void (*free_data)(void *)); int find_user(const char *temp_user, uid_t *uid); int find_group(const char *temp_group, gid_t *gid); int seed_prng(void); unsigned long prng_next(void); unsigned int randval(unsigned int i); #endif oidentd-2.5.0/src/options.h0000644000175000017500000000306013555260367012533 00000000000000/* ** options.h - oidentd command-line handler. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_OPTIONS_H_ #define __OIDENTD_OPTIONS_H_ #define _GNU_SOURCE #define CHANGE_UID (1 << 0x00) #define CHANGE_GID (1 << 0x01) #define HIDE_ERRORS (1 << 0x02) #define MASQ (1 << 0x03) #define FORWARD (1 << 0x04) #define PROXY (1 << 0x05) #define USEUDB (1 << 0x06) #define DEBUG_MSGS (1 << 0x07) #define QUIET (1 << 0x08) #define FOREGROUND (1 << 0x09) #define NOSYSLOG (1 << 0x0a) #define STDIO (1 << 0x0b) #define MASQ_OVERRIDE (1 << 0x0c) #ifndef LIBNFCT_SUPPORT #define LIBNFCT_SUPPORT 0 #endif #ifndef HAVE_LIBUDB #define HAVE_LIBUDB 0 #endif bool opt_enabled(u_int32_t option); void disable_opt(u_int32_t option); int get_options(int argc, char *const argv[]); #endif oidentd-2.5.0/src/inet_util.h0000644000175000017500000000500013545375404013026 00000000000000/* ** inet_util.h - oidentd network utility functions. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_INET_UTIL_H #define __OIDENTD_INET_UTIL_H #define SIN4(x) ((struct sockaddr_in *) (x)) #define SIN6(x) ((struct sockaddr_in6 *) (x)) int *setup_listen(struct sockaddr_storage **listen_addr, in_port_t listen_port); int get_port(const char *name, in_port_t *port); int get_addr(const char *const hostname, struct sockaddr_storage *g_addr); void get_ip(struct sockaddr_storage *ss, char *buf, socklen_t len); int get_hostname(struct sockaddr_storage *addr, char *hostname, socklen_t len); ssize_t sockprintf(int fd, const char *fmt, ...) __format((printf, 2, 3)); ssize_t sock_read(int fd, char *srbuf, ssize_t len); ssize_t sock_write(int sock, void *buf, ssize_t len); #ifndef HAVE_INET_ATON int inet_aton(const char *cp, struct in_addr *addr); #endif #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, size_t len); #endif #if WANT_IPV6 void sin_setv6(struct in6_addr *sin6, struct sockaddr_storage *ss); #endif void sin_setv4(in_addr_t addr, struct sockaddr_storage *ss); void sin_extractv4(void *sin6, struct in_addr *sin4); void sin_mapv4to6(void *in4, struct in6_addr *in6); size_t sin_len(const struct sockaddr_storage *ss); size_t sin_addr_len(const struct sockaddr_storage *ss); void sin_copy(struct sockaddr_storage *ss1, const struct sockaddr_storage *ss2); void *sin_addr(struct sockaddr_storage *ss); in_port_t sin_port(const struct sockaddr_storage *ss); void sin_set_port(in_port_t port, struct sockaddr_storage *ss); bool sin4_equal(struct sockaddr_storage *ss1, struct sockaddr_storage *ss2); bool sin6_equal(struct sockaddr_storage *ss1, struct sockaddr_storage *ss2); bool sin_equal(struct sockaddr_storage *ss1, struct sockaddr_storage *ss2); #endif oidentd-2.5.0/src/Makefile.am0000644000175000017500000000120413545375404012717 00000000000000SUBDIRS = missing sbin_PROGRAMS = oidentd oidentd_LDADD = -Lmissing -lmissing $(ADD_LIB) AM_CFLAGS = $(DEBUG_CFLAGS) $(WARN_CFLAGS) AM_CPPFLAGS = -I "$(srcdir)/missing" \ -D "SYSCONFDIR=\"$(sysconfdir)\"" AM_YFLAGS = -d EXTRA_DIST = kernel DISTCLEANFILES = \ os.c oidentd_SOURCES = \ oidentd.c \ util.c \ inet_util.c \ forward.c \ user_db.c \ options.c \ masq.c \ cfg_scan.l \ cfg_parse.y \ os.c noinst_HEADERS = \ oidentd.h \ cfg_parse.h \ inet_util.h \ forward.h \ masq.h \ netlink.h \ options.h \ user_db.h \ util.h BUILT_SOURCES = \ cfg_parse.h \ cfg_parse.c \ cfg_scan.c CLEANFILES = \ $(BUILT_SOURCES) oidentd-2.5.0/src/kernel/0000755000175000017500000000000013555260367012230 500000000000000oidentd-2.5.0/src/kernel/freebsd4.c0000644000175000017500000000721113545375404014011 00000000000000/* ** freebsd4.c - Ident lookup routines for >= FreeBSD 4 ** Copyright (c) 2000-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #define _WANT_UCRED #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } extern struct sockaddr_storage proxy; /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct ucred ucred; struct sockaddr_in sin4[2]; size_t len; int ret; len = sizeof(struct ucred); memset(sin4, 0, sizeof(sin4)); sin4[0].sin_len = sizeof(struct sockaddr_in); sin4[0].sin_family = AF_INET; sin4[0].sin_port = lport; sin4[0].sin_addr.s_addr = SIN4(laddr)->sin_addr.s_addr; sin4[1].sin_len = sizeof(struct sockaddr_in); sin4[1].sin_family = AF_INET; sin4[1].sin_port = fport; if (!opt_enabled(PROXY) || !sin_equal(faddr, &proxy)) sin4[1].sin_addr.s_addr = SIN4(faddr)->sin_addr.s_addr; ret = sysctlbyname("net.inet.tcp.getcred", &ucred, &len, sin4, sizeof(sin4)); if (ret == -1) { debug("sysctlbyname: %s", strerror(errno)); return MISSING_UID; } return ucred.cr_uid; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct ucred ucred; struct sockaddr_in6 sin6[2]; size_t len; int ret; len = sizeof(struct ucred); memset(sin6, 0, sizeof(sin6)); sin6[0].sin6_len = sizeof(struct sockaddr_in6); sin6[0].sin6_family = AF_INET6; sin6[0].sin6_port = lport; memcpy(&sin6[0].sin6_addr, &SIN6(laddr)->sin6_addr, sizeof(sin6[0].sin6_addr)); sin6[1].sin6_len = sizeof(struct sockaddr_in6); sin6[1].sin6_family = AF_INET6; sin6[1].sin6_port = fport; memcpy(&sin6[1].sin6_addr, &SIN6(faddr)->sin6_addr, sizeof(sin6[1].sin6_addr)); ret = sysctlbyname("net.inet6.tcp6.getcred", &ucred, &len, sin6, sizeof(sin6)); if (ret == -1) { debug("sysctlbyname: %s", strerror(errno)); return MISSING_UID; } return ucred.cr_uid; } #endif /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; nothing to do. */ int k_open(void) { return 0; } oidentd-2.5.0/src/kernel/openbsd30.c0000644000175000017500000001456613545375404014123 00000000000000/* ** openbsd30.c - Low level kernel access functions for OpenBSD 3.0 and greater ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** ** PF support by Kamil Andrusz */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if MASQ_SUPPORT # include # include # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" #define PF_DEVICE "/dev/pf" extern struct sockaddr_storage proxy; /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in *fin, *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); tir.faddr.ss_family = AF_INET; tir.faddr.ss_len = sizeof(struct sockaddr); fin = (struct sockaddr_in *) &tir.faddr; fin->sin_port = fport; if (!opt_enabled(PROXY) || !sin_equal(faddr, &proxy)) memcpy(&fin->sin_addr, &SIN4(faddr)->sin_addr, sizeof(struct in_addr)); tir.laddr.ss_family = AF_INET; tir.laddr.ss_len = sizeof(struct sockaddr); lin = (struct sockaddr_in *) &tir.laddr; lin->sin_port = lport; memcpy(&lin->sin_addr, &SIN4(laddr)->sin_addr, sizeof(struct in_addr)); i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct pfioc_natlook natlook; int pfdev; int retm; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; in_port_t masq_lport; in_port_t masq_fport; /* ** Only IPv4 is supported right now.. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; pfdev = open(PF_DEVICE, O_RDWR); if (pfdev == -1) { debug("open: %s: %s", PF_DEVICE, strerror(errno)); return -1; } memset(&natlook, 0, sizeof(struct pfioc_natlook)); memcpy(&natlook.saddr.v4.s_addr, &SIN4(laddr)->sin_addr.s_addr, sizeof(struct in_addr)); natlook.sport = lport; memcpy(&natlook.daddr.v4.s_addr, &SIN4(faddr)->sin_addr.s_addr, sizeof(struct in_addr)); natlook.dport = fport; natlook.direction = PF_IN; natlook.af = AF_INET; natlook.proto = IPPROTO_TCP; if (ioctl(pfdev, DIOCNATLOOK, &natlook) != 0) { debug("ioctl: %s", strerror(errno)); return -1; } fport = ntohs(fport); lport = ntohs(lport); masq_lport = ntohs(natlook.rsport); masq_fport = ntohs(natlook.rdport); sin_setv4(natlook.rsaddr.v4.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf; retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) (%d) failed", ipbuf, lport, natlook.rsport, fport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } return -1; } #endif #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in6 *fin; struct sockaddr_in6 *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); fin = (struct sockaddr_in6 *) &tir.faddr; fin->sin6_family = AF_INET6; fin->sin6_len = sizeof(struct sockaddr_in6); if (faddr->ss_len > sizeof(tir.faddr)) return MISSING_UID; memcpy(&fin->sin6_addr, &SIN6(faddr)->sin6_addr, sizeof(tir.faddr)); fin->sin6_port = fport; lin = (struct sockaddr_in6 *) &tir.laddr; lin->sin6_family = AF_INET6; lin->sin6_len = sizeof(struct sockaddr_in6); if (laddr->ss_len > sizeof(tir.laddr)) return MISSING_UID; memcpy(&lin->sin6_addr, &SIN6(laddr)->sin6_addr, sizeof(tir.laddr)); lin->sin6_port = lport; i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #endif /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; nothing to do. */ int k_open(void) { #ifdef HAVE_UNVEIL if (unveil("/", "r")) { debug("unveil: %s", strerror(errno)); return -1; } #endif return 0; } oidentd-2.5.0/src/kernel/netbsd5.c0000644000175000017500000000643313545375404013664 00000000000000/* ** netbsd5.c - Ident lookup routines for >= NetBSD 5 ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if WANT_IPV6 # include #endif #if MASQ_SUPPORT # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; nothing to do. */ int k_open(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; struct sockaddr_storage ss[2]; uid_t uid = MISSING_UID; size_t uidlen; size_t sslen; int error; memcpy(&ss[0], faddr, sizeof(ss[0])); memcpy(&ss[1], laddr, sizeof(ss[1])); SIN4(&ss[0])->sin_port = fport; SIN4(&ss[1])->sin_port = lport; uidlen = sizeof(uid); sslen = sizeof(ss); error = sysctl(mib, sizeof(mib) / sizeof(int), &uid, &uidlen, ss, sslen); if (error == 0 && uid != MISSING_UID) return uid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { int mib[] = { CTL_NET, PF_INET6, IPPROTO_TCP, TCPCTL_IDENT }; struct sockaddr_storage ss[2]; uid_t uid = MISSING_UID; size_t uidlen; size_t sslen; int error; memcpy(&ss[0], faddr, sizeof(ss[0])); memcpy(&ss[1], laddr, sizeof(ss[1])); SIN6(&ss[0])->sin6_port = fport; SIN6(&ss[1])->sin6_port = lport; uidlen = sizeof(uid); sslen = sizeof(ss); error = sysctl(mib, sizeof(mib) / sizeof(int), &uid, &uidlen, ss, sslen); if (error == 0 && uid != MISSING_UID) return uid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #endif oidentd-2.5.0/src/kernel/legacy/0000755000175000017500000000000013545375404013472 500000000000000oidentd-2.5.0/src/kernel/legacy/openbsd.c0000644000175000017500000002062513545375404015215 00000000000000/* ** openbsd.c - Low level kernel access functions for OpenBSD. ** ** This file was originally taken from the pidentd 2.x software package. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** OpenBSD IP masquerading support Copyright (c) 2000 ** Slawomir Piotrowski ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if WANT_IPV6 # include # include # include # include #endif #if MASQ_SUPPORT # include # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" extern struct sockaddr_storage proxy; #define N_TCB 0 #if MASQ_SUPPORT # define N_NATLIST 1 # define N_TOTAL 3 #else # define N_TOTAL 2 #endif static int getbuf(u_long addr, void *buf, size_t len); static struct socket *getlist4( struct inpcbtable *tcbtablep, struct inpcbtable *ktcbtablep, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr); static struct kainfo { kvm_t *kd; struct nlist nl[N_TOTAL]; } *kinfo; /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of OpenBSD is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of OpenBSD is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { free(kinfo); debug("kvm_open: %s", strerror(errno)); return -1; } kinfo->nl[N_TCB].n_name = "_tcbtable"; #if MASQ_SUPPORT if (opt_enabled(MASQ)) kinfo->nl[N_NATLIST].n_name = "_nat_instances"; else kinfo->nl[N_NATLIST].n_name = "NULL"; #endif kinfo->nl[N_TOTAL - 1].n_name = NULL; if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { kvm_close(kinfo->kd); free(kinfo); debug("kvm_nlist: %s", strerror(errno)); return -1; } #if MASQ_SUPPORT if (opt_enabled(MASQ) && kinfo->nl[N_NATLIST].n_value == 0) { o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable"); disable_opt(MASQ); } #endif return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 1 if call succeeded, else 0 (zero). */ static int getbuf(u_long addr, void *buf, size_t len) { if (kvm_read(kinfo->kd, addr, buf, len) < 0) { debug("getbuf: kvm_read(%08lx, %d): %s", addr, len, strerror(errno)); return -1; } return 0; } /* ** Traverse the inpcb list until a match is found. ** Returns NULL if no match. */ static struct socket *getlist4( struct inpcbtable *tcbtablep, struct inpcbtable *ktcbtablep, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr) { struct inpcb *kpcbp, pcb; if (!tcbtablep) return NULL; kpcbp = tcbtablep->inpt_queue.cqh_first; while (kpcbp != (struct inpcb *) ktcbtablep) { if (getbuf((u_long) kpcbp, &pcb, sizeof(struct inpcb)) == -1) break; if (opt_enabled(PROXY)) { if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } } if (pcb.inp_faddr.s_addr == faddr->s_addr && pcb.inp_laddr.s_addr == laddr->s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } kpcbp = pcb.inp_queue.cqe_next; } return NULL; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct socket *sockp, sock; struct inpcbtable tcbtable; int ret; ret = getbuf(kinfo->nl[N_TCB].n_value, &tcbtable, sizeof(tcbtable)); if (ret == -1) return MISSING_UID; sockp = getlist4(&tcbtable, (struct inpcbtable *) kinfo->nl[N_TCB].n_value, lport, fport, &SIN4(laddr)->sin_addr, &SIN4(faddr)->sin_addr); if (!sockp) return MISSING_UID; if (getbuf((u_long) sockp, &sock, sizeof(sock)) == -1) return MISSING_UID; if (!(sock.so_state & SS_CONNECTOUT)) return MISSING_UID; return sock.so_ruid; } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { nat_t *np; nat_t nat; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; /* ** Only IPv4 is supported right now. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; if (getbuf(kinfo->nl[N_NATLIST].n_value, &np, sizeof(np)) == -1) return -1; for (; np; np = nat.nat_next) { in_port_t masq_lport; in_port_t masq_fport; int retm; if (getbuf((u_long) np, &nat, sizeof(nat)) == -1) break; if (nat.nat_p != IPPROTO_TCP) continue; if (lport != nat.nat_outport) continue; if (fport != nat.nat_oport) continue; if (SIN4(laddr)->sin_addr.s_addr != nat.nat_outip.s_addr) continue; if (SIN4(faddr)->sin_addr.s_addr != nat.nat_oip.s_addr) { if (!opt_enabled(PROXY)) continue; if (SIN4(faddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr) continue; if (SIN4(laddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr) continue; } lport = ntohs(lport); fport = ntohs(fport); masq_lport = ntohs(nat.nat_inport); masq_fport = ntohs(nat.nat_outport); sin_setv4(nat.nat_inip.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf; retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) failed", ipbuf, lport, nat.nat_inport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } } return -1; } #endif #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in6 *fin; struct sockaddr_in6 *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error = 0; size_t i; memset(&tir, 0, sizeof(tir)); fin = (struct sockaddr_in6 *) &tir.faddr; fin->sin6_family = AF_INET6; fin->sin6_len = sizeof(struct sockaddr_in6); if (faddr->ss_len > sizeof(tir.faddr)) return MISSING_UID; memcpy(&fin->sin6_addr, &SIN6(faddr)->sin6_addr, sizeof(tir.faddr)); fin->sin6_port = fport; lin = (struct sockaddr_in6 *) &tir.laddr; lin->sin6_family = AF_INET6; lin->sin6_len = sizeof(struct sockaddr_in6); if (laddr->ss_len > sizeof(tir.laddr)) return MISSING_UID; memcpy(&lin->sin6_addr, &SIN6(laddr)->sin6_addr, sizeof(tir.laddr)); lin->sin6_port = lport; i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #endif oidentd-2.5.0/src/kernel/legacy/solaris7.c0000644000175000017500000001431313545375404015323 00000000000000/* ** solaris7.c - SunOS 5.6 and 5.7 kernel access functions ** ** Copyright (c) 1995-1997 Casper Dik ** Copyright (c) 1997 Peter Eriksson ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or ** modify it as you wish - as long as you don't claim that you wrote ** it. ** ** 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. */ #include #include #include #include #include #include #include #include #include #define _KMEMUSER #define _KERNEL #include /* some definition conflicts. but we must define _KERNEL */ #define exit kernel_exit #define strsignal kernel_strsignal #define mutex_init kernel_mutex_init #define mutex_destroy kernel_mutex_destroy #define sema_init kernel_sema_init #define sema_destroy kernel_sema_destroy #include #include #include #include #include #include #include #include #include #include #if SOLARIS >= 7 # include # include #endif #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #define FANOUT_OFFSET(n) (kip->nl[N_FANOUT].n_value + (n) * sizeof(icf_t) + offsetof(icf_t, icf_ipc)) #undef exit #undef strsignal #undef mutex_init #undef mutex_destroy #undef sema_init #undef sema_destroy #undef SEMA_HELD #undef RW_LOCK_HELD #undef RW_READ_HELD #undef RW_WRITE_HELD #undef MUTEX_HELD #define N_FANOUT 0 static struct kainfo { kvm_t *kd; struct nlist nl[2]; } *kinfo; static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len); /* ** This is needed as stdlib.h can't be included as it causes ** a clash with exit(), as declared by another header file. */ extern void free(void *ptr); /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of Solaris is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of Solaris is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); /* ** Open the kernel memory device */ kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { debug("kvm_open: %s", strerror(errno)); free(kinfo); return -1; } kinfo->nl[0].n_name = "ipc_tcp_conn_fanout"; kinfo->nl[1].n_name = NULL; /* ** Extract offsets to the needed variables in the kernel */ if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { debug("kvm_nlist: %s", strerror(errno)); kvm_close(kinfo->kd); free(kinfo); return -1; } return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 0 if call succeeded, else -1. */ static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len) { int i; ssize_t status = -1; for (i = 0; i < 5; ++i) { status = kvm_read(kd, addr, dst, len); if (status >= 0) break; } if (status < 0) return -1; return 0; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { in_addr_t laddr4 = SIN4(laddr)->sin_addr.s_addr; in_addr_t faddr4 = SIN4(faddr)->sin_addr.s_addr; ipc_t *icp; ipc_t ic; u_int offset; u_int32_t zero = 0; file_t tf; queue_t sqr; struct proc *procp; int ret; in_port_t *ports; in_addr_t *locaddr, *raddr; offset = fport ^ lport; offset ^= (u_int) SIN4(faddr)->sin_addr.S_un.S_un_b.s_b4 ^ (offset >> 8); offset &= 0xff; ret = getbuf(kinfo->kd, (off_t) FANOUT_OFFSET(offset), &icp, sizeof(ipc_t *)); if (ret == -1) return MISSING_UID; if (!icp) return MISSING_UID; locaddr = (in_addr_t *) &ic.ipc_laddr; raddr = (in_addr_t *) &ic.ipc_faddr; ports = (in_port_t *) &ic.ipc_ports; while (icp) { if (getbuf(kinfo->kd, (off_t) icp, &ic, sizeof(ic)) == -1) return MISSING_UID; if (fport == ports[0] && lport == ports[1] && (!memcmp(&laddr4, locaddr, 4) || !memcmp(&zero, locaddr, 4)) && !memcmp(&faddr4, raddr, 4)) { break; } icp = ic.ipc_hash_next; } if (!icp) return MISSING_UID; ret = getbuf(kip->kd, (off_t) ic.ipc_rq + offsetof(queue_t, q_stream), &sqr.q_stream, sizeof(sqr.q_stream)); if (ret == -1) return MISSING_UID; /* ** At this point sqr.qstream holds the pointer to the stream we're ** interested in. Now we're going to find the file pointer ** that refers to the vnode that refers to this stream stream */ if (kvm_setproc(kinfo->kd) != 0) return MISSING_UID; while ((procp = kvm_nextproc(kinfo->kd))) { struct uf_entry files[NFPCHUNK]; int nfiles = procp->p_user.u_nofiles; off_t addr = (off_t) procp->p_user.u_flist; while (nfiles > 0) { int nread = nfiles > NFPCHUNK ? NFPCHUNK : nfiles; int size = nread * sizeof(struct uf_entry); int i; struct file *last = NULL; vnode_t vp; if (getbuf(kinfo->kd, addr, &files[0], size) == -1) return MISSING_UID; for (i = 0; i < nread; ++i) { if (files[i].uf_ofile == 0 || files[i].uf_ofile == last) continue; last = files[i].uf_ofile; if (getbuf(kinfo->kd, (off_t) last, &tf, sizeof(tf)) == -1) return MISSING_UID; if (!tf.f_vnode) continue; ret = getbuf(kinfo->kd, (off_t) tf.f_vnode + offsetof(vnode_t, v_stream), &vp.v_stream, sizeof(vp.v_stream)); if (ret == -1) return MISSING_UID; if (vp.v_stream == sqr.q_stream) { cred_t cr; ret = getbuf(kinfo->kd, (off_t) tf.f_cred, &cr, sizeof(cr)); if (ret == -1) return MISSING_UID; return cr.cr_ruid; } } nfiles -= nread; addr += size; } } return MISSING_UID; } oidentd-2.5.0/src/kernel/legacy/openbsd29.c0000644000175000017500000001035613545375404015370 00000000000000/* ** openbsd29.c - Low level kernel access functions for OpenBSD 2.9 and greater ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" extern struct sockaddr_storage proxy; /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in *fin, *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); tir.faddr.ss_family = AF_INET; tir.faddr.ss_len = sizeof(struct sockaddr); fin = (struct sockaddr_in *) &tir.faddr; fin->sin_port = fport; if (!opt_enabled(PROXY) || !sin_equal(faddr, &proxy)) memcpy(&fin->sin_addr, &SIN4(faddr)->sin_addr, sizeof(struct in_addr)); tir.laddr.ss_family = AF_INET; tir.laddr.ss_len = sizeof(struct sockaddr); lin = (struct sockaddr_in *) &tir.laddr; lin->sin_port = lport; memcpy(&lin->sin_addr, &SIN4(laddr)->sin_addr, sizeof(struct in_addr)); i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in6 *fin; struct sockaddr_in6 *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); fin = (struct sockaddr_in6 *) &tir.faddr; fin->sin6_family = AF_INET6; fin->sin6_len = sizeof(struct sockaddr_in6); if (faddr->ss_len > sizeof(tir.faddr)) return MISSING_UID; memcpy(&fin->sin6_addr, &SIN6(faddr)->sin6_addr, sizeof(tir.faddr)); fin->sin6_port = fport; lin = (struct sockaddr_in6 *) &tir.laddr; lin->sin6_family = AF_INET6; lin->sin6_len = sizeof(struct sockaddr_in6); if (laddr->ss_len > sizeof(tir.laddr)) return MISSING_UID; memcpy(&lin->sin6_addr, &SIN6(laddr)->sin6_addr, sizeof(tir.laddr)); lin->sin6_port = lport; i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #endif /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; nothing to do. */ int k_open(void) { #warning "Support for this version of OpenBSD is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of OpenBSD is deprecated and may be removed in the future"); return 0; } oidentd-2.5.0/src/kernel/legacy/solaris8.c0000644000175000017500000002034313545375404015324 00000000000000/* ** solaris8.c - SunOS 5.8 kernel access functions ** ** Copyright (c) 1995-1999 Casper Dik ** Copyright (c) 1997 Peter Eriksson ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or ** modify it as you wish - as long as you don't claim that you wrote ** it. ** ** 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. ** ** For now, only support IPv4 for Solaris 8 */ #include #include #include #include #include #include #include #include #include #define _KMEMUSER #define _KERNEL #include /* some definition conflicts. but we must define _KERNEL */ #define exit kernel_exit #define strsignal kernel_strsignal #define mutex_init kernel_mutex_init #define mutex_destroy kernel_mutex_destroy #define sema_init kernel_sema_init #define sema_destroy kernel_sema_destroy #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" typedef struct hashentry { tcpb_t *he_tcp; kmutex_t he_lock; } he_t; #define GETBYTE(x, n) ((u_int32_t) (((u_int8_t *) &x)[n])) #define FANOUT_OFFSET(n) (kinfo->hash_table + (n) * sizeof(he_t) + offsetof(he_t, he_tcp)) #undef exit #undef strsignal #undef mutex_init #undef mutex_destroy #undef sema_init #undef sema_destroy #undef SEMA_HELD #undef RW_LOCK_HELD #undef RW_READ_HELD #undef RW_WRITE_HELD #undef MUTEX_HELD #define N_FANOUT 0 #define N_HASH_SIZE 1 #define NFPREAD 64 #ifndef NFPCHUNK # define uf_ofile uf_file # define u_flist u_finfo.fi_list # define u_nofiles u_finfo.fi_nfiles #endif static struct kainfo { kvm_t *kd; int hash_size; u_long hash_table; struct nlist nl[3]; } *kinfo; static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len); /* ** This is needed as stdlib.h can't be included as it causes ** a clash with exit(), as declared by another header file. */ extern void free(void *ptr); /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of Solaris is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of Solaris is deprecated and may be removed in the future"); int ret; kinfo = xmalloc(sizeof(struct kainfo)); /* ** Open the kernel memory device */ kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { debug("kvm_open: %s", strerror(errno)); free(kinfo); return -1; } kinfo->nl[0].n_name = "tcp_conn_fanout"; kinfo->nl[1].n_name = "tcp_conn_hash_size"; kinfo->nl[2].n_name = NULL; /* ** Extract offsets to the needed variables in the kernel */ if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { debug("kvm_nlist: %s", strerror(errno)); goto out_err; } /* ** Read the two kernel values we need but won't change */ ret = getbuf(kinfo->kd, kinfo->nl[N_HASH_SIZE].n_value, &kinfo->hash_size, sizeof(kinfo->hash_size)); if (ret == -1) goto out_err; ret = getbuf(kinfo->kd, kinfo->nl[N_FANOUT].n_value, &kinfo->hash_table, sizeof(kinfo->hash_table)); if (ret == -1) goto out_err; return 0; out_err: kvm_close(kinfo->kd); free(kinfo); debug("getbuf: can't get needed symbols: %s", strerror(errno)); return -1; } /* ** Get a piece of kernel memory with error handling. ** Returns 0 if call succeeded, else -1. */ static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len) { int i; ssize_t status = -1; for (i = 0; i < 5; ++i) { status = kvm_read(kd, addr, dst, len); if (status >= 0) break; } if (status < 0) return -1; return 0; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { in_addr_t laddr4 = SIN4(laddr)->sin_addr.s_addr; in_addr_t faddr4 = SIN4(faddr)->sin_addr.s_addr; u_int32_t offset; char *iphash; file_t tf; struct proc *procp; int ret; struct stdata *std; tcpb_t *tcpb; tcpb_t tb; queue_t *q; if (faddr->ss_family == AF_INET) iphash = (char *) &faddr4; else #if WANT_IPV6 iphash = ((char *) &SIN6(faddr)->sin6_addr) + 12; #else return MISSING_UID; #endif /* ** All tcp connections are in one single hash table; IPV4 connections ** over AF_INET6 sockets do not show up in the normal tcp hash tables ** ** First we need to find the hash entry in the tcp table; ** then we need to follow the chain and get the TCP entry. ** ** In Solaris 8, the tcp structure is split in two: the core part ** needed in TIME_WAIT state and the full structure. */ offset = GETBYTE(*iphash, 3) ^ GETBYTE(fport, 0) ^ GETBYTE(fport, 1) ^ GETBYTE(lport, 0) ^ GETBYTE(lport, 1) ^ ((GETBYTE(fport, 0) ^ GETBYTE(lport, 0) ^ GETBYTE(*iphash, 2)) << 10) ^ (GETBYTE(*iphash, 1) << 6); offset %= kinfo->hash_size; if (getbuf(kinfo->kd, FANOUT_OFFSET(offset), &tcpb, sizeof(tcpb)) == -1) return MISSING_UID; if (!tcpb) return MISSING_UID; while (tcpb) { if (getbuf(kinfo->kd, (off_t) tcpb, &tb, sizeof(tb)) == -1) return MISSING_UID; if (lport == tb.tcpb_lport && fport == tb.tcpb_fport) { if (faddr->ss_family == AF_INET) { struct in_addr fv4, lv4; sin_extractv4(&tb.tcpb_ip_src_v6, &lv4); sin_extractv4(&tb.tcpb_remote_v6, &fv4); if (!memcmp(&lv4, &laddr4, 4) && !memcmp(&fv4, &faddr4, 4)) break; } else { size_t len_local = sin_len(laddr); size_t len_remote = sin_len(faddr); if (!memcmp(&tb.tcpb_ip_src_v6, &laddr4, len_local) && !memcmp(&tb.tcpb_remote_v6, &faddr4, len_remote)) { break; } } } tcpb = tb.tcpb_conn_hash; } if (!tcpb) return MISSING_UID; ret = getbuf(kinfo->kd, (off_t) tb.tcpb_tcp + offsetof(tcp_t, tcp_rq), &q, sizeof(q)); if (ret == -1) return MISSING_UID; ret = getbuf(kinfo->kd, (off_t) q + offsetof(queue_t, q_stream), &std, sizeof(std)); if (ret == -1) return MISSING_UID; /* ** At this point std holds the pointer to the stream we're ** interested in. Now we're going to find the file pointer ** that refers to the vnode that refers to this stream stream */ if (kvm_setproc(kinfo->kd) != 0) return MISSING_UID; /* ** In Solaris 8, the file lists changed dramatically. ** There's no longer an NFPCHUNK; the uf_entries are ** part of a seperate structure inside user. */ while ((procp = kvm_nextproc(kinfo->kd))) { struct uf_entry files[NFPREAD]; int nfiles = procp->p_user.u_nofiles; off_t addr = (off_t) procp->p_user.u_flist; while (nfiles > 0) { int nread = nfiles > NFPREAD ? NFPREAD : nfiles; int size = nread * sizeof(struct uf_entry); int i; struct file *last = NULL; vnode_t vp; if (getbuf(kinfo->kd, addr, &files[0], size) == -1) return MISSING_UID; for (i = 0; i < nread; ++i) { if (files[i].uf_ofile == 0 || files[i].uf_ofile == last) continue; last = files[i].uf_ofile; if (getbuf(kinfo->kd, (off_t) last, &tf, sizeof(tf)) == -1) return MISSING_UID; if (!tf.f_vnode) continue; ret = getbuf(kinfo->kd, (off_t) tf.f_vnode + offsetof(vnode_t, v_stream), &vp.v_stream, sizeof(vp.v_stream)); if (ret == -1) return MISSING_UID; if (vp.v_stream == std) { cred_t cr; ret = getbuf(kinfo->kd, (off_t) tf.f_cred, &cr, sizeof(cr)); if (ret == -1) return MISSING_UID; return cr.cr_ruid; } } nfiles -= nread; addr += size; } } return MISSING_UID; } oidentd-2.5.0/src/kernel/legacy/solaris4.c0000644000175000017500000001552313545375404015324 00000000000000/* ** solaris4.c - SunOS 5.4 kernel access functions ** ** Copyright (c) 1995-1997 Casper Dik ** Copyright (c) 1997-1999 Peter Eriksson ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or ** modify it as you wish - as long as you don't claim that you wrote ** it. ** ** 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. */ #include #define _KMEMUSER #define _KERNEL /* some definition conflicts. but we must define _KERNEL */ #define exit kernel_exit #define strsignal kernel_strsignal #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef exit #undef strsignal #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #define N_FANOUT 0 #define N_PRACTIVE 1 static struct kainfo { kvm_t *kd; struct proc *nextp; struct proc currentp; struct nlist nl[3]; } *kinfo; #define FANOUT_OFFSET(x) (kinfo->nl[N_FANOUT].n_value + sizeof(ipc_t *) * (x)) static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len); /* ** This is needed as stdlib.h can't be included as it causes ** a clash with exit(), as declared by another header file. */ extern void free(void *ptr); /* ** Workaround for Solaris 2.x bug in kvm_setproc, ** kvm_setproc doesn't reread practive. */ static int xkvm_setproc(struct kainfo *kp) { int ret; ret = getbuf(kp->kd, (off_t) kp->nl[N_PRACTIVE].n_value, &kp->nextp, sizeof(kp->nextp)); return ret; } static struct proc *xkvm_nextproc(struct kainfo *kp) { int ret = getbuf(kp->kd, (off_t) kp->nextp, &kp->currentp, sizeof(kp->currentp)); if (ret == -1) return NULL; kp->nextp = kp->currentp.p_next; return &kp->currentp; } /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of Solaris is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of Solaris is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); /* ** Open the kernel memory device */ kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { debug("kvm_open: %s", strerror(errno)); free(kinfo); return -1; } kinfo->nl[0].n_name = "ipc_tcp_fanout"; kinfo->nl[1].n_name = "practive"; kinfo->nl[2].n_name = NULL; /* ** Extract offsets to the needed variables in the kernel */ if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { debug("kvm_nlist: %s", strerror(errno)); kvm_close(kinfo->kd); free(kinfo); return -1; } return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 0 if call succeeded, else -1. */ static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len) { int i; ssize_t status = -1; for (i = 0; i < 5; ++i) { status = kvm_read(kd, addr, dst, len); if (status >= 0) break; } if (status < 0) return -1; return 0; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { in_addr_t laddr4 = SIN4(laddr)->sin_addr.s_addr; in_addr_t faddr4 = SIN4(faddr)->sin_addr.s_addr; ipc_t *icp; ipc_t ic; u_int offset; u_int32_t zero = 0; file_t tf; queue_t sqr; struct proc *procp; int ret; in_port_t *ports; in_addr_t *locaddr, *raddr; ipc_t *alticp = NULL; u_int altoffset; #if defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) altoffset = fport >> 8; #else altoffset = lport >> 8; #endif altoffset ^= fport ^ lport; altoffset ^= SIN4(faddr)->sin_addr.S_un.S_un_b.s_b4; if (lport > 8 || fport != 0) altoffset ^= 1; altoffset &= 0xff; ret = getbuf(kip->kd, (off_t) FANOUT_OFFSET(altoffset), &alticp, sizeof(ipc_t *)); if (ret == -1) alticp = NULL; offset = fport ^ lport; offset ^= (u_int) SIN4(faddr)->sin_addr.S_un.S_un_b.s_b4 ^ (offset >> 8); offset &= 0xff; ret = getbuf(kinfo->kd, (off_t) FANOUT_OFFSET(offset), &icp, sizeof(ipc_t *)); if (ret == -1) { icp = alticp; alticp = NULL; } if (!icp) return MISSING_UID; locaddr = (in_addr_t *) &ic.ipc_tcp_laddr; raddr = (in_addr_t *) &ic.ipc_tcp_faddr; ports = (in_port_t *) &ic.ipc_tcp_ports; while (icp) { if (getbuf(kinfo->kd, (off_t) icp, &ic, sizeof(ic)) == -1) return MISSING_UID; if (fport == ports[0] && lport == ports[1] && (!memcmp(&laddr4, locaddr, 4) || !memcmp(&zero, locaddr, 4)) && !memcmp(&faddr4, raddr, 4)) { break; } icp = ic.ipc_hash_next; if (!icp) { icp = alticp; alticp = NULL; } } if (!icp) return MISSING_UID; ret = getbuf(kip->kd, (off_t) ic.ipc_rq + offsetof(queue_t, q_stream), &sqr.q_stream, sizeof(sqr.q_stream)); if (ret == -1) return MISSING_UID; /* ** At this point sqr.qstream holds the pointer to the stream we're ** interested in. Now we're going to find the file pointer ** that refers to the vnode that refers to this stream stream */ if (xkvm_setproc(kinfo->kd) != 0) return MISSING_UID; while ((procp = xkvm_nextproc(kinfo->kd))) { struct uf_entry files[NFPCHUNK]; int nfiles = procp->p_user.u_nofiles; off_t addr = (off_t) procp->p_user.u_flist; while (nfiles > 0) { int nread = nfiles > NFPCHUNK ? NFPCHUNK : nfiles; int size = nread * sizeof(struct uf_entry); int i; struct file *last = NULL; vnode_t vp; if (getbuf(kinfo->kd, addr, &files[0], size) == -1) return MISSING_UID; for (i = 0; i < nread; ++i) { if (files[i].uf_ofile == 0 || files[i].uf_ofile == last) continue; last = files[i].uf_ofile; if (getbuf(kinfo->kd, (off_t) last, &tf, sizeof(tf)) == -1) return MISSING_UID; if (!tf.f_vnode) continue; ret = getbuf(kinfo->kd, (off_t) tf.f_vnode + offsetof(vnode_t, v_stream), &vp.v_stream, sizeof(vp.v_stream)); if (ret == -1) return MISSING_UID; if (vp.v_stream == sqr.q_stream) { cred_t cr; ret = getbuf(kinfo->kd, (off_t) tf.f_cred, &cr, sizeof(cr)); if (ret == -1) return MISSING_UID; return cr.cr_ruid; } } nfiles -= nread; addr += size; } } return MISSING_UID; } oidentd-2.5.0/src/kernel/legacy/openbsd24.c0000644000175000017500000000753013545375404015363 00000000000000/* ** openbsd24.c - Low level kernel access functions for OpenBSD 2.4 and greater ** ** This file was originally taken from the pidentd 2.x software package. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" extern struct sockaddr_storage proxy; /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in *fin, *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); tir.faddr.sa_family = AF_INET; tir.faddr.sa_len = sizeof(struct sockaddr); fin = (struct sockaddr_in *) &tir.faddr; fin->sin_port = fport; if (!opt_enabled(PROXY) || !sin_equal(faddr, &proxy)) memcpy(&fin->sin_addr, &SIN4(faddr)->sin_addr, sizeof(struct in_addr)); tir.laddr.sa_family = AF_INET; tir.laddr.sa_len = sizeof(struct sockaddr); lin = (struct sockaddr_in *) &tir.laddr; lin->sin_port = lport; memcpy(&lin->sin_addr, &SIN4(laddr)->sin_addr, sizeof(struct in_addr)); i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct tcp_ident_mapping tir; struct sockaddr_in6 *fin; struct sockaddr_in6 *lin; int mib[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_IDENT }; int error; size_t i; memset(&tir, 0, sizeof(tir)); fin = (struct sockaddr_in6 *) &tir.faddr; fin->sin6_family = AF_INET6; fin->sin6_len = sizeof(struct sockaddr_in6); if (faddr->ss_len > sizeof(tir.faddr)) return MISSING_UID; memcpy(&fin->sin6_addr, &SIN6(faddr)->sin6_addr, sizeof(tir.faddr)); fin->sin6_port = fport; lin = (struct sockaddr_in6 *) &tir.laddr; lin->sin6_family = AF_INET6; lin->sin6_len = sizeof(struct sockaddr_in6); if (laddr->ss_len > sizeof(tir.laddr)) return MISSING_UID; memcpy(&lin->sin6_addr, &SIN6(laddr)->sin6_addr, sizeof(tir.laddr)); lin->sin6_port = lport; i = sizeof(tir); error = sysctl(mib, sizeof(mib) / sizeof(int), &tir, &i, NULL, 0); if (error == 0 && tir.ruid != -1) return tir.ruid; if (error == -1) debug("sysctl: %s", strerror(errno)); return MISSING_UID; } #endif /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; nothing to do. */ int k_open(void) { #warning "Support for this version of OpenBSD is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of OpenBSD is deprecated and may be removed in the future"); return 0; } oidentd-2.5.0/src/kernel/legacy/solaris5.c0000644000175000017500000001540713545375404015326 00000000000000/* ** solaris5.c - SunOS 5.5 kernel access functions ** ** Copyright (c) 1995-1997 Casper Dik ** Copyright (c) 1997 Peter Eriksson ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or ** modify it as you wish - as long as you don't claim that you wrote ** it. ** ** 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. */ #include #define _KMEMUSER #define _KERNEL /* some definition conflicts, but we must define _KERNEL */ #define exit kernel_exit #define strsignal kernel_strsignal #define mutex_init kernel_mutex_init #define mutex_destroy kernel_mutex_destroy #define sema_init kernel_sema_init #define sema_destroy kernel_sema_destroy #include #ifdef _POSIX_C_SOURCE # define DEF_POSIX_C_SOURCE _POSIX_C_SOURCE # undef _POSIX_C_SOURCE #endif #include #include #include #include #include #ifdef DEF_POSIX_C_SOURCE # define _POSIX_C_SOURCE DEF_POSIX_C_SOURCE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #define FANOUT_OFFSET(n) (kip->nl[N_FANOUT].n_value + (n) * sizeof(ipc_t *)) #undef exit #undef strsignal #undef mutex_init #undef mutex_destroy #undef sema_init #undef sema_destroy #undef SEMA_HELD #undef RW_LOCK_HELD #undef RW_READ_HELD #undef RW_WRITE_HELD #undef MUTEX_HELD #include #include #include #define N_FANOUT 0 static struct kainfo { kvm_t *kd; struct nlist nl[2]; } *kinfo; static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len); /* ** This is needed as stdlib.h can't be included as it causes ** a clash with exit() as declared by another header file. */ extern void free(void *ptr); /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of Solaris is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of Solaris is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); /* ** Open the kernel memory device */ kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { debug("kvm_open: %s", strerror(errno)); free(kinfo); return -1; } kinfo->nl[0].n_name = "ipc_tcp_fanout"; kinfo->nl[1].n_name = NULL; /* ** Extract offsets to the needed variables in the kernel */ if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { debug("kvm_nlist: %s", strerror(errno)); kvm_close(kinfo->kd); free(kinfo); return -1; } return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 0 if call succeeded, else -1. */ static int getbuf(kvm_t *kd, off_t addr, void *dst, size_t len) { int i; ssize_t status = -1; for (i = 0; i < 5; ++i) { status = kvm_read(kd, addr, dst, len); if (status >= 0) break; } if (status < 0) return -1; return 0; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { in_addr_t laddr4 = SIN4(laddr)->sin_addr.s_addr; in_addr_t faddr4 = SIN4(faddr)->sin_addr.s_addr; ipc_t *icp; ipc_t ic; u_int offset; u_int32_t zero = 0; file_t tf; queue_t sqr; struct proc *procp; int ret; in_port_t *ports; in_addr_t *locaddr, *raddr; ipc_t *alticp = NULL; u_int altoffset; #if defined(BIG_ENDIAN) || defined(_BIG_ENDIAN) altoffset = fport >> 8; #else altoffset = lport >> 8; #endif altoffset ^= fport ^ lport; altoffset ^= SIN4(faddr)->sin_addr.S_un.S_un_b.s_b4; if (lport > 8 || fport != 0) altoffset ^= 1; altoffset &= 0xff; ret = getbuf(kip->kd, (off_t) FANOUT_OFFSET(altoffset), &alticp, sizeof(ipc_t *)); if (ret == -1) alticp = NULL; offset = fport ^ lport; offset ^= (u_int) SIN4(faddr)->sin_addr.S_un.S_un_b.s_b4 ^ (offset >> 8); offset &= 0xff; ret = getbuf(kinfo->kd, (off_t) FANOUT_OFFSET(offset), &icp, sizeof(ipc_t *)); if (ret == -1) { icp = alticp; alticp = NULL; } if (!icp) return MISSING_UID; locaddr = (in_addr_t *) &ic.ipc_tcp_laddr; raddr = (in_addr_t *) &ic.ipc_tcp_faddr; ports = (in_port_t *) &ic.ipc_tcp_ports; while (icp) { if (getbuf(kinfo->kd, (off_t) icp, &ic, sizeof(ic)) == -1) return MISSING_UID; if (fport == ports[0] && lport == ports[1] && (!memcmp(&laddr4, locaddr, 4) || !memcmp(&zero, locaddr, 4)) && !memcmp(&faddr4, raddr, 4)) { break; } icp = ic.ipc_hash_next; if (!icp) { icp = alticp; alticp = NULL; } } if (!icp) return MISSING_UID; ret = getbuf(kip->kd, (off_t) ic.ipc_rq + offsetof(queue_t, q_stream), &sqr.q_stream, sizeof(sqr.q_stream)); if (ret == -1) return MISSING_UID; /* ** At this point sqr.qstream holds the pointer to the stream we're ** interested in. Now we're going to find the file pointer ** that refers to the vnode that refers to this stream stream */ if (kvm_setproc(kinfo->kd) != 0) return MISSING_UID; while ((procp = kvm_nextproc(kinfo->kd))) { struct uf_entry files[NFPCHUNK]; int nfiles = procp->p_user.u_nofiles; off_t addr = (off_t) procp->p_user.u_flist; while (nfiles > 0) { int nread = nfiles > NFPCHUNK ? NFPCHUNK : nfiles; int size = nread * sizeof(struct uf_entry); int i; struct file *last = NULL; vnode_t vp; if (getbuf(kinfo->kd, addr, &files[0], size) == -1) return MISSING_UID; for (i = 0; i < nread; ++i) { if (files[i].uf_ofile == 0 || files[i].uf_ofile == last) continue; last = files[i].uf_ofile; if (getbuf(kinfo->kd, (off_t) last, &tf, sizeof(tf)) == -1) return MISSING_UID; if (!tf.f_vnode) continue; ret = getbuf(kinfo->kd, (off_t) tf.f_vnode + offsetof(vnode_t, v_stream), &vp.v_stream, sizeof(vp.v_stream)); if (ret == -1) return MISSING_UID; if (vp.v_stream == sqr.q_stream) { cred_t cr; ret = getbuf(kinfo->kd, (off_t) tf.f_cred, &cr, sizeof(cr)); if (ret == -1) return MISSING_UID; return cr.cr_ruid; } } nfiles -= nread; addr += size; } } return MISSING_UID; } oidentd-2.5.0/src/kernel/legacy/darwin.c0000644000175000017500000002125113545375404015043 00000000000000/* ** darwin.c - Low level kernel access functions for Apple's Darwin OS. ** ** This is basically a modified version of the NetBSD file found in ** this directory. It's distributed under the same copyright. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** NAT code taken from the OpenBSD NAT code by ** Slawomir Piotrowski ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe ** ** All IPv6 code Copyright (c) 2002-2006 Ryan McCabe */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETINET_IP_COMPAT_H # include #endif #define KERNEL #include #undef KERNEL #if WANT_IPV6 # include # include # ifdef HAVE_NETINET6_IN6_PCB_H # include # endif #endif #if MASQ_SUPPORT # include # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" #define N_TCB 0 #define N_TCB6 1 #if MASQ_SUPPORT # define N_NATLIST 2 # define N_TOTAL 3 #else # define N_TOTAL 2 #endif extern struct sockaddr_storage proxy; static int getbuf(u_long addr, void *buf, size_t len); static struct socket *getlist4( struct inpcbhead *pcbhead, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr); static struct kainfo { kvm_t *kd; struct nlist nl[N_TOTAL]; } *kinfo; /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of Darwin is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of Darwin is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { free(kinfo); debug("kvm_open: %s", strerror(errno)); return -1; } kinfo->nl[N_TCB].n_name = "_tcb"; #if WANT_IPV6 kinfo->nl[N_TCB6].n_name = "_tcb6"; #else kinfo->nl[N_TCB6].n_name = "_oidentd_nonexistent"; #endif #if MASQ_SUPPORT if (opt_enabled(MASQ)) kinfo->nl[N_NATLIST].n_name = "_nat_instances"; else kinfo->nl[N_NATLIST].n_name = "NULL"; #endif kinfo->nl[N_TOTAL - 1].n_name = NULL; if (kvm_nlist(kinfo->kd, kinfo->nl) == -1) { kvm_close(kinfo->kd); free(kinfo); debug("kvm_nlist: %s", strerror(errno)); return -1; } #if MASQ_SUPPORT if (opt_enabled(MASQ) && kinfo->nl[N_NATLIST].n_value == 0) { o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable"); disable_opt(MASQ); } #endif return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 1 if call succeeded, else 0 (zero). */ static int getbuf(u_long addr, void *buf, size_t len) { if (kvm_read(kinfo->kd, addr, buf, len) < 0) { debug("getbuf: kvm_read(%08lx, %d): %s", addr, len, strerror(errno)); return -1; } return 0; } /* ** Traverse the inpcb list until a match is found. ** Returns NULL if no match. */ static struct socket *getlist4( struct inpcbhead *pcbhead, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr) { struct inpcb *pcbp, pcb; if (!pcbhead) return NULL; pcbp = pcbhead->lh_first; while (pcbp) { if (getbuf((u_long) pcbp, &pcb, sizeof(struct inpcb)) == -1) break; if (opt_enabled(PROXY)) { if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } } if (pcb.inp_faddr.s_addr == faddr->s_addr && pcb.inp_laddr.s_addr == laddr->s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } pcbp = pcb.inp_list.le_next; } return NULL; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct socket *sockp, sock; struct inpcbhead tcb; int ret; ret = getbuf(kinfo->nl[N_TCB].n_value, &tcb, sizeof(tcb)); if (ret == -1) return MISSING_UID; sockp = getlist4(&tcb, lport, fport, &SIN4(laddr)->sin_addr, &SIN4(faddr)->sin_addr); if (!sockp) return MISSING_UID; ret = getbuf((u_long) sockp, &sock, sizeof(sock)); if (ret == -1) return MISSING_UID; return sock.so_uid; } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { nat_t *np; nat_t nat; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; /* ** Only IPv4 is supported right now.. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; if (getbuf(kinfo->nl[N_NATLIST].n_value, &np, sizeof(np)) == -1) return -1; for (; np; np = nat.nat_next) { int retm; in_port_t masq_lport; in_port_t masq_fport; if (getbuf((u_long) np, &nat, sizeof(nat)) == -1) break; if (nat.nat_p != IPPROTO_TCP) continue; if (lport != nat.nat_outport) continue; if (fport != nat.nat_oport) continue; if (SIN4(laddr)->sin_addr.s_addr != nat.nat_outip.s_addr) continue; if (SIN4(faddr)->sin_addr.s_addr != nat.nat_oip.s_addr) { if (!opt_enabled(PROXY)) continue; if (SIN4(faddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr) continue; if (SIN4(laddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr) continue; } lport = ntohs(lport); fport = ntohs(fport); masq_lport = ntohs(nat.nat_inport); masq_fport = ntohs(nat.nat_outport); sin_setv4(nat.nat_inip.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) failed", ipbuf, nat.nat_inport, fport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } } return -1; } #endif #if WANT_IPV6 /* ** Traverse the tcb6 list until a match is found. ** Returns NULL if no match. */ static struct socket *getlist6( struct inpcbhead *pcbhead, in_port_t lport, in_port_t fport, const struct in6_addr *laddr, const struct in6_addr *faddr) { struct in6pcb *pcb6p, pcb6; if (!pcbhead) return NULL; pcb6p = pcbhead->lh_first; while (pcb6p) { if (getbuf((u_long) pcb6p, &pcb6, sizeof(struct in6pcb)) == -1) break; if (pcb6.in6p_fport == fport && pcb6.in6p_lport == lport && IN6_ARE_ADDR_EQUAL(&pcb6.in6p_laddr, laddr) && IN6_ARE_ADDR_EQUAL(&pcb6.in6p_faddr, faddr)) { return pcb6.in6p_socket; } pcb6p = pcb6.inp_list.le_next; } return NULL; } /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct socket *sockp, sock; struct inpcbhead pcb6; int ret; ret = getbuf(kinfo->nl[N_TCB6].n_value, &pcb6, sizeof(pcb6)); if (ret == -1) return MISSING_UID; sockp = getlist6(&pcb6, lport, fport, &SIN6(laddr)->sin6_addr, &SIN6(faddr)->sin6_addr); if (!sockp) return MISSING_UID; ret = getbuf((u_long) sockp, &sock, sizeof(sock)); if (ret == -1) return MISSING_UID; return sock.so_uid; } #endif oidentd-2.5.0/src/kernel/legacy/netbsd.c0000644000175000017500000002533713545375404015047 00000000000000/* ** netbsd.c - Low level kernel access functions for NetBSD. ** ** This file was originally taken from the pidentd 2.x software package. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** NAT code taken from the OpenBSD NAT code by ** Slawomir Piotrowski ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe ** ** All IPv6 code Copyright 2002-2006 Ryan McCabe */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __NetBSD_Version__ >= 399000300 /* 3.99.3 */ #define SO_UIDINFO /* "struct socket" contains so_uidinfo" */ #include #include #define _KERNEL 42 #include #undef _KERNEL #endif #if WANT_IPV6 # include # include # include # include # include # include #endif #if MASQ_SUPPORT # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" extern struct sockaddr_storage proxy; #define N_TCB 0 #define N_TCB6 1 #if MASQ_SUPPORT # define N_NATLIST 2 # define N_TOTAL 4 #else # define N_TOTAL 3 #endif static int getbuf(u_long addr, void *buf, size_t len); static struct socket *getlist4( struct inpcbtable *tcbtablep, struct inpcbtable *ktcbtablep, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr); static struct kainfo { kvm_t *kd; struct nlist nl[N_TOTAL]; } *kinfo; /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { #warning "Support for this version of NetBSD is deprecated and may be removed in the future" o_log(LOG_CRIT, "Support for this version of NetBSD is deprecated and may be removed in the future"); kinfo = xmalloc(sizeof(struct kainfo)); kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { free(kinfo); debug("kvm_open: %s", strerror(errno)); return -1; } kinfo->nl[N_TCB].n_name = "_tcbtable"; #if WANT_IPV6 #if __NetBSD_Version__ >= 106250000 /* 1.6Y */ kinfo->nl[N_TCB6].n_name = "_tcbtable"; #else kinfo->nl[N_TCB6].n_name = "_tcb6"; #endif #else kinfo->nl[N_TCB6].n_name = "_oidentd_nonexistent"; #endif #if MASQ_SUPPORT if (opt_enabled(MASQ)) kinfo->nl[N_NATLIST].n_name = "_nat_instances"; else kinfo->nl[N_NATLIST].n_name = "NULL"; #endif kinfo->nl[N_TOTAL - 1].n_name = NULL; if (kvm_nlist(kinfo->kd, kinfo->nl) == -1) { kvm_close(kinfo->kd); free(kinfo); debug("kvm_nlist: %s", strerror(errno)); return -1; } #if MASQ_SUPPORT if (opt_enabled(MASQ) && kinfo->nl[N_NATLIST].n_value == 0) { o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable"); disable_opt(MASQ); } #endif return 0; } /* ** Get a piece of kernel memory with error handling. ** Returns 1 if call succeeded, else 0 (zero). */ static int getbuf(u_long addr, void *buf, size_t len) { if (kvm_read(kinfo->kd, addr, buf, len) < 0) { debug("getbuf: kvm_read(%08lx, %d): %s", addr, len, strerror(errno)); return -1; } return 0; } /* ** Traverse the inpcb list until a match is found. ** Returns NULL if no match. */ static struct socket *getlist4( struct inpcbtable *tcbtablep, struct inpcbtable *ktcbtablep, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr) { struct inpcb *kpcbp, pcb; if (!tcbtablep) return NULL; kpcbp = (struct inpcb *) tcbtablep->inpt_queue.cqh_first; while (kpcbp != (struct inpcb *) ktcbtablep) { if (getbuf((u_long) kpcbp, &pcb, sizeof(struct inpcb)) == -1) break; if (opt_enabled(PROXY)) { if (faddr->s_addr == SIN4(&proxy)->sin_addr.s_addr && laddr->s_addr != SIN4(&proxy)->sin_addr.s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } } if (pcb.inp_faddr.s_addr == faddr->s_addr && pcb.inp_laddr.s_addr == laddr->s_addr && pcb.inp_fport == fport && pcb.inp_lport == lport) { return pcb.inp_socket; } kpcbp = (struct inpcb *) pcb.inp_queue.cqe_next; } return NULL; } /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct socket *sockp, sock; struct inpcbtable tcbtable; int ret; #ifdef SO_UIDINFO struct uidinfo uidinfo; #endif ret = getbuf(kinfo->nl[N_TCB].n_value, &tcbtable, sizeof(tcbtable)); if (ret == -1) return MISSING_UID; sockp = getlist4(&tcbtable, (struct inpcbtable *) kinfo->nl[N_TCB].n_value, lport, fport, &SIN4(laddr)->sin_addr, &SIN4(faddr)->sin_addr); if (!sockp) return MISSING_UID; if (getbuf((u_long) sockp, &sock, sizeof(sock)) == -1) return MISSING_UID; #ifdef SO_UIDINFO if (!sock.so_uidinfo) return MISSING_UID; if (getbuf((u_long) sock.so_uidinfo, &uidinfo, sizeof(uidinfo)) == -1) return MISSING_UID; return uidinfo.ui_uid; #else return sock.so_uid; #endif } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { nat_t *np; nat_t nat; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; /* ** Only IPv4 is supported right now.. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; if (getbuf(kinfo->nl[N_NATLIST].n_value, &np, sizeof(np)) == -1) return -1; for (; np; np = nat.nat_next) { in_port_t masq_lport; in_port_t masq_fport; int retm; if (getbuf((u_long) np, &nat, sizeof(nat)) == -1) break; if (nat.nat_p != IPPROTO_TCP) continue; if (lport != nat.nat_outport) continue; if (fport != nat.nat_oport) continue; if (SIN4(laddr)->sin_addr.s_addr != nat.nat_outip.s_addr) continue; if (SIN4(faddr)->sin_addr.s_addr != nat.nat_oip.s_addr) { if (!opt_enabled(PROXY)) continue; if (SIN4(faddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr) continue; if (SIN4(laddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr) continue; } lport = ntohs(lport); fport = ntohs(fport); masq_lport = ntohs(nat.nat_inport); masq_fport = ntohs(nat.nat_outport); sin_setv4(nat.nat_inip.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf; retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) failed", ipbuf, nat.nat_inport, fport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } } return -1; } #endif #if WANT_IPV6 /* ** Traverse the tcb6 list until a match is found. ** Returns NULL if no match. */ #if __NetBSD_Version__ >= 106250000 static struct socket *getlist6( struct inpcbtable *tcbtablep, struct inpcbtable *ktcbtablep, #else static struct socket *getlist6( struct in6pcb *tcb6, #endif in_port_t lport, in_port_t fport, const struct in6_addr *laddr, const struct in6_addr *faddr) { #if __NetBSD_Version__ >= 106250000 struct in6pcb *kpcbp, pcb; if (!tcbtablep) return NULL; kpcbp = (struct in6pcb *) tcbtablep->inpt_queue.cqh_first; while (kpcbp != (struct in6pcb *) ktcbtablep) { if (getbuf((u_long) kpcbp, &pcb, sizeof(struct in6pcb)) == -1) break; if (pcb.in6p_fport == fport && pcb.in6p_lport == lport && IN6_ARE_ADDR_EQUAL(&pcb.in6p_laddr, laddr) && IN6_ARE_ADDR_EQUAL(&pcb.in6p_faddr, faddr)) { return pcb.in6p_socket; } kpcbp = (struct in6pcb *) pcb.in6p_queue.cqe_next; } #else struct in6pcb *tcb6_cur, tcb6_temp; if (!tcb6) return NULL; tcb6_cur = tcb6; memcpy(&tcb6_temp, tcb6, sizeof(tcb6_temp)); do { if (tcb6_temp.in6p_fport == fport && tcb6_temp.in6p_lport == lport && IN6_ARE_ADDR_EQUAL(&tcb6_temp.in6p_laddr, laddr) && IN6_ARE_ADDR_EQUAL(&tcb6_temp.in6p_faddr, faddr)) { return tcb6_temp.in6p_socket; } tcb6_cur = tcb6_temp.in6p_next; if (getbuf((u_long) tcb6_cur, &tcb6_temp, sizeof(tcb6_temp)) == -1) break; } while ((u_long) tcb6_cur != kinfo->nl[N_TCB6].n_value); #endif return NULL; } /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { #if __NetBSD_Version__ >= 106250000 /* 1.6Y */ struct socket *sockp, sock; struct inpcbtable tcbtable; int ret; #ifdef SO_UIDINFO struct uidinfo uidinfo; #endif ret = getbuf(kinfo->nl[N_TCB6].n_value, &tcbtable, sizeof(tcbtable)); if (ret == -1) return MISSING_UID; sockp = getlist6(&tcbtable, (struct inpcbtable *) kinfo->nl[N_TCB6].n_value, lport, fport, &SIN6(laddr)->sin6_addr, &SIN6(faddr)->sin6_addr); #else struct socket *sockp, sock; struct in6pcb tcb6; int ret; ret = getbuf(kinfo->nl[N_TCB6].n_value, &tcb6, sizeof(tcb6)); if (ret == -1) return MISSING_UID; sockp = getlist6(&tcb6, lport, fport, &SIN6(laddr)->sin6_addr, &SIN6(faddr)->sin6_addr); #endif if (!sockp) return MISSING_UID; if (getbuf((u_long) sockp, &sock, sizeof(sock)) == -1) return MISSING_UID; #ifdef SO_UIDINFO if (!sock.so_uidinfo) return MISSING_UID; if (getbuf((u_long) sock.so_uidinfo, &uidinfo, sizeof(uidinfo)) == -1) return MISSING_UID; return uidinfo.ui_uid; #else return sock.so_uid; #endif } #endif oidentd-2.5.0/src/kernel/linux.c0000644000175000017500000005214313555260367013460 00000000000000/* ** linux.c - Linux user lookup facility. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "user_db.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" #include "netlink.h" #if !MASQ_SUPPORT # undef LIBNFCT_SUPPORT #endif #if LIBNFCT_SUPPORT # include #endif #if HAVE_LIBUDB # include #endif #define CFILE "/proc/net/tcp" #define CFILE6 "/proc/net/tcp6" #define MASQFILE "/proc/net/ip_masquerade" #define IPCONNTRACK "/proc/net/ip_conntrack" #define NFCONNTRACK "/proc/net/nf_conntrack" static int netlink_sock; extern struct sockaddr_storage proxy; extern char *ret_os; #if LIBNFCT_SUPPORT struct ct_masq_query { int sock; in_port_t lport; in_port_t fport; struct sockaddr_storage *laddr; struct sockaddr_storage *faddr; int status; }; #endif #if MASQ_SUPPORT static int masq_ct_line(char *line, int sock, int ct_type, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); #endif #if LIBNFCT_SUPPORT static bool dispatch_libnfct_query(struct ct_masq_query *queryp); static int callback_nfct(enum nf_conntrack_msg_type type, struct nf_conntrack *ct, void *data); #endif static uid_t lookup_tcp_diag( struct sockaddr_storage *src_addr, struct sockaddr_storage *dst_addr, in_port_t src_port, in_port_t dst_port); #if MASQ_SUPPORT enum { CT_UNKNOWN, CT_MASQFILE, CT_IPCONNTRACK, CT_NFCONNTRACK, }; FILE *masq_fp; static int conntrack = CT_UNKNOWN; #endif #if LIBNFCT_SUPPORT static bool dispatch_libnfct_query(struct ct_masq_query *queryp) { struct nfct_handle *nfcthp = nfct_open(CONNTRACK, 0); if (!nfcthp) { debug("nfct_open: %s", strerror(errno)); return false; } if (nfct_callback_register(nfcthp, NFCT_T_ALL, callback_nfct, (void *) queryp)) { debug("nfct_callback_register: %s", strerror(errno)); return false; } if (nfct_query(nfcthp, NFCT_Q_DUMP, &queryp->faddr->ss_family)) { debug("nfct_query: %s", strerror(errno)); return false; } if (nfct_close(nfcthp)) { debug("nfct_close: %s", strerror(errno)); return false; } return !queryp->status; } /* ** Callback for libnetfilter_conntrack queries */ static int callback_nfct(enum nf_conntrack_msg_type type __notused, struct nf_conntrack *ct, void *data) { char buf[1024]; struct ct_masq_query *query; int ret; nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, NFCT_OF_SHOW_LAYER3); query = (struct ct_masq_query *) data; ret = masq_ct_line(buf, query->sock, CT_NFCONNTRACK, query->lport, query->fport, query->laddr, query->faddr); if (ret == 1) return NFCT_CB_CONTINUE; query->status = ret; return NFCT_CB_STOP; } #endif /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { #if MASQ_SUPPORT if (!opt_enabled(MASQ)) { masq_fp = NULL; return 0; } masq_fp = fopen(MASQFILE, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", MASQFILE, strerror(errno)); return -1; } masq_fp = fopen(NFCONNTRACK, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", NFCONNTRACK, strerror(errno)); return -1; } masq_fp = fopen(IPCONNTRACK, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", IPCONNTRACK, strerror(errno)); return -1; } # if LIBNFCT_SUPPORT return 0; # else o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable " "because " PACKAGE_NAME " was compiled without " "libnetfilter_conntrack support and no " "connection tracking file was found."); disable_opt(MASQ); # endif } else { conntrack = CT_IPCONNTRACK; o_log(LOG_CRIT, "Support for " IPCONNTRACK " will be removed in a " "future release. Please update your kernel."); } } else { conntrack = CT_NFCONNTRACK; } } else if (opt_enabled(PROXY) || opt_enabled(FORWARD)) { o_log(LOG_CRIT, "Only local NAT is supported on your system; " "please consider upgrading your kernel"); return -1; } else { o_log(LOG_CRIT, "Support for " MASQFILE " will be removed in a " "future release. Please update your kernel."); conntrack = CT_MASQFILE; } #endif return 0; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { FILE *fp; char buf[1024]; if (netlink_sock != -1) { uid_t uid = lookup_tcp_diag(laddr, faddr, lport, fport); if (uid != MISSING_UID) return uid; } lport = ntohs(lport); fport = ntohs(fport); fp = fopen(CFILE6, "r"); if (!fp) { debug("fopen: %s: %s", CFILE6, strerror(errno)); return MISSING_UID; } /* Eat the header line. */ if (!fgets(buf, sizeof(buf), fp)) { debug("fgets: %s: Could not read header", CFILE6); fclose(fp); return MISSING_UID; } while (fgets(buf, sizeof(buf), fp)) { struct in6_addr remote6; struct in6_addr local6; u_int32_t portl_temp; u_int32_t portf_temp; in_port_t portl; in_port_t portf; unsigned long uid; unsigned long inode; int ret; ret = sscanf(buf, "%*d: %8x%8x%8x%8x:%x %8x%8x%8x%8x:%x %*x %*X:%*X %*x:%*X %*x %lu %*d %lu", &local6.s6_addr32[0], &local6.s6_addr32[1], &local6.s6_addr32[2], &local6.s6_addr32[3], &portl_temp, &remote6.s6_addr32[0], &remote6.s6_addr32[1], &remote6.s6_addr32[2], &remote6.s6_addr32[3], &portf_temp, &uid, &inode); if (ret != 12) continue; portl = (in_port_t) portl_temp; portf = (in_port_t) portf_temp; if (!memcmp(&local6, sin_addr(laddr), sizeof(local6)) && !memcmp(&remote6, sin_addr(faddr), sizeof(remote6)) && portl == lport && portf == fport) { fclose(fp); if (inode == 0 && uid == 0) return MISSING_UID; return (uid_t) uid; } } fclose(fp); return MISSING_UID; } #endif /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { unsigned long uid; unsigned long inode; FILE *fp; char buf[1024]; in_addr_t laddr4; in_addr_t faddr4; if (netlink_sock != -1) { uid_t nluid = lookup_tcp_diag(laddr, faddr, lport, fport); if (nluid != MISSING_UID) return nluid; } laddr4 = SIN4(laddr)->sin_addr.s_addr; faddr4 = SIN4(faddr)->sin_addr.s_addr; lport = ntohs(lport); fport = ntohs(fport); fp = fopen(CFILE, "r"); if (!fp) { debug("fopen: %s: %s", CFILE, strerror(errno)); return MISSING_UID; } /* Eat the header line. */ if (!fgets(buf, sizeof(buf), fp)) { debug("fgets: %s: Could not read header", CFILE); fclose(fp); return MISSING_UID; } /* ** The line should never be longer than 1024 chars, so fgets should be OK. */ while (fgets(buf, sizeof(buf), fp)) { int ret; u_int32_t portl_temp; u_int32_t portf_temp; in_port_t portl; in_port_t portf; in_addr_t local; in_addr_t remote; ret = sscanf(buf, "%*d: %x:%x %x:%x %*x %*x:%*x %*x:%*x %*x %lu %*d %lu", &local, &portl_temp, &remote, &portf_temp, &uid, &inode); if (ret != 6) continue; portl = (in_port_t) portl_temp; portf = (in_port_t) portf_temp; if (opt_enabled(PROXY)) { if (faddr4 == SIN4(&proxy)->sin_addr.s_addr && remote != SIN4(&proxy)->sin_addr.s_addr && lport == portl && fport == portf) { goto out_success; } } if (local == laddr4 && remote == faddr4 && portl == lport && portf == fport) { goto out_success; } } fclose(fp); return MISSING_UID; out_success: fclose(fp); /* ** If the inode is zero, the socket is dead, and its owner ** has probably been set to root. It would be incorrect ** to return a successful response here. */ if (inode == 0 && uid == 0) return MISSING_UID; return (uid_t) uid; } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { char buf[1024]; #if LIBNFCT_SUPPORT struct ct_masq_query query; #endif lport = ntohs(lport); fport = ntohs(fport); #if LIBNFCT_SUPPORT query = (struct ct_masq_query) { sock, lport, fport, laddr, faddr, 1 }; if (dispatch_libnfct_query(&query)) return 0; #endif if (masq_fp) { /* rewind fp to read new contents */ rewind(masq_fp); if (conntrack == CT_MASQFILE) { /* eat the header line */ if (!fgets(buf, sizeof(buf), masq_fp)) { debug("fgets: conntrack file: Could not read header"); return -1; } } while (fgets(buf, sizeof(buf), masq_fp)) { int ret = masq_ct_line(buf, sock, conntrack, lport, fport, laddr, faddr); if (ret == 1) continue; return ret; } } else if (conntrack != CT_UNKNOWN) debug("Connection tracking file is in use but not open"); return -1; } /* ** Process a connection tracking file entry. ** The lport and fport arguments are in host byte order. ** Returns -1 if an error occurred. ** Returns 0 if the entry matched and the request has been handled. ** Returns 1 if the entry did not match the query. **/ static int masq_ct_line(char *line, int sock, int ct_type, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { char os[24]; char family[16]; char proto[16]; in_port_t mport; in_port_t nport; in_port_t masq_lport; in_port_t masq_fport; char user[MAX_ULEN]; struct sockaddr_storage localm_ss; struct sockaddr_storage remotem_ss; struct sockaddr_storage localn_ss; struct sockaddr_storage remoten_ss; int ret; if (ct_type == CT_MASQFILE) { in_addr_t localm4; in_addr_t remotem4; u_int32_t mport_temp; u_int32_t nport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; if (faddr->ss_family != AF_INET) return -1; ret = sscanf(line, "%15s %X:%X %X:%X %X %X %*d %*d %*u", proto, &localm4, &masq_lport_temp, &remotem4, &masq_fport_temp, &mport_temp, &nport_temp); if (ret != 7) return 1; mport = (in_port_t) mport_temp; nport = (in_port_t) nport_temp; masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); /* Assume local NAT. */ sin_setv4(localm4, &remoten_ss); sin_setv4(remotem4, &localn_ss); } else if (ct_type == CT_IPCONNTRACK) { unsigned int ml1, ml2, ml3, ml4, mr1, mr2, mr3, mr4; unsigned int nl1, nl2, nl3, nl4, nr1, nr2, nr3, nr4; in_addr_t localm4; in_addr_t remotem4; in_addr_t localn4; in_addr_t remoten4; u_int32_t nport_temp; u_int32_t mport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; if (faddr->ss_family != AF_INET) return -1; ret = sscanf(line, "%15s %*d %*d ESTABLISHED" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u", proto, &ml1, &ml2, &ml3, &ml4, &mr1, &mr2, &mr3, &mr4, &masq_lport_temp, &masq_fport_temp, &nl1, &nl2, &nl3, &nl4, &nr1, &nr2, &nr3, &nr4, &nport_temp, &mport_temp); if (ret != 21) { ret = sscanf(line, "%15s %*d %*d ESTABLISHED" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u" " packets=%*d bytes=%*d" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u", proto, &ml1, &ml2, &ml3, &ml4, &mr1, &mr2, &mr3, &mr4, &masq_lport_temp, &masq_fport_temp, &nl1, &nl2, &nl3, &nl4, &nr1, &nr2, &nr3, &nr4, &nport_temp, &mport_temp); } if (ret != 21) return 1; masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; nport = (in_port_t) nport_temp; mport = (in_port_t) mport_temp; localm4 = ml1 << 24 | ml2 << 16 | ml3 << 8 | ml4; remotem4 = mr1 << 24 | mr2 << 16 | mr3 << 8 | mr4; localn4 = nl1 << 24 | nl2 << 16 | nl3 << 8 | nl4; remoten4 = nr1 << 24 | nr2 << 16 | nr3 << 8 | nr4; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); sin_setv4(localn4, &localn_ss); sin_setv4(remoten4, &remoten_ss); } else if (ct_type == CT_NFCONNTRACK) { char ml[MAX_IPLEN]; char mr[MAX_IPLEN]; char nl[MAX_IPLEN]; char nr[MAX_IPLEN]; in_addr_t localm4; in_addr_t remotem4; in_addr_t localn4; in_addr_t remoten4; struct in6_addr localm6; struct in6_addr remotem6; struct in6_addr localn6; struct in6_addr remoten6; u_int32_t nport_temp; u_int32_t mport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; ret = sscanf(line, "%15s %*d %15s %*d %*d ESTABLISHED" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d" " packets=%*d bytes=%*d" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d", family, proto, ml, mr, &masq_lport_temp, &masq_fport_temp, nl, nr, &nport_temp, &mport_temp); /* Added to handle /proc/sys/net/netfilter/nf_conntrack_acct = 0 */ if (ret != 10) { ret = sscanf(line, "%15s %*d %15s %*d %*d ESTABLISHED" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d", family, proto, ml, mr, &masq_lport_temp, &masq_fport_temp, nl, nr, &nport_temp, &mport_temp); } if (ret != 10) return 1; switch (faddr->ss_family) { case AF_INET: if (strcasecmp(family, "ipv4")) return 1; if (inet_pton(AF_INET, ml, &localm4) < 0 || inet_pton(AF_INET, mr, &remotem4) < 0 || inet_pton(AF_INET, nl, &localn4) < 0 || inet_pton(AF_INET, nr, &remoten4) < 0) return 1; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); sin_setv4(localn4, &localn_ss); sin_setv4(remoten4, &remoten_ss); break; case AF_INET6: if (strcasecmp(family, "ipv6")) return 1; if (inet_pton(AF_INET6, ml, &localm6) < 0 || inet_pton(AF_INET6, mr, &remotem6) < 0 || inet_pton(AF_INET6, nl, &localn6) < 0 || inet_pton(AF_INET6, nr, &remoten6) < 0) return 1; sin_setv6(&localm6, &localm_ss); sin_setv6(&remotem6, &remotem_ss); sin_setv6(&localn6, &localn_ss); sin_setv6(&remoten6, &remoten_ss); break; default: debug("masq_ct_line: bad address family %d", faddr->ss_family); return -1; } masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; nport = (in_port_t) nport_temp; mport = (in_port_t) mport_temp; } else return -1; if (strcasecmp(proto, "tcp")) return 1; if (mport != lport) return 1; if (nport != fport) return 1; /* Local NAT, don't forward or do masquerade entry lookup. */ if (sin_equal(&localm_ss, &remoten_ss)) { uid_t con_uid = MISSING_UID; struct passwd *pw; char suser[MAX_ULEN]; char ipbuf[MAX_IPLEN]; get_ip(faddr, ipbuf, sizeof(ipbuf)); if (con_uid == MISSING_UID && faddr->ss_family == AF_INET) con_uid = get_user4(htons(masq_lport), htons(masq_fport), laddr, &remotem_ss); if (con_uid == MISSING_UID && faddr->ss_family == AF_INET6) con_uid = get_user6(htons(masq_lport), htons(masq_fport), laddr, &remotem_ss); if (con_uid == MISSING_UID) return -1; pw = getpwuid(con_uid); if (!pw) { sockprintf(sock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("NO-USER")); debug("getpwuid(%lu): %s", (unsigned long) con_uid, strerror(errno)); return 0; } ret = get_ident(pw, masq_lport, masq_fport, laddr, &remotem_ss, suser, sizeof(suser)); if (ret == -1) { sockprintf(sock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("HIDDEN-USER")); o_log(LOG_INFO, "[%s] %d (%d) , %d (%d) : HIDDEN-USER (%s)", ipbuf, lport, masq_lport, fport, masq_fport, pw->pw_name); return 0; } sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, ret_os, suser); o_log(LOG_INFO, "[%s] Successful lookup: %d (%d) , %d (%d) : %s (%s)", ipbuf, lport, masq_lport, fport, masq_fport, pw->pw_name, suser); return 0; } if (!sin_equal(&localn_ss, faddr)) { if (!opt_enabled(PROXY)) return 1; if (!sin_equal(faddr, &proxy)) return 1; if (sin_equal(&localn_ss, &proxy)) return 1; } ret = find_masq_entry(&localm_ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (ret != 0 || !opt_enabled(MASQ_OVERRIDE))) { char ipbuf[MAX_IPLEN]; if (fwd_request(sock, lport, masq_lport, fport, masq_fport, &localm_ss) == 0) return 0; get_ip(&localm_ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) failed", ipbuf, masq_lport, fport); } if (ret == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (Masqueraded) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } return -1; } #endif /* ** Much of the code for this function has been borrowed from ** a patch to pidentd written by Alexey Kuznetsov ** and distributed with the iproute2 package. ** ** Ryan McCabe has made some cleanups and converted the ** routine to support both IPv4 and IPv6 queries. */ static uid_t lookup_tcp_diag( struct sockaddr_storage *src_addr, struct sockaddr_storage *dst_addr, in_port_t src_port, in_port_t dst_port) { struct sockaddr_nl nladdr; struct { struct nlmsghdr nlh; struct tcpdiagreq r; } req; size_t addr_len = sin_addr_len(dst_addr); struct iovec iov[1]; struct msghdr msghdr; char buf[8192]; memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; req.nlh.nlmsg_len = sizeof(req); req.nlh.nlmsg_type = TCPDIAG_GETSOCK; req.nlh.nlmsg_flags = NLM_F_REQUEST; req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_seq = 1; memset(&req.r, 0, sizeof(req.r)); req.r.tcpdiag_states = ~0U; req.r.tcpdiag_family = dst_addr->ss_family; memcpy(&req.r.id.tcpdiag_dst, sin_addr(dst_addr), addr_len); memcpy(&req.r.id.tcpdiag_src, sin_addr(src_addr), addr_len); req.r.id.tcpdiag_dport = dst_port; req.r.id.tcpdiag_sport = src_port; req.r.id.tcpdiag_cookie[0] = TCPDIAG_NOCOOKIE; req.r.id.tcpdiag_cookie[1] = TCPDIAG_NOCOOKIE; iov[0].iov_base = &req; iov[0].iov_len = sizeof(req); msghdr.msg_name = &nladdr; msghdr.msg_namelen = sizeof(nladdr); msghdr.msg_iov = iov; msghdr.msg_iovlen = 1; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; msghdr.msg_flags = 0; if (sendmsg(netlink_sock, &msghdr, 0) < 0) { if (errno == ECONNREFUSED) { close(netlink_sock); netlink_sock = -1; } return MISSING_UID; } iov[0].iov_base = buf; iov[0].iov_len = sizeof(buf); while (1) { ssize_t ret; size_t uret; struct nlmsghdr *h; msghdr.msg_name = &nladdr; msghdr.msg_namelen = sizeof(nladdr); msghdr.msg_iov = iov; msghdr.msg_iovlen = 1; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; msghdr.msg_flags = 0; ret = recvmsg(netlink_sock, &msghdr, 0); if (ret < 0) { if (errno == EINTR || errno == EAGAIN) continue; return MISSING_UID; } if (ret == 0) return MISSING_UID; h = (struct nlmsghdr *) buf; uret = (size_t) ret; while (NLMSG_OK(h, uret)) { struct tcpdiagmsg *r; if (h->nlmsg_seq != 1) { h = NLMSG_NEXT(h, uret); continue; } if (h->nlmsg_type == NLMSG_DONE || h->nlmsg_type == NLMSG_ERROR) return MISSING_UID; r = NLMSG_DATA(h); if (r->id.tcpdiag_dport == dst_port && r->id.tcpdiag_sport == src_port && !memcmp(r->id.tcpdiag_dst, sin_addr(dst_addr), addr_len) && !memcmp(r->id.tcpdiag_src, sin_addr(src_addr), addr_len)) { if (r->tcpdiag_inode == 0 && r->tcpdiag_uid == 0) return MISSING_UID; return r->tcpdiag_uid; } return MISSING_UID; } if ((msghdr.msg_flags & MSG_TRUNC) || uret != 0) return MISSING_UID; } return MISSING_UID; } /* ** Just open a netlink socket here. */ /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; open a Netlink socket instead. */ int k_open(void) { netlink_sock = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_TCPDIAG); if (netlink_sock == -1) { /* Not a fatal error, just log a debug message */ debug("Failed to open netlink socket: %s", strerror(errno)); } return 0; } oidentd-2.5.0/src/kernel/freebsd.c0000644000175000017500000002556613545375404013742 00000000000000/* ** freebsd.c - Low level kernel access functions for FreeBSD. ** ** This file was originally taken from the pidentd 2.x software package. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** The IP masquerading functionality has been taken from openbsd.c and ** is distributed under the same copyright. ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define KERNEL #define _KERNEL #include #undef KERNEL #undef _KERNEL #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if MASQ_SUPPORT # include # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" #include "masq.h" extern struct sockaddr_storage proxy; #ifdef INPLOOKUP_SETLOCAL # define _HAVE_OLD_INPCB #endif #define N_TCB 0 #if MASQ_SUPPORT # define N_NATLIST 1 # define N_TOTAL 3 #else # define N_TOTAL 2 #endif static int getbuf(u_long addr, void *buf, size_t len); static struct socket *getlist4( void *arg, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr); static struct kainfo { kvm_t *kd; struct nlist nl[N_TOTAL]; } *kinfo; /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { kinfo = xmalloc(sizeof(struct kainfo)); kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { free(kinfo); debug("kvm_open: %s", strerror(errno)); return -1; } kinfo->nl[N_TCB].n_name = "_tcb"; #if MASQ_SUPPORT if (opt_enabled(MASQ)) kinfo->nl[N_NATLIST].n_name = "_nat_instances"; else kinfo->nl[N_NATLIST].n_name = NULL; #endif kinfo->nl[N_TOTAL - 1].n_name = NULL; if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { kvm_close(kinfo->kd); free(kinfo); debug("kvm_nlist: %s", strerror(errno)); return -1; } #if MASQ_SUPPORT if (opt_enabled(MASQ) && kinfo->nl[N_NATLIST].n_value == 0) { o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable"); disable_opt(MASQ); } #endif return 0; } /* ** Get a piece of kernel memory. ** Returns 0 on success, -1 on failure. */ static int getbuf(u_long addr, void *buf, size_t len) { if (kvm_read(kinfo->kd, addr, buf, len) < 0) { debug("getbuf: kvm_read: %s", strerror(errno)); return -1; } return 0; } /* ** Traverse the inpcb list until a match is found. ** Returns NULL if no match. */ #ifdef _HAVE_OLD_INPCB static struct socket *getlist( void *arg, in_port_t lport, in_port_t fport, const struct sockaddr *laddr, const struct sockaddr *faddr) { struct inpcb *pcbp = arg; struct inpcb *head; if (!pcbp) return NULL; head = pcbp->inp_prev; do { if (opt_enabled(PROXY)) { if (SIN4(faddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && SIN4(laddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && pcbp->inp_fport == fport && pcbp->inp_lport == lport) { return pcb.inp_socket; } } if (pcbp->inp_faddr.s_addr == SIN4(faddr)->sin_addr.s_addr && pcbp->inp_laddr.s_addr == SIN4(laddr)->sin_addr.s_addr && pcbp->inp_fport == fport && pcbp->inp_lport == lport) { return pcbp->inp_socket; } } while (pcbp->inp_next != head && getbuf((u_long) pcbp->inp_next, pcbp, sizeof(struct inpcb)) != -1); return NULL; } #else static struct socket *getlist( void *arg, in_port_t lport, in_port_t fport, const struct sockaddr *local, const struct sockaddr *remote) { struct inpcb *head, pcbp; struct inpcbhead *pcbhead = arg; char *faddr, *laddr; if (remote->sa_family != local->sa_family) return NULL; switch (remote->sa_family) { case AF_INET: faddr = (char *)&SIN4(remote)->sin_addr; laddr = (char *)&SIN4(local)->sin_addr; break; #ifdef INP_IPV6 case AF_INET6: faddr = (char *)&SIN6(remote)->sin6_addr; laddr = (char *)&SIN6(local)->sin6_addr; break; #endif default: return NULL; } head = pcbhead->lh_first; if (!head) return NULL; for (; head; head = pcbp.inp_list.le_next) { char *pfaddr, *pladdr; int alen; if (getbuf((u_long) head, &pcbp, sizeof(struct inpcb)) == -1) break; if (opt_enabled(PROXY) && remote->sa_family == AF_INET) { if (SIN4(remote)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && SIN4(local)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && pcbp.inp_fport == fport && pcbp.inp_lport == lport) { return pcbp.inp_socket; } } #ifdef INP_IPV6 if (pcbp.inp_vflag & INP_IPV4) { if (remote->sa_family != AF_INET) continue; pfaddr = (char *)&pcbp.inp_faddr; pladdr = (char *)&pcbp.inp_laddr; alen = sizeof(struct in_addr); } else if (pcbp.inp_vflag & INP_IPV6) { if (remote->sa_family != AF_INET6) continue; pfaddr = (char *)&pcbp.in6p_faddr; pladdr = (char *)&pcbp.in6p_laddr; alen = sizeof(struct in6_addr); } else continue; #else pfaddr = (char *)&pcbp.inp_faddr; pladdr = (char *)&pcbp.inp_laddr; alen = sizeof(struct in_addr); #endif if (memcmp(pfaddr, faddr, alen) == 0 && memcmp(pladdr, laddr, alen) == 0 && pcbp.inp_fport == fport && pcbp.inp_lport == lport) { return pcbp.inp_socket; } } return NULL; } #endif /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Return the UID of the connection owner */ static uid_t get_user( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct kinfo_proc *kp; struct socket *sockp; int i; int nentries; #ifdef _HAVE_OLD_INPCB struct inpcb tcb; #else struct inpcbhead tcb; #endif kp = kvm_getprocs(kinfo->kd, KERN_PROC_ALL, 0, &nentries); if (!kp) { debug("kvm_getprocs: %s", strerror(errno)); return MISSING_UID; } if (getbuf(kinfo->nl[N_TCB].n_value, &tcb, sizeof(tcb)) == -1) return MISSING_UID; #ifdef _HAVE_OLD_INPCB tcb.inp_prev = (struct inpcb *) kinfo->nl[N_TCB].n_value; #endif sockp = getlist(&tcb, lport, fport, (struct sockaddr *)laddr, (struct sockaddr *)faddr); if (!sockp) return MISSING_UID; /* ** Locate the file descriptor that has the socket in question ** open so that we can get the 'ucred' information */ for (i = 0; i < nentries; ++i) { if (kp[i].kp_proc.p_fd) { int j; int ret; struct filedesc pfd; struct file **ofiles; if (getbuf((u_long) kp[i].kp_proc.p_fd, &pfd, sizeof(pfd)) == -1) return MISSING_UID; ofiles = xmalloc(pfd.fd_nfiles * sizeof(struct file *)); ret = getbuf((u_long) pfd.fd_ofiles, ofiles, pfd.fd_nfiles * sizeof(struct file *)); if (ret == -1) { free(ofiles); return MISSING_UID; } for (j = 0; j < pfd.fd_nfiles; ++j) { struct file ofile; if (!ofiles[j]) continue; ret = getbuf((u_long) ofiles[j], &ofile, sizeof(struct file)); if (ret == -1) { free(ofiles); return MISSING_UID; } if (ofile.f_count == 0) continue; if (ofile.f_type == DTYPE_SOCKET && (struct socket *) ofile.f_data == sockp) { struct pcred pc; ret = getbuf((u_long) kp[i].kp_proc.p_cred, &pc, sizeof(pc)); if (ret == -1) { free(ofiles); return MISSING_UID; } free(ofiles); return pc.p_ruid; } } free(ofiles); } } return MISSING_UID; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { return get_user(lport, fport, laddr, faddr); } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { nat_t *np; nat_t nat; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; /* ** Only IPv4 is supported right now.. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; if (getbuf(kinfo->nl[N_NATLIST].n_value, &np, sizeof(np)) == -1) return -1; for (; np; np = nat.nat_next) { in_port_t masq_lport; in_port_t masq_fport; int retm; if (getbuf((u_long) np, &nat, sizeof(nat)) == -1) { debug("getbuf: %s", strerror(errno)); break; } if (nat.nat_p != IPPROTO_TCP) continue; if (lport != nat.nat_outport) continue; if (fport != nat.nat_oport) continue; if (SIN4(laddr)->sin_addr.s_addr != nat.nat_outip.s_addr) continue; if (SIN4(faddr)->sin_addr.s_addr != nat.nat_oip.s_addr) { if (!opt_enabled(PROXY)) continue; if (SIN4(faddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr) continue; if (SIN4(laddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr) continue; } lport = ntohs(lport); fport = ntohs(fport); masq_lport = ntohs(nat.nat_inport); masq_fport = ntohs(nat.nat_outport); sin_setv4(nat.nat_inip.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf; retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d | %d %d) failed", ipbuf, lport, fport, nat.nat_inport, nat.nat_outport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } } return -1; } #endif #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { return get_user(lport, fport, laddr, faddr); } #endif oidentd-2.5.0/src/kernel/freebsd5.c0000644000175000017500000002472313545375404014021 00000000000000/* ** freebsd.c - Low level kernel access functions for FreeBSD. ** ** This file was originally taken from the pidentd 2.x software package. ** The original copyright notice is as follows: ** ** This program is in the public domain and may be used freely ** by anyone who wants to. ** ** The IP masquerading functionality has been taken from openbsd.c and ** is distributed under the same copyright. ** ** Modifications Copyright (c) 1998-2006 Ryan McCabe ** Modifications Copyright (c) 2018-2019 Janik Rabe */ #define _WANT_UCRED #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define KERNEL #define _KERNEL #include #undef KERNEL #undef _KERNEL #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if MASQ_SUPPORT # include # include # include #endif #include "oidentd.h" #include "util.h" #include "inet_util.h" #include "missing.h" #include "options.h" #include "masq.h" extern struct sockaddr_storage proxy; #ifdef INPLOOKUP_SETLOCAL # define _HAVE_OLD_INPCB #endif #define N_TCB 0 #if MASQ_SUPPORT # define N_NATLIST 1 # define N_TOTAL 3 #else # define N_TOTAL 2 #endif static int getbuf(u_long addr, void *buf, size_t len); static struct socket *getlist4( void *arg, in_port_t lport, in_port_t fport, const struct in_addr *laddr, const struct in_addr *faddr); static struct kainfo { kvm_t *kd; struct nlist nl[N_TOTAL]; } *kinfo; /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void) { kinfo = xmalloc(sizeof(struct kainfo)); kinfo->kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL); if (!kinfo->kd) { free(kinfo); debug("kvm_open: %s", strerror(errno)); return -1; } kinfo->nl[N_TCB].n_name = "_tcb"; #if MASQ_SUPPORT if (opt_enabled(MASQ)) kinfo->nl[N_NATLIST].n_name = "_nat_instances"; else kinfo->nl[N_NATLIST].n_name = NULL; #endif kinfo->nl[N_TOTAL - 1].n_name = NULL; if (kvm_nlist(kinfo->kd, kinfo->nl) != 0) { kvm_close(kinfo->kd); free(kinfo); debug("kvm_nlist: %s", strerror(errno)); return -1; } #if MASQ_SUPPORT if (opt_enabled(MASQ) && kinfo->nl[N_NATLIST].n_value == 0) { o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable"); disable_opt(MASQ); } #endif return 0; } /* ** Get a piece of kernel memory. ** Returns 0 on success, -1 on failure. */ static int getbuf(u_long addr, void *buf, size_t len) { if (kvm_read(kinfo->kd, addr, buf, len) < 0) { debug("getbuf: kvm_read: %s", strerror(errno)); return -1; } return 0; } /* ** Traverse the inpcb list until a match is found. ** Returns NULL if no match. */ #ifdef _HAVE_OLD_INPCB static struct socket *getlist( void *arg, in_port_t lport, in_port_t fport, const struct sockaddr *laddr, const struct sockaddr *faddr) { struct inpcb *pcbp = arg; struct inpcb *head; if (!pcbp) return NULL; head = pcbp->inp_prev; do { if (opt_enabled(PROXY)) { if (SIN4(faddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && SIN4(laddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && pcbp->inp_fport == fport && pcbp->inp_lport == lport) { return pcb.inp_socket; } } if (pcbp->inp_faddr.s_addr == SIN4(faddr)->sin_addr.s_addr && pcbp->inp_laddr.s_addr == SIN4(laddr)->sin_addr.s_addr && pcbp->inp_fport == fport && pcbp->inp_lport == lport) { return pcbp->inp_socket; } } while (pcbp->inp_next != head && getbuf((u_long) pcbp->inp_next, pcbp, sizeof(struct inpcb)) != -1); return NULL; } #else static struct socket *getlist( void *arg, in_port_t lport, in_port_t fport, const struct sockaddr *local, const struct sockaddr *remote) { struct inpcb *head, pcbp; struct inpcbhead *pcbhead = arg; char *faddr, *laddr, *pfaddr, *pladdr; int alen; if (remote->sa_family != local->sa_family) return NULL; switch (remote->sa_family) { case AF_INET: faddr = (char *)&SIN4(remote)->sin_addr; laddr = (char *)&SIN4(local)->sin_addr; break; case AF_INET6: faddr = (char *)&SIN6(remote)->sin6_addr; laddr = (char *)&SIN6(local)->sin6_addr; break; default: return NULL; } head = pcbhead->lh_first; if (!head) return NULL; do { if (getbuf((u_long) head, &pcbp, sizeof(struct inpcb)) == -1) break; if (opt_enabled(PROXY) && remote->sa_family == AF_INET) { if (SIN4(remote)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr && SIN4(local)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr && pcbp.inp_fport == fport && pcbp.inp_lport == lport) { return pcbp.inp_socket; } } if (remote->sa_family == AF_INET) { pfaddr = (char *)&pcbp.inp_faddr; pladdr = (char *)&pcbp.inp_laddr; alen = sizeof(struct in_addr); } else if (remote->sa_family == AF_INET6) { pfaddr = (char *)&pcbp.in6p_faddr; pladdr = (char *)&pcbp.in6p_laddr; alen = sizeof(struct in6_addr); } else continue; if (memcmp(pfaddr, faddr, alen) == 0 && memcmp(pladdr, laddr, alen) == 0 && pcbp.inp_fport == fport && pcbp.inp_lport == lport) { return pcbp.inp_socket; } head = pcbp.inp_list.le_next; } while (head); return NULL; } #endif /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { return 0; } /* ** Return the UID of the connection owner */ static uid_t get_user( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { struct kinfo_proc *kp; struct socket *sockp; int i; int nentries; #ifdef _HAVE_OLD_INPCB struct inpcb tcb; #else struct inpcbhead tcb; #endif kp = kvm_getprocs(kinfo->kd, KERN_PROC_ALL, 0, &nentries); if (!kp) { debug("kvm_getprocs: %s", strerror(errno)); return MISSING_UID; } if (getbuf(kinfo->nl[N_TCB].n_value, &tcb, sizeof(tcb)) == -1) return MISSING_UID; #ifdef _HAVE_OLD_INPCB tcb.inp_prev = (struct inpcb *) kinfo->nl[N_TCB].n_value; #endif sockp = getlist(&tcb, lport, fport, (struct sockaddr *)laddr, (struct sockaddr *)faddr); if (!sockp) return MISSING_UID; /* ** Locate the file descriptor that has the socket in question ** open so that we can get the 'ucred' information */ for (i = 0; i < nentries; ++i) { if (kp[i].ki_fd) { int j; int ret; struct filedesc pfd; struct file **ofiles; if (getbuf((u_long) kp[i].ki_fd, &pfd, sizeof(pfd)) == -1) return MISSING_UID; ofiles = xmalloc(pfd.fd_nfiles * sizeof(struct file *)); ret = getbuf((u_long) pfd.fd_ofiles, ofiles, pfd.fd_nfiles * sizeof(struct file *)); if (ret == -1) { free(ofiles); return MISSING_UID; } for (j = 0; j < pfd.fd_nfiles; ++j) { struct file ofile; if (!ofiles[j]) continue; ret = getbuf((u_long) ofiles[j], &ofile, sizeof(struct file)); if (ret == -1) { free(ofiles); return MISSING_UID; } if (ofile.f_count == 0) continue; if (ofile.f_type == DTYPE_SOCKET && (struct socket *) ofile.f_data == sockp) { free(ofiles); return kp[i].ki_ruid; } } free(ofiles); } } return MISSING_UID; } /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { return get_user(lport, fport, laddr, faddr); } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { nat_t *np; nat_t nat; char os[24]; char user[MAX_ULEN]; struct sockaddr_storage ss; /* ** Only IPv4 is supported right now.. */ if (faddr->ss_family != AF_INET || laddr->ss_family != AF_INET) return -1; if (getbuf(kinfo->nl[N_NATLIST].n_value, &np, sizeof(np)) == -1) return -1; for (; np; np = nat.nat_next) { in_port_t masq_lport; in_port_t masq_fport; int retm; if (getbuf((u_long) np, &nat, sizeof(nat)) == -1) { debug("getbuf: %s", strerror(errno)); break; } if (nat.nat_p != IPPROTO_TCP) continue; if (lport != nat.nat_outport) continue; if (fport != nat.nat_oport) continue; if (SIN4(laddr)->sin_addr.s_addr != nat.nat_outip.s_addr) continue; if (SIN4(faddr)->sin_addr.s_addr != nat.nat_oip.s_addr) { if (!opt_enabled(PROXY)) continue; if (SIN4(faddr)->sin_addr.s_addr != SIN4(&proxy)->sin_addr.s_addr) continue; if (SIN4(laddr)->sin_addr.s_addr == SIN4(&proxy)->sin_addr.s_addr) continue; } lport = ntohs(lport); fport = ntohs(fport); masq_lport = ntohs(nat.nat_inport); masq_fport = ntohs(nat.nat_outport); sin_setv4(nat.nat_inip.s_addr, &ss); retm = find_masq_entry(&ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (retm != 0 || !opt_enabled(MASQ_OVERRIDE))) { int retf; retf = fwd_request(sock, lport, masq_lport, fport, masq_fport, &ss); if (retf == 0) { if (retm != 0) return 0; } else { char ipbuf[MAX_IPLEN]; get_ip(&ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d | %d %d) failed", ipbuf, lport, fport, nat.nat_inport, nat.nat_outport); } } if (retm == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (NAT) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } } return -1; } #endif #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { return get_user(lport, fport, laddr, faddr); } #endif oidentd-2.5.0/src/inet_util.c0000644000175000017500000002464313545375404013037 00000000000000/* ** inet_util.c - oidentd network utility functions. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "options.h" static int setup_bind(const struct addrinfo *ai, in_port_t listen_port); static int setup_bind(const struct addrinfo *ai, in_port_t listen_port) { int ret; const int one = 1; int listenfd; listenfd = socket(ai->ai_family, SOCK_STREAM, 0); if (listenfd == -1) { debug("socket: %s", strerror(errno)); return -1; } switch (ai->ai_family) { #if WANT_IPV6 case AF_INET6: SIN6(ai->ai_addr)->sin6_port = listen_port; if (setsockopt(listenfd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one)) != 0) { debug("setsockopt IPV6_V6ONLY: %s", strerror(errno)); return -1; } break; #endif case AF_INET: SIN4(ai->ai_addr)->sin_port = listen_port; break; default: debug("address family %d not supported", ai->ai_family); return -1; } ret = setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (ret != 0) { debug("setsockopt: %s", strerror(errno)); return -1; } ret = bind(listenfd, ai->ai_addr, ai->ai_addrlen); if (ret != 0) { debug("bind: %s", strerror(errno)); return -1; } if (listen(listenfd, SOMAXCONN) != 0) { debug("listen: %s", strerror(errno)); return -1; } return listenfd; } /* ** Setup the listening socket(s). */ int *setup_listen(struct sockaddr_storage **listen_addr, in_port_t listen_port) { int ret; int *bound_fds = NULL; char listen_port_str[64]; struct addrinfo hints, *res, *cur; unsigned int naddr = 0; if (listen_addr) { do { cur = xcalloc(1, sizeof(struct addrinfo)); cur->ai_family = listen_addr[naddr]->ss_family; switch (cur->ai_family) { #if WANT_IPV6 case AF_INET6: cur->ai_addrlen = sizeof(struct sockaddr_in6); break; #endif case AF_INET: cur->ai_addrlen = sizeof(struct sockaddr_in); break; default: debug("address family %d not supported", cur->ai_family); free(cur); free(listen_addr[naddr]); return NULL; } cur->ai_addr = xmalloc(cur->ai_addrlen); memcpy(cur->ai_addr, listen_addr[naddr], cur->ai_addrlen); ret = setup_bind(cur, listen_port); free(cur->ai_addr); free(cur); free(listen_addr[naddr]); if (ret == -1) return NULL; bound_fds = xrealloc(bound_fds, (naddr + 2) * sizeof(int)); bound_fds[naddr] = ret; bound_fds[++naddr] = -1; } while (listen_addr[naddr]); return bound_fds; } memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; snprintf(listen_port_str, sizeof(listen_port_str), "%d", listen_port); ret = getaddrinfo(NULL, listen_port_str, &hints, &res); if (ret != 0) { debug("getaddrinfo: %s", gai_strerror(ret)); return NULL; } cur = res; if (cur) { size_t bound_addr = 0; size_t fdlen = 4; bound_fds = xmalloc(fdlen * sizeof(int)); do { ret = setup_bind(cur, listen_port); if (ret == -1) goto bind_next; if (bound_addr >= fdlen - 1) { fdlen += 4; bound_fds = xrealloc(bound_fds, fdlen * sizeof(int)); } bound_fds[bound_addr++] = ret; bind_next: cur = cur->ai_next; } while (cur); bound_fds[bound_addr++] = -1; bound_fds = xrealloc(bound_fds, bound_addr * sizeof(int)); freeaddrinfo(res); } else return NULL; return bound_fds; } /* ** Read at most "len" bytes from socket "sock" into "buf". */ ssize_t sock_read(int sock, char *buf, ssize_t len) { char c; ssize_t i; ssize_t ret; if (!buf) return 0; for (i = 1; i < len; ++i) { top: ret = read(sock, &c, 1); if (ret == 1) { *buf++ = c; if (c == '\n') break; } else if (ret == 0) { if (i == 1) return 0; break; } else if (errno == EINTR) { goto top; } else { return 0; } } *buf = '\0'; return i; } /* ** Write to a socket, deal with interrupted and incomplete writes. Returns ** the number of characters written to the socket on success, -1 on failure. */ ssize_t sock_write(int sock, void *buf, ssize_t len) { ssize_t written = 0; while (len > 0) { ssize_t n; n = write(sock, buf, (size_t) len); if (n == -1) { if (errno == EINTR) continue; return -1; } written += n; len -= n; buf = (char *) buf + n; } return written; } /* ** printf-like function that writes to sockets. */ ssize_t sockprintf(int fd, const char *fmt, ...) { va_list ap; char *buf; ssize_t ret; va_start(ap, fmt); ret = vasprintf(&buf, fmt, ap); va_end(ap); if (ret == -1) return -1; ret = sock_write(fd, buf, ret); free(buf); return ret; } /* ** Return the canonical hostname of the given address. */ inline int get_hostname(struct sockaddr_storage *addr, char *hostbuf, socklen_t len) { int ret; ret = getnameinfo((struct sockaddr *) addr, sizeof(struct sockaddr_storage), hostbuf, len, NULL, 0, NI_NAMEREQD); return ret; } /* ** Get the port associated with a TCP service name. */ int get_port(const char *name, in_port_t *port) { struct servent *servent; servent = getservbyname(name, "tcp"); if (servent) { *port = ntohs(servent->s_port); } else { char *end; long temp_port; temp_port = strtol(name, &end, 10); if (*end != '\0') return -1; if (!VALID_PORT(temp_port)) return -1; *port = (in_port_t) temp_port; } return 0; } /* ** Return a network byte ordered IPv4 or IPv6 address. */ int get_addr(const char *hostname, struct sockaddr_storage *addr) { struct addrinfo *res; size_t len; if (getaddrinfo(hostname, NULL, NULL, &res) != 0) return -1; switch (res->ai_addr->sa_family) { case AF_INET: len = sizeof(struct sockaddr_in); break; #if WANT_IPV6 case AF_INET6: len = sizeof(struct sockaddr_in6); break; #endif default: goto out_fail; } if (len < (size_t) res->ai_addrlen) goto out_fail; memcpy(addr, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); return 0; out_fail: freeaddrinfo(res); return -1; } /* ** Returns the address set in the appropriate ** sockaddr struct. */ inline void *sin_addr(struct sockaddr_storage *ss) { #if WANT_IPV6 if (ss->ss_family == AF_INET6) return &SIN6(ss)->sin6_addr; #endif return &SIN4(ss)->sin_addr; } /* ** Return string IPv4 or IPv6 address. */ inline void get_ip( struct sockaddr_storage *ss, char *buf, socklen_t len) { inet_ntop(ss->ss_family, sin_addr(ss), buf, len); } /* ** Returns true if the two in4 addresses are equal, false ** if they aren't. */ inline bool sin4_equal( struct sockaddr_storage *ss1, struct sockaddr_storage *ss2) { return (SIN4(ss1)->sin_addr.s_addr == SIN4(ss2)->sin_addr.s_addr); } /* ** Setup "ss" as an IPv4 sockaddr struct with the address specified by ** "addr" */ void sin_setv4(in_addr_t addr, struct sockaddr_storage *ss) { memset(ss, 0, sizeof(struct sockaddr_storage)); ss->ss_family = AF_INET; memcpy(&SIN4(ss)->sin_addr, &addr, sizeof(addr)); } #if WANT_IPV6 inline bool sin6_equal( struct sockaddr_storage *ss1, struct sockaddr_storage *ss2) { return IN6_ARE_ADDR_EQUAL(&SIN6(ss1)->sin6_addr, &SIN6(ss2)->sin6_addr); } /* ** Setup "ss" as an IPv6 sockaddr struct with the address specified by ** "sin6" */ void sin_setv6(struct in6_addr *sin6, struct sockaddr_storage *ss) { memset(ss, 0, sizeof(struct sockaddr_storage)); ss->ss_family = AF_INET6; memcpy(&SIN6(ss)->sin6_addr, sin6, sizeof(struct in6_addr)); } #endif /* ** Returns the length of the sockaddr struct. */ inline size_t sin_len(const struct sockaddr_storage *ss __notused) { #if WANT_IPV6 if (ss->ss_family == AF_INET6) return sizeof(struct sockaddr_in6); #endif return sizeof(struct sockaddr_in); } /* ** Returns the length of the address portion of the sockaddr ** structure. */ inline size_t sin_addr_len(const struct sockaddr_storage *ss __notused) { #if WANT_IPV6 if (ss->ss_family == AF_INET6) return sizeof(struct in6_addr); #endif return sizeof(struct in_addr); } /* ** Copies a sockaddr struct. */ inline void sin_copy( struct sockaddr_storage *ss1, const struct sockaddr_storage *ss2) { memset(ss1, 0, sizeof(struct sockaddr_storage)); memcpy(ss1, ss2, sin_len(ss2)); } /* ** Returns the port set in the sockaddr struct. */ inline in_port_t sin_port(const struct sockaddr_storage *ss) { #if WANT_IPV6 if (ss->ss_family == AF_INET6) return SIN6(ss)->sin6_port; #endif return SIN4(ss)->sin_port; } /* ** Sets the port for the approprite socket family. */ inline void sin_set_port(in_port_t port, struct sockaddr_storage *ss) { #if WANT_IPV6 if (ss->ss_family == AF_INET6) SIN6(ss)->sin6_port = port; #endif SIN4(ss)->sin_port = port; } /* ** Checks whether two addresses are equal. */ inline bool sin_equal( struct sockaddr_storage *ss1, struct sockaddr_storage *ss2) { #if WANT_IPV6 if (ss1->ss_family == AF_INET6) return sin6_equal(ss1, ss2); #endif return sin4_equal(ss1, ss2); } /* ** Converts an IPv6-mapped IPv4 address to an IPv4 address. */ inline void sin_extractv4(void *in6, struct in_addr *in4) { /* XXX - Is there a cleaner portable way to do this? */ memcpy(in4, ((char *) in6) + 12, sizeof(struct in_addr)); } /* ** Converts an IPv4 address to an IPv6-mapped IPv4 address. */ inline void sin_mapv4to6(void *in4, struct in6_addr *in6) { /* XXX - Is there a cleaner portable way to do this? */ char *in6_ptr = (char *) in6; memset(in6_ptr, 0, 10); memset(in6_ptr + 10, 0xFF, 2); memcpy(in6_ptr + 12, in4, sizeof(struct in_addr)); } oidentd-2.5.0/src/os.c0000644000175000017500000005214313646057327011463 00000000000000/* ** linux.c - Linux user lookup facility. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "user_db.h" #include "inet_util.h" #include "missing.h" #include "masq.h" #include "options.h" #include "netlink.h" #if !MASQ_SUPPORT # undef LIBNFCT_SUPPORT #endif #if LIBNFCT_SUPPORT # include #endif #if HAVE_LIBUDB # include #endif #define CFILE "/proc/net/tcp" #define CFILE6 "/proc/net/tcp6" #define MASQFILE "/proc/net/ip_masquerade" #define IPCONNTRACK "/proc/net/ip_conntrack" #define NFCONNTRACK "/proc/net/nf_conntrack" static int netlink_sock; extern struct sockaddr_storage proxy; extern char *ret_os; #if LIBNFCT_SUPPORT struct ct_masq_query { int sock; in_port_t lport; in_port_t fport; struct sockaddr_storage *laddr; struct sockaddr_storage *faddr; int status; }; #endif #if MASQ_SUPPORT static int masq_ct_line(char *line, int sock, int ct_type, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); #endif #if LIBNFCT_SUPPORT static bool dispatch_libnfct_query(struct ct_masq_query *queryp); static int callback_nfct(enum nf_conntrack_msg_type type, struct nf_conntrack *ct, void *data); #endif static uid_t lookup_tcp_diag( struct sockaddr_storage *src_addr, struct sockaddr_storage *dst_addr, in_port_t src_port, in_port_t dst_port); #if MASQ_SUPPORT enum { CT_UNKNOWN, CT_MASQFILE, CT_IPCONNTRACK, CT_NFCONNTRACK, }; FILE *masq_fp; static int conntrack = CT_UNKNOWN; #endif #if LIBNFCT_SUPPORT static bool dispatch_libnfct_query(struct ct_masq_query *queryp) { struct nfct_handle *nfcthp = nfct_open(CONNTRACK, 0); if (!nfcthp) { debug("nfct_open: %s", strerror(errno)); return false; } if (nfct_callback_register(nfcthp, NFCT_T_ALL, callback_nfct, (void *) queryp)) { debug("nfct_callback_register: %s", strerror(errno)); return false; } if (nfct_query(nfcthp, NFCT_Q_DUMP, &queryp->faddr->ss_family)) { debug("nfct_query: %s", strerror(errno)); return false; } if (nfct_close(nfcthp)) { debug("nfct_close: %s", strerror(errno)); return false; } return !queryp->status; } /* ** Callback for libnetfilter_conntrack queries */ static int callback_nfct(enum nf_conntrack_msg_type type __notused, struct nf_conntrack *ct, void *data) { char buf[1024]; struct ct_masq_query *query; int ret; nfct_snprintf(buf, sizeof(buf), ct, NFCT_T_UNKNOWN, NFCT_O_DEFAULT, NFCT_OF_SHOW_LAYER3); query = (struct ct_masq_query *) data; ret = masq_ct_line(buf, query->sock, CT_NFCONNTRACK, query->lport, query->fport, query->laddr, query->faddr); if (ret == 1) return NFCT_CB_CONTINUE; query->status = ret; return NFCT_CB_STOP; } #endif /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void) { #if MASQ_SUPPORT if (!opt_enabled(MASQ)) { masq_fp = NULL; return 0; } masq_fp = fopen(MASQFILE, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", MASQFILE, strerror(errno)); return -1; } masq_fp = fopen(NFCONNTRACK, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", NFCONNTRACK, strerror(errno)); return -1; } masq_fp = fopen(IPCONNTRACK, "r"); if (!masq_fp) { if (errno != ENOENT) { o_log(LOG_CRIT, "fopen: %s: %s", IPCONNTRACK, strerror(errno)); return -1; } # if LIBNFCT_SUPPORT return 0; # else o_log(LOG_CRIT, "NAT/IP masquerading support is unavailable " "because " PACKAGE_NAME " was compiled without " "libnetfilter_conntrack support and no " "connection tracking file was found."); disable_opt(MASQ); # endif } else { conntrack = CT_IPCONNTRACK; o_log(LOG_CRIT, "Support for " IPCONNTRACK " will be removed in a " "future release. Please update your kernel."); } } else { conntrack = CT_NFCONNTRACK; } } else if (opt_enabled(PROXY) || opt_enabled(FORWARD)) { o_log(LOG_CRIT, "Only local NAT is supported on your system; " "please consider upgrading your kernel"); return -1; } else { o_log(LOG_CRIT, "Support for " MASQFILE " will be removed in a " "future release. Please update your kernel."); conntrack = CT_MASQFILE; } #endif return 0; } #if WANT_IPV6 /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { FILE *fp; char buf[1024]; if (netlink_sock != -1) { uid_t uid = lookup_tcp_diag(laddr, faddr, lport, fport); if (uid != MISSING_UID) return uid; } lport = ntohs(lport); fport = ntohs(fport); fp = fopen(CFILE6, "r"); if (!fp) { debug("fopen: %s: %s", CFILE6, strerror(errno)); return MISSING_UID; } /* Eat the header line. */ if (!fgets(buf, sizeof(buf), fp)) { debug("fgets: %s: Could not read header", CFILE6); fclose(fp); return MISSING_UID; } while (fgets(buf, sizeof(buf), fp)) { struct in6_addr remote6; struct in6_addr local6; u_int32_t portl_temp; u_int32_t portf_temp; in_port_t portl; in_port_t portf; unsigned long uid; unsigned long inode; int ret; ret = sscanf(buf, "%*d: %8x%8x%8x%8x:%x %8x%8x%8x%8x:%x %*x %*X:%*X %*x:%*X %*x %lu %*d %lu", &local6.s6_addr32[0], &local6.s6_addr32[1], &local6.s6_addr32[2], &local6.s6_addr32[3], &portl_temp, &remote6.s6_addr32[0], &remote6.s6_addr32[1], &remote6.s6_addr32[2], &remote6.s6_addr32[3], &portf_temp, &uid, &inode); if (ret != 12) continue; portl = (in_port_t) portl_temp; portf = (in_port_t) portf_temp; if (!memcmp(&local6, sin_addr(laddr), sizeof(local6)) && !memcmp(&remote6, sin_addr(faddr), sizeof(remote6)) && portl == lport && portf == fport) { fclose(fp); if (inode == 0 && uid == 0) return MISSING_UID; return (uid_t) uid; } } fclose(fp); return MISSING_UID; } #endif /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { unsigned long uid; unsigned long inode; FILE *fp; char buf[1024]; in_addr_t laddr4; in_addr_t faddr4; if (netlink_sock != -1) { uid_t nluid = lookup_tcp_diag(laddr, faddr, lport, fport); if (nluid != MISSING_UID) return nluid; } laddr4 = SIN4(laddr)->sin_addr.s_addr; faddr4 = SIN4(faddr)->sin_addr.s_addr; lport = ntohs(lport); fport = ntohs(fport); fp = fopen(CFILE, "r"); if (!fp) { debug("fopen: %s: %s", CFILE, strerror(errno)); return MISSING_UID; } /* Eat the header line. */ if (!fgets(buf, sizeof(buf), fp)) { debug("fgets: %s: Could not read header", CFILE); fclose(fp); return MISSING_UID; } /* ** The line should never be longer than 1024 chars, so fgets should be OK. */ while (fgets(buf, sizeof(buf), fp)) { int ret; u_int32_t portl_temp; u_int32_t portf_temp; in_port_t portl; in_port_t portf; in_addr_t local; in_addr_t remote; ret = sscanf(buf, "%*d: %x:%x %x:%x %*x %*x:%*x %*x:%*x %*x %lu %*d %lu", &local, &portl_temp, &remote, &portf_temp, &uid, &inode); if (ret != 6) continue; portl = (in_port_t) portl_temp; portf = (in_port_t) portf_temp; if (opt_enabled(PROXY)) { if (faddr4 == SIN4(&proxy)->sin_addr.s_addr && remote != SIN4(&proxy)->sin_addr.s_addr && lport == portl && fport == portf) { goto out_success; } } if (local == laddr4 && remote == faddr4 && portl == lport && portf == fport) { goto out_success; } } fclose(fp); return MISSING_UID; out_success: fclose(fp); /* ** If the inode is zero, the socket is dead, and its owner ** has probably been set to root. It would be incorrect ** to return a successful response here. */ if (inode == 0 && uid == 0) return MISSING_UID; return (uid_t) uid; } #if MASQ_SUPPORT /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { char buf[1024]; #if LIBNFCT_SUPPORT struct ct_masq_query query; #endif lport = ntohs(lport); fport = ntohs(fport); #if LIBNFCT_SUPPORT query = (struct ct_masq_query) { sock, lport, fport, laddr, faddr, 1 }; if (dispatch_libnfct_query(&query)) return 0; #endif if (masq_fp) { /* rewind fp to read new contents */ rewind(masq_fp); if (conntrack == CT_MASQFILE) { /* eat the header line */ if (!fgets(buf, sizeof(buf), masq_fp)) { debug("fgets: conntrack file: Could not read header"); return -1; } } while (fgets(buf, sizeof(buf), masq_fp)) { int ret = masq_ct_line(buf, sock, conntrack, lport, fport, laddr, faddr); if (ret == 1) continue; return ret; } } else if (conntrack != CT_UNKNOWN) debug("Connection tracking file is in use but not open"); return -1; } /* ** Process a connection tracking file entry. ** The lport and fport arguments are in host byte order. ** Returns -1 if an error occurred. ** Returns 0 if the entry matched and the request has been handled. ** Returns 1 if the entry did not match the query. **/ static int masq_ct_line(char *line, int sock, int ct_type, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { char os[24]; char family[16]; char proto[16]; in_port_t mport; in_port_t nport; in_port_t masq_lport; in_port_t masq_fport; char user[MAX_ULEN]; struct sockaddr_storage localm_ss; struct sockaddr_storage remotem_ss; struct sockaddr_storage localn_ss; struct sockaddr_storage remoten_ss; int ret; if (ct_type == CT_MASQFILE) { in_addr_t localm4; in_addr_t remotem4; u_int32_t mport_temp; u_int32_t nport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; if (faddr->ss_family != AF_INET) return -1; ret = sscanf(line, "%15s %X:%X %X:%X %X %X %*d %*d %*u", proto, &localm4, &masq_lport_temp, &remotem4, &masq_fport_temp, &mport_temp, &nport_temp); if (ret != 7) return 1; mport = (in_port_t) mport_temp; nport = (in_port_t) nport_temp; masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); /* Assume local NAT. */ sin_setv4(localm4, &remoten_ss); sin_setv4(remotem4, &localn_ss); } else if (ct_type == CT_IPCONNTRACK) { unsigned int ml1, ml2, ml3, ml4, mr1, mr2, mr3, mr4; unsigned int nl1, nl2, nl3, nl4, nr1, nr2, nr3, nr4; in_addr_t localm4; in_addr_t remotem4; in_addr_t localn4; in_addr_t remoten4; u_int32_t nport_temp; u_int32_t mport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; if (faddr->ss_family != AF_INET) return -1; ret = sscanf(line, "%15s %*d %*d ESTABLISHED" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u", proto, &ml1, &ml2, &ml3, &ml4, &mr1, &mr2, &mr3, &mr4, &masq_lport_temp, &masq_fport_temp, &nl1, &nl2, &nl3, &nl4, &nr1, &nr2, &nr3, &nr4, &nport_temp, &mport_temp); if (ret != 21) { ret = sscanf(line, "%15s %*d %*d ESTABLISHED" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u" " packets=%*d bytes=%*d" " src=%u.%u.%u.%u dst=%u.%u.%u.%u sport=%u dport=%u", proto, &ml1, &ml2, &ml3, &ml4, &mr1, &mr2, &mr3, &mr4, &masq_lport_temp, &masq_fport_temp, &nl1, &nl2, &nl3, &nl4, &nr1, &nr2, &nr3, &nr4, &nport_temp, &mport_temp); } if (ret != 21) return 1; masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; nport = (in_port_t) nport_temp; mport = (in_port_t) mport_temp; localm4 = ml1 << 24 | ml2 << 16 | ml3 << 8 | ml4; remotem4 = mr1 << 24 | mr2 << 16 | mr3 << 8 | mr4; localn4 = nl1 << 24 | nl2 << 16 | nl3 << 8 | nl4; remoten4 = nr1 << 24 | nr2 << 16 | nr3 << 8 | nr4; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); sin_setv4(localn4, &localn_ss); sin_setv4(remoten4, &remoten_ss); } else if (ct_type == CT_NFCONNTRACK) { char ml[MAX_IPLEN]; char mr[MAX_IPLEN]; char nl[MAX_IPLEN]; char nr[MAX_IPLEN]; in_addr_t localm4; in_addr_t remotem4; in_addr_t localn4; in_addr_t remoten4; struct in6_addr localm6; struct in6_addr remotem6; struct in6_addr localn6; struct in6_addr remoten6; u_int32_t nport_temp; u_int32_t mport_temp; u_int32_t masq_lport_temp; u_int32_t masq_fport_temp; ret = sscanf(line, "%15s %*d %15s %*d %*d ESTABLISHED" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d" " packets=%*d bytes=%*d" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d", family, proto, ml, mr, &masq_lport_temp, &masq_fport_temp, nl, nr, &nport_temp, &mport_temp); /* Added to handle /proc/sys/net/netfilter/nf_conntrack_acct = 0 */ if (ret != 10) { ret = sscanf(line, "%15s %*d %15s %*d %*d ESTABLISHED" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d" " src=" IP_SCAN_SPEC " dst=" IP_SCAN_SPEC " sport=%d dport=%d", family, proto, ml, mr, &masq_lport_temp, &masq_fport_temp, nl, nr, &nport_temp, &mport_temp); } if (ret != 10) return 1; switch (faddr->ss_family) { case AF_INET: if (strcasecmp(family, "ipv4")) return 1; if (inet_pton(AF_INET, ml, &localm4) < 0 || inet_pton(AF_INET, mr, &remotem4) < 0 || inet_pton(AF_INET, nl, &localn4) < 0 || inet_pton(AF_INET, nr, &remoten4) < 0) return 1; sin_setv4(localm4, &localm_ss); sin_setv4(remotem4, &remotem_ss); sin_setv4(localn4, &localn_ss); sin_setv4(remoten4, &remoten_ss); break; case AF_INET6: if (strcasecmp(family, "ipv6")) return 1; if (inet_pton(AF_INET6, ml, &localm6) < 0 || inet_pton(AF_INET6, mr, &remotem6) < 0 || inet_pton(AF_INET6, nl, &localn6) < 0 || inet_pton(AF_INET6, nr, &remoten6) < 0) return 1; sin_setv6(&localm6, &localm_ss); sin_setv6(&remotem6, &remotem_ss); sin_setv6(&localn6, &localn_ss); sin_setv6(&remoten6, &remoten_ss); break; default: debug("masq_ct_line: bad address family %d", faddr->ss_family); return -1; } masq_lport = (in_port_t) masq_lport_temp; masq_fport = (in_port_t) masq_fport_temp; nport = (in_port_t) nport_temp; mport = (in_port_t) mport_temp; } else return -1; if (strcasecmp(proto, "tcp")) return 1; if (mport != lport) return 1; if (nport != fport) return 1; /* Local NAT, don't forward or do masquerade entry lookup. */ if (sin_equal(&localm_ss, &remoten_ss)) { uid_t con_uid = MISSING_UID; struct passwd *pw; char suser[MAX_ULEN]; char ipbuf[MAX_IPLEN]; get_ip(faddr, ipbuf, sizeof(ipbuf)); if (con_uid == MISSING_UID && faddr->ss_family == AF_INET) con_uid = get_user4(htons(masq_lport), htons(masq_fport), laddr, &remotem_ss); if (con_uid == MISSING_UID && faddr->ss_family == AF_INET6) con_uid = get_user6(htons(masq_lport), htons(masq_fport), laddr, &remotem_ss); if (con_uid == MISSING_UID) return -1; pw = getpwuid(con_uid); if (!pw) { sockprintf(sock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("NO-USER")); debug("getpwuid(%lu): %s", (unsigned long) con_uid, strerror(errno)); return 0; } ret = get_ident(pw, masq_lport, masq_fport, laddr, &remotem_ss, suser, sizeof(suser)); if (ret == -1) { sockprintf(sock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("HIDDEN-USER")); o_log(LOG_INFO, "[%s] %d (%d) , %d (%d) : HIDDEN-USER (%s)", ipbuf, lport, masq_lport, fport, masq_fport, pw->pw_name); return 0; } sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, ret_os, suser); o_log(LOG_INFO, "[%s] Successful lookup: %d (%d) , %d (%d) : %s (%s)", ipbuf, lport, masq_lport, fport, masq_fport, pw->pw_name, suser); return 0; } if (!sin_equal(&localn_ss, faddr)) { if (!opt_enabled(PROXY)) return 1; if (!sin_equal(faddr, &proxy)) return 1; if (sin_equal(&localn_ss, &proxy)) return 1; } ret = find_masq_entry(&localm_ss, user, sizeof(user), os, sizeof(os)); if (opt_enabled(FORWARD) && (ret != 0 || !opt_enabled(MASQ_OVERRIDE))) { char ipbuf[MAX_IPLEN]; if (fwd_request(sock, lport, masq_lport, fport, masq_fport, &localm_ss) == 0) return 0; get_ip(&localm_ss, ipbuf, sizeof(ipbuf)); debug("Forward to %s (%d %d) failed", ipbuf, masq_lport, fport); } if (ret == 0) { char ipbuf[MAX_IPLEN]; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", lport, fport, os, user); get_ip(faddr, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] (Masqueraded) Successful lookup: %d , %d : %s", ipbuf, lport, fport, user); return 0; } return -1; } #endif /* ** Much of the code for this function has been borrowed from ** a patch to pidentd written by Alexey Kuznetsov ** and distributed with the iproute2 package. ** ** Ryan McCabe has made some cleanups and converted the ** routine to support both IPv4 and IPv6 queries. */ static uid_t lookup_tcp_diag( struct sockaddr_storage *src_addr, struct sockaddr_storage *dst_addr, in_port_t src_port, in_port_t dst_port) { struct sockaddr_nl nladdr; struct { struct nlmsghdr nlh; struct tcpdiagreq r; } req; size_t addr_len = sin_addr_len(dst_addr); struct iovec iov[1]; struct msghdr msghdr; char buf[8192]; memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; req.nlh.nlmsg_len = sizeof(req); req.nlh.nlmsg_type = TCPDIAG_GETSOCK; req.nlh.nlmsg_flags = NLM_F_REQUEST; req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_seq = 1; memset(&req.r, 0, sizeof(req.r)); req.r.tcpdiag_states = ~0U; req.r.tcpdiag_family = dst_addr->ss_family; memcpy(&req.r.id.tcpdiag_dst, sin_addr(dst_addr), addr_len); memcpy(&req.r.id.tcpdiag_src, sin_addr(src_addr), addr_len); req.r.id.tcpdiag_dport = dst_port; req.r.id.tcpdiag_sport = src_port; req.r.id.tcpdiag_cookie[0] = TCPDIAG_NOCOOKIE; req.r.id.tcpdiag_cookie[1] = TCPDIAG_NOCOOKIE; iov[0].iov_base = &req; iov[0].iov_len = sizeof(req); msghdr.msg_name = &nladdr; msghdr.msg_namelen = sizeof(nladdr); msghdr.msg_iov = iov; msghdr.msg_iovlen = 1; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; msghdr.msg_flags = 0; if (sendmsg(netlink_sock, &msghdr, 0) < 0) { if (errno == ECONNREFUSED) { close(netlink_sock); netlink_sock = -1; } return MISSING_UID; } iov[0].iov_base = buf; iov[0].iov_len = sizeof(buf); while (1) { ssize_t ret; size_t uret; struct nlmsghdr *h; msghdr.msg_name = &nladdr; msghdr.msg_namelen = sizeof(nladdr); msghdr.msg_iov = iov; msghdr.msg_iovlen = 1; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; msghdr.msg_flags = 0; ret = recvmsg(netlink_sock, &msghdr, 0); if (ret < 0) { if (errno == EINTR || errno == EAGAIN) continue; return MISSING_UID; } if (ret == 0) return MISSING_UID; h = (struct nlmsghdr *) buf; uret = (size_t) ret; while (NLMSG_OK(h, uret)) { struct tcpdiagmsg *r; if (h->nlmsg_seq != 1) { h = NLMSG_NEXT(h, uret); continue; } if (h->nlmsg_type == NLMSG_DONE || h->nlmsg_type == NLMSG_ERROR) return MISSING_UID; r = NLMSG_DATA(h); if (r->id.tcpdiag_dport == dst_port && r->id.tcpdiag_sport == src_port && !memcmp(r->id.tcpdiag_dst, sin_addr(dst_addr), addr_len) && !memcmp(r->id.tcpdiag_src, sin_addr(src_addr), addr_len)) { if (r->tcpdiag_inode == 0 && r->tcpdiag_uid == 0) return MISSING_UID; return r->tcpdiag_uid; } return MISSING_UID; } if ((msghdr.msg_flags & MSG_TRUNC) || uret != 0) return MISSING_UID; } return MISSING_UID; } /* ** Just open a netlink socket here. */ /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. ** ** No kmem access required; open a Netlink socket instead. */ int k_open(void) { netlink_sock = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_TCPDIAG); if (netlink_sock == -1) { /* Not a fatal error, just log a debug message */ debug("Failed to open netlink socket: %s", strerror(errno)); } return 0; } oidentd-2.5.0/src/netlink.h0000644000175000017500000000324013545375404012502 00000000000000/* ** netlink.h - Linux netlink definitions. ** ** This header file extracts the needed structure definitions, #defines ** and macros from linux/netlink.h and linux/tcp_diag.h, and converts them ** to be usable from userland code. ** ** Cleanup and conversion Copyright (c) 2002-2006 Ryan McCabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. */ #ifndef __OIDENTD_NETLINK_H #define __OIDENTD_NETLINK_H #define NETLINK_TCPDIAG 4 #define TCPDIAG_GETSOCK 18 #define NLMSG_ERROR 0x2 #define NLMSG_DONE 0x3 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) /* Socket identity */ struct tcpdiag_sockid { u_int16_t tcpdiag_sport; u_int16_t tcpdiag_dport; u_int32_t tcpdiag_src[4]; u_int32_t tcpdiag_dst[4]; u_int32_t tcpdiag_if; u_int32_t tcpdiag_cookie[2]; #define TCPDIAG_NOCOOKIE (~0U) }; /* Request structure */ struct tcpdiagreq { u_int8_t tcpdiag_family; u_int8_t tcpdiag_src_len; u_int8_t tcpdiag_dst_len; u_int8_t tcpdiag_ext; struct tcpdiag_sockid id; u_int32_t tcpdiag_states; u_int32_t tcpdiag_dbs; }; struct tcpdiagmsg { u_int8_t tcpdiag_family; u_int8_t tcpdiag_state; u_int8_t tcpdiag_timer; u_int8_t tcpdiag_retrans; struct tcpdiag_sockid id; u_int32_t tcpdiag_expires; u_int32_t tcpdiag_rqueue; u_int32_t tcpdiag_wqueue; u_int32_t tcpdiag_uid; u_int32_t tcpdiag_inode; }; #endif oidentd-2.5.0/src/Makefile.in0000644000175000017500000006253313646057317012746 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = oidentd$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_oidentd_OBJECTS = oidentd.$(OBJEXT) util.$(OBJEXT) \ inet_util.$(OBJEXT) forward.$(OBJEXT) user_db.$(OBJEXT) \ options.$(OBJEXT) masq.$(OBJEXT) cfg_scan.$(OBJEXT) \ cfg_parse.$(OBJEXT) os.$(OBJEXT) oidentd_OBJECTS = $(am_oidentd_OBJECTS) am__DEPENDENCIES_1 = oidentd_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cfg_parse.Po ./$(DEPDIR)/cfg_scan.Po \ ./$(DEPDIR)/forward.Po ./$(DEPDIR)/inet_util.Po \ ./$(DEPDIR)/masq.Po ./$(DEPDIR)/oidentd.Po \ ./$(DEPDIR)/options.Po ./$(DEPDIR)/os.Po \ ./$(DEPDIR)/user_db.Po ./$(DEPDIR)/util.Po am__mv = mv -f 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 = $(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 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = SOURCES = $(oidentd_SOURCES) DIST_SOURCES = $(oidentd_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 HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap cfg_parse.c cfg_parse.h cfg_scan.c 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@ ADD_LIB = @ADD_LIB@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sedpath = @sedpath@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = missing oidentd_LDADD = -Lmissing -lmissing $(ADD_LIB) AM_CFLAGS = $(DEBUG_CFLAGS) $(WARN_CFLAGS) AM_CPPFLAGS = -I "$(srcdir)/missing" \ -D "SYSCONFDIR=\"$(sysconfdir)\"" AM_YFLAGS = -d EXTRA_DIST = kernel DISTCLEANFILES = \ os.c oidentd_SOURCES = \ oidentd.c \ util.c \ inet_util.c \ forward.c \ user_db.c \ options.c \ masq.c \ cfg_scan.l \ cfg_parse.y \ os.c noinst_HEADERS = \ oidentd.h \ cfg_parse.h \ inet_util.h \ forward.h \ masq.h \ netlink.h \ options.h \ user_db.h \ util.h BUILT_SOURCES = \ cfg_parse.h \ cfg_parse.c \ cfg_scan.c CLEANFILES = \ $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(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) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-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 \ ; 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) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(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: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) cfg_parse.h: cfg_parse.c @if test ! -f $@; then rm -f cfg_parse.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) cfg_parse.c; else :; fi oidentd$(EXEEXT): $(oidentd_OBJECTS) $(oidentd_DEPENDENCIES) $(EXTRA_oidentd_DEPENDENCIES) @rm -f oidentd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oidentd_OBJECTS) $(oidentd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg_parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg_scan.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masq.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oidentd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_db.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(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) '$<'` .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -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." -rm -f cfg_parse.c -rm -f cfg_parse.h -rm -f cfg_scan.c -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/cfg_parse.Po -rm -f ./$(DEPDIR)/cfg_scan.Po -rm -f ./$(DEPDIR)/forward.Po -rm -f ./$(DEPDIR)/inet_util.Po -rm -f ./$(DEPDIR)/masq.Po -rm -f ./$(DEPDIR)/oidentd.Po -rm -f ./$(DEPDIR)/options.Po -rm -f ./$(DEPDIR)/os.Po -rm -f ./$(DEPDIR)/user_db.Po -rm -f ./$(DEPDIR)/util.Po -rm -f Makefile distclean-am: clean-am distclean-compile 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-sbinPROGRAMS 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 ./$(DEPDIR)/cfg_parse.Po -rm -f ./$(DEPDIR)/cfg_scan.Po -rm -f ./$(DEPDIR)/forward.Po -rm -f ./$(DEPDIR)/inet_util.Po -rm -f ./$(DEPDIR)/masq.Po -rm -f ./$(DEPDIR)/oidentd.Po -rm -f ./$(DEPDIR)/options.Po -rm -f ./$(DEPDIR)/os.Po -rm -f ./$(DEPDIR)/user_db.Po -rm -f ./$(DEPDIR)/util.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic 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-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ 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: oidentd-2.5.0/src/user_db.h0000644000175000017500000000452713545375404012472 00000000000000/* ** user_db.h - oidentd user database routines. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_USER_DB_H #define __OIDENTD_USER_DB_H #define PARSE_USER 0x00 #define PARSE_SYSTEM 0x01 #define ACTION_DENY 0x00 #define ACTION_ALLOW 0x01 #define ACTION_FORCE 0x02 #define CAP_SPOOF (1 << 0x00) #define CAP_SPOOF_ALL (1 << 0x01) #define CAP_SPOOF_PRIVPORT (1 << 0x02) #define CAP_HIDE (1 << 0x03) #define CAP_RANDOM (1 << 0x04) #define CAP_RANDOM_NUMERIC (1 << 0x05) #define CAP_NUMERIC (1 << 0x06) #define CAP_REPLY (1 << 0x07) #define CAP_FORWARD (1 << 0x08) #define DB_HASH_SIZE 32 struct user_cap { struct port_range { in_port_t min; in_port_t max; } *lport, *fport; struct sockaddr_storage *src; struct sockaddr_storage *dest; u_int16_t caps; u_int16_t action; union user_cap_data { struct replies_data { char **data; u_int8_t num; } replies; struct forward_data { struct sockaddr_storage *host; in_port_t port; } forward; } data; }; struct user_info { uid_t user; list_t *cap_list; }; struct user_info *user_db_lookup(uid_t uid); void user_db_add(struct user_info *user_info); void user_db_destroy(void); void user_db_cap_destroy_data(void *data); void user_db_set_default(struct user_info *user_info); struct user_info *user_db_create_default(void); int get_ident( const struct passwd *pwd, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr, char *reply, size_t len); list_t *user_db_get_pref_list(const struct passwd *pw); #endif oidentd-2.5.0/src/oidentd.c0000644000175000017500000002612613555503445012466 00000000000000/* ** oidentd.c - oidentd ident (RFC 1413) implementation. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "user_db.h" #include "options.h" #include "masq.h" #if HAVE_LIBUDB # warning "libudb support is deprecated" # include #endif #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION static void sig_segv(int unused __notused) __noreturn; static void sig_child(int sig); static void sig_alarm(int unused __notused) __noreturn; static void sig_hup(int unused); #endif static void copy_pw(const struct passwd *pw, struct passwd *pwd); static void free_pw(struct passwd *pwd); static int service_request(int insock, int outsock); u_int32_t timeout = DEFAULT_TIMEOUT; u_int32_t connection_limit; u_int32_t current_connections = 0; uid_t target_uid; gid_t target_gid; char *ret_os; char *failuser; char *replyall; char *config_file; in_port_t listen_port; struct sockaddr_storage **addr; int main(int argc, char **argv) { int *listen_fds = NULL; if (get_options(argc, argv) != 0) exit(EXIT_FAILURE); openlog(PACKAGE_NAME, LOG_PID | LOG_CONS | LOG_NDELAY, LOG_DAEMON); if (!replyall && read_config(config_file) != 0) { o_log(LOG_CRIT, "Fatal: Error reading configuration file"); exit(EXIT_FAILURE); } if (!replyall && core_init() != 0) { if (opt_enabled(DEBUG_MSGS)) { o_log(LOG_CRIT, "Fatal: Error initializing core"); } else { o_log(LOG_CRIT, "Fatal: Error initializing core (try --debug)"); } exit(EXIT_FAILURE); } if (!opt_enabled(STDIO)) { listen_fds = setup_listen(addr, htons(listen_port)); if (!listen_fds || listen_fds[0] == -1) { o_log(LOG_CRIT, "Fatal: Unable to set up listening socket"); o_log(LOG_CRIT, " (try running " PACKAGE_NAME " as root)"); exit(EXIT_FAILURE); } } if (!opt_enabled(FOREGROUND) && go_background() == -1) { o_log(LOG_CRIT, "Fatal: Error creating daemon process"); exit(EXIT_FAILURE); } if (!replyall && k_open() != 0) { o_log(LOG_CRIT, "Fatal: Unable to initialize kernel module: %s", strerror(errno)); exit(EXIT_FAILURE); } if (drop_privs(target_uid, target_gid) == -1) { o_log(LOG_CRIT, "Fatal: Failed to drop privileges (global)"); exit(EXIT_FAILURE); } #if HAVE_LIBUDB if (!replyall && opt_enabled(USEUDB)) { if (udb_init(UDB_ENV_BASE_KEY) == 0) { o_log(LOG_CRIT, "Fatal: Can't open UDB shared memory tables"); exit(EXIT_FAILURE); } } #endif #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION signal(SIGALRM, sig_alarm); signal(SIGCHLD, sig_child); signal(SIGHUP, sig_hup); signal(SIGSEGV, sig_segv); #endif if (opt_enabled(STDIO)) { service_request(fileno(stdin), fileno(stdout)); exit(EXIT_SUCCESS); } for (;;) { fd_set rfds; int ret; size_t fdlen = 0; FD_ZERO(&rfds); do { int fd = listen_fds[fdlen++]; FD_SET(fd, &rfds); } while (listen_fds[fdlen] != -1); ret = select(listen_fds[fdlen - 1] + 1, &rfds, NULL, NULL, NULL); if (ret > 0) { size_t i; for (i = 0; i < fdlen; ++i) { if (FD_ISSET(listen_fds[i], &rfds)) { int connectfd; pid_t child; connectfd = accept(listen_fds[i], NULL, NULL); if (connectfd == -1) { debug("accept: %s", strerror(errno)); continue; } if (current_connections >= connection_limit) { o_log(LOG_INFO, "Connection limit exceeded; " "closing incoming connection"); close(connectfd); continue; } ++current_connections; child = fork(); if (child == -1) { o_log(LOG_CRIT, "Failed to fork: %s", strerror(errno)); } else if (child == 0) { size_t idx; for (idx = 0; listen_fds[idx] != -1; ++idx) close(listen_fds[idx]); free(listen_fds); alarm(timeout); service_request(connectfd, connectfd); exit(EXIT_SUCCESS); } close(connectfd); } } } } } /* ** Handle the client's request: read the client data and send the ident reply. */ static int service_request(int insock, int outsock) { int len; int ret; uid_t con_uid; int lport_temp; int fport_temp; in_port_t lport; in_port_t fport; char line[128]; char suser[MAX_ULEN]; char host_buf[MAX_HOSTLEN]; char ip_buf[MAX_IPLEN]; struct sockaddr_storage laddr, laddr6, faddr, faddr6; struct passwd *pw, pwd; #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION in_addr_t fuzz_faddr, fuzz_laddr; (void) inet_pton(AF_INET, "192.0.2.1", &fuzz_faddr); (void) inet_pton(AF_INET, "127.0.0.1", &fuzz_laddr); sin_setv4(fuzz_faddr, &faddr); sin_setv4(fuzz_laddr, &laddr); sin_set_port(49152, &faddr); sin_set_port(113, &faddr); #else static socklen_t socklen = sizeof(struct sockaddr_storage); if (getpeername(insock, (struct sockaddr *) &faddr, &socklen) != 0) { debug("getpeername: %s", strerror(errno)); return -1; } if (getsockname(insock, (struct sockaddr *) &laddr, &socklen) != 0) { debug("getsockname: %s", strerror(errno)); return -1; } #endif fport = htons(sin_port(&faddr)); #if WANT_IPV6 laddr6 = laddr; faddr6 = faddr; if (laddr.ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&SIN6(&laddr)->sin6_addr)) { struct in_addr in4; sin_extractv4(&SIN6(&laddr)->sin6_addr, &in4); sin_setv4(in4.s_addr, &laddr); sin_extractv4(&SIN6(&faddr)->sin6_addr, &in4); sin_setv4(in4.s_addr, &faddr); } #endif get_ip(&faddr, ip_buf, sizeof(ip_buf)); if (get_hostname(&faddr, host_buf, sizeof(host_buf)) != 0) { o_log(LOG_INFO, "Connection from %s:%d", ip_buf, fport); xstrncpy(host_buf, ip_buf, sizeof(host_buf)); } else o_log(LOG_INFO, "Connection from %s (%s):%d", host_buf, ip_buf, fport); if (!sock_read(insock, line, sizeof(line))) return -1; len = sscanf(line, "%d , %d", &lport_temp, &fport_temp); if (len < 2) { debug("[%s] Malformed request: \"%s\"", host_buf, line); return 0; } if (!VALID_PORT(lport_temp) || !VALID_PORT(fport_temp)) { sockprintf(outsock, "%d,%d:ERROR:%s\r\n", lport_temp, fport_temp, ERROR("INVALID-PORT")); debug("[%s] %d , %d : ERROR : INVALID-PORT", host_buf, lport_temp, fport_temp); return 0; } if (replyall) { sockprintf(outsock, "%d,%d:USERID:%s:%s\r\n", lport_temp, fport_temp, ret_os, replyall); o_log(LOG_INFO, "[%s] Static reply: %d , %d : (returned %s)", host_buf, lport_temp, fport_temp, replyall); return 0; } lport = (in_port_t) lport_temp; fport = (in_port_t) fport_temp; /* User ID is unknown. */ con_uid = MISSING_UID; #if HAVE_LIBUDB if (opt_enabled(USEUDB)) { struct udb_lookup_res udb_res = get_udb_user( lport, fport, &laddr, &faddr, insock); if (udb_res.status == 2) return 0; con_uid = udb_res.uid; } #endif if (con_uid == MISSING_UID && laddr.ss_family == AF_INET) con_uid = get_user4(htons(lport), htons(fport), &laddr, &faddr); #if WANT_IPV6 /* * Check for IPv6-mapped IPv4 addresses. This ensures that the correct * ident response is returned for connections to a mapped address. */ if (con_uid == MISSING_UID && laddr.ss_family == AF_INET) { struct sockaddr_storage laddr_m6, faddr_m6; struct in6_addr in6; sin_mapv4to6(&SIN4(&laddr)->sin_addr, &in6); sin_setv6(&in6, &laddr_m6); sin_mapv4to6(&SIN4(&faddr)->sin_addr, &in6); sin_setv6(&in6, &faddr_m6); con_uid = get_user6(htons(lport), htons(fport), &laddr_m6, &faddr_m6); } if (con_uid == MISSING_UID && laddr6.ss_family == AF_INET6) con_uid = get_user6(htons(lport), htons(fport), &laddr6, &faddr6); #endif if (opt_enabled(MASQ)) { if (con_uid == MISSING_UID && laddr.ss_family == AF_INET) if (masq(insock, htons(lport), htons(fport), &laddr, &faddr) == 0) return 0; } if (con_uid == MISSING_UID) { if (failuser) { sockprintf(outsock, "%d,%d:USERID:%s:%s\r\n", lport, fport, ret_os, failuser); o_log(LOG_INFO, "[%s] Failed lookup: %d , %d : (returned %s)", host_buf, lport, fport, failuser); } else { sockprintf(outsock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("NO-USER")); o_log(LOG_INFO, "[%s] %d , %d : ERROR : NO-USER", host_buf, lport, fport); } return 0; } pw = getpwuid(con_uid); if (!pw) { sockprintf(outsock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("NO-USER")); debug("getpwuid(%lu): %s", (unsigned long) con_uid, strerror(errno)); return 0; } else copy_pw(pw, &pwd); if (seed_prng() != 0) { o_log(LOG_CRIT, "Failed to seed PRNG"); goto out_fail; } ret = get_ident(&pwd, lport, fport, &laddr, &faddr, suser, sizeof(suser)); if (ret == -1) { sockprintf(outsock, "%d,%d:ERROR:%s\r\n", lport, fport, ERROR("HIDDEN-USER")); o_log(LOG_INFO, "[%s] %d , %d : HIDDEN-USER (%s)", host_buf, lport, fport, pwd.pw_name); goto out; } sockprintf(outsock, "%d,%d:USERID:%s:%s\r\n", lport, fport, ret_os, suser); o_log(LOG_INFO, "[%s] Successful lookup: %d , %d : %s (%s)", host_buf, lport, fport, pwd.pw_name, suser); out: free_pw(&pwd); return 0; out_fail: free_pw(&pwd); return -1; } /* ** Copy the needed fields from a passwd struct. */ static void copy_pw(const struct passwd *pw, struct passwd *pwd) { pwd->pw_name = xstrdup(pw->pw_name); pwd->pw_uid = pw->pw_uid; pwd->pw_gid = pw->pw_gid; pwd->pw_dir = xstrdup(pw->pw_dir); } /* ** Free a copied passwd struct. */ static void free_pw(struct passwd *pw) { free(pw->pw_name); free(pw->pw_dir); } #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION /* ** Handle SIGSEGV. */ static void sig_segv(int unused __notused) { o_log(LOG_CRIT, "Caught SIGSEGV; please report this to " PACKAGE_BUGREPORT); exit(EXIT_FAILURE); } /* ** Handle SIGCHLD. */ static void sig_child(int sig) { while (waitpid(-1, &sig, WNOHANG) > 0) --current_connections; signal(SIGCHLD, sig_child); } /* ** Handle SIGALRM. */ static void sig_alarm(int unused __notused) { o_log(LOG_INFO, "Request timed out; closing connection"); exit(EXIT_SUCCESS); } /* ** Handle SIGHUP - This causes oidentd to reload its configuration file. */ static void sig_hup(int unused __notused) { if (replyall) { /* * Configuration file was never loaded; don't try to reload it. */ return; } user_db_destroy(); if (read_config(CONFFILE) != 0) { o_log(LOG_CRIT, "Error parsing configuration file"); exit(EXIT_FAILURE); } } #endif oidentd-2.5.0/src/cfg_scan.l0000644000175000017500000001261213545375404012610 00000000000000%{ /* ** cfg_scan.l - oidentd configuration scanner. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "user_db.h" #include "options.h" #include "cfg_parse.h" #define STRING_CHUNK_LEN 256 extern int parser_mode; static char *string_buf; static size_t str_idx; static size_t max_slen; static char get_esc_char(char c); u_int32_t current_line; %} %option case-insensitive %option never-interactive %option noyywrap %option nounput %x state_comment %x state_string TO to FROM from USER user DEFAULT default GLOBAL global FPORT fport LPORT lport ALLOW allow DENY deny FORCE force HIDE hide REPLY reply RANDOM random NUMERIC numeric RANDOM_NUMERIC random_numeric SPOOF spoof SPOOF_ALL spoof_all SPOOF_PRIVPORT spoof_privport FORWARD forward %% "{"|"}" { return yytext[0]; } [ \t]+ { /* ignore */ } #[^\n]* { /* ignore */ } {USER} { return TOK_USER; } {DEFAULT} { return TOK_DEFAULT; } {GLOBAL} { return TOK_GLOBAL; } {TO} { return TOK_TO; } {FROM} { return TOK_FROM; } {FPORT} { return TOK_FPORT; } {LPORT} { return TOK_LPORT; } {ALLOW} { yylval.value = ACTION_ALLOW; return TOK_ALLOWDENY; } {DENY} { yylval.value = ACTION_DENY; return TOK_ALLOWDENY; } {FORCE} { return TOK_FORCE; } {HIDE} { yylval.value = CAP_HIDE; return TOK_CAP; } {RANDOM} { yylval.value = CAP_RANDOM; return TOK_CAP; } {NUMERIC} { yylval.value = CAP_NUMERIC; return TOK_CAP; } {RANDOM_NUMERIC} { yylval.value = CAP_RANDOM_NUMERIC; return TOK_CAP; } {SPOOF} { yylval.value = CAP_SPOOF; return TOK_CAP; } {SPOOF_ALL} { yylval.value = CAP_SPOOF_ALL; return TOK_CAP; } {SPOOF_PRIVPORT} { yylval.value = CAP_SPOOF_PRIVPORT; return TOK_CAP; } {REPLY} { return TOK_REPLY; } {FORWARD} { return TOK_FORWARD; } \" { string_buf = xmalloc(STRING_CHUNK_LEN); str_idx = 0; max_slen = STRING_CHUNK_LEN; BEGIN(state_string); } "/*" BEGIN(state_comment); [^*\n]* { /* ignore */; } "*"+[^*/\n]* { /* ignore */; } "*"+"/" { BEGIN(INITIAL); } \" { string_buf[str_idx++] = '\0'; string_buf = xrealloc(string_buf, str_idx); yylval.string = string_buf; BEGIN(INITIAL); return TOK_STRING; } \n { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Error: Unterminated string constant", current_line); } free(string_buf); return -1; } <*>\n { current_line++; } \\[0-7]{1,3} { u_int32_t result; result = strtoul(yytext + 1, NULL, 8); if (result > 0xff) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad escape sequence: \"%s\"", current_line, yytext); } free(string_buf); return -1; } if (str_idx >= max_slen - 1) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = result; } \\[xX][0-9A-Fa-f]{1,2} { u_int32_t result; result = strtoul(yytext + 2, NULL, 16); if (str_idx >= max_slen - 2) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = result; } \\[0-9] { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Error: Bad escape sequence: \"%s\"", current_line, yytext); } free(string_buf); return -1; } \\. { if (str_idx >= max_slen - 2) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = get_esc_char(yytext[1]); } [^\\\n\"]+ { size_t len = yyleng; char *p = yytext; if (str_idx + len >= max_slen - 1) { max_slen += len + 1; string_buf = xrealloc(string_buf, max_slen); } while (*p) string_buf[str_idx++] = *p++; } ([^\n\t "/{}]([^\n\t {}]*))|(\/([^*\n\t {}]+)([^\n\t {}]*)) { yylval.string = xstrdup(yytext); return TOK_STRING; } . { return yytext[0]; } %% /* ** Return the specified escaped character. */ static char get_esc_char(char c) { switch (c) { case 'n': return '\n'; case 't': return '\t'; case 'r': return '\r'; case 'f': return '\f'; case 'b': return '\b'; case 'v': return '\v'; case 'a': return '\a'; case 'e': if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Warning: Escape sequence '\\e' is " "deprecated; use '\\033' or '\\x1B' instead.", current_line); } return '\x1B'; default: break; } return c; } oidentd-2.5.0/src/forward.c0000644000175000017500000000627013545375404012503 00000000000000/* ** forward.c - oidentd request forwarding. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018 Jan Steffens ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "options.h" #include "forward.h" static sigjmp_buf timebuf; static int fsock; static void fwd_alarm(int sig) __noreturn; /* ** Make an ident request to another machine and return its response, ** if the request was successful. */ int forward_request(const struct sockaddr_storage *host, in_port_t port, in_port_t lport, in_port_t fport, char *reply, size_t len) { struct sockaddr_storage addr; char ipbuf[MAX_IPLEN]; char user[512]; char buf[1024]; sin_copy(&addr, host); sin_set_port(htons(port), &addr); fsock = socket(addr.ss_family, SOCK_STREAM, 0); if (fsock == -1) { debug("socket: %s", strerror(errno)); return -1; } if (sigsetjmp(timebuf, 1) != 0) { debug("sigsetjmp: %s", strerror(errno)); return -1; } signal(SIGALRM, fwd_alarm); /* ** Five seconds should be plenty, seeing as we're forwarding to a machine ** on a local network. */ alarm(5); if (connect(fsock, (struct sockaddr *) &addr, (socklen_t) sin_len(&addr)) != 0) { get_ip(&addr, ipbuf, sizeof(ipbuf)); debug("connect to %s:%d: %s", ipbuf, ntohs(sin_port(&addr)), strerror(errno)); goto out_fail; } if (sockprintf(fsock, "%d,%d\r\n", lport, fport) < 1) { debug("write: %s", strerror(errno)); goto out_fail; } if (!sock_read(fsock, buf, sizeof(buf))) { debug("read(%d): %s", fsock, strerror(errno)); goto out_fail; } /* ** Don't time out once we've finished processing the request. */ alarm(0); close(fsock); if (sscanf(buf, "%*d , %*d : USERID :%*[^:]:%511s", user) != 1) { char *p = strchr(buf, '\r'); if (p) *p = '\0'; get_ip(&addr, ipbuf, sizeof(ipbuf)); debug("[%s] Remote response: \"%s\"", ipbuf, buf); return -1; } xstrncpy(reply, user, len); return 0; out_fail: alarm(0); close(fsock); return -1; } /* ** Handle the timeout of a forward request. */ static void fwd_alarm(int sig) { o_log(LOG_INFO, "Forward timed out"); close(fsock); siglongjmp(timebuf, sig); } oidentd-2.5.0/src/user_db.c0000644000175000017500000002661313545375404012465 00000000000000/* ** user_db.c - oidentd user database routines. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "user_db.h" #include "options.h" #include "forward.h" #define USER_DB_HASH(x) ((x) % DB_HASH_SIZE) int parser_mode; struct user_cap *pref_cap; static list_t *user_hash[DB_HASH_SIZE]; struct user_info *default_user; static char *select_reply(const struct user_cap *user); static void db_destroy_user_cb(void *data); static bool port_match(in_port_t port, const struct port_range *cap_ports); static bool addr_match( struct sockaddr_storage *addr, struct sockaddr_storage *cap_addr); static bool user_db_have_cap( const struct user_cap *user_cap, u_int16_t cap_flag); static bool user_db_can_reply( const struct user_cap *user_cap, const struct passwd *user_pwd, const char *reply, in_port_t fport); static struct user_cap *user_db_cap_lookup( struct user_info *user_info, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); static struct user_cap *user_db_get_pref( const struct passwd *pw, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); /* ** Generate a pseudo-random ident response consisting of a string of "len" ** characters of the set "valid" */ static void random_ident(char *buf, size_t len) { size_t i; static const char valid[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for (i = 0; i < len - 1; ++i) buf[i] = valid[randval(sizeof(valid) - 1)]; buf[i] = '\0'; } /* ** Select a reply randomly. */ static inline char *select_reply(const struct user_cap *user) { return user->data.replies.data[randval(user->data.replies.num)]; } /* ** Use a user's UID as the ident reply. */ static inline void numeric_ident(uid_t con_uid, char *buf, size_t len) { snprintf(buf, len, "%lu", (unsigned long) con_uid); } /* ** Generates an ident response of the form UPREFIXxxxxx, ** where xxxxx is a pseudo-random number between 1 and 99999 */ static inline void random_ident_numeric(char *buf, size_t len) { snprintf(buf, len, "%s%u", UPREFIX, randval(RANDOM_NUMERIC_UPPER_EXCL)); } /* ** Returns true if the user has a capability, false if they don't. */ static inline bool user_db_have_cap(const struct user_cap *user_cap, u_int16_t cap_flag) { return (user_cap->caps & cap_flag) != 0; } /* ** Stores the appropriate ident reply in "reply." ** Returns 0 if user is not hidden, -1 if the user is hidden. */ int get_ident( const struct passwd *pwd, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr, char *reply, size_t len) { struct user_cap *user_cap; struct user_cap *user_pref; user_cap = user_db_cap_lookup(user_db_lookup(pwd->pw_uid), lport, fport, laddr, faddr); if (!user_cap) user_cap = user_db_cap_lookup(default_user, lport, fport, laddr, faddr); if (user_cap->action == ACTION_FORCE) { switch (user_cap->caps) { case CAP_REPLY: xstrncpy(reply, select_reply(user_cap), len); break; case CAP_FORWARD: return forward_request(user_cap->data.forward.host, user_cap->data.forward.port, lport, fport, reply, len); break; case CAP_HIDE: return -1; break; case CAP_RANDOM: random_ident(reply, MIN(12, len)); break; case CAP_NUMERIC: numeric_ident(pwd->pw_uid, reply, len); break; case CAP_RANDOM_NUMERIC: random_ident_numeric(reply, len); break; default: goto out_implicit; } return 0; } user_pref = user_db_get_pref(pwd, lport, fport, laddr, faddr); if (user_pref) { u_int16_t caps = user_pref->caps; switch (caps) { case CAP_HIDE: if (user_db_have_cap(user_cap, CAP_HIDE)) { goto out_hide; } break; case CAP_REPLY: { char *temp_reply = select_reply(user_pref); if (user_db_can_reply(user_cap, pwd, temp_reply, fport)) { xstrncpy(reply, temp_reply, len); goto out_success; } break; } case CAP_FORWARD: if (user_db_have_cap(user_cap, CAP_FORWARD)) { int ret; ret = forward_request(user_pref->data.forward.host, user_pref->data.forward.port, lport, fport, reply, len); if (ret == 0) { if (user_db_can_reply(user_cap, pwd, reply, fport)) goto out_success; } else if (user_db_have_cap(user_cap, CAP_HIDE)) { goto out_hide; } } break; case CAP_RANDOM: if (user_db_have_cap(user_cap, CAP_RANDOM)) { random_ident(reply, MIN(12, len)); goto out_success; } break; case CAP_NUMERIC: if (user_db_have_cap(user_cap, CAP_NUMERIC)) { numeric_ident(pwd->pw_uid, reply, len); goto out_success; } break; case CAP_RANDOM_NUMERIC: if (user_db_have_cap(user_cap, CAP_RANDOM_NUMERIC)) { random_ident_numeric(reply, len); goto out_success; } break; default: goto out_default; } user_db_cap_destroy_data(user_pref); } out_implicit: xstrncpy(reply, pwd->pw_name, len); return 0; out_default: user_db_cap_destroy_data(user_pref); goto out_implicit; out_success: user_db_cap_destroy_data(user_pref); return 0; out_hide: user_db_cap_destroy_data(user_pref); return -1; } /* ** Callback for destroying a capability list ** with list_destroy. */ void user_db_cap_destroy_data(void *data) { struct user_cap *user_cap = data; if (!data) return; free(user_cap->lport); free(user_cap->fport); free(user_cap->src); free(user_cap->dest); if (user_cap->caps == CAP_REPLY) { size_t i; for (i = 0; i < user_cap->data.replies.num; ++i) free(user_cap->data.replies.data[i]); free(user_cap->data.replies.data); } if (user_cap->caps == CAP_FORWARD) { free(user_cap->data.forward.host); } } /* ** Callback for destroying a user_info struct ** with list_destroy. */ static inline void db_destroy_user_cb(void *data) { struct user_info *user_info = data; list_destroy(user_info->cap_list, user_db_cap_destroy_data); } /* ** Add an entry to the hash table. */ inline void user_db_add(struct user_info *user_info) { list_prepend(&user_hash[USER_DB_HASH(user_info->user)], user_info); } /* ** Destroy the user capability database. */ void user_db_destroy(void) { size_t i; for (i = 0; i < DB_HASH_SIZE; ++i) { if (user_hash[i]) { list_destroy(user_hash[i], db_destroy_user_cb); user_hash[i] = NULL; } } db_destroy_user_cb(default_user); default_user = NULL; } /* ** Returns true if the user specified by "con_uid" is allowed ** to spoof "reply" to destination port "fport," otherwise ** returns false. */ static bool user_db_can_reply( const struct user_cap *user_cap, const struct passwd *user_pwd, const char *reply, in_port_t fport) { struct passwd *spoof_pwd; spoof_pwd = getpwnam(reply); if (spoof_pwd) { /* ** A user can always reply with their own username. */ if (spoof_pwd->pw_uid == user_pwd->pw_uid) return true; if (!user_db_have_cap(user_cap, CAP_SPOOF_ALL)) { o_log(LOG_INFO, "User %s tried to masquerade as user %s", user_pwd->pw_name, spoof_pwd->pw_name); return false; } } if (!user_db_have_cap(user_cap, CAP_SPOOF)) return false; if (fport < 1024 && !user_db_have_cap(user_cap, CAP_SPOOF_PRIVPORT)) { return false; } return true; } /* ** Find the entry in the hash table for the given UID. */ struct user_info *user_db_lookup(uid_t uid) { list_t *cur; cur = user_hash[USER_DB_HASH(uid)]; while (cur) { struct user_info *user_info = cur->data; if (user_info->user == uid) return user_info; cur = cur->next; } return NULL; } /* ** Find the list of capabilitites for the user. */ static struct user_cap *user_db_cap_lookup( struct user_info *user_info, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { list_t *cur; if (!user_info) return NULL; for (cur = user_info->cap_list; cur; cur = cur->next) { struct user_cap *user_cap = cur->data; if (!port_match(lport, user_cap->lport)) continue; if (!port_match(fport, user_cap->fport)) continue; if (!addr_match(laddr, user_cap->src)) continue; if (!addr_match(faddr, user_cap->dest)) continue; return user_cap; } return NULL; } /* ** Create the default user, if none was specified ** in the system-wide configuration. */ struct user_info *user_db_create_default(void) { struct user_info *temp_default; struct user_cap *cur_cap; temp_default = xmalloc(sizeof(struct user_info)); temp_default->cap_list = NULL; cur_cap = xcalloc(1, sizeof(struct user_cap)); list_prepend(&temp_default->cap_list, cur_cap); return temp_default; } /* ** Sets "user_info" as the default user. */ void user_db_set_default(struct user_info *user_info) { if (default_user) { list_destroy(default_user->cap_list, user_db_cap_destroy_data); free(default_user); } default_user = user_info; } /* ** Find out if the user has specified any action for this range. */ static struct user_cap *user_db_get_pref( const struct passwd *pw, in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr) { list_t *cap_list; list_t *cur; cap_list = user_db_get_pref_list(pw); for (cur = cap_list; cur; cur = cur->next) { struct user_cap *cur_cap = cur->data; if (!port_match(lport, cur_cap->lport)) continue; if (!port_match(fport, cur_cap->fport)) continue; if (!addr_match(laddr, cur_cap->src)) continue; if (!addr_match(faddr, cur_cap->dest)) continue; /* ** Don't let list_destroy destroy this one. */ cur->data = NULL; list_destroy(cap_list, user_db_cap_destroy_data); return cur_cap; } list_destroy(cap_list, user_db_cap_destroy_data); return NULL; } /* ** Compares two internet addresses. NULL is treated as a ** wildcard. */ static bool addr_match( struct sockaddr_storage *addr, struct sockaddr_storage *cap_addr) { if (!cap_addr) return true; return sin_equal(addr, cap_addr); } /* ** Checks whether "port" is contained in the range "cap_ports" ** NULL is treated as a wildcard. */ static bool port_match(in_port_t port, const struct port_range *cap_ports) { if (!cap_ports) return true; if (port >= cap_ports->min && port <= cap_ports->max) return true; return false; } oidentd-2.5.0/src/cfg_parse.y0000644000175000017500000002752213545375404013021 00000000000000%{ /* ** cfg_parse.y - oidentd configuration parser. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "user_db.h" #include "options.h" extern struct user_info *default_user; extern u_int32_t current_line; extern int parser_mode; static FILE *open_user_config(const struct passwd *pw); static int extract_port_range(const char *token, struct port_range *range); static void free_cap_entries(struct user_cap *free_cap); static void yyerror(const char *err); void yyrestart(FILE *fp); int yylex(); static struct user_info *cur_user; static struct user_cap *cur_cap; list_t *pref_list; u_int16_t default_caps; %} %union { int value; char *string; } %token TOK_USER %token TOK_DEFAULT %token TOK_GLOBAL %token TOK_FROM %token TOK_TO %token TOK_FPORT %token TOK_LPORT %token TOK_FORCE %token TOK_REPLY %token TOK_FORWARD %token TOK_ALLOWDENY %token TOK_CAP %token TOK_STRING %% program: /* empty */ | program parse_global ; parse_global: user_rule | { if (parser_mode != PARSE_USER) { o_log(LOG_CRIT, "[line %d] This construct is valid only for user configuration files", current_line); YYABORT; } cur_cap = xcalloc(1, sizeof(struct user_cap)); cur_cap->caps = default_caps; } user_range_rule { list_prepend(&pref_list, cur_cap); } ; user_rule: user_statement | default_statement ; default_statement: TOK_DEFAULT { if (parser_mode != PARSE_SYSTEM) YYABORT; cur_user = xmalloc(sizeof(struct user_info)); cur_user->cap_list = NULL; user_db_set_default(cur_user); } '{' target_rule '}' ; user_statement: TOK_USER TOK_STRING { if (parser_mode != PARSE_SYSTEM) { free($2); YYABORT; } cur_user = xmalloc(sizeof(struct user_info)); cur_user->cap_list = NULL; if (find_user($2, &cur_user->user) != 0) { o_log(LOG_CRIT, "[line %u] Invalid user: \"%s\"", current_line, $2); free($2); free_cap_entries(cur_cap); YYABORT; } if (user_db_lookup(cur_user->user)) { o_log(LOG_CRIT, "[line %u] User \"%s\" already has a capability entry", current_line, $2); free($2); free_cap_entries(cur_cap); YYABORT; } free($2); } '{' target_rule '}' { user_db_add(cur_user); } ; target_rule: target_statement | target_rule target_statement ; target_statement: { cur_cap = xcalloc(1, sizeof(struct user_cap)); cur_cap->caps = default_caps; } range_rule { list_prepend(&cur_user->cap_list, cur_cap); } ; range_rule: TOK_DEFAULT '{' cap_rule '}' { if (cur_user == default_user) default_caps = cur_cap->caps; } | rule_specification_list_req '{' cap_rule '}' ; rule_specification_list_req: rule_specification_list rule_specification ; rule_specification_list: /* empty */ | rule_specification_list rule_specification ; rule_specification: to_statement | fport_statement | from_statement | lport_statement ; to_statement: TOK_TO TOK_STRING { if (cur_cap->dest) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'to' can only be specified once", current_line); } free($2); free_cap_entries(cur_cap); YYABORT; } cur_cap->dest = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr($2, cur_cap->dest) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, $2); } free($2); free_cap_entries(cur_cap); YYABORT; } free($2); } ; fport_statement: TOK_FPORT TOK_STRING { if (cur_cap->fport) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'fport' can only be specified once", current_line); } free($2); free_cap_entries(cur_cap); YYABORT; } cur_cap->fport = xmalloc(sizeof(struct port_range)); if (extract_port_range($2, cur_cap->fport) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port or port range: \"%s\"", current_line, $2); free($2); free_cap_entries(cur_cap); YYABORT; } free($2); } ; from_statement: TOK_FROM TOK_STRING { if (cur_cap->src) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'from' can only be specified once", current_line); } free($2); free_cap_entries(cur_cap); YYABORT; } cur_cap->src = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr($2, cur_cap->src) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, $2); } free($2); free_cap_entries(cur_cap); YYABORT; } free($2); } ; lport_statement: TOK_LPORT TOK_STRING { if (cur_cap->lport) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'lport' can only be specified once", current_line); } free($2); free_cap_entries(cur_cap); YYABORT; } cur_cap->lport = xmalloc(sizeof(struct port_range)); if (extract_port_range($2, cur_cap->lport) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port or port range: \"%s\"", current_line, $2); free($2); free_cap_entries(cur_cap); YYABORT; } free($2); } ; cap_rule: cap_statement | cap_rule cap_statement ; force_reply: TOK_FORCE TOK_REPLY TOK_STRING { cur_cap->caps = CAP_REPLY; cur_cap->action = ACTION_FORCE; cur_cap->data.replies.num = 1; cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, sizeof(u_char *)); cur_cap->data.replies.data[0] = $3; } | force_reply TOK_STRING { if (cur_cap->data.replies.num < 0xFF) { cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, ++cur_cap->data.replies.num * sizeof(u_char *)); cur_cap->data.replies.data[cur_cap->data.replies.num - 1] = $2; } else { o_log(LOG_CRIT, "[line %u] No more than 255 replies may be specified", current_line); free_cap_entries(cur_cap); YYABORT; } } ; force_forward: TOK_FORCE TOK_FORWARD TOK_STRING TOK_STRING { cur_cap->caps = CAP_FORWARD; cur_cap->action = ACTION_FORCE; cur_cap->data.forward.host = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr($3, cur_cap->data.forward.host) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, $3); } free($3); free($4); free_cap_entries(cur_cap); YYABORT; } if (get_port($4, &cur_cap->data.forward.port) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port: \"%s\"", current_line, $4); free($3); free($4); free_cap_entries(cur_cap); YYABORT; } free($3); free($4); } ; cap_statement: TOK_FORCE TOK_CAP { cur_cap->caps = $2; cur_cap->action = ACTION_FORCE; } | force_reply | force_forward | TOK_ALLOWDENY TOK_CAP { if ($1 == ACTION_ALLOW) cur_cap->caps |= $2; else cur_cap->caps &= ~$2; cur_cap->action = $1; } | TOK_ALLOWDENY TOK_FORWARD { if ($1 == ACTION_ALLOW) cur_cap->caps |= CAP_FORWARD; else cur_cap->caps &= ~CAP_FORWARD; cur_cap->action = $1; } ; user_range_rule: TOK_GLOBAL '{' user_cap_rule '}' | rule_specification_list_req '{' user_cap_rule '}' ; user_reply: TOK_REPLY TOK_STRING { cur_cap->caps = CAP_REPLY; cur_cap->data.replies.num = 1; cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, sizeof(u_char *)); cur_cap->data.replies.data[0] = $2; } | user_reply TOK_STRING { if (cur_cap->data.replies.num < MAX_RANDOM_REPLIES && cur_cap->data.replies.num < 0xFF) { cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, ++cur_cap->data.replies.num * sizeof(u_char *)); cur_cap->data.replies.data[cur_cap->data.replies.num - 1] = $2; } } ; user_forward: TOK_FORWARD TOK_STRING TOK_STRING { cur_cap->caps = CAP_FORWARD; cur_cap->data.forward.host = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr($2, cur_cap->data.forward.host) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, $2); } free($2); free($3); free_cap_entries(cur_cap); YYABORT; } if (get_port($3, &cur_cap->data.forward.port) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port: \"%s\"", current_line, $3); free($2); free($3); free_cap_entries(cur_cap); YYABORT; } free($2); free($3); } ; user_cap_rule: TOK_CAP { if ($1 == CAP_SPOOF || $1 == CAP_SPOOF_ALL || $1 == CAP_SPOOF_PRIVPORT) { free_cap_entries(cur_cap); YYABORT; } cur_cap->caps = $1; } | user_reply | user_forward ; %% /* ** Read in the system-wide configuration file. */ int read_config(const char *path) { FILE *fp; int ret; fp = fopen(path, "r"); if (!fp) { if (errno == ENOENT) { /* ** If a configuration file is specified on the ** command line, return an error if it can't be opened, ** even if it doesn't exist. */ if (!strcmp(path, CONFFILE)) { struct user_info *temp_default; temp_default = user_db_create_default(); user_db_set_default(temp_default); return 0; } } o_log(LOG_CRIT, "Error opening configuration file: %s: %s", path, strerror(errno)); return -1; } yyrestart(fp); current_line = 1; parser_mode = PARSE_SYSTEM; ret = yyparse(); fclose(fp); /* ** Make sure there's a default to fall back on. */ if (!default_user) { struct user_info *temp_default; temp_default = user_db_create_default(); user_db_set_default(temp_default); } return ret; } /* ** Open the user's configuration file for reading by the parser. */ static FILE *open_user_config(const struct passwd *pw) { FILE *fp = NULL; #if XDGBDIR_SUPPORT if (!fp) fp = safe_open(pw, USER_CONF_XDG); #endif if (!fp) fp = safe_open(pw, USER_CONF); if (!fp) return NULL; yyrestart(fp); current_line = 1; parser_mode = PARSE_USER; return fp; } /* ** Read in a user's configuration file. */ list_t *user_db_get_pref_list(const struct passwd *pw) { FILE *fp; int ret; fp = open_user_config(pw); if (!fp) return NULL; cur_cap = NULL; pref_list = NULL; ret = yyparse(); fclose(fp); if (ret != 0) { list_destroy(pref_list, user_db_cap_destroy_data); return NULL; } return pref_list; } static void yyerror(const char *err) { if (parser_mode == PARSE_USER) free_cap_entries(cur_cap); else o_log(LOG_CRIT, "[line %u] %s", current_line, err); } /* ** Extract a port range from a token. */ static int extract_port_range(const char *token, struct port_range *range) { char *p; p = strchr(token, ':'); if (p) *p++ = '\0'; if (*token == '\0') range->min = PORT_MIN; else if (get_port(token, &range->min) == -1) return -1; if (!p) { range->max = range->min; } else { if (*p == '\0') range->max = PORT_MAX; else if (get_port(p, &range->max) == -1) return -1; } return 0; } static void free_cap_entries(struct user_cap *free_cap) { user_db_cap_destroy_data(free_cap); if (free_cap != cur_cap) free(cur_cap); free(free_cap); free(cur_user); cur_cap = NULL; cur_user = NULL; pref_list = NULL; } oidentd-2.5.0/src/missing/0000755000175000017500000000000013646057327012422 500000000000000oidentd-2.5.0/src/missing/inet_ntop.c0000644000175000017500000000123313475700570014477 00000000000000#include #ifndef HAVE_INET_NTOP #include #include #include #include #include #include #include #include #ifndef INET_ADDRSTRLEN # define INET_ADDRSTRLEN 16 #endif /* ** This is an IPv4 only inet_ntop(3) replacement function. */ const char *inet_ntop(int af, const void *src, char *dst, size_t len) { const char *tmp = src; if (af != AF_INET) { errno = EAFNOSUPPORT; return (NULL); } if (len < INET_ADDRSTRLEN) { errno = ENOSPC; return (NULL); } snprintf(dst, len, "%u.%u.%u.%u", tmp[0], tmp[1], tmp[2], tmp[3]); return (dst); } #endif oidentd-2.5.0/src/missing/missing.h0000644000175000017500000000351313545375404014163 00000000000000/* ** missing.h ** Copyright (c) 2003-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. */ #ifndef __OIDENTD_MISSING_H #define __OIDENTD_MISSING_H #ifndef HAVE_INET_NTOP const char *inet_ntop(int af, const void *src, char *dst, size_t len); #endif #ifndef EAI_NODATA # define EAI_NODATA 1 #endif #ifndef EAI_MEMORY # define EAI_MEMORY 2 #endif #ifndef AI_PASSIVE # define AI_PASSIVE 1 #endif #ifndef AI_CANONNAME # define AI_CANONNAME 2 #endif #ifndef NI_NUMERICHOST # define NI_NUMERICHOST 2 #endif #ifndef NI_NAMEREQD # define NI_NAMEREQD 4 #endif #ifndef NI_NUMERICSERV # define NI_NUMERICSERV 8 #endif #if !defined HAVE_STRUCT_ADDRINFO || !defined HAVE_GETNAMEINFO struct sockaddr; #endif #ifndef HAVE_STRUCT_ADDRINFO struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; char *ai_canonname; struct sockaddr *ai_addr; struct addrinfo *ai_next; }; #endif #ifndef HAVE_GETADDRINFO int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res); #endif #ifndef HAVE_GAI_STRERROR char *gai_strerror(int ecode); #endif #ifndef HAVE_FREEADDRINFO void freeaddrinfo(struct addrinfo *ai); #endif #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); #endif #ifndef HAVE_VASPRINTF int vasprintf(char **result, const char *format, va_list args); #endif #ifndef NI_MAXSERV # define NI_MAXSERV 32 #endif #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif #else # warning "included multiple times" #endif oidentd-2.5.0/src/missing/getopt_missing.h0000644000175000017500000000371513475700570015547 00000000000000/* ** getopt_missing.h - Declarations for getopt. ** ** Copyright (c) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. ** This file is part of the GNU C Library. ** ** The GNU C Library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** The GNU C Library 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 ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with the GNU C Library; if not, write to the Free ** Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ** 02110-1301 USA. ** ** Cleanup Copyright (c) 2001-2006 Ryan McCabe */ #ifndef _GETOPT_MISSING_H #define _GETOPT_MISSING_H # ifndef HAVE_GETOPT_LONG extern char *optarg; extern int optind; extern int opterr; extern int optopt; struct option { const char *name; int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 int getopt(int ___argc, char *const *___argv, const char *__shortopts); int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); int getopt_long_only( int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); int _getopt_internal( int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else # warning "included multiple times" #endif oidentd-2.5.0/src/missing/ipv6_missing.c0000644000175000017500000001001113475700570015107 00000000000000/* ** ipv6.c - Compatibility functions. ** ** This file includes getaddrinfo(), freeaddrinfo() and gai_strerror(). ** These funtions are defined in rfc2133. ** ** But these functions are not implemented correctly. The minimum subset ** is implemented for ssh use only. For exapmle, this routine assumes ** that ai_family is AF_INET. Don't use it for another purpose. ** ** This code was taken from OpenSSH. It is distributed ** under a two-term BSD license. ** ** Modifications Copyright (c) 2001-2006 Ryan McCabe */ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "missing.h" #ifndef HAVE_GAI_STRERROR char *gai_strerror(int ecode) { switch (ecode) { case EAI_NODATA: return ("no address associated with hostname"); case EAI_MEMORY: return ("memory allocation failure"); default: return ("unknown error"); } } #endif #ifndef HAVE_FREEADDRINFO void freeaddrinfo(struct addrinfo *ai) { while (ai != NULL) { struct addrinfo *next = ai->ai_next; free(ai); ai = next; } } #endif #ifndef HAVE_GETADDRINFO static struct addrinfo *malloc_ai(int port, in_addr_t addr) { struct addrinfo *ai; ai = malloc(sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); if (ai == NULL) return (NULL); memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); ai->ai_addr = (struct sockaddr *) (ai + 1); ai->ai_addrlen = sizeof(struct sockaddr_in); ai->ai_addr->sa_family = ai->ai_family = AF_INET; ((struct sockaddr_in *) (ai)->ai_addr)->sin_port = port; ((struct sockaddr_in *) (ai)->ai_addr)->sin_addr.s_addr = addr; return (ai); } int getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { struct addrinfo *cur, *prev = NULL; struct hostent *hp; struct in_addr in; int i, port; if (servname) port = htons(atoi(servname)); else port = 0; if (hints != NULL && hints->ai_flags & AI_PASSIVE) { *res = malloc_ai(port, htonl(0x00000000)); if (*res != NULL) return (0); else return (EAI_MEMORY); } if (hostname == NULL) { *res = malloc_ai(port, htonl(0x7f000001)); if (*res != NULL) return (0); else return (EAI_MEMORY); } if (inet_aton(hostname, &in) != 0) { *res = malloc_ai(port, in.s_addr); if (*res != NULL) return (0); else return (EAI_MEMORY); } hp = gethostbyname(hostname); if (hp != NULL && hp->h_name != NULL && hp->h_name[0] != 0 && hp->h_addr_list[0] != NULL) { for (i = 0 ; hp->h_addr_list[i] ; i++) { cur = malloc_ai(port, ((struct in_addr *) hp->h_addr_list[i])->s_addr); if (cur == NULL) { if (*res != NULL) freeaddrinfo(*res); return (EAI_MEMORY); } if (prev != NULL) prev->ai_next = cur; else *res = cur; prev = cur; } return (0); } return (EAI_NODATA); } #endif #ifndef HAVE_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) { struct sockaddr_in *sin4 = (struct sockaddr_in *) sa; struct hostent *hp; char tmpserv[16]; (void) salen; if (serv != NULL) { snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin4->sin_port)); if (strlen(tmpserv) >= servlen) return (EAI_MEMORY); else strcpy(serv, tmpserv); } if (host != NULL) { if (flags & NI_NUMERICHOST) { if (strlen(inet_ntoa(sin4->sin_addr)) >= hostlen) return (EAI_MEMORY); strcpy(host, inet_ntoa(sin4->sin_addr)); return (0); } else { hp = gethostbyaddr((char *) &sin4->sin_addr, sizeof(struct in_addr), AF_INET); if (hp == NULL) return (EAI_NODATA); if (strlen(hp->h_name) >= hostlen) return (EAI_MEMORY); strcpy(host, hp->h_name); return (0); } } return (0); } #endif oidentd-2.5.0/src/missing/Makefile.am0000644000175000017500000000037413545375404014377 00000000000000AM_CFLAGS = "-I$(srcdir)" $(DEBUG_CFLAGS) $(WARN_CFLAGS) noinst_LIBRARIES = libmissing.a libmissing_a_SOURCES = \ inet_aton.c \ inet_ntop.c \ ipv6_missing.c \ getopt.c \ vasprintf.c noinst_HEADERS = \ getopt_missing.h \ missing.h oidentd-2.5.0/src/missing/inet_aton.c0000644000175000017500000001230113475700570014456 00000000000000/* * ++Copyright++ 1983, 1990, 1993 * - * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. * * 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, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION 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. * - * --Copyright-- */ #include #if !defined(HAVE_INET_ATON) #include #include #include #include #include /* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. * This replaces inet_addr, the return value from which * cannot distinguish between failure and a local broadcast address. */ int inet_aton(const char *cp, struct in_addr *addr) { register u_int32_t val; register int base, n; register char c; unsigned int parts[4]; register unsigned int *pp = parts; c = *cp; for (;;) { /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ if (!isdigit(c)) return (0); val = 0; base = 10; if (c == '0') { c = *++cp; if (c == 'x' || c == 'X') base = 16, c = *++cp; else base = 8; } for (;;) { if (isascii(c) && isdigit(c)) { val = (val * base) + (c - '0'); c = *++cp; } else if (base == 16 && isascii(c) && isxdigit(c)) { val = (val << 4) | (c + 10 - (islower(c) ? 'a' : 'A')); c = *++cp; } else break; } if (c == '.') { /* * Internet format: * a.b.c.d * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ if (pp >= parts + 3) return (0); *pp++ = val; c = *++cp; } else break; } /* * Check for trailing characters. */ if (c != '\0' && (!isascii(c) || !isspace(c))) return (0); /* * Concoct the address according to * the number of parts specified. */ n = pp - parts + 1; switch (n) { case 0: return (0); /* initial nondigit */ case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if ((val > 0xffffff) || (parts[0] > 0xff)) return (0); val |= parts[0] << 24; break; case 3: /* a.b.c -- 8.8.16 bits */ if ((val > 0xffff) || (parts[0] > 0xff) || (parts[1] > 0xff)) return (0); val |= (parts[0] << 24) | (parts[1] << 16); break; case 4: /* a.b.c.d -- 8.8.8.8 bits */ if ((val > 0xff) || (parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff)) return (0); val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); break; } if (addr) addr->s_addr = htonl(val); return (1); } #endif /* !defined(HAVE_INET_ATON) */ oidentd-2.5.0/src/missing/Makefile.in0000644000175000017500000004214113646057317014410 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = src/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar 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 = libmissing_a_AR = $(AR) $(ARFLAGS) libmissing_a_LIBADD = am_libmissing_a_OBJECTS = inet_aton.$(OBJEXT) inet_ntop.$(OBJEXT) \ ipv6_missing.$(OBJEXT) getopt.$(OBJEXT) vasprintf.$(OBJEXT) libmissing_a_OBJECTS = $(am_libmissing_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) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/inet_aton.Po \ ./$(DEPDIR)/inet_ntop.Po ./$(DEPDIR)/ipv6_missing.Po \ ./$(DEPDIR)/vasprintf.Po am__mv = mv -f 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 = $(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 = $(libmissing_a_SOURCES) DIST_SOURCES = $(libmissing_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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@ ADD_LIB = @ADD_LIB@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sedpath = @sedpath@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = "-I$(srcdir)" $(DEBUG_CFLAGS) $(WARN_CFLAGS) noinst_LIBRARIES = libmissing.a libmissing_a_SOURCES = \ inet_aton.c \ inet_ntop.c \ ipv6_missing.c \ getopt.c \ vasprintf.c noinst_HEADERS = \ getopt_missing.h \ missing.h all: all-am .SUFFIXES: .SUFFIXES: .c .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) --gnu src/missing/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/missing/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmissing.a: $(libmissing_a_OBJECTS) $(libmissing_a_DEPENDENCIES) $(EXTRA_libmissing_a_DEPENDENCIES) $(AM_V_at)-rm -f libmissing.a $(AM_V_AR)$(libmissing_a_AR) libmissing.a $(libmissing_a_OBJECTS) $(libmissing_a_LIBADD) $(AM_V_at)$(RANLIB) libmissing.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_aton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipv6_missing.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(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) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) 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." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/getopt.Po -rm -f ./$(DEPDIR)/inet_aton.Po -rm -f ./$(DEPDIR)/inet_ntop.Po -rm -f ./$(DEPDIR)/ipv6_missing.Po -rm -f ./$(DEPDIR)/vasprintf.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-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 ./$(DEPDIR)/getopt.Po -rm -f ./$(DEPDIR)/inet_aton.Po -rm -f ./$(DEPDIR)/inet_ntop.Po -rm -f ./$(DEPDIR)/ipv6_missing.Po -rm -f ./$(DEPDIR)/vasprintf.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ 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 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: oidentd-2.5.0/src/missing/getopt.c0000644000175000017500000002507313475700570014012 00000000000000/* ** Copyright (c) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 ** Free Software Foundation, Inc. ** This file is part of the GNU C Library. ** ** The GNU C Library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** The GNU C Library 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 ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with the GNU C Library; if not, write to the Free ** Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ** 02110-1301 USA. ** ** Code cleanup Copyright (c) 2001-2006 Ryan McCabe */ #include #ifndef HAVE_GETOPT_LONG #include #include #include #include char *optarg; int optind = 1; int __getopt_initialized; static char *nextchar; int opterr = 1; int optopt = '?'; static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; static char *posixly_correct; static char *my_index(const char *str, int chr) { while (*str) { if (*str == chr) return ((char *) str); str++; } return (0); } static int first_nonopt; static int last_nonopt; #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') static void exchange(char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { int len = middle - bottom; int i; for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } top -= len; } else { int len = top - middle; int i; for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } bottom += len; } } first_nonopt += (optind - last_nonopt); last_nonopt = optind; } static const char *_getopt_initialize( int argc, char *const *argv, const char *optstring) { (void) argc; (void) argv; first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv("POSIXLY_CORRECT"); if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; return (optstring); } int _getopt_internal( int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return (-1); optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; optstring = _getopt_initialize(argc, argv, optstring); __getopt_initialized = 1; } if (nextchar == NULL || *nextchar == '\0') { if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } if (optind != argc && !strcmp(argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } if (optind == argc) { if (first_nonopt != last_nonopt) optind = first_nonopt; return (-1); } if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return (-1); optarg = argv[optind++]; return (1); } nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) ; for (p = longopts, option_index = 0; p->name; p++, option_index++) { if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen(p->name)) { pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) { ambig = 1; } } } if (ambig && !exact) { if (print_errors) { fprintf(stderr, "%s: option `%s' is ambiguous\n", argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; optopt = 0; return ('?'); } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { if (argv[optind - 1][1] == '-') { fprintf(stderr, "%s: option `--%s' doesn't allow an argument\n", argv[0], pfound->name); } else { fprintf(stderr, "%s: option `%c%s' doesn't allow an argument\n", argv[0], argv[optind - 1][0], pfound->name); } } nextchar += strlen(nextchar); optopt = pfound->val; return ('?'); } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { fprintf(stderr, "%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); optopt = pfound->val; return (optstring[0] == ':' ? ':' : '?'); } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return (0); } return (pfound->val); } if (!long_only || argv[optind][1] == '-' || my_index(optstring, *nextchar) == NULL) { if (print_errors) { if (argv[optind][1] == '-') { fprintf(stderr, "%s: unrecognized option `--%s'\n", argv[0], nextchar); } else { fprintf(stderr, "%s: unrecognized option `%c%s'\n", argv[0], argv[optind][0], nextchar); } } nextchar = (char *) ""; optind++; optopt = 0; return ('?'); } } { char c = *nextchar++; char *temp = my_index(optstring, c); if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { if (posixly_correct) { fprintf(stderr, "%s: illegal option -- %c\n", argv[0], c); } else { fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c); } } optopt = c; return ('?'); } if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; if (*nextchar != '\0') { optarg = nextchar; optind++; } else if (optind == argc) { if (print_errors) { fprintf(stderr, "%s: option requires an argument -- %c\n", argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return (c); } else optarg = argv[optind++]; for (nextchar = nameend = optarg ; *nameend && *nameend != '=' ; nameend++) { ; } for (p = longopts, option_index = 0 ; p->name; p++, option_index++) { if (!strncmp(p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen(p->name)) { pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { pfound = p; indfound = option_index; } else ambig = 1; } } if (ambig && !exact) { if (print_errors) { fprintf(stderr, "%s: option `-W %s' is ambiguous\n", argv[0], argv[optind]); } nextchar += strlen(nextchar); optind++; return ('?'); } if (pfound != NULL) { option_index = indfound; if (*nameend) { if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { fprintf(stderr, "%s option `-W %s' doesn't allow an argument\n", argv[0], pfound->name); } nextchar += strlen(nextchar); return ('?'); } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { fprintf(stderr, "%s: option `%s' requires an argument\n", argv[0], argv[optind - 1]); } nextchar += strlen(nextchar); return (optstring[0] == ':' ? ':' : '?'); } } nextchar += strlen(nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return (0); } return (pfound->val); } nextchar = NULL; return ('W'); } if (temp[1] == ':') { if (temp[2] == ':') { if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { if (*nextchar != '\0') { optarg = nextchar; optind++; } else if (optind == argc) { if (print_errors) { fprintf(stderr, "%s: option requires an argument -- %c\n", argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else optarg = argv[optind++]; nextchar = NULL; } } return (c); } } int getopt(int argc, char *const *argv, const char *optstring) { return (_getopt_internal(argc, argv, optstring, NULL, NULL, 0)); } int getopt_long(int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return (_getopt_internal(argc, argv, options, long_options, opt_index, 0)); } int getopt_long_only( int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return (_getopt_internal(argc, argv, options, long_options, opt_index, 1)); } #endif oidentd-2.5.0/src/missing/vasprintf.c0000644000175000017500000000531213475700570014516 00000000000000/* Like vsprintf but provides a pointer to malloc'd storage, which must be freed by the caller. Copyright (c) 1994 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Libiberty 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #ifndef HAVE_VASPRINTF #include #include #include #include #include static int int_vasprintf(char **result, char *format, va_list args) { char *p = format; /* ** Add one to make sure that it is never zero, which might cause malloc ** to return NULL. */ int total_width = strlen(format) + 1; va_list ap; memcpy(&ap, args, sizeof(va_list)); while (*p != '\0') { if (*p++ == '%') { while (strchr("-+ #0", *p)) ++p; if (*p == '*') { ++p; total_width += abs(va_arg(ap, int)); } else total_width += strtoul(p, &p, 10); if (*p == '.') { ++p; if (*p == '*') { ++p; total_width += abs(va_arg(ap, int)); } else total_width += strtoul(p, &p, 10); } while (strchr("hlL", *p)) ++p; /* ** Should be big enough for any format ** specifier except %s and floats. */ total_width += 30; switch (*p) { case 'd': case 'i': case 'o': case 'u': case 'x': case 'X': case 'c': (void) va_arg(ap, int); break; case 'f': case 'e': case 'E': case 'g': case 'G': (void) va_arg(ap, double); /* ** Since an ieee double can have an exponent of 307, ** we'll make the buffer wide enough to cover ** the gross case. */ total_width += 307; break; case 's': total_width += strlen(va_arg(ap, char *)); break; case 'p': case 'n': (void) va_arg(ap, char *); break; } } } *result = malloc(total_width); if (*result != NULL) return (vsprintf(*result, format, args)); else return (0); } int vasprintf(char **strp, const char *fmt, va_list ap) { return (int_vasprintf(strp, (char *) fmt, ap)); } #endif oidentd-2.5.0/src/masq.c0000644000175000017500000001316513555260367012003 00000000000000/* ** masq.c - oidentd IP masquerading handler. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_LIBUDB # include #endif #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "masq.h" #include "options.h" #include "forward.h" struct sockaddr_storage proxy; #if MASQ_SUPPORT in_port_t fwdport; extern char *ret_os; static bool blank_line(const char *buf); /* ** Returns true if the buffer contains only ** blank characters (spaces and/or tabs). Returns ** false otherwise. */ static bool blank_line(const char *buf) { const char *p; for (p = buf; *p; ++p) { if (*p != ' ' && *p != '\t') return false; } return true; } /* ** Parse the masquerading map file. ** Returns 0 on success, -1 on failure. */ int find_masq_entry(struct sockaddr_storage *host, char *user, size_t user_len, char *os, size_t os_len) { FILE *fp; struct sockaddr_storage addr; u_int32_t line_num; char buf[4096]; #if HAVE_LIBUDB if (opt_enabled(USEUDB)) { struct udb_ip_user ibuf; struct sockaddr_storage hostaddr; char ipbuf[MAX_IPLEN]; memcpy(&hostaddr, host, sizeof(hostaddr)); get_ip(&hostaddr, ipbuf, sizeof(ipbuf)); debug("[%s] UDB lookup...", ipbuf); if (udb_ip_get(SIN4(&hostaddr), &ibuf)) { get_ip(&hostaddr, ipbuf, sizeof(ipbuf)); xstrncpy(user, ibuf.username, user_len); xstrncpy(os, ret_os, os_len); o_log(LOG_INFO, "Successful UDB lookup: %s : %s", ipbuf, user); return 0; } } #endif fp = fopen(MASQ_MAP, "r"); if (!fp) { if (errno != EEXIST) debug("fopen: %s: %s", MASQ_MAP, strerror(errno)); return -1; } line_num = 0; while (fgets(buf, sizeof(buf), fp)) { struct sockaddr_storage stemp; char *p, *temp; ++line_num; p = strchr(buf, '\n'); if (!p) { debug("[%s:%d] Line too long", MASQ_MAP, line_num); goto failure; } *p = '\0'; if (buf[0] == '#') continue; if (blank_line(buf)) continue; p = strchr(buf, '\r'); if (p) *p = '\0'; p = strtok(buf, " \t"); if (!p) { debug("[%s:%d] Missing address parameter", MASQ_MAP, line_num); goto failure; } temp = strchr(p, '/'); if (temp) *temp++ = '\0'; if (get_addr(p, &stemp) == -1) { debug("[%s:%d] Invalid address: %s", MASQ_MAP, line_num, p); goto failure; } sin_copy(&addr, &stemp); if (stemp.ss_family == AF_INET && temp) { in_addr_t mask, mask2; char *end; mask = strtoul(temp, &end, 10); if (*end != '\0') { if (get_addr(temp, &stemp) == -1) { debug("[%s:%d] Invalid address: %s", MASQ_MAP, line_num, temp); goto failure; } mask2 = SIN4(&stemp)->sin_addr.s_addr; } else { if (mask < 1 || mask > 31) { debug("[%s:%d] Invalid mask: %s", MASQ_MAP, line_num, temp); goto failure; } mask2 = htonl(~(((uint32_t) 1 << (32 - mask)) - 1)); } SIN4(&addr)->sin_addr.s_addr &= mask2; SIN4(host)->sin_addr.s_addr &= mask2; } if (!sin_equal(&addr, host)) continue; p = strtok(NULL, " \t"); if (!p) { debug("[%s:%d] Missing user parameter", MASQ_MAP, line_num); goto failure; } if (strlen(p) >= user_len) { debug("[%s:%d] Username too long (limit is %ld)", MASQ_MAP, line_num, user_len); goto failure; } xstrncpy(user, p, user_len); p = strtok(NULL, " \t"); if (!p) { debug("[%s:%d] Missing OS parameter", MASQ_MAP, line_num); goto failure; } if (strlen(p) >= os_len) { debug("[%s:%d] OS name too long (limit is %ld)", MASQ_MAP, line_num, os_len); goto failure; } xstrncpy(os, p, os_len); fclose(fp); return 0; } failure: fclose(fp); return -1; } /* ** Forward an ident request to another machine, return the response to the ** client that has connected to us and requested it. */ int fwd_request( int sock, in_port_t real_lport, in_port_t masq_lport, in_port_t real_fport, in_port_t masq_fport, struct sockaddr_storage *mrelay) { char ipbuf[MAX_IPLEN]; char user[512]; int ret; ret = forward_request(mrelay, fwdport, masq_lport, masq_fport, user, sizeof user); if (ret == -1) return -1; sockprintf(sock, "%d,%d:USERID:%s:%s\r\n", real_lport, real_fport, ret_os, user); get_ip(mrelay, ipbuf, sizeof(ipbuf)); o_log(LOG_INFO, "[%s] Successful lookup (by forward): %d (%d) , %d (%d) : %s", ipbuf, real_lport, masq_lport, real_fport, masq_fport, user); return 0; } #else /* ** Handle a request to a host that's IP masquerading through us. ** Returns non-zero on failure. */ int masq( int sock __notused, in_port_t lport __notused, in_port_t fport __notused, struct sockaddr_storage *local __notused, struct sockaddr_storage *remote __notused) { return -1; } #endif oidentd-2.5.0/src/cfg_parse.c0000644000175000017500000017062313646057327012777 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 1 "cfg_parse.y" /* yacc.c:337 */ /* ** cfg_parse.y - oidentd configuration parser. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ** */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "inet_util.h" #include "user_db.h" #include "options.h" extern struct user_info *default_user; extern u_int32_t current_line; extern int parser_mode; static FILE *open_user_config(const struct passwd *pw); static int extract_port_range(const char *token, struct port_range *range); static void free_cap_entries(struct user_cap *free_cap); static void yyerror(const char *err); void yyrestart(FILE *fp); int yylex(); static struct user_info *cur_user; static struct user_cap *cur_cap; list_t *pref_list; u_int16_t default_caps; #line 134 "cfg_parse.c" /* yacc.c:337 */ # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ #ifndef YY_YY_CFG_PARSE_H_INCLUDED # define YY_YY_CFG_PARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { TOK_USER = 258, TOK_DEFAULT = 259, TOK_GLOBAL = 260, TOK_FROM = 261, TOK_TO = 262, TOK_FPORT = 263, TOK_LPORT = 264, TOK_FORCE = 265, TOK_REPLY = 266, TOK_FORWARD = 267, TOK_ALLOWDENY = 268, TOK_CAP = 269, TOK_STRING = 270 }; #endif /* Tokens. */ #define TOK_USER 258 #define TOK_DEFAULT 259 #define TOK_GLOBAL 260 #define TOK_FROM 261 #define TOK_TO 262 #define TOK_FPORT 263 #define TOK_LPORT 264 #define TOK_FORCE 265 #define TOK_REPLY 266 #define TOK_FORWARD 267 #define TOK_ALLOWDENY 268 #define TOK_CAP 269 #define TOK_STRING 270 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 65 "cfg_parse.y" /* yacc.c:352 */ int value; char *string; #line 212 "cfg_parse.c" /* yacc.c:352 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CFG_PARSE_H_INCLUDED */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 61 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 18 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 28 /* YYNRULES -- Number of rules. */ #define YYNRULES 47 /* YYNSTATES -- Number of states. */ #define YYNSTATES 78 #define YYUNDEFTOK 2 #define YYMAXUTOK 270 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 17, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 86, 86, 89, 93, 95, 95, 110, 112, 116, 116, 128, 128, 161, 163, 167, 167, 176, 181, 185, 188, 191, 195, 197, 199, 201, 205, 235, 263, 293, 321, 323, 327, 336, 351, 381, 386, 388, 390, 399, 410, 412, 416, 424, 435, 464, 474, 476 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "TOK_USER", "TOK_DEFAULT", "TOK_GLOBAL", "TOK_FROM", "TOK_TO", "TOK_FPORT", "TOK_LPORT", "TOK_FORCE", "TOK_REPLY", "TOK_FORWARD", "TOK_ALLOWDENY", "TOK_CAP", "TOK_STRING", "'{'", "'}'", "$accept", "program", "parse_global", "$@1", "user_rule", "default_statement", "$@2", "user_statement", "$@3", "target_rule", "target_statement", "$@4", "range_rule", "rule_specification_list_req", "rule_specification_list", "rule_specification", "to_statement", "fport_statement", "from_statement", "lport_statement", "cap_rule", "force_reply", "force_forward", "cap_statement", "user_range_rule", "user_reply", "user_forward", "user_cap_rule", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 123, 125 }; # endif #define YYPACT_NINF -51 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-51))) #define YYTABLE_NINF -20 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int8 yypact[] = { -51, 3, -51, -3, -51, -51, 17, -51, -51, -51, -51, 15, 16, 18, 10, -51, 19, -51, 9, 9, 21, 22, 23, 24, 25, -51, -51, -51, -51, -51, 12, -51, 26, 27, 28, -51, 29, -51, 30, 31, -51, -51, -51, -51, 32, -51, -51, 34, -51, 35, -51, 37, -51, -51, -51, -51, 0, 0, -51, 13, 14, -9, 38, -51, -51, -8, 39, 40, -51, -51, -51, -51, -51, -51, -51, -51, 41, -51 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 5, 1, 0, 9, 3, 20, 4, 8, 7, 11, 0, 0, 0, 0, 6, 0, 15, 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, 25, 15, 15, 13, 20, 0, 0, 45, 46, 47, 0, 0, 28, 26, 27, 29, 15, 10, 14, 0, 16, 0, 42, 0, 43, 40, 41, 12, 0, 0, 44, 0, 0, 0, 36, 37, 30, 0, 0, 0, 35, 39, 38, 17, 31, 33, 18, 32, 0, 34 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -51, -51, -51, -51, -51, -51, -51, -51, -51, 4, -30, -51, -51, 8, -51, -51, -51, -51, -51, -51, -12, -51, -51, -50, -51, -51, -51, 42 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 5, 6, 7, 8, 11, 9, 16, 30, 31, 32, 48, 13, 14, 24, 25, 26, 27, 28, 61, 62, 63, 64, 15, 36, 37, 38 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 46, 59, 59, 2, 60, 60, 3, 4, 71, 74, 59, 72, 10, 60, 46, 72, 20, 21, 22, 23, 33, 34, 12, 35, 66, 67, 69, 68, 70, 45, 47, 17, 18, 44, 19, 29, 40, 41, 42, 43, 49, -19, 50, 51, 52, 65, 0, 53, 54, 55, 56, 57, 58, 73, 75, 76, 77, 0, 0, 0, 0, 39 }; static const yytype_int8 yycheck[] = { 30, 10, 10, 0, 13, 13, 3, 4, 17, 17, 10, 61, 15, 13, 44, 65, 6, 7, 8, 9, 11, 12, 5, 14, 11, 12, 12, 14, 14, 17, 4, 16, 16, 29, 16, 16, 15, 15, 15, 15, 32, 16, 15, 15, 15, 57, -1, 17, 17, 17, 16, 16, 15, 15, 15, 15, 15, -1, -1, -1, -1, 19 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 19, 0, 3, 4, 20, 21, 22, 23, 25, 15, 24, 5, 31, 32, 42, 26, 16, 16, 16, 6, 7, 8, 9, 33, 34, 35, 36, 37, 16, 27, 28, 29, 11, 12, 14, 43, 44, 45, 45, 15, 15, 15, 15, 27, 17, 28, 4, 30, 31, 15, 15, 15, 17, 17, 17, 16, 16, 15, 10, 13, 38, 39, 40, 41, 38, 11, 12, 14, 12, 14, 17, 41, 15, 17, 15, 15, 15 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 18, 19, 19, 20, 21, 20, 22, 22, 24, 23, 26, 25, 27, 27, 29, 28, 30, 30, 31, 32, 32, 33, 33, 33, 33, 34, 35, 36, 37, 38, 38, 39, 39, 40, 41, 41, 41, 41, 41, 42, 42, 43, 43, 44, 45, 45, 45 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 0, 2, 1, 1, 0, 5, 0, 6, 1, 2, 0, 2, 4, 4, 2, 0, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 3, 2, 4, 2, 1, 1, 2, 2, 4, 4, 2, 2, 3, 1, 1, 1 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyo, yytype, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; else goto append; append: default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 5: #line 95 "cfg_parse.y" /* yacc.c:1652 */ { if (parser_mode != PARSE_USER) { o_log(LOG_CRIT, "[line %d] This construct is valid only for user configuration files", current_line); YYABORT; } cur_cap = xcalloc(1, sizeof(struct user_cap)); cur_cap->caps = default_caps; } #line 1361 "cfg_parse.c" /* yacc.c:1652 */ break; case 6: #line 104 "cfg_parse.y" /* yacc.c:1652 */ { list_prepend(&pref_list, cur_cap); } #line 1369 "cfg_parse.c" /* yacc.c:1652 */ break; case 9: #line 116 "cfg_parse.y" /* yacc.c:1652 */ { if (parser_mode != PARSE_SYSTEM) YYABORT; cur_user = xmalloc(sizeof(struct user_info)); cur_user->cap_list = NULL; user_db_set_default(cur_user); } #line 1383 "cfg_parse.c" /* yacc.c:1652 */ break; case 11: #line 128 "cfg_parse.y" /* yacc.c:1652 */ { if (parser_mode != PARSE_SYSTEM) { free((yyvsp[0].string)); YYABORT; } cur_user = xmalloc(sizeof(struct user_info)); cur_user->cap_list = NULL; if (find_user((yyvsp[0].string), &cur_user->user) != 0) { o_log(LOG_CRIT, "[line %u] Invalid user: \"%s\"", current_line, (yyvsp[0].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } if (user_db_lookup(cur_user->user)) { o_log(LOG_CRIT, "[line %u] User \"%s\" already has a capability entry", current_line, (yyvsp[0].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[0].string)); } #line 1415 "cfg_parse.c" /* yacc.c:1652 */ break; case 12: #line 155 "cfg_parse.y" /* yacc.c:1652 */ { user_db_add(cur_user); } #line 1423 "cfg_parse.c" /* yacc.c:1652 */ break; case 15: #line 167 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap = xcalloc(1, sizeof(struct user_cap)); cur_cap->caps = default_caps; } #line 1432 "cfg_parse.c" /* yacc.c:1652 */ break; case 16: #line 170 "cfg_parse.y" /* yacc.c:1652 */ { list_prepend(&cur_user->cap_list, cur_cap); } #line 1440 "cfg_parse.c" /* yacc.c:1652 */ break; case 17: #line 176 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_user == default_user) default_caps = cur_cap->caps; } #line 1449 "cfg_parse.c" /* yacc.c:1652 */ break; case 26: #line 205 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->dest) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'to' can only be specified once", current_line); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } cur_cap->dest = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr((yyvsp[0].string), cur_cap->dest) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, (yyvsp[0].string)); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[0].string)); } #line 1481 "cfg_parse.c" /* yacc.c:1652 */ break; case 27: #line 235 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->fport) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'fport' can only be specified once", current_line); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } cur_cap->fport = xmalloc(sizeof(struct port_range)); if (extract_port_range((yyvsp[0].string), cur_cap->fport) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port or port range: \"%s\"", current_line, (yyvsp[0].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[0].string)); } #line 1511 "cfg_parse.c" /* yacc.c:1652 */ break; case 28: #line 263 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->src) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'from' can only be specified once", current_line); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } cur_cap->src = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr((yyvsp[0].string), cur_cap->src) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, (yyvsp[0].string)); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[0].string)); } #line 1543 "cfg_parse.c" /* yacc.c:1652 */ break; case 29: #line 293 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->lport) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] 'lport' can only be specified once", current_line); } free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } cur_cap->lport = xmalloc(sizeof(struct port_range)); if (extract_port_range((yyvsp[0].string), cur_cap->lport) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port or port range: \"%s\"", current_line, (yyvsp[0].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[0].string)); } #line 1573 "cfg_parse.c" /* yacc.c:1652 */ break; case 32: #line 327 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap->caps = CAP_REPLY; cur_cap->action = ACTION_FORCE; cur_cap->data.replies.num = 1; cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, sizeof(u_char *)); cur_cap->data.replies.data[0] = (yyvsp[0].string); } #line 1586 "cfg_parse.c" /* yacc.c:1652 */ break; case 33: #line 336 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->data.replies.num < 0xFF) { cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, ++cur_cap->data.replies.num * sizeof(u_char *)); cur_cap->data.replies.data[cur_cap->data.replies.num - 1] = (yyvsp[0].string); } else { o_log(LOG_CRIT, "[line %u] No more than 255 replies may be specified", current_line); free_cap_entries(cur_cap); YYABORT; } } #line 1603 "cfg_parse.c" /* yacc.c:1652 */ break; case 34: #line 351 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap->caps = CAP_FORWARD; cur_cap->action = ACTION_FORCE; cur_cap->data.forward.host = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr((yyvsp[-1].string), cur_cap->data.forward.host) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, (yyvsp[-1].string)); } free((yyvsp[-1].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } if (get_port((yyvsp[0].string), &cur_cap->data.forward.port) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port: \"%s\"", current_line, (yyvsp[0].string)); free((yyvsp[-1].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[-1].string)); free((yyvsp[0].string)); } #line 1635 "cfg_parse.c" /* yacc.c:1652 */ break; case 35: #line 381 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap->caps = (yyvsp[0].value); cur_cap->action = ACTION_FORCE; } #line 1644 "cfg_parse.c" /* yacc.c:1652 */ break; case 38: #line 390 "cfg_parse.y" /* yacc.c:1652 */ { if ((yyvsp[-1].value) == ACTION_ALLOW) cur_cap->caps |= (yyvsp[0].value); else cur_cap->caps &= ~(yyvsp[0].value); cur_cap->action = (yyvsp[-1].value); } #line 1657 "cfg_parse.c" /* yacc.c:1652 */ break; case 39: #line 399 "cfg_parse.y" /* yacc.c:1652 */ { if ((yyvsp[-1].value) == ACTION_ALLOW) cur_cap->caps |= CAP_FORWARD; else cur_cap->caps &= ~CAP_FORWARD; cur_cap->action = (yyvsp[-1].value); } #line 1670 "cfg_parse.c" /* yacc.c:1652 */ break; case 42: #line 416 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap->caps = CAP_REPLY; cur_cap->data.replies.num = 1; cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, sizeof(u_char *)); cur_cap->data.replies.data[0] = (yyvsp[0].string); } #line 1682 "cfg_parse.c" /* yacc.c:1652 */ break; case 43: #line 424 "cfg_parse.y" /* yacc.c:1652 */ { if (cur_cap->data.replies.num < MAX_RANDOM_REPLIES && cur_cap->data.replies.num < 0xFF) { cur_cap->data.replies.data = xrealloc(cur_cap->data.replies.data, ++cur_cap->data.replies.num * sizeof(u_char *)); cur_cap->data.replies.data[cur_cap->data.replies.num - 1] = (yyvsp[0].string); } } #line 1695 "cfg_parse.c" /* yacc.c:1652 */ break; case 44: #line 435 "cfg_parse.y" /* yacc.c:1652 */ { cur_cap->caps = CAP_FORWARD; cur_cap->data.forward.host = xmalloc(sizeof(struct sockaddr_storage)); if (get_addr((yyvsp[-1].string), cur_cap->data.forward.host) == -1) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad address: \"%s\"", current_line, (yyvsp[-1].string)); } free((yyvsp[-1].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } if (get_port((yyvsp[0].string), &cur_cap->data.forward.port) == -1) { if (parser_mode == PARSE_SYSTEM) o_log(LOG_CRIT, "[line %u] Bad port: \"%s\"", current_line, (yyvsp[0].string)); free((yyvsp[-1].string)); free((yyvsp[0].string)); free_cap_entries(cur_cap); YYABORT; } free((yyvsp[-1].string)); free((yyvsp[0].string)); } #line 1726 "cfg_parse.c" /* yacc.c:1652 */ break; case 45: #line 464 "cfg_parse.y" /* yacc.c:1652 */ { if ((yyvsp[0].value) == CAP_SPOOF || (yyvsp[0].value) == CAP_SPOOF_ALL || (yyvsp[0].value) == CAP_SPOOF_PRIVPORT) { free_cap_entries(cur_cap); YYABORT; } cur_cap->caps = (yyvsp[0].value); } #line 1740 "cfg_parse.c" /* yacc.c:1652 */ break; #line 1744 "cfg_parse.c" /* yacc.c:1652 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif /*-----------------------------------------------------. | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 479 "cfg_parse.y" /* yacc.c:1918 */ /* ** Read in the system-wide configuration file. */ int read_config(const char *path) { FILE *fp; int ret; fp = fopen(path, "r"); if (!fp) { if (errno == ENOENT) { /* ** If a configuration file is specified on the ** command line, return an error if it can't be opened, ** even if it doesn't exist. */ if (!strcmp(path, CONFFILE)) { struct user_info *temp_default; temp_default = user_db_create_default(); user_db_set_default(temp_default); return 0; } } o_log(LOG_CRIT, "Error opening configuration file: %s: %s", path, strerror(errno)); return -1; } yyrestart(fp); current_line = 1; parser_mode = PARSE_SYSTEM; ret = yyparse(); fclose(fp); /* ** Make sure there's a default to fall back on. */ if (!default_user) { struct user_info *temp_default; temp_default = user_db_create_default(); user_db_set_default(temp_default); } return ret; } /* ** Open the user's configuration file for reading by the parser. */ static FILE *open_user_config(const struct passwd *pw) { FILE *fp = NULL; #if XDGBDIR_SUPPORT if (!fp) fp = safe_open(pw, USER_CONF_XDG); #endif if (!fp) fp = safe_open(pw, USER_CONF); if (!fp) return NULL; yyrestart(fp); current_line = 1; parser_mode = PARSE_USER; return fp; } /* ** Read in a user's configuration file. */ list_t *user_db_get_pref_list(const struct passwd *pw) { FILE *fp; int ret; fp = open_user_config(pw); if (!fp) return NULL; cur_cap = NULL; pref_list = NULL; ret = yyparse(); fclose(fp); if (ret != 0) { list_destroy(pref_list, user_db_cap_destroy_data); return NULL; } return pref_list; } static void yyerror(const char *err) { if (parser_mode == PARSE_USER) free_cap_entries(cur_cap); else o_log(LOG_CRIT, "[line %u] %s", current_line, err); } /* ** Extract a port range from a token. */ static int extract_port_range(const char *token, struct port_range *range) { char *p; p = strchr(token, ':'); if (p) *p++ = '\0'; if (*token == '\0') range->min = PORT_MIN; else if (get_port(token, &range->min) == -1) return -1; if (!p) { range->max = range->min; } else { if (*p == '\0') range->max = PORT_MAX; else if (get_port(p, &range->max) == -1) return -1; } return 0; } static void free_cap_entries(struct user_cap *free_cap) { user_db_cap_destroy_data(free_cap); if (free_cap != cur_cap) free(cur_cap); free(free_cap); free(cur_user); cur_cap = NULL; cur_user = NULL; pref_list = NULL; } oidentd-2.5.0/src/oidentd.h0000644000175000017500000001140213545375404012463 00000000000000/* ** oidentd.h - oidentd ident (RFC 1413) implementation. ** Copyright (c) 1998-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __OIDENTD_H_ #define __OIDENTD_H_ #ifndef SYSCONFDIR #define SYSCONFDIR "/etc" #endif /* ** File containing the ident replies to be used for hosts that ** masquerade through us. */ #define MASQ_MAP SYSCONFDIR "/oidentd_masq.conf" /* ** String prepended to a random number when the random_numeric capability is ** used. */ #define UPREFIX "user" /* ** System-wide configuration file. */ #define CONFFILE SYSCONFDIR "/oidentd.conf" /* ** Per-user configuration file. This file is relative to the user's ** home directory. */ #if XDGBDIR_SUPPORT # define USER_CONF_XDG ".config/oidentd.conf" #endif #define USER_CONF ".oidentd.conf" /* ** Maximum length of ident replies. */ #define MAX_ULEN 512 /* ** Exclusive upper limit for numbers generated by the "random_numeric" ** capability. */ #define RANDOM_NUMERIC_UPPER_EXCL 100000 /* ** Maximum number of random replies -- the number of strings that ** may follow "reply" statements. */ #define MAX_RANDOM_REPLIES 20 /* ** The default UID and GID, respectively, that oidentd will ** run with. */ #define DEFAULT_UID 65534UL #define DEFAULT_GID 65534UL /* ** Default port oidentd runs on and default forward port. ** ** If you're going to change these default ports, be sure to make them a ** string (eg. "113" not 113). */ #define DEFAULT_PORT "113" #define DEFAULT_FPORT "113" /* ** The amount of time oidentd will wait for client input ** before it drops the connection. */ #define DEFAULT_TIMEOUT 30 /* ** Nothing below here should need to be changed. */ #define DEFAULT_UMASK 0022 #define MAX_HOSTLEN 256 #ifndef INET_ADDRSTRLEN # define INET_ADDRSTRLEN 16 #endif #if WANT_IPV6 # ifndef INET6_ADDRSTRLEN # define INET6_ADDRSTRLEN 46 # endif # if INET6_ADDRSTRLEN < 46 # error "INET6_ADDRSTRLEN is too small" # endif # define MAX_IPLEN INET6_ADDRSTRLEN # define IP_SCAN_SPEC "%45s" #else # if INET_ADDRSTRLEN < 16 # error "INET_ADDRSTRLEN is too small" # endif # define MAX_IPLEN INET_ADDRSTRLEN # define IP_SCAN_SPEC "%15s" #endif #define PORT_MAX 0xffff #define PORT_MIN 1 /* ** POSIX reserves these UID and GID values for this purpose. */ #define MISSING_UID ((uid_t) -1) #define MISSING_GID ((gid_t) -1) #define VALID_PORT(p) ((p) >= PORT_MIN && ((p) & PORT_MAX) == (p)) #define ERROR(x) (opt_enabled(HIDE_ERRORS) ? "UNKNOWN-ERROR" : (x)) #if ENABLE_DEBUGGING # define debug(format, args...) do { o_log(LOG_DEBUG, "[%s:%u:%s] DEBUG: " format, __FILE__, __LINE__, __FUNCTION__, ##args); } while (0) #else # define debug(format, args...) do { } while (0) #endif #ifdef HAVE___ATTRIBUTE__UNUSED #define __notused __attribute__((unused)) #else #define __notused #endif #ifdef HAVE___ATTRIBUTE__NORETURN #define __noreturn __attribute__((noreturn)) #else #define __noreturn #endif #ifdef HAVE___ATTRIBUTE__FORMAT #define __format(x) __attribute__((format x )) #else #define __format(x) #endif #ifdef HAVE_STDBOOL_H # include #else typedef enum { false = 0, true = 1 } bool; #endif /* ** Open the kernel memory device. ** Return 0 on success, or -1 with errno set. */ int k_open(void); #ifndef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage { struct sockaddr __ss_sockaddr; char __ss_pad[128 - sizeof(struct sockaddr)]; }; # define ss_family __ss_sockaddr.sa_family #endif #ifdef HAVE___SS_FAMILY #define ss_family __ss_family #endif /* ** System-dependent initialization; called only once. ** Called before privileges are dropped. ** Returns non-zero on failure. */ int core_init(void); /* ** Returns the UID of the owner of an IPv4 connection, ** or MISSING_UID on failure. */ uid_t get_user4( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); /* ** Returns the UID of the owner of an IPv6 connection, ** or MISSING_UID on failure. */ uid_t get_user6( in_port_t lport, in_port_t fport, struct sockaddr_storage *laddr, struct sockaddr_storage *faddr); int read_config(const char *config_file); #endif oidentd-2.5.0/src/cfg_scan.c0000644000175000017500000016032013646057327012602 00000000000000 #line 3 "cfg_scan.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 38 #define YY_END_OF_BUFFER 39 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[136] = { 0, 0, 0, 25, 25, 0, 0, 39, 36, 2, 30, 23, 3, 37, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 1, 25, 26, 35, 29, 28, 38, 36, 2, 3, 3, 36, 24, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 7, 36, 25, 26, 26, 27, 35, 34, 31, 33, 34, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 31, 32, 36, 36, 12, 36, 36, 36, 8, 36, 14, 36, 36, 36, 36, 36, 4, 31, 32, 11, 36, 13, 36, 9, 36, 10, 36, 36, 21, 18, 36, 36, 6, 36, 15, 36, 5, 22, 16, 36, 36, 36, 36, 36, 36, 36, 19, 36, 36, 36, 36, 36, 36, 36, 36, 36, 17, 20, 0 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 1, 1, 1, 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 1, 19, 20, 21, 22, 23, 1, 24, 25, 26, 27, 28, 29, 30, 31, 1, 1, 32, 1, 1, 33, 1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 1, 1, 43, 44, 45, 46, 47, 1, 48, 49, 50, 51, 52, 53, 30, 54, 1, 55, 1, 56, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const YY_CHAR yy_meta[57] = { 0, 1, 2, 3, 4, 1, 5, 1, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2 } ; static const flex_int16_t yy_base[150] = { 0, 0, 0, 54, 55, 59, 61, 252, 0, 249, 327, 327, 57, 244, 47, 54, 48, 54, 56, 52, 49, 67, 55, 57, 55, 327, 0, 76, 0, 327, 327, 76, 0, 245, 65, 0, 239, 327, 67, 93, 63, 85, 87, 93, 103, 95, 98, 98, 99, 101, 0, 110, 0, 82, 119, 327, 0, 327, 233, 327, 0, 234, 0, 105, 118, 99, 125, 110, 115, 125, 130, 121, 135, 137, 136, 134, 133, 225, 0, 133, 136, 0, 150, 155, 140, 0, 157, 0, 144, 147, 150, 144, 161, 0, 327, 327, 0, 158, 0, 158, 0, 164, 0, 166, 165, 0, 199, 166, 180, 0, 185, 198, 189, 0, 0, 0, 181, 184, 180, 178, 191, 193, 193, 0, 186, 201, 195, 195, 198, 204, 200, 213, 204, 0, 0, 327, 254, 260, 266, 272, 278, 284, 290, 296, 302, 308, 314, 123, 320, 63 } ; static const flex_int16_t yy_def[150] = { 0, 135, 1, 136, 136, 137, 137, 135, 138, 135, 135, 135, 139, 140, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 135, 141, 142, 143, 135, 135, 144, 138, 135, 139, 145, 146, 135, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 141, 142, 142, 135, 143, 135, 135, 135, 147, 146, 148, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 135, 149, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 135, 135, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 0, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135 } ; static const flex_int16_t yy_nxt[384] = { 0, 8, 9, 10, 11, 12, 8, 13, 8, 8, 14, 8, 8, 15, 8, 16, 17, 18, 8, 19, 8, 20, 8, 8, 21, 22, 23, 24, 8, 8, 8, 8, 8, 8, 14, 8, 8, 15, 8, 16, 17, 18, 8, 19, 8, 20, 8, 8, 21, 22, 23, 24, 8, 8, 8, 25, 25, 10, 10, 35, 27, 27, 29, 30, 29, 30, 38, 35, 39, 95, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 48, 54, 55, 58, 59, 63, 66, 135, 135, 38, 31, 39, 31, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 48, 60, 67, 64, 68, 63, 66, 35, 35, 65, 69, 70, 71, 72, 73, 35, 35, 74, 75, 76, 54, 55, 79, 80, 78, 81, 67, 64, 68, 84, 85, 86, 82, 65, 69, 70, 71, 72, 73, 87, 88, 74, 75, 76, 89, 90, 79, 80, 81, 83, 91, 92, 93, 84, 85, 86, 82, 96, 97, 98, 99, 100, 101, 87, 88, 102, 103, 104, 89, 90, 105, 106, 107, 83, 91, 92, 93, 108, 109, 110, 111, 96, 97, 98, 99, 100, 101, 113, 114, 102, 103, 104, 115, 105, 117, 106, 107, 119, 120, 121, 122, 108, 109, 110, 111, 123, 124, 118, 125, 126, 127, 113, 114, 128, 129, 130, 115, 131, 117, 132, 133, 119, 120, 121, 122, 134, 116, 112, 94, 123, 124, 118, 125, 126, 127, 62, 77, 128, 129, 130, 62, 131, 33, 132, 133, 37, 33, 135, 135, 134, 26, 26, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 32, 135, 135, 32, 32, 32, 34, 34, 135, 34, 34, 34, 36, 135, 135, 36, 36, 36, 52, 52, 135, 52, 135, 52, 53, 53, 135, 53, 53, 53, 56, 56, 135, 135, 56, 56, 57, 57, 135, 57, 57, 57, 35, 35, 135, 35, 35, 35, 61, 135, 135, 61, 61, 61, 62, 135, 135, 62, 62, 62, 7, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135 } ; static const flex_int16_t yy_chk[384] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 12, 3, 4, 5, 5, 6, 6, 14, 34, 15, 149, 16, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 21, 27, 27, 31, 31, 38, 40, 53, 53, 14, 5, 15, 6, 16, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 21, 31, 41, 39, 42, 38, 40, 12, 12, 39, 43, 44, 45, 46, 47, 34, 34, 48, 49, 51, 54, 54, 63, 64, 147, 65, 41, 39, 42, 67, 68, 69, 66, 39, 43, 44, 45, 46, 47, 70, 71, 48, 49, 51, 72, 73, 63, 64, 65, 66, 74, 75, 76, 67, 68, 69, 66, 79, 80, 82, 83, 84, 86, 70, 71, 88, 89, 90, 72, 73, 91, 92, 97, 66, 74, 75, 76, 99, 101, 103, 104, 79, 80, 82, 83, 84, 86, 107, 108, 88, 89, 90, 110, 91, 112, 92, 97, 116, 117, 118, 119, 99, 101, 103, 104, 120, 121, 112, 122, 124, 125, 107, 108, 126, 127, 128, 110, 129, 112, 130, 131, 116, 117, 118, 119, 132, 111, 106, 77, 120, 121, 112, 122, 124, 125, 61, 58, 126, 127, 128, 36, 129, 33, 130, 131, 13, 9, 7, 0, 132, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 138, 0, 0, 138, 138, 138, 139, 139, 0, 139, 139, 139, 140, 0, 0, 140, 140, 140, 141, 141, 0, 141, 0, 141, 142, 142, 0, 142, 142, 142, 143, 143, 0, 0, 143, 143, 144, 144, 0, 144, 144, 144, 145, 145, 0, 145, 145, 145, 146, 0, 0, 146, 146, 146, 148, 0, 0, 148, 148, 148, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "cfg_scan.l" #line 2 "cfg_scan.l" /* ** cfg_scan.l - oidentd configuration scanner. ** Copyright (c) 2001-2006 Ryan McCabe ** Copyright (c) 2018-2019 Janik Rabe ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License, version 2, ** as published by the Free Software Foundation. ** ** 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, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "oidentd.h" #include "util.h" #include "missing.h" #include "user_db.h" #include "options.h" #include "cfg_parse.h" #define STRING_CHUNK_LEN 256 extern int parser_mode; static char *string_buf; static size_t str_idx; static size_t max_slen; static char get_esc_char(char c); u_int32_t current_line; #line 630 "cfg_scan.c" #line 632 "cfg_scan.c" #define INITIAL 0 #define state_comment 1 #define state_string 2 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 86 "cfg_scan.l" #line 852 "cfg_scan.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 136 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 135 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 88 "cfg_scan.l" { return yytext[0]; } YY_BREAK case 2: YY_RULE_SETUP #line 92 "cfg_scan.l" { /* ignore */ } YY_BREAK case 3: YY_RULE_SETUP #line 96 "cfg_scan.l" { /* ignore */ } YY_BREAK case 4: YY_RULE_SETUP #line 100 "cfg_scan.l" { return TOK_USER; } YY_BREAK case 5: YY_RULE_SETUP #line 104 "cfg_scan.l" { return TOK_DEFAULT; } YY_BREAK case 6: YY_RULE_SETUP #line 108 "cfg_scan.l" { return TOK_GLOBAL; } YY_BREAK case 7: YY_RULE_SETUP #line 112 "cfg_scan.l" { return TOK_TO; } YY_BREAK case 8: YY_RULE_SETUP #line 116 "cfg_scan.l" { return TOK_FROM; } YY_BREAK case 9: YY_RULE_SETUP #line 120 "cfg_scan.l" { return TOK_FPORT; } YY_BREAK case 10: YY_RULE_SETUP #line 124 "cfg_scan.l" { return TOK_LPORT; } YY_BREAK case 11: YY_RULE_SETUP #line 128 "cfg_scan.l" { yylval.value = ACTION_ALLOW; return TOK_ALLOWDENY; } YY_BREAK case 12: YY_RULE_SETUP #line 133 "cfg_scan.l" { yylval.value = ACTION_DENY; return TOK_ALLOWDENY; } YY_BREAK case 13: YY_RULE_SETUP #line 138 "cfg_scan.l" { return TOK_FORCE; } YY_BREAK case 14: YY_RULE_SETUP #line 142 "cfg_scan.l" { yylval.value = CAP_HIDE; return TOK_CAP; } YY_BREAK case 15: YY_RULE_SETUP #line 147 "cfg_scan.l" { yylval.value = CAP_RANDOM; return TOK_CAP; } YY_BREAK case 16: YY_RULE_SETUP #line 152 "cfg_scan.l" { yylval.value = CAP_NUMERIC; return TOK_CAP; } YY_BREAK case 17: YY_RULE_SETUP #line 157 "cfg_scan.l" { yylval.value = CAP_RANDOM_NUMERIC; return TOK_CAP; } YY_BREAK case 18: YY_RULE_SETUP #line 162 "cfg_scan.l" { yylval.value = CAP_SPOOF; return TOK_CAP; } YY_BREAK case 19: YY_RULE_SETUP #line 167 "cfg_scan.l" { yylval.value = CAP_SPOOF_ALL; return TOK_CAP; } YY_BREAK case 20: YY_RULE_SETUP #line 172 "cfg_scan.l" { yylval.value = CAP_SPOOF_PRIVPORT; return TOK_CAP; } YY_BREAK case 21: YY_RULE_SETUP #line 177 "cfg_scan.l" { return TOK_REPLY; } YY_BREAK case 22: YY_RULE_SETUP #line 181 "cfg_scan.l" { return TOK_FORWARD; } YY_BREAK case 23: YY_RULE_SETUP #line 185 "cfg_scan.l" { string_buf = xmalloc(STRING_CHUNK_LEN); str_idx = 0; max_slen = STRING_CHUNK_LEN; BEGIN(state_string); } YY_BREAK case 24: YY_RULE_SETUP #line 193 "cfg_scan.l" BEGIN(state_comment); YY_BREAK case 25: YY_RULE_SETUP #line 195 "cfg_scan.l" { /* ignore */; } YY_BREAK case 26: YY_RULE_SETUP #line 199 "cfg_scan.l" { /* ignore */; } YY_BREAK case 27: YY_RULE_SETUP #line 203 "cfg_scan.l" { BEGIN(INITIAL); } YY_BREAK case 28: YY_RULE_SETUP #line 207 "cfg_scan.l" { string_buf[str_idx++] = '\0'; string_buf = xrealloc(string_buf, str_idx); yylval.string = string_buf; BEGIN(INITIAL); return TOK_STRING; } YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP #line 216 "cfg_scan.l" { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Error: Unterminated string constant", current_line); } free(string_buf); return -1; } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP #line 226 "cfg_scan.l" { current_line++; } YY_BREAK case 31: YY_RULE_SETUP #line 230 "cfg_scan.l" { u_int32_t result; result = strtoul(yytext + 1, NULL, 8); if (result > 0xff) { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Bad escape sequence: \"%s\"", current_line, yytext); } free(string_buf); return -1; } if (str_idx >= max_slen - 1) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = result; } YY_BREAK case 32: YY_RULE_SETUP #line 253 "cfg_scan.l" { u_int32_t result; result = strtoul(yytext + 2, NULL, 16); if (str_idx >= max_slen - 2) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = result; } YY_BREAK case 33: YY_RULE_SETUP #line 266 "cfg_scan.l" { if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Error: Bad escape sequence: \"%s\"", current_line, yytext); } free(string_buf); return -1; } YY_BREAK case 34: YY_RULE_SETUP #line 276 "cfg_scan.l" { if (str_idx >= max_slen - 2) { max_slen += STRING_CHUNK_LEN; string_buf = xrealloc(string_buf, max_slen); } string_buf[str_idx++] = get_esc_char(yytext[1]); } YY_BREAK case 35: YY_RULE_SETUP #line 285 "cfg_scan.l" { size_t len = yyleng; char *p = yytext; if (str_idx + len >= max_slen - 1) { max_slen += len + 1; string_buf = xrealloc(string_buf, max_slen); } while (*p) string_buf[str_idx++] = *p++; } YY_BREAK case 36: YY_RULE_SETUP #line 298 "cfg_scan.l" { yylval.string = xstrdup(yytext); return TOK_STRING; } YY_BREAK case 37: YY_RULE_SETUP #line 303 "cfg_scan.l" { return yytext[0]; } YY_BREAK case 38: YY_RULE_SETUP #line 307 "cfg_scan.l" ECHO; YY_BREAK #line 1242 "cfg_scan.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(state_comment): case YY_STATE_EOF(state_string): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 136 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 136 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 135); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 307 "cfg_scan.l" /* ** Return the specified escaped character. */ static char get_esc_char(char c) { switch (c) { case 'n': return '\n'; case 't': return '\t'; case 'r': return '\r'; case 'f': return '\f'; case 'b': return '\b'; case 'v': return '\v'; case 'a': return '\a'; case 'e': if (parser_mode == PARSE_SYSTEM) { o_log(LOG_CRIT, "[line %u] Warning: Escape sequence '\\e' is " "deprecated; use '\\033' or '\\x1B' instead.", current_line); } return '\x1B'; default: break; } return c; } oidentd-2.5.0/config.guess0000755000175000017500000012637313646057317012435 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # 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. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 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'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". 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) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|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 ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 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 ;; 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:4.4BSD:*) 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) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" 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*: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 ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-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 "[:upper:]" "[:lower:]"``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 ;; k1om: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; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-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 ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-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:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi 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.*:*) 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 configure 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 ;; SX-ACE:SUPER-UX:*:*) echo sxace-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 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi 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 ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-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 ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </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-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: oidentd-2.5.0/compile0000755000175000017500000001632713646057317011470 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: oidentd-2.5.0/aclocal.m40000644000175000017500000012362113646057315011744 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])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-2018 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-2018 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-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 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-2018 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-2018 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-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 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 ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2018 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. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 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-2018 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-2018 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-2018 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-2018 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-2018 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-2018 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-2018 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 oidentd-2.5.0/contrib/0000755000175000017500000000000013475700570011615 500000000000000oidentd-2.5.0/contrib/systemd/0000755000175000017500000000000013545375404013307 500000000000000oidentd-2.5.0/contrib/systemd/oidentd.socket0000644000175000017500000000036513545375404016073 00000000000000[Unit] Conflicts=oidentd.service Description=RFC 1413 compliant ident socket Documentation=man:oidentd(8) man:oidentd.conf(5) man:oidentd_masq.conf(5) [Socket] Accept=true ListenStream=113 PrivateDevices=true [Install] WantedBy=sockets.target oidentd-2.5.0/contrib/systemd/oidentd@.service0000644000175000017500000000036513545375404016343 00000000000000[Unit] Description=RFC 1413 compliant per-connection ident server Documentation=man:oidentd(8) man:oidentd.conf(5) man:oidentd_masq.conf(5) [Service] ExecStart=/usr/sbin/oidentd -IS PrivateDevices=true StandardInput=socket StandardError=syslog oidentd-2.5.0/contrib/systemd/oidentd.service0000644000175000017500000000047113545375404016241 00000000000000[Unit] Description=RFC 1413 compliant ident daemon Documentation=man:oidentd(8) man:oidentd.conf(5) man:oidentd_masq.conf(5) After=network.target [Service] ExecStart=/usr/sbin/oidentd -S ExecReload=/bin/kill -HUP $MAINPID PrivateDevices=true Restart=on-failure Type=forking [Install] WantedBy=multi-user.target oidentd-2.5.0/configure.ac0000644000175000017500000004657313646056630012403 00000000000000dnl configure.ac - oidentd ident (RFC 1413) implementation. dnl Copyright (c) 2006 Ryan McCabe dnl Copyright (c) 2018-2019 Janik Rabe dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License, version 2, dnl as published by the Free Software Foundation. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA AC_INIT([oidentd], [2.5.0], [oidentd@janikrabe.com],, [https://oidentd.janikrabe.com]) AM_INIT_AUTOMAKE AC_DEFINE(PACKAGE_AUTHOR, ["Janik Rabe"], [maintainer]) AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_CPP AC_PROG_YACC AC_PROG_LEX AC_PROG_RANLIB AC_PROG_INSTALL AC_PATH_PROG(sedpath, sed) AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_C_CONST AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_CANONICAL_HOST WARN_CFLAGS="" DEBUG_CFLAGS="" ADD_LIB="" use_kmem=no require_superuser=no enableval="" masq_support=yes AC_ARG_ENABLE(masq, [ --disable-masq disable NAT/IP masquerading support]) if test "$enableval" = "no"; then masq_support=no fi enableval="" AC_ARG_ENABLE(nat, [ --disable-nat disable NAT/IP masquerading support]) if test "$enableval" = "no"; then masq_support=no fi enableval="" ipv6_support=yes AC_ARG_ENABLE(ipv6, [ --disable-ipv6 disable IPv6 support]) if test "$enableval" = "no"; then ipv6_support=no fi enableval="" libnfct_support=yes AC_ARG_ENABLE(libnfct, [ --disable-libnfct disable libnetfilter_conntrack support]) if test "$enableval" = "no"; then libnfct_support=no fi enableval="" xdgbdir_support=yes AC_ARG_ENABLE(xdgbdir, [ --disable-xdgbdir disable XDG Base Directory support]) if test "$enableval" = "no"; then xdgbdir_support=no fi enableval="" AC_ARG_ENABLE(debug, [ --enable-debug enable debugging support]) if test "$enableval" = "yes"; then AC_DEFINE(ENABLE_DEBUGGING, 1, [Set to enable debugging]) else AC_DEFINE(ENABLE_DEBUGGING, 0, [Set to enable debugging]) fi enableval="" AC_ARG_ENABLE(warn, [ --enable-warn enable a variety of compiler warnings]) if test "$enableval" = "yes"; then WARN_CFLAGS="-O3 -ggdb -fstack-protector -fstrict-aliasing -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls -Wmissing-format-attribute -Wmissing-noreturn -Wstrict-aliasing=2 -Wlong-long -Wcomment -Wunreachable-code -Wswitch-enum -Wswitch-default -Wvolatile-register-var -Wformat=2 -Winit-self -Winvalid-pch -Winline -Wpointer-arith -Wbad-function-cast -Wcast-align -Wchar-subscripts -Wunsafe-loop-optimizations -Wdisabled-optimization -Wwrite-strings -Wsign-compare -Wconversion -Wmissing-field-initializers -Wnested-externs -Wstack-protector -Wunused-macros -Wendif-labels -Wno-cast-qual" fi if test "$LEX" = ":" || ! $LEX --version < /dev/null > /dev/null 2>&1; then AC_MSG_ERROR([No lexer generator found; please install flex]) fi if ! $YACC --version < /dev/null > /dev/null 2>&1; then AC_MSG_ERROR([No parser generator found; please install bison]) fi AC_SUBST(WARN_CFLAGS) AC_SUBST(DEBUG_CFLAGS) # Don't rely on __STDC_VERSION__ as kernels may use C99 booleans AC_CHECK_HEADERS(stdbool.h) AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h) AC_CHECK_HEADERS(net/if.h, [], [], [ #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif ]) AC_CHECK_HEADERS(netinet/ip_compat.h netinet6/in6_pcb.h, [], [], [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NET_IF_H #include #endif ]) AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h) AC_CHECK_TYPE(u_int32_t, uint32_t) if test "$ac_cv_type_u_int32_t" = "no"; then AC_CHECK_TYPE(uint32_t, unsigned int) fi AC_CHECK_TYPE(u_int16_t, uint16_t) if test "$ac_cv_type_u_int16_t" = "no"; then AC_CHECK_TYPE(uint16_t, unsigned short) fi AC_CHECK_TYPE(u_int8_t, uint8_t) if test "$ac_cv_type_u_int8_t" = "no"; then AC_CHECK_TYPE(uint8_t, unsigned char) fi AC_MSG_CHECKING(for AF_INET6) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include #include #include #include #include ], [AF_INET6+1;])], [AC_MSG_RESULT(yes)], [AC_DEFINE(AF_INET6, 10, [Define if AF_INET6 is missing]) AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for socklen_t) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include #include ], [sizeof(socklen_t);])], [AC_MSG_RESULT(yes)], [AC_DEFINE(socklen_t, int, [Define to int if socklen_t is missing]) AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for in_addr_t) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include #include #include #include #include ], [sizeof(in_addr_t);])], [AC_MSG_RESULT(yes)], [AC_DEFINE(in_addr_t, unsigned int, [Define to unsigned int if in_addr_t is missing]) AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for in_port_t) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include #include #include #include #include ], [sizeof(in_port_t);])], [AC_MSG_RESULT(yes)], [AC_DEFINE(in_port_t, unsigned short, [Define to unsigned short if in_port_t is missing]) AC_MSG_RESULT(no)]) AC_CHECK_SIZEOF(void *) AC_DEFINE_UNQUOTED(SIZEOF_VOID_P, $ac_cv_sizeof_void_p, [Size of the 'void *' type]) AC_MSG_CHECKING(for __attribute__ unused) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [int x __attribute__((unused));])], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE___ATTRIBUTE__UNUSED, 1, [Define if your compiler has __attribute__ unused])], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for __attribute__ noreturn) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ exit(0); } static void foo(void) __attribute__((noreturn)); static void foo(void) {exit(0); ])], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE___ATTRIBUTE__NORETURN, 1, [Define if your compiler has __attribute__ noreturn])], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for __attribute__ format) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ exit(0); } static int foo(char *fmt, ...) __attribute__((format (printf, 1, 2))); static int foo(char *fmt, ...) { ])], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE___ATTRIBUTE__FORMAT, 1, [Define if your compiler has __attribute__ format])], [AC_MSG_RESULT(no)]) AC_TYPE_SIGNAL AC_CHECK_FUNCS(strsep) AC_CHECK_FUNCS(clock_gettime select strdup strstr strtol uname) AC_CHECK_FUNCS(arc4random_uniform lrand48 random) AC_CHECK_FUNCS(memcmp strftime vprintf gethostbyname) AC_CHECK_FUNCS(vasprintf asprintf) AC_CHECK_FUNCS(inet_aton getpagesize getopt_long) AC_CHECK_FUNCS(setgroups) AC_CHECK_FUNCS(unveil) AC_SEARCH_LIBS(socket, socket, , [AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket)]) AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the 'getaddrinfo' function.]), AC_SEARCH_LIBS(getaddrinfo, socket, AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the 'getaddrinfo' function.]))) AC_CHECK_FUNC(freeaddrinfo, AC_DEFINE(HAVE_FREEADDRINFO, 1, [Define to 1 if you have the 'freeaddrinfo' function.]), AC_SEARCH_LIBS(freeaddrinfo, socket, AC_DEFINE(HAVE_FREEADDRINFO, 1, [Define to 1 if you have the 'freeaddrinfo' function.]))) AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.]), AC_SEARCH_LIBS(gai_strerror, socket, AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.]))) AC_CHECK_FUNC(getnameinfo, AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define to 1 if you have the 'getnameinfo' function.]), AC_SEARCH_LIBS(gai_strerror, socket, AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define to 1 if you have the 'getnameinfo' function.]))) AC_CHECK_FUNC(inet_ntop, AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have the 'inet_ntop' function.]), AC_SEARCH_LIBS(inet_ntop, nsl, AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have the 'inet_ntop' function.]))) AC_CHECK_LIB(udb, main) AC_MSG_CHECKING(for struct sockaddr_storage) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ struct sockaddr_storage ss; ])], [ have_sockaddr_storage=yes ], [ have_sockaddr_storage=no ]) AC_MSG_RESULT($have_sockaddr_storage) if test "$have_sockaddr_storage" = "yes"; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Define to 1 if you have struct sockaddr_storage]) AC_MSG_CHECKING(for ss_family member in struct sockaddr_storage) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ size_t test = sizeof(((struct sockaddr_storage *)0)->ss_family);])], [ have_ss_family=yes ], [ have_ss_family=no ]) AC_MSG_RESULT($have_ss_family) if test "$have_ss_family" = "no"; then AC_MSG_CHECKING(for __ss_family member in struct sockaddr_storage) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ size_t test = sizeof(((struct sockaddr_storage *)0)->__ss_family);])], [ have_ss_family=yes ], [ have_ss_family=no ]) AC_MSG_RESULT($have_ss_family) if test "$have_ss_family" = "yes"; then AC_DEFINE(HAVE___SS_FAMILY, 1, [Define if the sockaddr storage struct has the ss_family member]) fi fi fi AC_MSG_CHECKING(for struct sockaddr_in6) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ struct sockaddr_in6 s; ])], [ have_sockaddr_in6=yes ], [ have_sockaddr_in6=no ]) AC_MSG_RESULT($have_sockaddr_in6) if test "$have_sockaddr_in6" = "yes"; then AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [Define to 1 if you have struct sockaddr_in6]) fi AC_MSG_CHECKING(for struct in6_addr) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include ], [ struct in6_addr s; ])], [ have_in6_addr=yes ], [ have_in6_addr=no ]) AC_MSG_RESULT($have_in6_addr) if test "$have_in6_addr" = "yes"; then AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [Define to 1 if you have struct in6_addr]) fi AC_MSG_CHECKING(for struct addrinfo) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include #include #include ], [ size_t test = sizeof(((struct addrinfo *)0)->ai_flags);])], [ have_struct_addrinfo=yes ], [ have_struct_addrinfo=no ]) AC_MSG_RESULT($have_struct_addrinfo) if test "$have_struct_addrinfo" = "yes"; then AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Define to 1 if you have struct addrinfo]) fi have_ipnat_h="" AC_CHECK_HEADER(netinet/ip_compat.h netinet/ip_fil.h netinet/ip_nat.h) AC_CHECK_HEADER(netinet/ip_nat.h, have_ipnat_h="yes", have_ipnat_h="no", [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_IP_COMPAT_H #include #endif #ifdef HAVE_NETINET_IP_FIL_H #include #endif ]) if test "$have_ipnat_h" = "no"; then AC_CHECK_HEADER(/usr/src/sys/contrib/ipfilter/netinet/ip_nat.h, have_ipnat_h="yes", have_ipnat_h="no", [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_IP_COMPAT_H #include #endif #ifdef HAVE_NETINET_IP_FIL_H #include #endif ]) if test "$have_ipnat_h" = "yes"; then CPPFLAGS="$CPPFLAGS -I/usr/src/sys/contrib/ipfilter" fi fi if test "$masq_support" = "yes"; then old_CPPFLAGS=$CPPFLAGS if test `uname -s` = "SunOS"; then release=`uname -r | cut -d. -f2` CPPFLAGS="$CPPFLAGS -DSOLARIS=$release" fi AC_MSG_CHECKING(if nat_t has nat_p member) AC_CACHE_VAL(ac_cv_ipf_nat_p, AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [ #include #include #include #include #include #include #include #include #include #include #include #if defined(__OpenBSD__) # include #else # if defined(SOLARIS) && SOLARIS >= 8 # include # endif # include #endif #include #include ], [int i = sizeof(((nat_t *)0)->nat_p);])], ac_cv_ipf_nat_p=yes, ac_cv_ipf_nat_p=no)) AC_MSG_RESULT($ac_cv_ipf_nat_p) CPPFLAGS=$old_CPPFLAGS fi if test "$masq_support" = "no"; then libnfct_support=no fi want_libnfct=no case "$host_os" in *linux* ) os_src=linux.c if test "$masq_support" = "yes"; then want_libnfct=yes fi if test "$libnfct_support" = "yes"; then AC_CHECK_LIB(netfilter_conntrack, nfct_query, , [libnfct_support=no]) fi ;; *netbsd* ) case "$host_os" in *netbsd[[1-4]].* ) AC_MSG_WARN(Support for this version of NetBSD is deprecated and may be removed in the future) use_kmem=yes os_src=legacy/netbsd.c if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; * ) use_kmem=no require_superuser=yes os_src=netbsd5.c masq_support=no ;; esac ;; *darwin* ) AC_MSG_WARN(Support for this version of Darwin is deprecated and may be removed in the future) use_kmem=yes os_src=legacy/darwin.c if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; *openbsd* ) case "$host_os" in *openbsd1.* ) AC_MSG_ERROR([cannot build on $host_os; oidentd requires OpenBSD 2.0 or newer]) ;; *openbsd2.* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; esac if test "$masq_support" = "no"; then case "$host_os" in *openbsd2.[[0-3]]* ) AC_MSG_WARN(Support for this version of OpenBSD is deprecated and may be removed in the future) use_kmem=yes os_src=legacy/openbsd.c ;; *openbsd2.[[4-8]] ) AC_MSG_WARN(Support for this version of OpenBSD is deprecated and may be removed in the future) os_src=legacy/openbsd24.c ;; *openbsd2.9* ) AC_MSG_WARN(Support for this version of OpenBSD is deprecated and may be removed in the future) os_src=legacy/openbsd29.c ;; * ) os_src=openbsd30.c ;; esac else case "$host_os" in *openbsd2.* ) AC_MSG_WARN(Support for this version of OpenBSD is deprecated and may be removed in the future) use_kmem=yes os_src=legacy/openbsd.c ;; * ) os_src=openbsd30.c ;; esac fi ;; *freebsd* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi if test "$masq_support" = "no"; then case "$host_os" in *freebsd[[1-3]].* ) AC_MSG_WARN(Support for this version of FreeBSD is deprecated and may be removed in the future) use_kmem=yes os_src=freebsd.c ;; * ) use_kmem=no require_superuser=yes os_src=freebsd4.c ;; esac else case "$host_os" in *freebsd[[1-4]].* ) AC_MSG_WARN(Support for this version of FreeBSD is deprecated and may be removed in the future) use_kmem=yes os_src=freebsd.c ;; * ) use_kmem=yes os_src=freebsd5.c ;; esac fi ;; *dragonfly* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi if test "$masq_support" = "no"; then use_kmem=no require_superuser=yes os_src=freebsd4.c else use_kmem=yes os_src=freebsd.c fi ;; *solaris* ) ADD_LIB="$ADD_LIB -lelf" AC_MSG_WARN(Support for this version of Solaris is deprecated and may be removed in the future) use_kmem=yes masq_support=no ipv6_support=no case "$host_os" in *solaris2.[[0-3]]* ) AC_MSG_ERROR([cannot build on $host_os; oidentd requires Solaris 2.4 or newer]) ;; *solaris2.4* ) AC_DEFINE(SOLARIS, 4, [Solaris version number]) os_src=legacy/solaris4.c ;; *solaris2.5* ) AC_DEFINE(SOLARIS, 5, [Solaris version number]) os_src=legacy/solaris5.c ;; *solaris2.6* ) AC_DEFINE(SOLARIS, 6, [Solaris version number]) os_src=legacy/solaris7.c ;; *solaris2.7* ) AC_DEFINE(SOLARIS, 7, [Solaris version number]) os_src=legacy/solaris7.c ;; *solaris[[2-4]].* ) AC_DEFINE(SOLARIS, 8, [Solaris version number]) os_src=legacy/solaris8.c ;; *solaris5.0* ) AC_DEFINE(SOLARIS, 8, [Solaris version number]) os_src=legacy/solaris8.c ;; * ) AC_MSG_ERROR([cannot build on $host_os; oidentd requires Solaris 5.0 or older]) ;; esac ;; * ) AC_MSG_ERROR([oidentd does not yet support $host_os]) ;; esac AC_DEFINE_UNQUOTED(KERNEL_DRIVER, "$os_src", [The name of the detected kernel driver]) if test "$use_kmem" = "yes"; then AC_DEFINE(USE_KMEM, 1, [Set if using /dev/kmem]) ADD_LIB="$ADD_LIB -lkvm" else AC_DEFINE(USE_KMEM, 0, [Set if using /dev/kmem]) fi if test "$require_superuser" = "yes"; then AC_DEFINE(NEED_ROOT, 1, [Set if privileges cannot be dropped]) AC_MSG_WARN(privileges will not be dropped automatically on this system) else AC_DEFINE(NEED_ROOT, 0, [Set if privileges cannot be dropped]) fi if test "$masq_support" = "yes"; then AC_DEFINE(MASQ_SUPPORT, 1, [Set to include NAT/IP masquerading support]) else AC_DEFINE(MASQ_SUPPORT, 0, [Set to include NAT/IP masquerading support]) AC_MSG_WARN(not including NAT/IP masquerade support) fi if test "$ipv6_support" = "yes"; then AC_DEFINE(WANT_IPV6, 1, [Set to include IPv6 support]) else AC_DEFINE(WANT_IPV6, 0, [Set to include IPv6 support]) AC_MSG_WARN(not including IPv6 support) fi if test "$want_libnfct" = "yes"; then if test "$libnfct_support" = "yes"; then AC_DEFINE(LIBNFCT_SUPPORT, 1, [Set to include libnetfilter_conntrack support]) else AC_MSG_WARN([You are compiling oidentd without libnetfilter_conntrack]) AC_MSG_WARN([support. Depending on your kernel configuration, this may]) AC_MSG_WARN([make NAT support unavailable. Future releases of oidentd]) AC_MSG_WARN([may require libnetfilter_conntrack because parsing]) AC_MSG_WARN([connection tracking files relies on an obsolete Linux kernel]) AC_MSG_WARN([option. Consult the INSTALL file for more information.]) fi fi if test "$xdgbdir_support" = "yes"; then AC_DEFINE(XDGBDIR_SUPPORT, 1, [Set to include XDG Base Directory support]) else AC_DEFINE(XDGBDIR_SUPPORT, 0, [Set to include XDG Base Directory support]) fi if test -n "$DEBUG_CFLAGS"; then CFLAGS="$(echo $CFLAGS | sed 's/-O[[1-9]]*/-O0/g' | sed 's/-g[[0-9]]*/-g3 -ggdb/g')" fi AC_SUBST(LIBS) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(ADD_LIB) AC_SUBST(CPPFLAGS) AC_OUTPUT([ Makefile src/Makefile src/missing/Makefile doc/Makefile ]) cp -f $srcdir/src/kernel/$os_src src/os.c oidentd-2.5.0/COPYING.DOC0000644000175000017500000005465313545375404011553 00000000000000 GNU Free Documentation License Version 1.3, 3 November 2008 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The "publisher" means any person or entity that distributes copies of the Document to the public. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See https://www.gnu.org/licenses/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. oidentd-2.5.0/config.sub0000755000175000017500000010645013646057317012072 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 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" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: oidentd-2.5.0/Makefile.am0000644000175000017500000000020213475700570012123 00000000000000SUBDIRS = src doc sysconf_DATA = oidentd.conf \ oidentd_masq.conf EXTRA_DIST = KERNEL_SUPPORT.md \ $(sysconf_DATA) \ contrib oidentd-2.5.0/oidentd.conf0000644000175000017500000000145013545375404012374 00000000000000# This is the system-wide configuration file for oidentd. This # file provides defaults for users. The settings in this file # can be overridden by user configuration files of users who # have been granted sufficient privileges through this file. # # See oidentd.conf(5) for more information. default { default { # Capabilities are disabled by default deny spoof deny spoof_all deny spoof_privport deny random deny random_numeric deny numeric deny hide deny forward } } # It is recommended that you hide any connections owned by # the superuser. Uncomment the following lines to do this. #user root { # default { # # Uncomment only one of the following two lines. # force hide # Either report an error ... # force reply "nobody" # ... or spoof ident responses # } #} oidentd-2.5.0/AUTHORS0000644000175000017500000000433513545375404011154 00000000000000Bjarni R. Einarsson Support for libudb Chris Taylor Linux masquerading improvements Christian Kellner Linux DNAT patch Christof Douma Linux netfilter permissions fix Daniel Brafford Initial IPv6 support and IPv6 implementation for Linux Douglas Henke Improvements to PRNG seeding Flags --foreground and --nosyslog Support for inetd and daemontools Elliott Mitchell Fixed memory leaks in configuration parser Eric LeBlanc Fixed a bug that caused IP masquerading to fail Fabian Knittel Bind to IPv6 socket by default Fardale Fixed incorrect filter order in range specifications Guus Sliepen Initial netfilter (Linux >= 2.3 Support) Hanno Böck Fixed overflow due to incorrect sizeof type Jan Alexander Steffens Forwarding capability Jan Rękorajski Support for listening on multiple IPs Janik Rabe Everything else (project maintainer) Joerg Sonnenberger Initial DragonFly BSD support Johnny A. Solbu Various improvements to the build system Kamil Andrusz OpenBSD >= 3.0 Packet Filter support Krzysztof Oledzki Fix for IPv6 connection lookups Kufat Compatibility of inline functions with C99 Martin Waitz UDB fixes Matthias Scheler Replaced hardcoded configuration file path Motohiko Takemura Fixed a bug in the command-line argument handler Fixed a bug that caused IP masquerading to fail Fixed bugs with the --forward and --other flags Petr Písař Linux masquerading improvements Fixes for several compiler warnings Ryan McCabe Everything else (original author) Simon Arlott Local NAT support for Linux Linux nf_conntrack support MASQ_OVERRIDE (--masquerade-first) option Slawomir Piotrowski IP masquerading (NAT) support for OpenBSD oidentd-2.5.0/doc/0000755000175000017500000000000013646057330010721 500000000000000oidentd-2.5.0/doc/book/0000755000175000017500000000000013646041522011647 500000000000000oidentd-2.5.0/doc/book/getting-started/0000755000175000017500000000000013646041522014754 500000000000000oidentd-2.5.0/doc/book/getting-started/installation.md0000644000175000017500000000430313646041476017727 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Installation" weight: 1 --- {{% alert "primary" "Looking for the download link?" %}} You can download oidentd from the [project website]({{% ref "/projects/oidentd" %}}). {{% /alert %}} Most popular operating system distributions include a recent version of oidentd in their package repositories. Installing oidentd using a package manager is recommended in most cases. In some cases, however, it may be desirable to install oidentd from source. This may be useful if your distribution does not package a recent version of oidentd, or if there are any compile-time features you would like to enable. More detailed instructions for compiling and installing oidentd can be found in the `INSTALL` file included in all releases. ### Configuring the Build After downloading, verifying and extracting oidentd, enter the directory you extracted and run `./configure` to configure the build. On many modern Linux systems, you may have to install libnetfilter\_conntrack before running `./configure`. More information can be found in the `INSTALL` file in the source tree. The `./configure` script supports a number of optional flags: * `--disable-ipv6` disables support for {{< abbr "IPv6" "Internet Protocol, Version 6" >}}. * `--disable-libnfct` disables support for libnetfilter\_conntrack. * `--disable-nat` disables support for {{< abbr "NAT" "Network Address Translation" >}}. * `--enable-debug` compiles oidentd with the `--debug` option. * `--enable-warn` is intended for developers and enables additional warning messages during compilation. ### Compile oidentd Run `make` to compile oidentd. You can run `src/oidentd --version` to verify that the compilation succeeded. ### Install oidentd Run `make install` as root to install oidentd. To uninstall oidentd later on, run `make uninstall` as root in the same directory. oidentd-2.5.0/doc/book/getting-started/capabilities.md0000644000175000017500000000646213646041477017670 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Capabilities" weight: 2 --- Capabilities allow the system administrator to control the set of features users have access to. They can be granted or revoked using [capability directives][capdirs]. No capabilities are granted to users by default. ## `forward` The `forward` capability allows users to forward Ident queries to another server. The `host` and `port` arguments specify the host and port of the receiving Ident server. This server must support forwarding (e.g., oidentd with the `--proxy` option). Forwarding does not allow users to send replies they otherwise would not be able to send. For example, if the receiving Ident server replies with the name of another user, the reply will be sent back to the client only if the user that owns the connection was granted the `spoof` and `spoof_all` capabilities. This restriction does not apply to `force forward` statements in the system-wide configuration file. Imperative syntax: `forward ` ## `hide` The `hide` capability allows users to hide their connections. When used, oidentd reports a `HIDDEN-USER` error to clients. Imperative syntax: `hide` ## `numeric` The `numeric` capability allows users to reply with their user ID (UID) instead of their user name. Imperative syntax: `numeric` ## `random` The `random` capability allows users to send random alphanumeric Ident replies. Replies are logged so that the system administrator can identify the user responsible for a particular connection. Imperative syntax: `random` ## `random_numeric` The `random_numeric` capability allows users to send random numeric Ident replies of the form `userNNNNN`, where `N` represents a digit from 0 to 9. Replies are logged so that the system administrator can identify the user responsible for a particular connection. Imperative syntax: `random_numeric` ## `reply` The `reply` capability cannot be granted or revoked. However, using it may require one or more of `spoof`, `spoof_all`, and `spoof_privport`, depending on the replies and type of connection. If more than one reply is given, a random reply is chosen from the list for each incoming query. At least one reply must be specified. Imperative syntax: `reply ` ## `spoof` The `spoof` capability allows users to send custom Ident replies, except in cases that require the `spoof_all` or `spoof_privport` capabilities. This capability does not have an imperative syntax. ## `spoof_all` The `spoof_all` capability allows users to reply with the names of other users on the system. It only works in conjunction with the `spoof` capability. This capability does not have an imperative syntax. ## `spoof_privport` The `spoof_privport` capability allows users to spoof replies for connections to privileged foreign ports (port numbers below 1024). It only works in conjunction with the `spoof` capability. This capability does not have an imperative syntax. [capdirs]: {{% ref "configuration#capability-directives" %}} oidentd-2.5.0/doc/book/getting-started/starting-the-server.md0000644000175000017500000000352213646041500021131 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Starting the Server" weight: 4 --- oidentd can be run as a standalone server or started by a service manager. By default, oidentd forks to the background after starting up. If you installed oidentd from your distribution's package repositories, an initialization script or [systemd service][systemd] may already have been included in the package. Consult your distribution's documentation for more information. oidentd needs to be started as root on most systems, but normally drops its privileges automatically after starting up. See [Dropping Privileges][drop-privs] for details. Run `oidentd` to start the server. oidentd accepts a large number of command-line options. Some commonly used options are: * `-a`, `--address`: bind to the specified address (may be specified multiple times) * `-d`, `--debug`: show messages that may be useful for debugging * `-i`, `--foreground`: do not run as a background process * `-p`, `--port`: listen on the specified port instead of port 113 The `oidentd(8)` manual page contains a complete list of options with detailed explanations. `oidentd --help` prints a list with more concise descriptions. ## systemd Service Many systemd-based distributions include service files for oidentd. On these distributions, oidentd can be started and enabled with the following command: {{< code >}} systemctl enable --now oidentd {{< /code >}} [drop-privs]: {{% ref dropping-privileges %}} [systemd]: {{% ref "#systemd-service" %}} oidentd-2.5.0/doc/book/getting-started/configuration/0000755000175000017500000000000013646041522017623 500000000000000oidentd-2.5.0/doc/book/getting-started/configuration/examples.md0000644000175000017500000000411413646041501021700 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Examples" weight: 1 --- The following examples illustrate how capabilities and conditional directives can be used in system-wide and user configuration files. Lines stating with `#` are comments. They are ignored by oidentd. ## System-wide Configuration File This configuration allows `ryan` to send spoofed and random Ident replies, except in response to lookups for connections to `example.net`. Other users' connections are hidden so that no user information is disclosed. {{< code >}} default { # User defaults default { # Connection defaults # Hide all connections from users not # explicitly listed in this file. force hide } } user ryan { # Settings for user "ryan" default { # Connection defaults # Allow ryan to send custom Ident replies, # except for the names of other users. allow spoof # Allow ryan to send random Ident replies. allow random } to example.net { # Connections to example.net # Do not allow ryan to spoof Ident replies. force reply "ryan" } } {{< /code >}} ## User Configuration File This user configuration file instructs oidentd to reply to Ident queries for connections to foreign ports `6667` through `6697` with the name of a random Greek letter. This requires the `spoof` capability. It also requires the `spoof_all` capability if there is a local user named "alpha", "beta", or "gamma". A random alphanumeric Ident reply is sent in response to all other queries. This requires the `random` capability. {{< code >}} global { # Connection defaults # Send random Ident replies by default. random } fport 6667:6697 { # Foreign ports from 6667 to 6697 # Choose one of three Greek letters at random. reply "alpha" "beta" "gamma" } {{< /code >}} oidentd-2.5.0/doc/book/getting-started/configuration/_index.md0000644000175000017500000001204013646041502021326 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Configuration" weight: 3 --- When an Ident query is received, oidentd normally replies with the user name of the user that owns the corresponding connection. Users can override this behavior only if they have been granted permission to do so through the system-wide configuration file. ## System-wide Configuration File The system-wide configuration file is usually found at `/etc/oidentd.conf` or `/usr/local/etc/oidentd.conf`, depending on how oidentd was installed. It is not necessary for this file to exist. This file may contain any number of [user directives][user-directives]. ## User Configuration File Each user may also create a user configuration file at `~/.config/oidentd.conf` or `~/.oidentd.conf`. If both files exist, only the former is used. The user configuration file is ignored if oidentd does not have permission to read it. This file may contain one directive of the following form: {{< code >}} global { } {{< /code >}} This `global` directive matches all connections. If used, it should be the first directive in the file. The user configuration file may also contain any number of directives of the following form: {{< code >}} { } {{< /code >}} In this form the directive only applies to connections that match the given range specification. ## User Directives A user directive takes one of the following forms: {{< code >}} default { } {{< /code >}} This form can be used to specify defaults for users. There should be no more than one directive of this form. If used, it should be the first user directive. {{< code >}} user "" { } {{< /code >}} In this form the directive applies only to the specified user. ## Range Directives A range directive takes one of the following forms: {{< code >}} default { } {{< /code >}} In this form the directive matches when no other range directive in its scope does. There should be no more than one directive of this form. If used, it should be the first range directive. {{< code >}} { } {{< /code >}} In this form the directive only applies to connections that match the given range specification. ## Range Specification A range specification takes the following form: {{< code >}} [to ] [fport ] [from ] [lport ] {{< /code >}} * `to` is the foreign address associated with the connection. * `fport` is the foreign port associated with the connection. * `from` is the local address associated with the connection. * `lport` is the local port associated with the connection. At least one of the four filters must be specified. Hosts may be specified by hostname or by {{< abbr "IP" "Internet Protocol" >}} address. Ports may optionally be specified as a port range of the form `min:max`, `min:`, or `:max`. A range specification matches a connection if all specified filters match. ## Capability Directives A capability directive takes one of the following forms: {{< code >}} allow {{< /code >}} In this form the directive grants the specified capability. {{< code >}} deny {{< /code >}} In this form the directive revokes the specified capability. {{< code >}} force {{< /code >}} In this form the directive enforces use of the specified capability. ## Capabilities The following are valid capabilities: * [`forward`][cap-forward] * [`hide`][cap-hide] * [`numeric`][cap-numeric] * [`random`][cap-random] * [`random_numeric`][cap-random_numeric] * [`spoof`][cap-spoof] * [`spoof_all`][cap-spoof_all] * [`spoof_privport`][cap-spoof_privport] ## Capability Statements The following are valid capability statements: * [`forward `][cap-forward] * [`hide`][cap-hide] * [`numeric`][cap-numeric] * [`random`][cap-random] * [`random_numeric`][cap-random_numeric] * [`reply `][cap-reply] ## Further Reading The `oidentd.conf(5)` manual page contains further information on how to configure oidentd, as well as detailed descriptions of all capabilities. [user-directives]: {{% ref "#user-directives" %}} [cap-forward]: {{% ref "capabilities#forward" %}} [cap-hide]: {{% ref "capabilities#hide" %}} [cap-numeric]: {{% ref "capabilities#numeric" %}} [cap-random]: {{% ref "capabilities#random" %}} [cap-random_numeric]: {{% ref "capabilities#random-numeric" %}} [cap-reply]: {{% ref "capabilities#reply" %}} [cap-spoof]: {{% ref "capabilities#spoof" %}} [cap-spoof_all]: {{% ref "capabilities#spoof-all" %}} [cap-spoof_privport]: {{% ref "capabilities#spoof-privport" %}} oidentd-2.5.0/doc/book/getting-started/support.md0000644000175000017500000000245713646041503016741 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Support" weight: 5 --- If you need help or have any questions about oidentd, feel free to use any of the following resources. ## Documentation Documentation for oidentd can be found in the `oidentd(8)`, `oidentd.conf(5)`, and `oidentd_masq.conf(5)` manual pages. Additional documentation for developers and package maintainers is available in the `INSTALL` and `HACKING` files in the oidentd source tree. ## {{< abbr "IRC" "Internet Relay Chat" >}} Channel You can find us in `#oidentd` on `ircs://chat.freenode.net`. Please be patient; it may take a while for someone to see your message. ## Contact the Maintainer Feel free to [contact the project maintainer][contact-maint] if you have any questions or need help with oidentd. This is also the best way to share any feedback you may have. We're always looking for ways to make oidentd better, and we'd appreciate your help. [contact-maint]: {{% ref "/contact" %}} oidentd-2.5.0/doc/book/getting-started/_index.md0000644000175000017500000000073413646041504016470 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Getting Started" weight: 1 --- Learn how to install and configure oidentd. oidentd-2.5.0/doc/book/security/0000755000175000017500000000000013646041522013516 500000000000000oidentd-2.5.0/doc/book/security/dropping-privileges.md0000644000175000017500000000323613646041505017756 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Dropping Privileges" weight: 1 --- It is highly recommended not to run internet-facing services as root. For this reason, oidentd attempts to switch to an unprivileged user automatically after starting up. Please note that oidentd needs to run as root on a small number of systems. On these systems, a warning is printed at startup and privileges are not dropped automatically. Your system is affected by this limitation if `oidentd --version` prints "Needs root access: Yes". ## Default User By default, oidentd attempts to run as one of the following users, in order of preference. If a user does not exist, oidentd tries to use the next one. * oidentd * nobody If neither of the above users exists, oidentd switches to user ID 65534. ## Default Group By default, oidentd attempts to run as one of the following groups, in order of preference. If a group does not exist, oidentd tries to use the next one. * oidentd * nobody * nogroup If none of the above groups exist, oidentd switches to group ID 65534. ## Changing This Behavior The `--user` and `--group` options can be used to run oidentd as another user or group. oidentd refuses to start up if the user or group specified by either of these options does not exist, or if privileges cannot be dropped for some other reason. oidentd-2.5.0/doc/book/security/identification-vs-authentication.md0000644000175000017500000000274413646041506022425 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Identification vs. Authentication" weight: 3 --- The Ident protocol was designed for identification, not authentication. Please don't use it for access control. The primary purpose of the Ident protocol is to serve as an auditing and abuse prevention mechanism. For example, many {{< abbr "IRC" "Internet Relay Chat" >}} servers act as Ident clients, querying and publicly displaying users' Ident replies. This allows providers of {{< abbr "IRC" "Internet Relay Chat" >}} bouncers, shell accounts and other services to identify users abusing their systems and enables channel operators and network operators to remove individual users without excluding their entire host or network. Ident queries and replies are sent as plain text, with no encryption or authentication, and can be intercepted or modified by an attacker. In addition, it is not possible to prevent compromised or malicious hosts from [sending arbitrary Ident replies][cap-spoof]. For these reasons, the Ident protocol is not suitable for authentication or access control. [cap-spoof]: {{% ref "../getting-started/capabilities#spoof" %}} oidentd-2.5.0/doc/book/security/_index.md0000644000175000017500000000073013646041507015231 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Security" weight: 4 --- Improve the security of your oidentd instance. oidentd-2.5.0/doc/book/security/hiding-connections.md0000644000175000017500000000275013646041510017543 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Hiding Connections" weight: 2 --- It is recommended to hide connections to any servers running on your machine to avoid disclosing unnecessary information. The recommended way to accomplish this is to hide all connections and only respond to queries for certain user accounts: {{< code >}} default { default { force hide } } user "ryan" { default { force reply "ryan" } } {{< /code >}} It is also possible to hide individual users' connections: {{< code >}} user "root" { default { force hide } } user "http" { default { force hide } } {{< /code >}} Alternatively, the [`random`][cap_random] and [`random_numeric`][cap_random_numeric] capabilities may be used to conceal users' real login names while still allowing the system administrator to identify who was responsible for a particular connection. See the [list of capabilities][caps] for more information. [caps]: {{% ref "../getting-started/capabilities" %}} [cap_random]: {{% ref "../getting-started/capabilities#random" %}} [cap_random_numeric]: {{% ref "../getting-started/capabilities#random-numeric" %}} oidentd-2.5.0/doc/book/guides/0000755000175000017500000000000013646041522013127 500000000000000oidentd-2.5.0/doc/book/guides/using-oidentd-with-znc.md0000644000175000017500000000366513646041511017713 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Using oidentd with ZNC" weight: 2 --- You can use oidentd to spoof Ident replies so that they match Idents configured within ZNC. Append the following to your [system-wide configuration file][sys-conf]: {{< code >}} user "" { default { allow spoof # Add the next line if ZNC needs to # reply with the name of a local user. allow spoof_all } } {{< /code >}} Replace `` with the user name of the ZNC user (e.g., `znc`). Change to the user running ZNC (e.g., using `su znc -ls "$SHELL"`), and use the following commands to create an empty [user configuration file][usr-conf]: {{< code >}} touch ~/.oidentd.conf chmod 0644 ~/.oidentd.conf {{< /code >}} Ensure that the ZNC home directory (typically `~znc`) is world-executable (mode `0711`) so that oidentd can read the user configuration file: {{< code >}} chmod 0711 ~ {{< /code >}} Ensure that ZNC's *identfile* module is loaded and configured correctly: {{< code >}} /MSG *status LoadMod identfile /MSG *identfile SetFile ~/.oidentd.conf /MSG *identfile SetFormat global { reply "%user%" } /MSG *status SaveConfig {{< /code >}} Note that `%user%` expands to the name of the ZNC user that initiated the connection. Another popular choice is `%ident%`, which allows users to specify any Ident. Your changes will take effect after you reload oidentd and reconnect to {{< abbr "IRC" "Internet Relay Chat" >}}. [sys-conf]: {{% ref "../getting-started/configuration#system-wide-configuration-file" %}} [usr-conf]: {{% ref "../getting-started/configuration#user-configuration-file" %}} oidentd-2.5.0/doc/book/guides/using-oidentd-with-quassel.md0000644000175000017500000000467113646041512020575 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Using oidentd with Quassel" weight: 1 --- You can use oidentd to spoof Ident replies so that they match Idents configured within Quassel. ## Forwarding to Quassel oidentd can forward incoming queries for connections owned by the Quassel user directly to Quassel's built-in Ident server. This is the recommended method. Append the following to your [system-wide configuration file][sys-conf]: {{< code >}} user "" { default { allow spoof # Add the next line if Quassel needs to # reply with the name of a local user. allow spoof_all force forward } } {{< /code >}} Replace `` with the user name of the Quassel user (e.g., `quasselcore`). Replace `` with the {{< abbr "IP" "Internet Protocol" >}} address or hostname Quassel's built-in Ident server is configured to listen on (e.g., `::1`). Replace `` with the port Quassel's built-in Ident server is configured to listen on (e.g., `10113`). ## Using Quassel's oidentd Configuration Generator Quassel can automatically write to an oidentd user configuration file when establishing a new connection. Use of this feature is discouraged as of oidentd 2.3.0. Some {{< abbr "IRC" "Internet Relay Chat" >}} servers send Ident queries before the connection's local port is known to Quassel, which may cause lookups to fail. Append the following to your [system-wide configuration file][sys-conf]: {{< code >}} user "" { default { allow spoof # Use this only if Quassel needs to spoof local user names allow spoof_all } } {{< /code >}} Replace `` with the user name of the Quassel user (e.g., `quasselcore`). Ensure that the Quassel home directory (typically `~quasselcore`) is world-executable (mode `0711`) so that oidentd can read the user configuration file: {{< code >}} chmod 0711 ~quasselcore {{< /code >}} Finally, make sure Quassel is run with the `--oidentd` flag. Your changes will take effect after you reload oidentd and restart Quassel. [sys-conf]: {{% ref "../getting-started/configuration#system-wide-configuration-file" %}} oidentd-2.5.0/doc/book/guides/_index.md0000644000175000017500000000072513646041513014643 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Guides" weight: 2 --- Learn how to use oidentd with other software. oidentd-2.5.0/doc/book/_index.md0000644000175000017500000000423113646041514013360 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "About oidentd" --- {{% project-detail "description" %}}. oidentd is a configurable, {{< abbr "RFC" "Request for Comments" >}} 1413 compliant Ident server. It runs on Linux, FreeBSD, OpenBSD, NetBSD, and DragonFly BSD. The Ident Protocol is used primarily on {{< abbr "IRC" "Internet Relay Chat" >}} to detect and prevent abuse and to identify users connecting through shared networks. ## Features * oidentd is highly [configurable][configuration], but configuration is optional and sensible defaults are provided. * oidentd provides system administrators with a granular, capability-based [access control][acl] system. * [Conditional replies][conditionals] enable users to send replies based on connection information, such as ports and IP addresses. * oidentd is capable of sending [hidden][cap-hide], [randomized][cap-random], and [spoofed][cap-spoof] replies. * oidentd can optionally handle requests for [{{< abbr "NAT" "Network Address Translation" >}} connections][nat] and is capable of forwarding requests to other Ident servers. * Both {{< abbr "IPv4" "Internet Protocol, Version 4" >}} and {{< abbr "IPv6" "Internet Protocol, Version 6" >}} are supported. * oidentd is free software licensed under the {{< abbr "GNU" "GNU's Not Unix" >}} {{< abbr "GPLv2" "General Public License, Version 2" >}}. [acl]: {{% ref "getting-started/configuration#capability-directives" %}} [cap-hide]: {{% ref "getting-started/capabilities#hide" %}} [cap-random]: {{% ref "getting-started/capabilities#random" %}} [cap-spoof]: {{% ref "getting-started/capabilities#spoof" %}} [conditionals]: {{% ref "getting-started/configuration#range-specification" %}} [configuration]: {{% ref "getting-started/configuration" %}} [nat]: {{% ref "nat/introduction" %}} oidentd-2.5.0/doc/book/nat/0000755000175000017500000000000013646041522012431 500000000000000oidentd-2.5.0/doc/book/nat/static-replies.md0000644000175000017500000000301213646041515015621 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Static Replies" weight: 2 --- oidentd can send different Ident replies for each host connecting through the machine it is running on. To enable this functionality, oidentd must be run with the `--masquerade` (`-m`) flag. ## Configuring Replies Replies can be configured in the masquerading configuration file, which is usually found in `/etc/oidentd_masq.conf` or in `/usr/local/etc/oidentd_masq.conf`, depending on how oidentd was installed. This file should consist of lines of the following form: {{< code >}} [/subnet] ident_reply system_type {{< /code >}} The masquerading configuration file is read from top to bottom, so more specific rules should be placed before more general ones. For example: {{< code >}} 10.0.0.1 user1 UNIX 10.0.0.2 user2 FREEBSD 10.0.0.0/24 user3 OTHER {{< /code >}} In this example, a `user1` reply is sent in response to all requests for `10.0.0.1`. A `user2` reply is sent for all requests for `10.0.0.2`. Finally, `user3` is sent in response to requests for other machines in the `10.0.0.0/24` subnetwork. Detailed information can be found in the `oidentd_masq.conf(5)` manual page. oidentd-2.5.0/doc/book/nat/introduction.md0000644000175000017500000000257513646041516015430 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Introduction" weight: 1 --- oidentd can handle Ident queries for other machines connecting through the server it is running on. This is especially useful when the server running oidentd performs Network Address Translation (NAT). Before configuring oidentd to use {{< abbr "NAT" "Network Address Translation" >}}, please take a look at the `KERNEL_SUPPORT.md` file in the source tree to find out whether {{< abbr "NAT" "Network Address Translation" >}} is supported on your system. oidentd supports two features that may be useful in combination with {{< abbr "NAT" "Network Address Translation" >}}: - [Static replies][static] instruct oidentd to send a certain reply in response to every Ident query intended for a particular host or subnetwork. - [Forwarding][forwarding] allows Ident queries to be forwarded through {{< abbr "NAT" "Network Address Translation" >}} to the host that established a connection. [static]: {{% ref "static-replies" %}} [forwarding]: {{% ref "forwarding" %}} oidentd-2.5.0/doc/book/nat/forwarding.md0000644000175000017500000000360513646041517015045 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "Forwarding" weight: 3 --- oidentd can forward Ident queries to the host they were intended for, provided that this host is connecting through the machine oidentd is running on. When forwarding is enabled, the default behavior is to forward immediately and only fall back to using the configured [static replies][static-replies] if forwarding fails. This can be changed by using the `--masquerade-first` (`-M`) flag, in which case oidentd only forwards requests if no matching static reply was found. ## Configuring the Gateway Forwarding can be enabled on the device performing network address translation by running oidentd with the `--forward` (`-f`) option. Optionally, a target port may be specified using `--forward=port`. If no port is specified, port `113` is used. ## Configuring the Servers All machines that need to receive forwarded queries must be running an Ident server capable of handling these queries, such as oidentd with the `--proxy` (`-P`) option. For example, oidentd can be run on a machine behind {{< abbr "NAT" "Network Address Translation" >}} with the following command: {{< code >}} oidentd -P 10.0.0.1 {{< /code >}} This allows `10.0.0.1` to forward queries to the current oidentd instance. If you specified a custom target port for forwarding, make sure the target server is configured to listen on that port: {{< code >}} oidentd -P 10.0.0.1 -p 113 {{< /code >}} Port `113` is the default and does not need to be specified explicitly. [static-replies]: {{% ref "static-replies" %}} oidentd-2.5.0/doc/book/nat/_index.md0000644000175000017500000000077713646041522014154 00000000000000--- # Copyright (c) 2018-2020 Janik Rabe # # Permission is granted to copy, distribute and/or modify this document # under the terms of the GNU Free Documentation License, Version 1.3 # or any later version published by the Free Software Foundation; # with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. # A copy of the license is included in the file 'COPYING.DOC' title: "NAT" weight: 3 --- Learn how to use oidentd for {{< abbr "NAT" "Network Address Translation" >}} connections. oidentd-2.5.0/doc/oidentd_masq.conf.5.adoc0000644000175000017500000000556613646056645015253 00000000000000//// Copyright (c) 2019 Janik Rabe Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file 'COPYING.DOC' //// oidentd_masq.conf(5) ==================== :doctype: manpage :man manual: oidentd User Manual :man source: oidentd :reproducible: yes :revdate: 2020-04-16 :sysconfdir: /etc NAME ---- oidentd_masq.conf - oidentd NAT configuration file DESCRIPTION ----------- If NAT support is enabled with the *--masquerade* option, *oidentd* reads the *{sysconfdir}/oidentd_masq.conf* file to determine ident responses to queries intended for other machines. It is also possible to forward queries to ident servers on the hosts connecting through the machine *oidentd* runs on. For more information on forwarding, please see the *--forward* option in *oidentd*(8). The NAT configuration file contains one rule per line. Lines are read from top to bottom, and only the first matching rule is used. Lines starting with a number sign ("#") are ignored. RULE FORMAT ----------- Rules must have the following form: [subs="quotes"] .... _host_[/_mask_] _response_ _system-type_ .... The _host_ field specifies the hostname or IP address of the host that owns the connection for which an ident query was received. This host must be connecting through the machine *oidentd* runs on. The host may be specified as either an IP address or a hostname. If a network mask is specified using the _mask_ field, the rule applies to all hosts in the given subnetwork. Network masks may be specified in dot notation (e.g., "255.255.192.0") or in CIDR notation (e.g., "18"). The _response_ field specifies the response to be sent when receiving a query for the specified host or subnetwork. The _system-type_ field specifies the operating system to send alongside the ident response. See the *--other* option in *oidentd*(8) for more information. EXAMPLES -------- [subs="quotes"] .... # host[/mask] response system-type 10.0.0.1 user1 UNIX server.internal user2 UNIX-BSD 10.0.0.0/24 user3 UNIX 10.0.0.0/255.255.0.0 user4 UNKNOWN .... Note that the order of the rules is significant in this example. Due to lines being read from top to bottom, more specific rules must precede more general ones. For example, the rule for "10.0.0.1" would not match any connections if it were preceded by the more general "10.0.0.0/24". AUTHOR ------ mailto:oidentd@janikrabe.com[Janik Rabe]:: https://oidentd.janikrabe.com Originally written by Ryan McCabe. BUGS ---- Please report any bugs to mailto:oidentd@janikrabe.com[Janik Rabe]. SEE ALSO -------- *oidentd*(8) *oidentd.conf*(5) oidentd-2.5.0/doc/Makefile.am0000644000175000017500000000073013646041602012670 00000000000000man_MANS = \ oidentd.8 \ oidentd.conf.5 \ oidentd_masq.conf.5 DISTCLEANFILES = \ $(man_MANS) EXTRA_DIST = \ book \ $(man_MANS) \ oidentd.8.adoc \ oidentd.conf.5.adoc \ oidentd_masq.conf.5.adoc SUFFIXES = .adoc oidentd.8: oidentd.8.adoc oidentd.conf.5: oidentd.conf.5.adoc oidentd_masq.conf.5: oidentd_masq.conf.5.adoc .adoc: asciidoctor \ --backend manpage \ --doctype manpage \ -a "sysconfdir=@sysconfdir@" \ -a "mansource=@PACKAGE_STRING@" \ $< oidentd-2.5.0/doc/oidentd.80000644000175000017500000001754113646057330012370 00000000000000'\" t .\" Title: oidentd .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 1.5.8 .\" Manual: oidentd User Manual .\" Source: oidentd 2.5.0 .\" Language: English .\" .TH "OIDENTD" "8" "" "oidentd 2.5.0" "oidentd User Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" oidentd \- flexible, RFC 1413 compliant ident daemon with NAT support .SH "SYNOPSIS" .sp \fBoidentd\fP [\fIOPTIONS\fP] .SH "DESCRIPTION" .sp \fBoidentd\fP implements the Identification Protocol as described in RFC 1413. By default, \fBoidentd\fP replies with the username of the owner of connections. This behavior can be altered in \fBoidentd.conf\fP(5) and by using the options specified in this document. .SH "OPTIONS" .sp \fB\-a, \-\-address\fP=\fIADDRESS\fP .RS 4 Bind to the specified address. This option causes \fBoidentd\fP to listen for incoming connections only on the specified address or addresses instead of on all interfaces. This option may be specified more than once to configure multiple addresses. .RE .sp \fB\-c, \-\-charset\fP=\fICHARSET\fP .RS 4 Inform clients that ident replies use the specified character set as defined in RFC 1340 or its successors. The default is not to send a character set to clients. .RE .sp \fB\-C, \-\-config\fP=\fIFILE\fP .RS 4 Use the specified system\-wide configuration file. If this option is not given, \fBoidentd\fP defaults to \fB/usr/local/etc/oidentd.conf\fP. The format of the system\-wide configuration file is described in \fBoidentd.conf\fP(5). .RE .sp \fB\-d, \-\-debug\fP .RS 4 Show debug messages, including detailed lookup information that may be useful for diagnosing issues with failed lookups. This option is only available if \fBoidentd\fP was compiled with debugging support. .RE .sp \fB\-e, \-\-error\fP .RS 4 Hide error messages, returning \fBUNKNOWN\-ERROR\fP for all errors. This includes the \fBNO\-USER\fP, \fBHIDDEN\-USER\fP and \fBINVALID\-PORT\fP errors. This option may be used to conceal the fact that \fBoidentd\fP is hiding ident responses for a user. .RE .sp \fB\-f, \-\-forward\fP=[\fIPORT\fP] .RS 4 Forward requests for hosts masquerading through the server \fBoidentd\fP is running on to the host that established the corresponding connection. The target host must be running \fBoidentd\fP with the \fB\-\-proxy\fP option, or some ident server returning static responses regardless of the query. If no port is specified, the default ident port (113) is used. If forwarding fails, \fBoidentd\fP falls back to the response specified in \fBoidentd_masq.conf\fP(5). This option implies \fB\-\-masquerade\fP. The \fB\-\-masquerade\-first\fP option can be used to forward queries only if no response was specified in \fBoidentd_masq.conf\fP(5). .RE .sp \fB\-g, \-\-group\fP=\fIGROUP|GID\fP .RS 4 Run as the specified group or GID. If this option is not given, \fBoidentd\fP falls back to running as "oidentd", "nobody", "nogroup" or GID 65534, in this order. On systems that require \fBoidentd\fP to run as the superuser, a warning is shown and the group is not changed automatically. .RE .sp \fB\-h, \-\-help\fP .RS 4 Print a summary of options and exit. .RE .sp \fB\-i, \-\-foreground\fP .RS 4 Do not fork to background. This option may be useful for debugging, or for running \fBoidentd\fP from a service manager like \fBsystemd\fP(1) with \fBType=simple\fP. .RE .sp \fB\-I, \-\-stdio\fP .RS 4 Read a single ident query from standard input, write the response to standard output, then exit. This option may be useful for debugging, or when running \fBoidentd\fP from a listener daemon such as \fBxinetd\fP(8). .RE .sp \fB\-l, \-\-limit\fP=\fIMAX\fP .RS 4 Limit the maximum number of concurrent connections to the specified value. Further connections beyond this limit will be closed immediately without spawning a new process. If this option is not specified, no limit is enforced. .RE .sp \fB\-m, \-\-masquerade\fP .RS 4 Enable support for NAT connections, allowing Ident lookups intended for hosts masquerading through the server running \fBoidentd\fP. Ident responses for NAT connections can be configured in the \fBoidentd_masq.conf\fP(5) configuration file. .RE .sp \fB\-M, \-\-masquerade\-first\fP .RS 4 If an entry matching the target host exists in the \fBoidentd_masq.conf\fP(5) configuration file, return the configured Ident response instead of forwarding the query. With this option, queries are forwarded only if no static response has been configured. If this option is not specified, the default behavior of \fB\-\-forward\fP is to forward queries before checking the \fBoidentd_masq.conf\fP(5) file. This option implies \fB\-\-forward\fP and \fB\-\-masquerade\fP. .RE .sp \fB\-o, \-\-other\fP=[\fIOS\fP] .RS 4 Set an alternative operating system string to send alongside ident responses. Note that some clients may interpret queries as having failed when an unknown operating system is returned. If this option is not specified, the value \fBUNIX\fP is used. If this option is specified without an argument, \fBOTHER\fP is returned. .RE .sp \fB\-p, \-\-port\fP=\fIPORT\fP .RS 4 Listen on the specified port instead of port 113. .RE .sp \fB\-P, \-\-proxy\fP=\fIORIGIN\fP .RS 4 Allow the specified host to forward queries to this instance using the \fB\-\-forward\fP option. If \fB\-\-reply\fP is not specified, this option must be enabled for \fBoidentd\fP to correctly handle forwarded connections. .RE .sp \fB\-q, \-\-quiet\fP .RS 4 Suppress normal logging, showing only critical messages. .RE .sp \fB\-r, \-\-reply\fP=\fIREPLY\fP .RS 4 When a lookup fails, send the specified ident response as if it had succeeded. .RE .sp \fB\-R, \-\-reply\-all\fP=\fIREPLY\fP .RS 4 Send the specified reply in response to all well\-formed queries. When this option is used, the configuration files are not read and connection lookups are never performed. Privileged initialization is not performed on systems that would otherwise require it, so unprivileged users can run oidentd with this option as long as they have permission to bind the requested port. .RE .sp \fB\-S, \-\-nosyslog\fP .RS 4 Log messages to the standard error stream, even if it is not a terminal. If standard error is a terminal, messages are written to it by default. .RE .sp \fB\-t, \-\-timeout\fP=\fISECONDS\fP .RS 4 Close connections if no ident query is received within the specified number of seconds. By default, connections are closed after 30 seconds. .RE .sp \fB\-u, \-\-user\fP=\fIUSER|UID\fP .RS 4 Run as the specified user or UID. If this option is not given, \fBoidentd\fP falls back to running as "oidentd", "nobody" or UID 65534, in this order. On systems that require \fBoidentd\fP to run as the superuser, a warning is shown and the user is not changed automatically. .RE .sp \fB\-U, \-\-udb\fP .RS 4 Look up connection owners using libudb. Lookup results that do not match any local user are returned verbatim. If a UDB lookup fails, the operating system is queried directly. This option also applies to NAT connections if the \fB\-\-masquerade\fP option is specified. .RE .sp \fB\-v, \-\-version\fP .RS 4 Print version and build information and exit. .RE .SH "FILES" .sp \fB/usr/local/etc/oidentd.conf\fP .RS 4 System\-wide configuration file; see \fBoidentd.conf\fP(5). .RE .sp \fB~/.config/oidentd.conf\fP, \fB~/.oidentd.conf\fP .RS 4 User configuration files; see \fBoidentd.conf\fP(5). .RE .sp \fB/usr/local/etc/oidentd_masq.conf\fP .RS 4 Masquerading configuration file; see \fBoidentd_masq.conf\fP(5). .RE .SH "AUTHOR" .sp .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "" .RS 4 .URL "https://oidentd.janikrabe.com" "" "" .RE .sp Originally written by Ryan McCabe. .SH "BUGS" .sp Please report any bugs to \c .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "." .SH "SEE ALSO" .sp \fBoidentd.conf\fP(5) \fBoidentd_masq.conf\fP(5)oidentd-2.5.0/doc/oidentd.conf.50000644000175000017500000003010513646057330013300 00000000000000'\" t .\" Title: oidentd.conf .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 1.5.8 .\" Manual: oidentd User Manual .\" Source: oidentd 2.5.0 .\" Language: English .\" .TH "OIDENTD.CONF" "5" "" "oidentd 2.5.0" "oidentd User Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" oidentd.conf \- oidentd configuration files .SH "DESCRIPTION" .sp The \fBoidentd\fP configuration files are used to control the responses \fBoidentd\fP sends to clients after receiving a query for a connection owned by a particular user. .sp The system\-wide configuration file \fB/usr/local/etc/oidentd.conf\fP specifies the types of responses individual users are permitted to send. By default, users must respond with their real username. .sp The user configuration files \fB~/.config/oidentd.conf\fP allow users to send custom ident responses or to hide their identities, provided that they have been granted the necessary capabilities through the system\-wide configuration file. If this file does not exist or \fBoidentd\fP was compiled without XDG Base Directory support, the file \fB~/.oidentd.conf\fP is used instead. Note that user configuration files are read only after a connection is determined to belong to the user in question. .SH "SYSTEM\-WIDE CONFIGURATION FILE" .sp The system\-wide configuration file is used to grant capabilities to users or force users to use a certain capability. The default behavior is not to grant any privileges, which means that all users must send their real usernames in response to ident queries. The system\-wide configuration file may be empty or missing, in which case this default applies. Changes to this file take effect only after \fBoidentd\fP is reloaded (which occurs when a SIGHUP signal is received) or restarted. .sp The system\-wide configuration file contains zero or one directive of the following form: .sp .if n .RS 4 .nf \fBdefault\fP { \fIrange\-directives...\fP } .fi .if n .RE .sp This default directive matches all users for which no explicit rules have been defined. Any user directives following this directive inherit the capabilities it defines. If present, the default directive should be the first directive in the user configuration file. .sp The system\-wide configuration file may also contain zero or more directives of the following form: .sp .if n .RS 4 .nf \fBuser\fP \fIusername\fP { \fIrange\-directives...\fP } .fi .if n .RE .sp This user directive applies only to the specified user. .SH "USER CONFIGURATION FILE" .sp Each user may create a user configuration file at \fB~/.config/oidentd.conf\fP or \fB~/.oidentd.conf\fP. This file must be readable by the user \fBoidentd\fP runs as. The user configuration file is read automatically after every successful lookup, so any changes take effect immediately. .sp The user configuration file contains zero or one directive of the following form: .sp .if n .RS 4 .nf \fBglobal\fP { \fIcapability\-statements...\fP } .fi .if n .RE .sp This global directive matches all connections owned by the user. If present, it should be the first directive in the user configuration file. .sp The user configuration file may also contain zero or more directives of the following form: .sp .if n .RS 4 .nf \fIrange\-specification\fP { \fIcapability\-statements...\fP } .fi .if n .RE .sp This range directive applies only to connections that match the given range specification. .SH "RANGE DIRECTIVES" .sp At most one range directive in any given scope may take the following form: .sp .if n .RS 4 .nf \fBdefault\fP { \fIcapability\-directives...\fP } .fi .if n .RE .sp This default directive defines rules for all connections that do not match any other range directive. If present, the default directive should be the first directive in its scope. .sp A range directive may also take the following form: .sp .if n .RS 4 .nf \fIrange\-specification\fP { \fIcapability\-directives...\fP } .fi .if n .RE .sp This range directive applies only to connections that match the given range specification. .SH "RANGE SPECIFICATIONS" .sp A range specification consists of filters that define which connections a range directive applies to. It takes the following form: .sp .if n .RS 4 .nf \fBto\fP \fIfhost\fP \fBfport\fP \fIfport\fP \fBfrom\fP \fIlhost\fP \fBlport\fP \fIlport\fP .fi .if n .RE .sp This range specification matches only connections with the specified foreign host, foreign port, local host, and local port. At least one of these filters must be specified. Omitted filters match any value. Filters may be specified in any order. .sp The \fIfhost\fP filter specifies the foreign host or address of a connection, from the perspective of the machine running \fBoidentd\fP. .sp The \fIfport\fP filter specifies the foreign port or port range of a connection. .sp The \fIlhost\fP filter specifies the local host or address of a connection, from the perspective of the machine running \fBoidentd\fP. This may be useful for supporting virtual hosts on systems with more than one IP address. .sp The \fIlport\fP filter specifies the local port or port range of a connection. .sp Ports can be specified either numerically (e.g., 113) or using a service name (e.g., ident). Port ranges are specified numerically as \fImin\fP:\fImax\fP. The \fImin\fP port may be omitted to select all ports less than or equal to the \fImax\fP port. Likewise, the \fImax\fP port may be omitted to select all ports greater than or equal to the \fImin\fP port. .SH "CAPABILITY DIRECTIVES" .sp A capability directive may take one of the following forms: .sp .if n .RS 4 .nf \fBallow\fP \fIcapability\fP .fi .if n .RE .sp In this form, the directive grants the user permission to use the specified capability. .sp .if n .RS 4 .nf \fBdeny\fP \fIcapability\fP .fi .if n .RE .sp In this form, the directive revokes the user\(cqs permission to use the specified capability. .sp .if n .RS 4 .nf \fBforce\fP \fIcapability\-statement\fP .fi .if n .RE .sp In this form, the directive forces the user to use the specified capability. .SH "CAPABILITIES" .sp The following expressions are valid capabilities: .sp .if n .RS 4 .nf \fBforward\fP \fBhide\fP \fBnumeric\fP \fBrandom\fP \fBrandom_numeric\fP .fi .if n .RE .sp These capabilities allow users to use the corresponding capability statements. .sp .if n .RS 4 .nf \fBspoof\fP .fi .if n .RE .sp The \fBspoof\fP capability allows users to send custom ident replies. Note that this does not include replying with the name of another user or spoofing replies for connections to privileged foreign ports. .sp .if n .RS 4 .nf \fBspoof_all\fP .fi .if n .RE .sp The \fBspoof_all\fP capability allows users to reply with the names of other users. This capability should be used with care, as it allows users to impersonate other users on the local system. The \fBspoof_all\fP capability only works in conjunction with \fBspoof\fP, but does not imply it. .sp .if n .RS 4 .nf \fBspoof_privport\fP .fi .if n .RE .sp The \fBspoof_privport\fP capability allows users to spoof replies for connections to privileged foreign ports (with port numbers below 1024). The \fBspoof_privport\fP capability only works in conjunction with \fBspoof\fP, but does not imply it. .SH "CAPABILITY STATEMENTS" .sp A capability statement may take one of the following forms: .sp .if n .RS 4 .nf \fBforward\fP \fIhost\fP \fIport\fP .fi .if n .RE .sp Forward received queries to another ident server. The target server must support forwarding (like \fBoidentd\fP with the \fB\-\-proxy\fP option). .sp Additional capabilities may be required for forwarding to succeed. For example, the \fBspoof\fP capability is required if the target server sends a response other than the user\(cqs name on the forwarding server. It may therefore be desirable to also grant at least one of \fBhide\fP, \fBspoof\fP, \fBspoof_all\fP, and \fBspoof_privport\fP in addition to the \fBforward\fP capability. If \fBforce forward\fP is used, no additional checks are performed and no capabilities are required. .sp If forwarding fails, \fBoidentd\fP responds with a "HIDDEN\-USER" error or with the user\(cqs real username, depending on whether the user has been granted the \fBhide\fP capability. Replies are logged, allowing the system administrator to identify which user sent a particular reply. .sp .if n .RS 4 .nf \fBhide\fP .fi .if n .RE .sp Hide ident replies from clients. When this capability is used, \fBoidentd\fP reports a "HIDDEN\-USER" error to ident clients instead of sending an ident reply. .sp .if n .RS 4 .nf \fBnumeric\fP .fi .if n .RE .sp Respond with the user ID (UID). .sp .if n .RS 4 .nf \fBrandom\fP .fi .if n .RE .sp Send randomly generated, alphanumeric ident replies. A new reply is generated for each ident lookup. Replies are logged, allowing the system administrator to identify which user sent a particular reply. .sp .if n .RS 4 .nf \fBrandom_numeric\fP .fi .if n .RE .sp Send randomly generated, numeric ident replies between 0 (inclusive) and 100,000 (exclusive), prefixed with "user". A new reply is generated for each ident lookup. Replies are logged, allowing the system administrator to identify which user sent a particular reply. .sp .if n .RS 4 .nf \fBreply\fP \fIreply1\fP [\fIreply2\fP ...] .fi .if n .RE .sp Send an ident reply chosen at random from the given list of quoted replies. When used in a user configuration file, at most 20 replies may be specified. In the system\-wide configuration file, up to 255 replies may be specified. Replies are logged, allowing the system administrator to identify which user sent a particular reply. .SH "EXAMPLES" .SS "SYSTEM\-WIDE CONFIGURATION FILE" .sp .if n .RS 4 .nf \fBdefault\fP { \fBdefault\fP { \fBallow\fP \fBspoof\fP } \fBfport\fP 6667 { \fBdeny\fP \fBspoof\fP \fBallow\fP \fBhide\fP } } .fi .if n .RE .sp Allow all users to spoof ident replies, except on connections to port 6667. Only on connections to port 6667, allow users to hide their ident replies. .sp .if n .RS 4 .nf \fBuser\fP "root" { \fBdefault\fP { \fBforce\fP \fBhide\fP } } .fi .if n .RE .sp Hide all connections owned by the root user. .sp .if n .RS 4 .nf \fBuser\fP "lisa" { \fBlport\fP 1024: { \fBforce\fP \fBreply\fP "me" } } .fi .if n .RE .sp For connections owned by user "lisa" on local port 1024 or greater, always reply with "me", ignoring any settings in the user configuration file. .SS "USER CONFIGURATION FILE" .sp .if n .RS 4 .nf \fBglobal\fP { \fBreply\fP "paul" } .fi .if n .RE .sp Reply with "paul" to all ident queries. .sp .if n .RS 4 .nf \fBto\fP irc.example.net \fBfport\fP 6667 { \fBhide\fP } .fi .if n .RE .sp Hide ident replies for connections to irc.example.net on port 6667. .SH "STRING FORMATTING" .sp Strings may be enclosed in double quotes. This is useful for strings containing special characters that would otherwise be interpreted in an unintended way. .sp Quoted strings may contain the following escape sequences: .sp .if n .RS 4 .nf \(rsa alert (bell) \(rsb backspace \(rsf form feed \(rsn newline (line feed) \(rsr carriage return \(rst horizontal tab \(rsv vertical tab \(rs\:\(rs backslash \(rs" double quotation mark \(rs\:\fINNN\fP the character with octal numerical value \fINNN\fP \(rsx\fINN\fP the character with hexadecimal numerical value \fINN\fP .fi .if n .RE .SH "COMMENTS" .sp After encountering a number sign ("#"), \fBoidentd\fP ignores any remaining text on the same line. This allows users to add comments to the configuration file. Comments can also be written in the following form, which allows them to span multiple lines: .sp .if n .RS 4 .nf /* \fIcomment\fP */ .fi .if n .RE .SH "AUTHOR" .sp .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "" .RS 4 .URL "https://oidentd.janikrabe.com" "" "" .RE .sp Originally written by Ryan McCabe. .SH "BUGS" .sp Please report any bugs to \c .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "." .SH "SEE ALSO" .sp \fBoidentd\fP(8) \fBoidentd_masq.conf\fP(5)oidentd-2.5.0/doc/Makefile.in0000644000175000017500000004076013646057317012722 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = 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; }; \ } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADD_LIB = @ADD_LIB@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sedpath = @sedpath@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = \ oidentd.8 \ oidentd.conf.5 \ oidentd_masq.conf.5 DISTCLEANFILES = \ $(man_MANS) EXTRA_DIST = \ book \ $(man_MANS) \ oidentd.8.adoc \ oidentd.conf.5.adoc \ oidentd_masq.conf.5.adoc SUFFIXES = .adoc all: all-am .SUFFIXES: .SUFFIXES: .adoc $(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) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ 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=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | 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-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ 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=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)" "$(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) -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." clean: clean-am clean-am: clean-generic 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-man5 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 pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic 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-man5 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 pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man5 uninstall-man8 .PRECIOUS: Makefile oidentd.8: oidentd.8.adoc oidentd.conf.5: oidentd.conf.5.adoc oidentd_masq.conf.5: oidentd_masq.conf.5.adoc .adoc: asciidoctor \ --backend manpage \ --doctype manpage \ -a "sysconfdir=@sysconfdir@" \ -a "mansource=@PACKAGE_STRING@" \ $< # 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: oidentd-2.5.0/doc/oidentd.conf.5.adoc0000644000175000017500000002656513646056643014232 00000000000000//// Copyright (c) 2019 Janik Rabe Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file 'COPYING.DOC' //// oidentd.conf(5) =============== :doctype: manpage :man manual: oidentd User Manual :man source: oidentd :reproducible: yes :revdate: 2020-04-16 :sysconfdir: /etc NAME ---- oidentd.conf - oidentd configuration files DESCRIPTION ----------- The *oidentd* configuration files are used to control the responses *oidentd* sends to clients after receiving a query for a connection owned by a particular user. The system-wide configuration file *{sysconfdir}/oidentd.conf* specifies the types of responses individual users are permitted to send. By default, users must respond with their real username. The user configuration files *~/.config/oidentd.conf* allow users to send custom ident responses or to hide their identities, provided that they have been granted the necessary capabilities through the system-wide configuration file. If this file does not exist or *oidentd* was compiled without XDG Base Directory support, the file *~/.oidentd.conf* is used instead. Note that user configuration files are read only after a connection is determined to belong to the user in question. SYSTEM-WIDE CONFIGURATION FILE ------------------------------ The system-wide configuration file is used to grant capabilities to users or force users to use a certain capability. The default behavior is not to grant any privileges, which means that all users must send their real usernames in response to ident queries. The system-wide configuration file may be empty or missing, in which case this default applies. Changes to this file take effect only after *oidentd* is reloaded (which occurs when a SIGHUP signal is received) or restarted. The system-wide configuration file contains zero or one directive of the following form: [subs="quotes"] .... **default** { __range-directives...__ } .... This default directive matches all users for which no explicit rules have been defined. Any user directives following this directive inherit the capabilities it defines. If present, the default directive should be the first directive in the user configuration file. The system-wide configuration file may also contain zero or more directives of the following form: [subs="quotes"] .... **user** __username__ { __range-directives...__ } .... This user directive applies only to the specified user. USER CONFIGURATION FILE ----------------------- Each user may create a user configuration file at *~/.config/oidentd.conf* or *~/.oidentd.conf*. This file must be readable by the user *oidentd* runs as. The user configuration file is read automatically after every successful lookup, so any changes take effect immediately. The user configuration file contains zero or one directive of the following form: [subs="quotes"] .... **global** { __capability-statements...__ } .... This global directive matches all connections owned by the user. If present, it should be the first directive in the user configuration file. The user configuration file may also contain zero or more directives of the following form: [subs="quotes"] .... __range-specification__ { __capability-statements...__ } .... This range directive applies only to connections that match the given range specification. RANGE DIRECTIVES ---------------- At most one range directive in any given scope may take the following form: [subs="quotes"] .... **default** { __capability-directives...__ } .... This default directive defines rules for all connections that do not match any other range directive. If present, the default directive should be the first directive in its scope. A range directive may also take the following form: [subs="quotes"] .... __range-specification__ { __capability-directives...__ } .... This range directive applies only to connections that match the given range specification. RANGE SPECIFICATIONS -------------------- A range specification consists of filters that define which connections a range directive applies to. It takes the following form: [subs="quotes"] .... **to** __fhost__ **fport** __fport__ **from** __lhost__ **lport** __lport__ .... This range specification matches only connections with the specified foreign host, foreign port, local host, and local port. At least one of these filters must be specified. Omitted filters match any value. Filters may be specified in any order. The _fhost_ filter specifies the foreign host or address of a connection, from the perspective of the machine running *oidentd*. The _fport_ filter specifies the foreign port or port range of a connection. The _lhost_ filter specifies the local host or address of a connection, from the perspective of the machine running *oidentd*. This may be useful for supporting virtual hosts on systems with more than one IP address. The _lport_ filter specifies the local port or port range of a connection. Ports can be specified either numerically (e.g., 113) or using a service name (e.g., ident). Port ranges are specified numerically as __min__:__max__. The _min_ port may be omitted to select all ports less than or equal to the _max_ port. Likewise, the _max_ port may be omitted to select all ports greater than or equal to the _min_ port. CAPABILITY DIRECTIVES --------------------- A capability directive may take one of the following forms: [subs="quotes"] .... **allow** __capability__ .... In this form, the directive grants the user permission to use the specified capability. [subs="quotes"] .... **deny** __capability__ .... In this form, the directive revokes the user's permission to use the specified capability. [subs="quotes"] .... **force** __capability-statement__ .... In this form, the directive forces the user to use the specified capability. CAPABILITIES ------------ The following expressions are valid capabilities: [subs="quotes"] .... **forward** **hide** **numeric** **random** **random_numeric** .... These capabilities allow users to use the corresponding capability statements. [subs="quotes"] .... **spoof** .... The *spoof* capability allows users to send custom ident replies. Note that this does not include replying with the name of another user or spoofing replies for connections to privileged foreign ports. [subs="quotes"] .... **spoof_all** .... The *spoof_all* capability allows users to reply with the names of other users. This capability should be used with care, as it allows users to impersonate other users on the local system. The *spoof_all* capability only works in conjunction with *spoof*, but does not imply it. [subs="quotes"] .... **spoof_privport** .... The *spoof_privport* capability allows users to spoof replies for connections to privileged foreign ports (with port numbers below 1024). The *spoof_privport* capability only works in conjunction with *spoof*, but does not imply it. CAPABILITY STATEMENTS --------------------- A capability statement may take one of the following forms: [subs="quotes"] .... **forward** __host__ __port__ .... Forward received queries to another ident server. The target server must support forwarding (like *oidentd* with the *--proxy* option). Additional capabilities may be required for forwarding to succeed. For example, the *spoof* capability is required if the target server sends a response other than the user's name on the forwarding server. It may therefore be desirable to also grant at least one of *hide*, *spoof*, *spoof_all*, and *spoof_privport* in addition to the *forward* capability. If *force forward* is used, no additional checks are performed and no capabilities are required. If forwarding fails, *oidentd* responds with a "HIDDEN-USER" error or with the user's real username, depending on whether the user has been granted the *hide* capability. Replies are logged, allowing the system administrator to identify which user sent a particular reply. [subs="quotes"] .... **hide** .... Hide ident replies from clients. When this capability is used, *oidentd* reports a "HIDDEN-USER" error to ident clients instead of sending an ident reply. [subs="quotes"] .... **numeric** .... Respond with the user ID (UID). [subs="quotes"] .... **random** .... Send randomly generated, alphanumeric ident replies. A new reply is generated for each ident lookup. Replies are logged, allowing the system administrator to identify which user sent a particular reply. [subs="quotes"] .... **random_numeric** .... Send randomly generated, numeric ident replies between 0 (inclusive) and 100,000 (exclusive), prefixed with "user". A new reply is generated for each ident lookup. Replies are logged, allowing the system administrator to identify which user sent a particular reply. [subs="quotes"] .... **reply** __reply1__ [__reply2__ ...] .... Send an ident reply chosen at random from the given list of quoted replies. When used in a user configuration file, at most 20 replies may be specified. In the system-wide configuration file, up to 255 replies may be specified. Replies are logged, allowing the system administrator to identify which user sent a particular reply. EXAMPLES -------- === SYSTEM-WIDE CONFIGURATION FILE [subs="quotes"] .... **default** { **default** { **allow** **spoof** } **fport** 6667 { **deny** **spoof** **allow** **hide** } } .... Allow all users to spoof ident replies, except on connections to port 6667. Only on connections to port 6667, allow users to hide their ident replies. [subs="quotes"] .... **user** "root" { **default** { **force** **hide** } } .... Hide all connections owned by the root user. [subs="quotes"] .... **user** "lisa" { **lport** 1024: { **force** **reply** "me" } } .... For connections owned by user "lisa" on local port 1024 or greater, always reply with "me", ignoring any settings in the user configuration file. === USER CONFIGURATION FILE [subs="quotes"] .... **global** { **reply** "paul" } .... Reply with "paul" to all ident queries. [subs="quotes"] .... **to** irc.example.net **fport** 6667 { **hide** } .... Hide ident replies for connections to irc.example.net on port 6667. STRING FORMATTING ----------------- Strings may be enclosed in double quotes. This is useful for strings containing special characters that would otherwise be interpreted in an unintended way. Quoted strings may contain the following escape sequences: [subs="quotes"] .... \a alert (bell) \b backspace \f form feed \n newline (line feed) \r carriage return \t horizontal tab \v vertical tab \\:\ backslash \" double quotation mark \\:__NNN__ the character with octal numerical value __NNN__ \x__NN__ the character with hexadecimal numerical value __NN__ .... COMMENTS -------- After encountering a number sign ("#"), *oidentd* ignores any remaining text on the same line. This allows users to add comments to the configuration file. Comments can also be written in the following form, which allows them to span multiple lines: [subs="quotes"] .... /* __comment__ */ .... AUTHOR ------ mailto:oidentd@janikrabe.com[Janik Rabe]:: https://oidentd.janikrabe.com Originally written by Ryan McCabe. BUGS ---- Please report any bugs to mailto:oidentd@janikrabe.com[Janik Rabe]. SEE ALSO -------- *oidentd*(8) *oidentd_masq.conf*(5) oidentd-2.5.0/doc/oidentd.8.adoc0000644000175000017500000001647013646056637013306 00000000000000//// Copyright (c) 2019 Janik Rabe Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file 'COPYING.DOC' //// oidentd(8) ========== :doctype: manpage :man manual: oidentd User Manual :man source: oidentd :reproducible: yes :revdate: 2020-04-16 :sysconfdir: /etc NAME ---- oidentd - flexible, RFC 1413 compliant ident daemon with NAT support SYNOPSIS -------- *oidentd* ['OPTIONS'] DESCRIPTION ----------- *oidentd* implements the Identification Protocol as described in RFC 1413. By default, *oidentd* replies with the username of the owner of connections. This behavior can be altered in *oidentd.conf*(5) and by using the options specified in this document. OPTIONS ------- *-a, --address*='ADDRESS':: Bind to the specified address. This option causes *oidentd* to listen for incoming connections only on the specified address or addresses instead of on all interfaces. This option may be specified more than once to configure multiple addresses. *-c, --charset*='CHARSET':: Inform clients that ident replies use the specified character set as defined in RFC 1340 or its successors. The default is not to send a character set to clients. *-C, --config*='FILE':: Use the specified system-wide configuration file. If this option is not given, *oidentd* defaults to *{sysconfdir}/oidentd.conf*. The format of the system-wide configuration file is described in *oidentd.conf*(5). *-d, --debug*:: Show debug messages, including detailed lookup information that may be useful for diagnosing issues with failed lookups. This option is only available if *oidentd* was compiled with debugging support. *-e, --error*:: Hide error messages, returning *UNKNOWN-ERROR* for all errors. This includes the *NO-USER*, *HIDDEN-USER* and *INVALID-PORT* errors. This option may be used to conceal the fact that *oidentd* is hiding ident responses for a user. *-f, --forward*=['PORT']:: Forward requests for hosts masquerading through the server *oidentd* is running on to the host that established the corresponding connection. The target host must be running *oidentd* with the *--proxy* option, or some ident server returning static responses regardless of the query. If no port is specified, the default ident port (113) is used. If forwarding fails, *oidentd* falls back to the response specified in *oidentd_masq.conf*(5). This option implies *--masquerade*. The *--masquerade-first* option can be used to forward queries only if no response was specified in *oidentd_masq.conf*(5). *-g, --group*='GROUP|GID':: Run as the specified group or GID. If this option is not given, *oidentd* falls back to running as "oidentd", "nobody", "nogroup" or GID 65534, in this order. On systems that require *oidentd* to run as the superuser, a warning is shown and the group is not changed automatically. *-h, --help*:: Print a summary of options and exit. *-i, --foreground*:: Do not fork to background. This option may be useful for debugging, or for running *oidentd* from a service manager like *systemd*(1) with *Type=simple*. *-I, --stdio*:: Read a single ident query from standard input, write the response to standard output, then exit. This option may be useful for debugging, or when running *oidentd* from a listener daemon such as *xinetd*(8). *-l, --limit*='MAX':: Limit the maximum number of concurrent connections to the specified value. Further connections beyond this limit will be closed immediately without spawning a new process. If this option is not specified, no limit is enforced. *-m, --masquerade*:: Enable support for NAT connections, allowing Ident lookups intended for hosts masquerading through the server running *oidentd*. Ident responses for NAT connections can be configured in the *oidentd_masq.conf*(5) configuration file. *-M, --masquerade-first*:: If an entry matching the target host exists in the *oidentd_masq.conf*(5) configuration file, return the configured Ident response instead of forwarding the query. With this option, queries are forwarded only if no static response has been configured. If this option is not specified, the default behavior of *--forward* is to forward queries before checking the *oidentd_masq.conf*(5) file. This option implies *--forward* and *--masquerade*. *-o, --other*=['OS']:: Set an alternative operating system string to send alongside ident responses. Note that some clients may interpret queries as having failed when an unknown operating system is returned. If this option is not specified, the value *UNIX* is used. If this option is specified without an argument, *OTHER* is returned. *-p, --port*='PORT':: Listen on the specified port instead of port 113. *-P, --proxy*='ORIGIN':: Allow the specified host to forward queries to this instance using the *--forward* option. If *--reply* is not specified, this option must be enabled for *oidentd* to correctly handle forwarded connections. *-q, --quiet*:: Suppress normal logging, showing only critical messages. *-r, --reply*='REPLY':: When a lookup fails, send the specified ident response as if it had succeeded. *-R, --reply-all*='REPLY':: Send the specified reply in response to all well-formed queries. When this option is used, the configuration files are not read and connection lookups are never performed. Privileged initialization is not performed on systems that would otherwise require it, so unprivileged users can run oidentd with this option as long as they have permission to bind the requested port. *-S, --nosyslog*:: Log messages to the standard error stream, even if it is not a terminal. If standard error is a terminal, messages are written to it by default. *-t, --timeout*='SECONDS':: Close connections if no ident query is received within the specified number of seconds. By default, connections are closed after 30 seconds. *-u, --user*='USER|UID':: Run as the specified user or UID. If this option is not given, *oidentd* falls back to running as "oidentd", "nobody" or UID 65534, in this order. On systems that require *oidentd* to run as the superuser, a warning is shown and the user is not changed automatically. *-U, --udb*:: Look up connection owners using libudb. Lookup results that do not match any local user are returned verbatim. If a UDB lookup fails, the operating system is queried directly. This option also applies to NAT connections if the *--masquerade* option is specified. *-v, --version*:: Print version and build information and exit. FILES ----- *{sysconfdir}/oidentd.conf*:: System-wide configuration file; see *oidentd.conf*(5). *~/.config/oidentd.conf*, *~/.oidentd.conf*:: User configuration files; see *oidentd.conf*(5). *{sysconfdir}/oidentd_masq.conf*:: Masquerading configuration file; see *oidentd_masq.conf*(5). AUTHOR ------ mailto:oidentd@janikrabe.com[Janik Rabe]:: https://oidentd.janikrabe.com Originally written by Ryan McCabe. BUGS ---- Please report any bugs to mailto:oidentd@janikrabe.com[Janik Rabe]. SEE ALSO -------- *oidentd.conf*(5) *oidentd_masq.conf*(5) oidentd-2.5.0/doc/oidentd_masq.conf.50000644000175000017500000000567513646057330014337 00000000000000'\" t .\" Title: oidentd_masq.conf .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 1.5.8 .\" Manual: oidentd User Manual .\" Source: oidentd 2.5.0 .\" Language: English .\" .TH "OIDENTD_MASQ.CONF" "5" "" "oidentd 2.5.0" "oidentd User Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" oidentd_masq.conf \- oidentd NAT configuration file .SH "DESCRIPTION" .sp If NAT support is enabled with the \fB\-\-masquerade\fP option, \fBoidentd\fP reads the \fB/usr/local/etc/oidentd_masq.conf\fP file to determine ident responses to queries intended for other machines. It is also possible to forward queries to ident servers on the hosts connecting through the machine \fBoidentd\fP runs on. For more information on forwarding, please see the \fB\-\-forward\fP option in \fBoidentd\fP(8). .sp The NAT configuration file contains one rule per line. Lines are read from top to bottom, and only the first matching rule is used. Lines starting with a number sign ("#") are ignored. .SH "RULE FORMAT" .sp Rules must have the following form: .sp .if n .RS 4 .nf \fIhost\fP[/\fImask\fP] \fIresponse\fP \fIsystem\-type\fP .fi .if n .RE .sp The \fIhost\fP field specifies the hostname or IP address of the host that owns the connection for which an ident query was received. This host must be connecting through the machine \fBoidentd\fP runs on. The host may be specified as either an IP address or a hostname. .sp If a network mask is specified using the \fImask\fP field, the rule applies to all hosts in the given subnetwork. Network masks may be specified in dot notation (e.g., "255.255.192.0") or in CIDR notation (e.g., "18"). .sp The \fIresponse\fP field specifies the response to be sent when receiving a query for the specified host or subnetwork. .sp The \fIsystem\-type\fP field specifies the operating system to send alongside the ident response. See the \fB\-\-other\fP option in \fBoidentd\fP(8) for more information. .SH "EXAMPLES" .sp .if n .RS 4 .nf # host[/mask] response system\-type 10.0.0.1 user1 UNIX server.internal user2 UNIX\-BSD 10.0.0.0/24 user3 UNIX 10.0.0.0/255.255.0.0 user4 UNKNOWN .fi .if n .RE .sp Note that the order of the rules is significant in this example. Due to lines being read from top to bottom, more specific rules must precede more general ones. For example, the rule for "10.0.0.1" would not match any connections if it were preceded by the more general "10.0.0.0/24". .SH "AUTHOR" .sp .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "" .RS 4 .URL "https://oidentd.janikrabe.com" "" "" .RE .sp Originally written by Ryan McCabe. .SH "BUGS" .sp Please report any bugs to \c .MTO "oidentd\(atjanikrabe.com" "Janik Rabe" "." .SH "SEE ALSO" .sp \fBoidentd\fP(8) \fBoidentd.conf\fP(5)oidentd-2.5.0/INSTALL0000644000175000017500000000660013545375404011132 00000000000000Installing oidentd ****************** Copyright (c) 2019 Janik Rabe Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. Introduction ============ This document describes how to install oidentd from a release tarball. For instructions for building from git, please refer to the 'HACKING' file. Optional Dependencies ===================== Unless the '--disable-libnfct' flag is used, oidentd is compiled with support for libnetfilter_conntrack on Linux systems on which it is available. Please note that this requires the libnetfilter_conntrack library and its headers to be installed. libnetfilter_conntrack allows oidentd to obtain connection tracking information without using the '/proc' filesystem. This is useful on kernels without CONFIG_NF_CONNTRACK_PROCFS, on which '/proc/net/nf_conntrack' is not available. Build Configuration =================== Run './configure' to configure the build. The './configure' script accepts a number of optional flags: - '--disable-nat': disable NAT support Disables '--forward', '--masquerade' and '--masquerade-first' - '--disable-ipv6': disable IPv6 support Disables listening on IPv6 and ignores all IPv6 connections - '--disable-libnfct': disable Linux libnetfilter_conntrack support See "Optional Dependencies" above for more information - '--disable-xdgbdir': disable XDG Base Directory support Do not look for '~/.config/oidentd.conf' before '~/.oidentd.conf' - '--enable-debug': enable debugging support Enables support for the '--debug' option - '--enable-warn': enable additional compiler warnings Show more warnings during compilation By default, oidentd is configured with a prefix of '/usr/local'. This is the directory that files will be installed to. For example, the oidentd binary will be installed to '/usr/local/sbin/oidentd'. The prefix can be changed by passing the '--prefix' option to the './configure' script. A complete list of options can be viewed by running './configure --help'. Compilation and Installation ============================ Run 'make' to compile the source code and documentation, then 'make install' to install the compiled files. Note that 'make install' must be run as root if the current user does not have permission to write to the directory that was specified with the '--prefix' option to './configure'. Running oidentd =============== Like most internet-facing services, oidentd should not run as root. For this reason, it drops its privileges after starting up. However, oidentd still needs to be started as root for a number of reasons: - to bind the privileged port 113 (unless the '--port' option is used) - to open the kernel memory device (on systems where this is required) - to open the connection tracking file (on systems where this is required) The user and group oidentd runs as after dropping privileges can be specified with the '--user' and '--group' options, respectively. Documentation for these options are available in oidentd.conf(5). Note that in some cases, oidentd may be unable to run as an unprivileged user on FreeBSD, NetBSD, and DragonFly BSD. On affected systems, a warning will be shown at runtime and when running './configure'. oidentd-2.5.0/ylwrap0000755000175000017500000001531413646057317011351 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: oidentd-2.5.0/Makefile.in0000644000175000017500000006506013646057317012155 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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 = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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)$(sysconfdir)" DATA = $(sysconf_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING COPYING.DOC ChangeLog INSTALL NEWS README compile \ config.guess config.sub install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADD_LIB = @ADD_LIB@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_CFLAGS = @DEBUG_CFLAGS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sedpath = @sedpath@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src doc sysconf_DATA = oidentd.conf \ oidentd_masq.conf EXTRA_DIST = KERNEL_SUPPORT.md \ $(sysconf_DATA) \ contrib all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || 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)$(sysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sysconfdir)'; $(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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sysconfdir)"; 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." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr 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-sysconfDATA install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sysconfDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-sysconfDATA installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am uninstall-sysconfDATA .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: oidentd-2.5.0/configure0000755000175000017500000071531713646057317012026 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for oidentd 2.5.0. # # 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" 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: oidentd@janikrabe.com about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: 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'" 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='oidentd' PACKAGE_TARNAME='oidentd' PACKAGE_VERSION='2.5.0' PACKAGE_STRING='oidentd 2.5.0' PACKAGE_BUGREPORT='oidentd@janikrabe.com' PACKAGE_URL='https://oidentd.janikrabe.com' # 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_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS ADD_LIB DEBUG_CFLAGS WARN_CFLAGS host_os host_vendor host_cpu host build_os build_vendor build_cpu build EGREP GREP sedpath RANLIB LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_masq enable_nat enable_ipv6 enable_libnfct enable_xdgbdir enable_debug enable_warn ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP YACC YFLAGS' # 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 oidentd 2.5.0 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/oidentd] --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 oidentd 2.5.0:";; 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 --disable-masq disable NAT/IP masquerading support --disable-nat disable NAT/IP masquerading support --disable-ipv6 disable IPv6 support --disable-libnfct disable libnetfilter_conntrack support --disable-xdgbdir disable XDG Base Directory support --enable-debug enable debugging support --enable-warn enable a variety of compiler warnings 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 YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. 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 . oidentd home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$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 oidentd configure 2.5.0 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_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_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_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_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_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 oidentd@janikrabe.com ## ## ------------------------------------ ##" ) | 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_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $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 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 oidentd $as_me 2.5.0, 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 # 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.16' 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='oidentd' VERSION='2.5.0' 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 $as_echo "#define PACKAGE_AUTHOR \"Janik Rabe\"" >>confdefs.h ac_config_headers="$ac_config_headers config.h" 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # 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 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 for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex 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_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c 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 # Extract the first word of "sed", so it can be a program name with args. set dummy sed; 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_sedpath+:} false; then : $as_echo_n "(cached) " >&6 else case $sedpath in [\\/]* | ?:[\\/]*) ac_cv_path_sedpath="$sedpath" # 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_sedpath="$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 sedpath=$ac_cv_path_sedpath if test -n "$sedpath"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sedpath" >&5 $as_echo "$sedpath" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_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_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac # 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_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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi # 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 WARN_CFLAGS="" DEBUG_CFLAGS="" ADD_LIB="" use_kmem=no require_superuser=no enableval="" masq_support=yes # Check whether --enable-masq was given. if test "${enable_masq+set}" = set; then : enableval=$enable_masq; fi if test "$enableval" = "no"; then masq_support=no fi enableval="" # Check whether --enable-nat was given. if test "${enable_nat+set}" = set; then : enableval=$enable_nat; fi if test "$enableval" = "no"; then masq_support=no fi enableval="" ipv6_support=yes # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; fi if test "$enableval" = "no"; then ipv6_support=no fi enableval="" libnfct_support=yes # Check whether --enable-libnfct was given. if test "${enable_libnfct+set}" = set; then : enableval=$enable_libnfct; fi if test "$enableval" = "no"; then libnfct_support=no fi enableval="" xdgbdir_support=yes # Check whether --enable-xdgbdir was given. if test "${enable_xdgbdir+set}" = set; then : enableval=$enable_xdgbdir; fi if test "$enableval" = "no"; then xdgbdir_support=no fi enableval="" # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "$enableval" = "yes"; then $as_echo "#define ENABLE_DEBUGGING 1" >>confdefs.h else $as_echo "#define ENABLE_DEBUGGING 0" >>confdefs.h fi enableval="" # Check whether --enable-warn was given. if test "${enable_warn+set}" = set; then : enableval=$enable_warn; fi if test "$enableval" = "yes"; then WARN_CFLAGS="-O3 -ggdb -fstack-protector -fstrict-aliasing -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls -Wmissing-format-attribute -Wmissing-noreturn -Wstrict-aliasing=2 -Wlong-long -Wcomment -Wunreachable-code -Wswitch-enum -Wswitch-default -Wvolatile-register-var -Wformat=2 -Winit-self -Winvalid-pch -Winline -Wpointer-arith -Wbad-function-cast -Wcast-align -Wchar-subscripts -Wunsafe-loop-optimizations -Wdisabled-optimization -Wwrite-strings -Wsign-compare -Wconversion -Wmissing-field-initializers -Wnested-externs -Wstack-protector -Wunused-macros -Wendif-labels -Wno-cast-qual" fi if test "$LEX" = ":" || ! $LEX --version < /dev/null > /dev/null 2>&1; then as_fn_error $? "No lexer generator found; please install flex" "$LINENO" 5 fi if ! $YACC --version < /dev/null > /dev/null 2>&1; then as_fn_error $? "No parser generator found; please install bison" "$LINENO" 5 fi # Don't rely on __STDC_VERSION__ as kernels may use C99 booleans for ac_header in stdbool.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" if test "x$ac_cv_header_stdbool_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi done for ac_header in sys/types.h sys/socket.h netinet/in.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 net/if.h do : ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif " if test "x$ac_cv_header_net_if_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_IF_H 1 _ACEOF fi done for ac_header in netinet/ip_compat.h netinet6/in6_pcb.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" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NET_IF_H #include #endif " 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 fcntl.h sys/time.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 ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default" if test "x$ac_cv_type_u_int32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define u_int32_t uint32_t _ACEOF fi if test "$ac_cv_type_u_int32_t" = "no"; then ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" if test "x$ac_cv_type_uint32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint32_t unsigned int _ACEOF fi fi ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default" if test "x$ac_cv_type_u_int16_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define u_int16_t uint16_t _ACEOF fi if test "$ac_cv_type_u_int16_t" = "no"; then ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" if test "x$ac_cv_type_uint16_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint16_t unsigned short _ACEOF fi fi ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default" if test "x$ac_cv_type_u_int8_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define u_int8_t uint8_t _ACEOF fi if test "$ac_cv_type_u_int8_t" = "no"; then ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default" if test "x$ac_cv_type_uint8_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint8_t unsigned char _ACEOF fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_INET6" >&5 $as_echo_n "checking for AF_INET6... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include int main () { AF_INET6+1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define AF_INET6 10" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 $as_echo_n "checking for socklen_t... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { sizeof(socklen_t); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define socklen_t int" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t" >&5 $as_echo_n "checking for in_addr_t... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include int main () { sizeof(in_addr_t); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define in_addr_t unsigned int" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_port_t" >&5 $as_echo_n "checking for in_port_t... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include int main () { sizeof(in_port_t); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else $as_echo "#define in_port_t unsigned short" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_p" = 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 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ unused" >&5 $as_echo_n "checking for __attribute__ unused... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int x __attribute__((unused)); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE___ATTRIBUTE__UNUSED 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ noreturn" >&5 $as_echo_n "checking for __attribute__ noreturn... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { exit(0); } static void foo(void) __attribute__((noreturn)); static void foo(void) {exit(0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE___ATTRIBUTE__NORETURN 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ format" >&5 $as_echo_n "checking for __attribute__ format... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { exit(0); } static int foo(char *fmt, ...) __attribute__((format (printf, 1, 2))); static int foo(char *fmt, ...) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE___ATTRIBUTE__FORMAT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in strsep do : ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" if test "x$ac_cv_func_strsep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRSEP 1 _ACEOF fi done for ac_func in clock_gettime select strdup strstr strtol uname 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 arc4random_uniform lrand48 random 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 memcmp strftime vprintf gethostbyname 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 vasprintf asprintf 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 inet_aton getpagesize getopt_long 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 setgroups do : ac_fn_c_check_func "$LINENO" "setgroups" "ac_cv_func_setgroups" if test "x$ac_cv_func_setgroups" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETGROUPS 1 _ACEOF fi done for ac_func in unveil do : ac_fn_c_check_func "$LINENO" "unveil" "ac_cv_func_unveil" if test "x$ac_cv_func_unveil" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNVEIL 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lsocket $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 socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=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_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : LIBS="$LIBS -lsocket -lnsl" fi fi ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" if test "x$ac_cv_func_getaddrinfo" = xyes; then : $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "freeaddrinfo" "ac_cv_func_freeaddrinfo" if test "x$ac_cv_func_freeaddrinfo" = xyes; then : $as_echo "#define HAVE_FREEADDRINFO 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing freeaddrinfo" >&5 $as_echo_n "checking for library containing freeaddrinfo... " >&6; } if ${ac_cv_search_freeaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char freeaddrinfo (); int main () { return freeaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_freeaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_freeaddrinfo+:} false; then : break fi done if ${ac_cv_search_freeaddrinfo+:} false; then : else ac_cv_search_freeaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_freeaddrinfo" >&5 $as_echo "$ac_cv_search_freeaddrinfo" >&6; } ac_res=$ac_cv_search_freeaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_FREEADDRINFO 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "gai_strerror" "ac_cv_func_gai_strerror" if test "x$ac_cv_func_gai_strerror" = xyes; then : $as_echo "#define HAVE_GAI_STRERROR 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gai_strerror" >&5 $as_echo_n "checking for library containing gai_strerror... " >&6; } if ${ac_cv_search_gai_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gai_strerror (); int main () { return gai_strerror (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gai_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gai_strerror+:} false; then : break fi done if ${ac_cv_search_gai_strerror+:} false; then : else ac_cv_search_gai_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gai_strerror" >&5 $as_echo "$ac_cv_search_gai_strerror" >&6; } ac_res=$ac_cv_search_gai_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_GAI_STRERROR 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" if test "x$ac_cv_func_getnameinfo" = xyes; then : $as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gai_strerror" >&5 $as_echo_n "checking for library containing gai_strerror... " >&6; } if ${ac_cv_search_gai_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gai_strerror (); int main () { return gai_strerror (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gai_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gai_strerror+:} false; then : break fi done if ${ac_cv_search_gai_strerror+:} false; then : else ac_cv_search_gai_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gai_strerror" >&5 $as_echo "$ac_cv_search_gai_strerror" >&6; } ac_res=$ac_cv_search_gai_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h fi fi ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop" if test "x$ac_cv_func_inet_ntop" = xyes; then : $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ludb" >&5 $as_echo_n "checking for main in -ludb... " >&6; } if ${ac_cv_lib_udb_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ludb $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_udb_main=yes else ac_cv_lib_udb_main=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_udb_main" >&5 $as_echo "$ac_cv_lib_udb_main" >&6; } if test "x$ac_cv_lib_udb_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBUDB 1 _ACEOF LIBS="-ludb $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 $as_echo_n "checking for struct sockaddr_storage... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sockaddr_storage ss; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_sockaddr_storage=yes else have_sockaddr_storage=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sockaddr_storage" >&5 $as_echo "$have_sockaddr_storage" >&6; } if test "$have_sockaddr_storage" = "yes"; then $as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss_family member in struct sockaddr_storage" >&5 $as_echo_n "checking for ss_family member in struct sockaddr_storage... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { size_t test = sizeof(((struct sockaddr_storage *)0)->ss_family); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_ss_family=yes else have_ss_family=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ss_family" >&5 $as_echo "$have_ss_family" >&6; } if test "$have_ss_family" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __ss_family member in struct sockaddr_storage" >&5 $as_echo_n "checking for __ss_family member in struct sockaddr_storage... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { size_t test = sizeof(((struct sockaddr_storage *)0)->__ss_family); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_ss_family=yes else have_ss_family=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ss_family" >&5 $as_echo "$have_ss_family" >&6; } if test "$have_ss_family" = "yes"; then $as_echo "#define HAVE___SS_FAMILY 1" >>confdefs.h fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_in6" >&5 $as_echo_n "checking for struct sockaddr_in6... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sockaddr_in6 s; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_sockaddr_in6=yes else have_sockaddr_in6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sockaddr_in6" >&5 $as_echo "$have_sockaddr_in6" >&6; } if test "$have_sockaddr_in6" = "yes"; then $as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct in6_addr" >&5 $as_echo_n "checking for struct in6_addr... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct in6_addr s; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_in6_addr=yes else have_in6_addr=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_in6_addr" >&5 $as_echo "$have_in6_addr" >&6; } if test "$have_in6_addr" = "yes"; then $as_echo "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct addrinfo" >&5 $as_echo_n "checking for struct addrinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { size_t test = sizeof(((struct addrinfo *)0)->ai_flags); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_struct_addrinfo=yes else have_struct_addrinfo=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_struct_addrinfo" >&5 $as_echo "$have_struct_addrinfo" >&6; } if test "$have_struct_addrinfo" = "yes"; then $as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h fi have_ipnat_h="" ac_fn_c_check_header_mongrel "$LINENO" "netinet/ip_compat.h netinet/ip_fil.h netinet/ip_nat.h" "ac_cv_header_netinet_ip_compat_h_netinet_ip_fil_h_netinet_ip_nat_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_ip_compat_h_netinet_ip_fil_h_netinet_ip_nat_h" = xyes; then : fi ac_fn_c_check_header_compile "$LINENO" "netinet/ip_nat.h" "ac_cv_header_netinet_ip_nat_h" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_IP_COMPAT_H #include #endif #ifdef HAVE_NETINET_IP_FIL_H #include #endif " if test "x$ac_cv_header_netinet_ip_nat_h" = xyes; then : have_ipnat_h="yes" else have_ipnat_h="no" fi if test "$have_ipnat_h" = "no"; then ac_fn_c_check_header_compile "$LINENO" "/usr/src/sys/contrib/ipfilter/netinet/ip_nat.h" "ac_cv_header__usr_src_sys_contrib_ipfilter_netinet_ip_nat_h" " #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETINET_IP_COMPAT_H #include #endif #ifdef HAVE_NETINET_IP_FIL_H #include #endif " if test "x$ac_cv_header__usr_src_sys_contrib_ipfilter_netinet_ip_nat_h" = xyes; then : have_ipnat_h="yes" else have_ipnat_h="no" fi if test "$have_ipnat_h" = "yes"; then CPPFLAGS="$CPPFLAGS -I/usr/src/sys/contrib/ipfilter" fi fi if test "$masq_support" = "yes"; then old_CPPFLAGS=$CPPFLAGS if test `uname -s` = "SunOS"; then release=`uname -r | cut -d. -f2` CPPFLAGS="$CPPFLAGS -DSOLARIS=$release" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if nat_t has nat_p member" >&5 $as_echo_n "checking if nat_t has nat_p member... " >&6; } if ${ac_cv_ipf_nat_p+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include #include #include #include #include #if defined(__OpenBSD__) # include #else # if defined(SOLARIS) && SOLARIS >= 8 # include # endif # include #endif #include #include int main () { int i = sizeof(((nat_t *)0)->nat_p); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_ipf_nat_p=yes else ac_cv_ipf_nat_p=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ipf_nat_p" >&5 $as_echo "$ac_cv_ipf_nat_p" >&6; } CPPFLAGS=$old_CPPFLAGS fi if test "$masq_support" = "no"; then libnfct_support=no fi want_libnfct=no case "$host_os" in *linux* ) os_src=linux.c if test "$masq_support" = "yes"; then want_libnfct=yes fi if test "$libnfct_support" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nfct_query in -lnetfilter_conntrack" >&5 $as_echo_n "checking for nfct_query in -lnetfilter_conntrack... " >&6; } if ${ac_cv_lib_netfilter_conntrack_nfct_query+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetfilter_conntrack $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 nfct_query (); int main () { return nfct_query (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_netfilter_conntrack_nfct_query=yes else ac_cv_lib_netfilter_conntrack_nfct_query=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_netfilter_conntrack_nfct_query" >&5 $as_echo "$ac_cv_lib_netfilter_conntrack_nfct_query" >&6; } if test "x$ac_cv_lib_netfilter_conntrack_nfct_query" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNETFILTER_CONNTRACK 1 _ACEOF LIBS="-lnetfilter_conntrack $LIBS" else libnfct_support=no fi fi ;; *netbsd* ) case "$host_os" in *netbsd[1-4].* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of NetBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of NetBSD is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=legacy/netbsd.c if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; * ) use_kmem=no require_superuser=yes os_src=netbsd5.c masq_support=no ;; esac ;; *darwin* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of Darwin is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of Darwin is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=legacy/darwin.c if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; *openbsd* ) case "$host_os" in *openbsd1.* ) as_fn_error $? "cannot build on $host_os; oidentd requires OpenBSD 2.0 or newer" "$LINENO" 5 ;; *openbsd2.* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi ;; esac if test "$masq_support" = "no"; then case "$host_os" in *openbsd2.[0-3]* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=legacy/openbsd.c ;; *openbsd2.[4-8] ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&2;} os_src=legacy/openbsd24.c ;; *openbsd2.9* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&2;} os_src=legacy/openbsd29.c ;; * ) os_src=openbsd30.c ;; esac else case "$host_os" in *openbsd2.* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of OpenBSD is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=legacy/openbsd.c ;; * ) os_src=openbsd30.c ;; esac fi ;; *freebsd* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi if test "$masq_support" = "no"; then case "$host_os" in *freebsd[1-3].* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of FreeBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of FreeBSD is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=freebsd.c ;; * ) use_kmem=no require_superuser=yes os_src=freebsd4.c ;; esac else case "$host_os" in *freebsd[1-4].* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of FreeBSD is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of FreeBSD is deprecated and may be removed in the future" >&2;} use_kmem=yes os_src=freebsd.c ;; * ) use_kmem=yes os_src=freebsd5.c ;; esac fi ;; *dragonfly* ) if test "$ac_cv_ipf_nat_p" = "no"; then masq_support=no fi if test "$masq_support" = "no"; then use_kmem=no require_superuser=yes os_src=freebsd4.c else use_kmem=yes os_src=freebsd.c fi ;; *solaris* ) ADD_LIB="$ADD_LIB -lelf" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for this version of Solaris is deprecated and may be removed in the future" >&5 $as_echo "$as_me: WARNING: Support for this version of Solaris is deprecated and may be removed in the future" >&2;} use_kmem=yes masq_support=no ipv6_support=no case "$host_os" in *solaris2.[0-3]* ) as_fn_error $? "cannot build on $host_os; oidentd requires Solaris 2.4 or newer" "$LINENO" 5 ;; *solaris2.4* ) $as_echo "#define SOLARIS 4" >>confdefs.h os_src=legacy/solaris4.c ;; *solaris2.5* ) $as_echo "#define SOLARIS 5" >>confdefs.h os_src=legacy/solaris5.c ;; *solaris2.6* ) $as_echo "#define SOLARIS 6" >>confdefs.h os_src=legacy/solaris7.c ;; *solaris2.7* ) $as_echo "#define SOLARIS 7" >>confdefs.h os_src=legacy/solaris7.c ;; *solaris[2-4].* ) $as_echo "#define SOLARIS 8" >>confdefs.h os_src=legacy/solaris8.c ;; *solaris5.0* ) $as_echo "#define SOLARIS 8" >>confdefs.h os_src=legacy/solaris8.c ;; * ) as_fn_error $? "cannot build on $host_os; oidentd requires Solaris 5.0 or older" "$LINENO" 5 ;; esac ;; * ) as_fn_error $? "oidentd does not yet support $host_os" "$LINENO" 5 ;; esac cat >>confdefs.h <<_ACEOF #define KERNEL_DRIVER "$os_src" _ACEOF if test "$use_kmem" = "yes"; then $as_echo "#define USE_KMEM 1" >>confdefs.h ADD_LIB="$ADD_LIB -lkvm" else $as_echo "#define USE_KMEM 0" >>confdefs.h fi if test "$require_superuser" = "yes"; then $as_echo "#define NEED_ROOT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: privileges will not be dropped automatically on this system" >&5 $as_echo "$as_me: WARNING: privileges will not be dropped automatically on this system" >&2;} else $as_echo "#define NEED_ROOT 0" >>confdefs.h fi if test "$masq_support" = "yes"; then $as_echo "#define MASQ_SUPPORT 1" >>confdefs.h else $as_echo "#define MASQ_SUPPORT 0" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not including NAT/IP masquerade support" >&5 $as_echo "$as_me: WARNING: not including NAT/IP masquerade support" >&2;} fi if test "$ipv6_support" = "yes"; then $as_echo "#define WANT_IPV6 1" >>confdefs.h else $as_echo "#define WANT_IPV6 0" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not including IPv6 support" >&5 $as_echo "$as_me: WARNING: not including IPv6 support" >&2;} fi if test "$want_libnfct" = "yes"; then if test "$libnfct_support" = "yes"; then $as_echo "#define LIBNFCT_SUPPORT 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are compiling oidentd without libnetfilter_conntrack" >&5 $as_echo "$as_me: WARNING: You are compiling oidentd without libnetfilter_conntrack" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support. Depending on your kernel configuration, this may" >&5 $as_echo "$as_me: WARNING: support. Depending on your kernel configuration, this may" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: make NAT support unavailable. Future releases of oidentd" >&5 $as_echo "$as_me: WARNING: make NAT support unavailable. Future releases of oidentd" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: may require libnetfilter_conntrack because parsing" >&5 $as_echo "$as_me: WARNING: may require libnetfilter_conntrack because parsing" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: connection tracking files relies on an obsolete Linux kernel" >&5 $as_echo "$as_me: WARNING: connection tracking files relies on an obsolete Linux kernel" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: option. Consult the INSTALL file for more information." >&5 $as_echo "$as_me: WARNING: option. Consult the INSTALL file for more information." >&2;} fi fi if test "$xdgbdir_support" = "yes"; then $as_echo "#define XDGBDIR_SUPPORT 1" >>confdefs.h else $as_echo "#define XDGBDIR_SUPPORT 0" >>confdefs.h fi if test -n "$DEBUG_CFLAGS"; then CFLAGS="$(echo $CFLAGS | sed 's/-O[1-9]*/-O0/g' | sed 's/-g[0-9]*/-g3 -ggdb/g')" fi ac_config_files="$ac_config_files Makefile src/Makefile src/missing/Makefile doc/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $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= 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 -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 : "${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 oidentd $as_me 2.5.0, 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 . oidentd home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ oidentd config.status 2.5.0 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" MAKE="${MAKE-make}" _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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/missing/Makefile") CONFIG_FILES="$CONFIG_FILES src/missing/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; 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 cp -f $srcdir/src/kernel/$os_src src/os.c oidentd-2.5.0/oidentd_masq.conf0000644000175000017500000000075613545375404013425 00000000000000# This is the NAT configuration file for oidentd. # If you enable NAT support with the '-m' option, # this file is read to determine the appropriate # ident responses to queries intended for hosts # masquerading through this server. # # See oidentd_masq.conf(5) for more information. # host[/mask] response system-type # 10.0.0.1 user1 UNIX # server.internal user2 UNIX-BSD # 10.0.0.0/24 user3 UNIX # 10.0.0.0/255.255.0.0 user4 UNKNOWN oidentd-2.5.0/ChangeLog0000644000175000017500000005551013646056471011661 000000000000002020-04-16 Janik Rabe * Released as version 2.5.0. * Import documentation from website. 2019-11-16 Janik Rabe * Revert deprecation of '--disable-masq' configure flag. * Clarify behavior of user configuration files. 2019-10-27 Janik Rabe * Add '--reply-all' option. 2019-08-25 Janik Rabe * Remove default CFLAGS -fstack-protector -fPIE. 2019-08-12 Janik Rabe * Released as version 2.4.0. 2019-08-11 Janik Rabe * Set type of default UID and GID to unsigned long. 2019-07-31 Hanno Böck * Fix overflow by using proper type for sizeof 2019-06-05 Janik Rabe * Show pf device path when open fails (OpenBSD) * Remove snprintf(), vsnprintf() from libmissing 2019-06-04 Janik Rabe * Use PACKAGE_NAME macro for syslog ident 2019-05-28 Janik Rabe * Clarify error message in MASQ_MAP parser * Remove unnecessary free(NULL) checks * Remove duplicate colon in safe_open() * Scan and print uid_t and gid_t as %lu 2019-05-21 Janik Rabe * Deprecate configure flag '--disable-masq'; use '--disable-nat' instead. * Add detailed warning when compiling without libnfct. * Deprecate MASQFILE and IPCONNTRACK on Linux. 2019-04-25 Janik Rabe * Add broad unveil call for OpenBSD. 2019-04-23 Janik Rabe * Remove libcap-ng status from '--version' output. * Remove optional dependency on libcap-ng. * Drop supplementary groups if possible. 2019-04-22 Janik Rabe * Improve PRNG interface. * Remove superfluous newlines from o_log() calls. * Create macro for random_numeric upper limit. * Adjust user_db.h macro values. * Prevent overflow when too many replies are specified in the system-wide configuration file. * Make reply statements override previous replies. 2019-04-20 Janik Rabe * Reduce option bitfield values. * Use int values in capng_change_id call. * Use standard syslog priority names. * Change some error messages. * Use EXIT_SUCCESS exit code after forking. 2019-04-19 Janik Rabe * Deprecate support for Darwin. * Deprecate support for FreeBSD 1-3. * Deprecate support for FreeBSD 4. * Deprecate support for NetBSD 1-4. * Deprecate support for OpenBSD 2.0-2.3. * Deprecate support for OpenBSD 2.4-2.8. * Deprecate support for OpenBSD 2.9. * Deprecate support for Solaris 2.4. * Deprecate support for Solaris 2.5. * Deprecate support for Solaris 2.6-2.7. * Deprecate support for Solaris 2.8. 2019-04-18 Janik Rabe * Log debug message when Netlink socket fails to open. 2019-04-03 Janik Rabe * Improve extract_port_range error messages. 2019-03-28 Janik Rabe * Remove unnecessary parentheses from VALID_PORT. * Implement XDG Base Directory specification. * Indicate directories relative to $HOME in --version. * Fix incorrect username in failed spoof_all log message. 2019-03-27 Janik Rabe * Rewrite manual page oidentd_masq.conf(5). 2019-03-26 Janik Rabe * Rewrite INSTALL file. 2019-03-25 Janik Rabe * Deprecate non-standard '\e' escape sequence. * Fix incorrect UPREFIX comment. * Promote some messages to LOG_CRIT. * Reformat default oidentd_masq.conf. * Rewrite README file. * Rewrite manual page oidentd.conf(5). * Update project description. 2019-03-13 Janik Rabe * Change default oidentd.conf comment style. * Indent values in --version output. 2019-03-02 Janik Rabe * Rewrite manual page oidentd(8). 2019-02-04 Janik Rabe * Handle fork() errors. 2019-01-03 Janik Rabe * Released as version 2.3.2. * Fix oidentd_masq.conf(5) comment style. 2019-01-01 Janik Rabe * Add fuzzing build configuration. * Remove parentheses from return statements. * Build with -fPIE and -fstack-protector. 2018-12-14 Janik Rabe * Fix NULL dereference with libnfct on CT_UNKNOWN kernels. * Fix size_t format specifications. 2018-12-13 Janik Rabe * Fix byte order of ports in libnfct queries. 2018-12-08 Janik Rabe * Change masq() return type from bool to int. * Change core_init() return type from bool to int. * Change find_user() return type from bool to int. * Change find_group() return type from bool to int. 2018-10-29 Janik Rabe * Deprecate libudb support. 2018-10-28 Janik Rabe * Fix masquerading buffer lengths on Linux systems without `WANT_IPV6`. * Narrow variable scopes. * Remove unused variables. * Fix sscanf unsigned integer specifications. * Change `randval()` to use unsigned integers. 2018-10-02 Janik Rabe * Add systemd services and socket file. * Show compile-time configuration in `--version` output. 2018-09-27 Janik Rabe * Improve error messages. 2018-06-24 Janik Rabe * Make `--forward` imply `--masquerade`. * Log warning when connection limit is exceeded. 2018-06-13 Janik Rabe * Released as version 2.3.1. * Fix build with libnetfilter_conntrack on Linux. 2018-06-12 Janik Rabe * Released as version 2.3.0. * Forward declare yyrestart and yylex. * Change sock_write and sockprintf signatures. * Change get_hostname to use socklen_t. * Change get_ip to use socklen_t. * Fix a few signed/unsigned conversion issues. * Add default cases to switch statements. 2018-05-16 Jan Alexander Steffens * Move reply data into union. * Add out_hide label to get_ident. * Move request forwarding to forward.c. * Implement forward capability. * Document forward capability. 2018-05-04 Janik Rabe * Consistently use ssize_t in sock_read. 2018-04-07 Janik Rabe * Fix a few signed/unsigned conversion issues. * Remove some redundant redeclarations. 2018-04-06 Janik Rabe * Add Linux IPv6 masquerading support. * Always use libnetfilter_conntrack when available. * Fix signed/unsigned bit shifting on Linux. * Separate declarations from code (ISO C90). * Made a couple of function arguments constant. * Fix incorrect conversion from ssize_t to int. * Fix incorrect vasprintf return type. * Remove unused type parameter from callback_nfct. * Prevent overflows when parsing UIDs and GIDs. 2018-04-04 Janik Rabe * Add build information to `--version` output. 2018-04-03 Janik Rabe * Add spoofed replies to the default configuration file. 2018-03-30 Janik Rabe * Released as version 2.2.3. * On systems where oidentd needs to run as root, do not drop privileges automatically and show a warning instead. 2018-03-26 Janik Rabe * Fix lookup of connections to IPv6-mapped IPv4 addresses. * Warn when lexer or parser generator cannot be found. 2018-03-22 Janik Rabe * Allow to, fport, from, lport to be specified in any order. 2018-03-22 Fardale * Fix incorrect order of lport and fport in manual pages. 2018-03-10 Janik Rabe * Allow only local NAT if /proc/net/ip_masquerade is used. 2018-03-08 Petr Písař * Regenerate Bison header file using Automake. * Fix an out-of-bound read/write issue. * Check for fgets() failure when reading header lines. * Return error if masq_ct_line() cannot decide. 2018-03-07 Janik Rabe * Released as version 2.2.2. * Implicitly drop privileges only when running as root. 2018-03-02 Magnus Holmgren * Don't let --enable-debug mess with build flags. 2018-02-24 Janik Rabe * Rename --forward-last to --masquerade-first. - Option --forward-last is now deprecated. * Replace --masq with --masquerade in manual pages. * Make the -M option imply -f in addition to -m. * Don't assume sysconfdir is /etc. - Previously it was possible to specify a custom configuration file using the -C option, but the path to /etc/oidentd_masq.conf was hardcoded. 2018-02-21 Janik Rabe * Run as oidentd:oidentd by default. - Only if the oidentd user does not exist, fall back to running as nobody, or UID 65534, in this order. - Only if the oidentd group does not exist, fall back to running as nobody, nogroup, or GID 65534, in this order. - Thanks to Johannes Löthberg for this suggestion. 2018-02-20 Janik Rabe * Released as version 2.2.1. * Move configuration file out of src directory. * Fix LIBNFCT_SUPPORT being defined on systems where $want_libnfct = "no". 2018-02-19 Janik Rabe * Released as version 2.2.0. 2018-02-18 Janik Rabe * Add libnetfilter_conntrack support for IP masquerading on Linux. - Enabled by default if libnetfilter_conntrack and libcap-ng libraries and headers are present during configuration. - Can be disabled by passing the --disable-libnfct flag to the './configure' script. - Feature requested by Johnny A. Solbu . * Bind socket before forking. - This allows errors (most commonly EACCES) to be shown. 2018-02-17 Janik Rabe * Update the default configuration file. - Add header comment. - Disable all capabilities by default. - Properly hide superuser connections instead of simply responding with "UNKNOWN" (commented out by default). * Properly drop privileges without the --user and --group options. - This seems to always have been the intention, but a bug prevented this feature from working correctly. 2018-02-17 Johnny A. Solbu * Use the configuration file shipped by distributions. 2018-02-16 Janik Rabe * Install a default configuration file to sysconfdir. * Warn when k_open() functions disable masquerading. * Replace some AC_CHECK_LIB macros with AC_SEARCH_LIBS. * Consistently use AC_MSG_ERROR macro. 2018-02-15 Janik Rabe * Only show a warning when masquerading support is unavailable. - Instead of exiting immediately, show a warning and continue without masquerading support. * Removed scripts "dist.sh" and "scrub.sh". - These scripts should no longer be necessary with the presence of "make distcheck" and "git clean -dfx". 2018-02-14 Janik Rabe * Follow RFC 1413 recommendations on white space. - Remove unnecessary white space from ident replies. * Fail when masquerading on Linux is requested but not supported. * Replaced deprecated AC_TRY_* macros. 2018-02-13 Janik Rabe * Fix libudb support and various inconsistencies. * Return exit code 0 when --version is used. * Prevent --limit option from falling through. - This caused --limit to also enable --other. * Fix "make distcheck" attempting to include missing files. * Change masq function to return bool. 2018-02-12 Janik Rabe * Fix --disable-masq option to ./configure. - NAT/IP masquerading support was re-enabled after processing this flag. 2018-02-12 Johnny A. Solbu * Add missing required files to "make dist". 2018-02-12 Janik Rabe * Return exit code 0 when --help is used. 2018-02-08 Janik Rabe * Add basic NetBSD 5+ support. - IP masquerading is not yet supported. 2018-02-06 Janik Rabe * Re-add legacy FreeBSD support. 2018-02-03 Janik Rabe * Explicitly drop support for NetBSD 5+ and SunOS 5.1+. - oidentd does not compile on these versions, so fail directly in configure.ac instead of trying to compile an incompatible source file. 2018-02-02 Janik Rabe * Fix build on OpenBSD. 2018-02-01 Janik Rabe * Add missing OpenBSD prerequisite headers. 2018-01-28 Janik Rabe * Suggest use of --debug when core_init fails. 2018-01-27 Jan Rękorajski * Support listening on multiple specified IP addresses. 2018-01-25 Janik Rabe * Fix build on FreeBSD. * Add missing FreeBSD prerequisite headers. 2018-01-19 Janik Rabe * Use exit code constants where possible. 2018-01-19 Matthias Scheler * Replace hardcoded CONFFILE path in usage instructions. 2018-01-18 Joerg Sonnenberger * Add basic DragonFly BSD support. 2018-01-13 Janik Rabe * Declare randval() function static. 2018-01-10 Janik Rabe * Always show errors when socket initialization fails. 2018-01-10 Fabian Knittel * Bind to IPv6 socket as well. 2018-01-10 Petr Písař * Open connection tracking table only when necessary. 2018-01-09 Janik Rabe * Update logging priorities to ensure that errors are shown. * Update documentation and manual pages. * Warn when --debug is used in a build without debugging support. 2018-01-08 Janik Rabe * Fix and modernize build system. * Add missing user_db header to linux.c. 2018-01-07 Kufat * Move inline function randval() to header. * Header for rand in randval(). 2018-01-07 Chris Taylor * Add handling for nf_conntrack_acct being off. - Thanks to Jonas Gorski 2018-01-07 Simon Arlott * Fix bug handling NAT with a different destination port on Linux. * Fix forwarding when the destination port is different. * Add an option that does forwarding only if the masquerading file lookup fails. * Support Layer 3 Independent Connection tracking on Linux. * Handle local NAT on Linux (instead of forwarding to self). * Copy fport before converting v4-mapped v6 addresses. 2018-01-07 Janik Rabe * Released as version 2.1.0. * Fix memory corruption on FreeBSD. 2006-05-22 Ryan McCabe * Released as version 2.0.8. * Removed spaces between commas and colons from responses. * Pulled in patches for Linux from Debian. * Pulled in Darwin patches from fink and http://sbutler.typepad.com/oidentd-2.0.7-darwin-fix.patch. * Pulled in NetBSD patches from pkgsrc/net/oidentd/patches/patch-ac. * Pulled in patches for FreeBSD from FreeBSD ports (ports/security/oidentd/files/patch-unprivileged_ipv6). 2006-01-26 Christof Douma * Open masquerading options before dropping permissions on linux. 2003-07-11 Ryan McCabe * Really fix the bug with random ident replies. * Build fixes (specifically, for Solaris). 2003-04-27 Ryan McCabe * Released as version 2.0.6. * Fixed a build problem on some versions of FreeBSD when NAT support is included. - Problem reported by John Blazek * Made random replies 12 characters long. I guess some programs don't like it when they get a 512-byte long random reply. 2003-04-23 Douglas Henke * Improve PRNG seeding and random number selection. * Add support for running in the foreground, logging only to stderr, and for inetd support and daemontools support. 2003-02-14 Ryan McCabe * Make it build again on recent versions of Darwin. 2003-02-12 Ryan McCabe * Released as version 2.0.5. 2003-02-12 Ryan McCabe * Added support for connection forwarding on recent versions of OpenBSD and on FreeBSD when NAT is disabled. 2003-02-12 Mieczyslaw Nalewaj * Add support for FreeBSD 5. 2003-02-12 Elliott Mitchell * Prevent memory leaks in parts of the configuration parser. 2003-01-09 Christian Kellner * DNAT patch for Linux 2003-01-09 Krzysztof Oledzki * Fix lookups of IPv6 connections. 2002-08-24 Ryan McCabe * Fixed a compile error for older versions of libc on Linux. - Thanks to Motohiko Takemura 2002-08-22 Ryan McCabe * Cleaned up the connection forwarding code, made connection forwarding actually work on BSD. - Thanks to Ewen McNeill 2002-08-20 Ryan McCabe * Released as version 2.0.4. 2002-08-08 Ryan McCabe * Added support for Solaris 9. - Thanks to Douglas Palmer * Use the netlink socket diagnostics interface to look up connection owners on Linux, if available. 2002-01-30 Ryan McCabe * Added support for Darwin. 2002-01-22 Ryan McCabe * Kill the "Address family not supported by protocol" warning when running with --debug. 2002-01-16 Ryan McCabe * Really fixed forwarding and proxy support on FreeBSD. * Fixes for NAT on OpenBSD >= 3.0. 2002-01-01 Ryan McCabe * Added support for NetBSD. * Fixed a bug in the OpenBSD connection forwarding code. 2001-12-29 Ryan McCabe * Released as version 2.0.3. * Fixed a bug in the configure script that caused a compile error on OpenBSD 3.0. * Moved all the OS-specific user lookup functions into the src/kernel directory. 2001-12-28 Ryan McCabe * Released as version 2.0.2. * Fixed a bug in the forwarding code. 2001-12-28 Kamil Andrusz * Add support for OpenBSD >= 3.0 packet filter. 2001-11-12 Ryan McCabe * Cleaned up the parsing of $HOME/.oidentd.conf files. 2001-11-03 Ryan McCabe * Allow multiple strings after a reply statement, from which one of them will be selected randomly. 2001-10-29 Ryan McCabe * Added a --limit command-line option. 2001-10-03 Ryan McCabe * Released as version 2.0.1. * Fixed a crash that occurred when oidentd reloaded its configuration file. 2001-10-03 Ryan McCabe * Only lookup the "_nat_instances" symbol on BSD if the --masq option is given. - Without this patch, oidentd fails on FreeBSD (at least) if NAT support is not compiled into the kernel. 2001-10-02 Ryan McCabe * Blank lines and lines beginning with # (comments) are ignored in /etc/oidentd_masq.conf. 2001-09-30 Ryan McCabe * Re-enable NAT support for OpenBSD 2.9 and greater. - Eric LeBlanc noted that the kernel access method used for earlier OpenBSD versions still works for version 2.9. 2001-09-29 Ryan McCabe * Released as version 2.0.0. * Fixed a bug that caused freebsd.c to be built instead of freebsd4.c when IP masq/NAT is diabled on FreeBSD. 2001-09-29 Ryan McCabe * Removed the debugging code from the FreeBSD NAT handler. - Thanks to Steven Nikkel for making NAT support on FreeBSD possible. * Made debugging messages a compile time option. - They're only included if configure is passed --enable-debug 2001-09-27 Motohiko Takemura * Fix a bug in the command-line argument handler. 2001-09-25 Ryan McCabe * Allow oidentd to bind more than one interface returned by getaddrinfo(). 2001-09-19 Ryan McCabe * Fixed a potential problem with the default port binding mechanism. 2001-09-19 Ryan McCabe * Added a new command-line flag, --config, that is used to specify the location of the configuration file. The default is /etc/oidentd.conf. 2001-09-19 Ryan McCabe * Make sure the trailing new line is trimmed from the operating system parameter in the /etc/oidentd_masq.conf file. - Thanks to Eric LeBlanc for noticing this. 2001-09-18 Ryan McCabe * Fixes for IP masquerading and connection forwarding on OpenBSD and FreeBSD. 2001-09-18 Eric LeBlanc 2001-09-18 Motohiko Takemura * Fix a bug that caused IP masquerading to fail. 2001-09-18 Martin Waitz * UDB fixes 2001-09-17 Ryan McCabe * Added IP masquerade support for FreeBSD. 2001-09-17 Ryan McCabe * Fixed bugs that caused openbsd.c not to compile. * Add OpenBSD 2.9 support. - Thanks to Stephen Marley for access to a machine running OpenBSD 2.9. 2001-09-14 Ryan McCabe * Released as version 1.9.9.1 2001-09-14 Ryan McCabe * Merged the --other and --os command-line flags. See the manual page for details. 2001-09-12 Motohiko Takemura * Fixed a typo in the oidentd_masq.conf man file. * Fixed bugs with the -f (--forward) command-line flag. * Fixed bugs with the -o (--other) command-line flag. * Fixed a typo that caused the UDB and forward options to use the same bit mask. 2001-09-04 Ryan McCabe * Fix a crash when no configuration file was used. 2001-09-04 Ryan McCabe * IPv4/IPv6 interoperability cleanups. * Fixed the configure --enable-ivp6 and --enable-masq options. - Thanks to Arkadiusz Miskiewicz for input and the bug report concerning the configure flags. 2001-08-31 Ryan McCabe * It's $HOME/.oidentd.conf. Fix everywhere... 2001-08-31 Ryan McCabe * Fixed Solaris 8 support. - Thanks to Carlton Clark for access to his Solaris 8 box. 2001-08-29 Ryan McCabe * Solaris 7 support. * Cleaned up the Solaris 2.[456] support. 2001-08-28 Ryan McCabe * Solaris 8 support. * Small cleanups. 2001-08-28 Ryan McCabe * Compile fix for systems that have __ss_family instead of ss_family. 2001-08-27 Ryan McCabe * Fix the port binding mechanism. 2001-08-27 Ryan McCabe * autoconf tweaks. * Fixed to work with automake 1.5. 2001-08-25 Ryan McCabe * Fixed compile bugs that showed up when you passed configure a --srcdir argument. - Reported by Frederic L. W. Meunier <0@pervalidus.net> 2001-08-24 Ryan McCabe * Released version 1.9.9 oidentd-2.5.0/missing0000755000175000017500000001533613646057317011510 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 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=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: oidentd-2.5.0/depcomp0000755000175000017500000005602013646057317011461 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: oidentd-2.5.0/KERNEL_SUPPORT.md0000644000175000017500000000114413545375404012635 00000000000000# Kernel Support Table | Kernel | IPv4 | IPv6 | IPv4 NAT | IPv6 NAT | Needs kmem | Needs root | | ----------------- | ---- | ---- | -------- | -------- | ---------- | ---------- | | DragonFly BSD | Yes | Yes | ipf only | No | NAT only | If no NAT | | FreeBSD 5+ | Yes | Yes | ipf only | No | NAT only | If no NAT | | Linux | Yes | Yes | Yes | Yes | No | No | | NetBSD 5+ | Yes | Yes | No | No | No | Yes | | OpenBSD 3+ | Yes | Yes | Yes | No | No | No | oidentd-2.5.0/NEWS0000644000175000017500000002133713646056517010607 00000000000000Changes in version 2.5.0 * Added '--reply-all' option. * Imported documentation from website. Changes in version 2.4.0 * Linux: removed optional dependency on libcap-ng. * Deprecated '\e' escape sequence in configuration files. * Fixed incorrect username in log message when spoofing fails. * Implemented XDG Base Directory specification * ~/.config/oidentd.conf takes precedence over ~/.oidentd.conf * Rewrote all manual pages, now licensed under GFDL v1.3+. * Prevent overflow when too many replies are specified in the system-wide configuration file. * Rewrote INSTALL and README files. * Improved PRNG interface. * Changed project description. * Deprecated support for MASQFILE and IPCONNTRACK on Linux. * Users of recent kernels are unaffected by this change. * Minor bugfixes, cleanups, and improvements. * Deprecated support for Darwin. * Deprecated support for FreeBSD 1-3. * Deprecated support for FreeBSD 4. * Deprecated support for NetBSD 1-4. * Deprecated support for OpenBSD 2.0-2.3. * Deprecated support for OpenBSD 2.4-2.8. * Deprecated support for OpenBSD 2.9. * Deprecated support for Solaris 2.4. * Deprecated support for Solaris 2.5. * Deprecated support for Solaris 2.6-2.7. * Deprecated support for Solaris 2.8. Changes in version 2.3.2 * Option `--forward` now implies `--masquerade`. * Added a warning when the connection limit is exceeded. * Added systemd services and a socket file. * Added compile-time configuration to `--version` output. * Linux: fixed incorrect buffer lengths when compiled with `--disable-ipv6`. * Deprecated libudb (user database library) support. * Linux: fixed incorrect byte order in libnetfilter_conntrack queries. * Linux: fixed a null dereference with libnetfilter_conntrack on kernels without a connection tracking file. * Build as a position-independent executable and with stack protection. * Fixed an invalid comment style in the default oidentd_masq.conf file. Changes in version 2.3.1 * Fixed build with libnetfilter_conntrack on Linux. Changes in version 2.3.0 * Added a forwarding capability. * Added Linux IPv6 masquerading support. * Added build information to `--version` output. * Always use libnetfilter_conntrack when available. * Fixed signed/unsigned bit shifting on Linux. * Minor bugfixes. Changes in version 2.2.3 * Fixed an out-of-buffer read/write issue. * Fixed several compiler warnings. * Fixed incorrect order of lport and fport in manual pages. * Fixed lookup of connections to IPv6-mapped IPv4 addresses. * Allow to, fport, from and lport to be specified in any order. * Warn when privileges cannot be dropped automatically. Changes in version 2.2.2 * Implicitly drop privileges only when running as root. * Try to run as oidentd:oidentd before falling back to nobody etc. * Search for configuration files in sysconfdir instead of `/etc`. * Deprecated option --forward-last in favor of --masquerade-first. Changes in version 2.2.1 * Fixed LIBNFCT_SUPPORT being defined incorrectly on some systems. Changes in version 2.2.0 * Security: privileges were not being dropped without the `--user` and `--group` options. * Security: fixed a null pointer dereference with libudb support and IP masquerading enabled. * Added a system-wide default configuration file. * Added a HACKING file with instructions for modifying oidentd. * Added a kernel support table (KERNEL_SUPPORT.md). * Added support for modern FreeBSD kernels. * Added support for modern OpenBSD kernels. * Added support for NetBSD 5+ (no IP masquerading support yet). * Added support for DragonFly BSD. * Added support for listening on multiple addresses. * Added flag `--forward-last`. * Bind to IPv6 by default. * Warn when `--debug` is used in a build without debugging support. * Warn when IP masquerading support is requested but unavailable. * Improved logging to make sure important errors are shown. * Bind socket before forking so that any errors are shown. * Follow RFC 1413 recommendations regarding white space in replies. * Modernized build system and replaced deprecated macros. * Updated all documentation and manual pages. * Fixed function inlined using a method incompatible with C99. * Fixed `--limit` option also enabling `--other`. * Fixed `--forward` option with a different destination port. * Fixed exit code when `--help` or `--version` was used. * Fixed configuration option `--disable-masq` having no effect. * Fixed various minor issues leading to compiler warnings. * Linux: handle local NAT properly instead of trying to forward. * Linux: fixed NAT when a different destination port was used. * Linux: fixed an issue with IPv4-mapped IPv6 addresses. * Linux: add masquerading support using `/proc/net/nf_conntrack`. * Linux: add masquerading support using `libnetfilter_conntrack`. * Linux: open connection tracking file only when necessary. * Removed Solaris 5.1+ support (build is broken due to kernel changes). Changes in version 2.1.0 * Fixed memory corruption on FreeBSD. * Changed maintainer to Janik Rabe . * Migrated project from CVS to git. Changes in version 2.0.9 * Internal changes. Changes in version 2.0.8 * So, I guess some things have changed in the past 3 years. * Fixed bugs. Changes in version 2.0.7 * Bug fixes. * Build fixes. Changes in version 2.0.6 * Bug fixes. * Build fixes for Darwin and FreeBSD. * Support for inetd/xinetd/daemontools. Changes in version 2.0.5 * Bugfixes for connection forwarding on BSD. * DNAT support on linux. * Configuration Parser/scanner cleanups. * IPv6 fixes. * FreeBSD 5 support. * Compile fixes. * Made connection forwarding work on recent versions of OpenBSD and on FreeBSD when NAT is disabled. Changes in version 2.0.4 * Support for lookups using the netlink socket diagnostics interface on Linux. * Support for Solaris 9. * Support for NetBSD. * Support for Darwin. * Bugfixes for NAT on *BSD. Changes in version 2.0.3 * Fixed a bug in the configure script that caused a compile error on OpenBSD 3.0. Changes in version 2.0.2 * Added support for OpenBSD (>= 3.0) Packet Filter. * Allow multiple strings to be specified after a "reply" statement from which one string will be selected at random. * A --limit command-line argument used to limit the number of connections that can be open at any one time. * Fixed a bug that caused oidentd to chew up lots of CPU time on some operating systems. * Note that oidentd only suports ipf NAT in FreeBSD (i.e. ipfw is not supported). - See the TODO file for slightly more info. Changes in version 2.0.1 * NAT support on OpenBSD 2.9 and greater has been enabled again. * Allow comments and whitespace in /etc/oidentd_masq.conf. * Fix a crash that occurred when oidentd reloaded its configuration file. Changes in version 2.0.0 * A new command-line flag, --config, can be used to specify the config file. * Support for OpenBSD 2.9 * IP masquerading/NAT support for FreeBSD. * The bug that caused IP masquerading to fail was fixed. * More bug fixes. Changes in version 1.9.9.1 * Lots of bugfixes. * Support for Solaris 5.4 - 5.8 Changes in version 1.9.9 * Complete rewrite. * Addition of system-wide and per-user configuration files. * IPv6 support. Changes in version 1.7.1 * Fixed a bug that prevented oidentd from running in standalone mode. Changes in version 1.7.0 * IP masquerading support for OpenBSD. * Support for FreeBSD 4.* * Support for libudb. Changes in version 1.6.4 * Add -F and -O flags. See the manual page for a description. * Add the capability to set an identd reply for a specific user in /etc/identd.spoof. For example, the line "user:reply" will cause oidentd to return "reply" for every successful query for a connection of the user "user" Changes in version 1.6.3 * Fix a few small bugs. * Add -q (quiet) flag, which suppresses normal system logging. Changes in version 1.6.2 * New flag: -x (see the man page or ChangeLog) * Service names as well as port numbers are accepted where a port is supplied. /etc/oidentd.users * If our attempt to forward a connection to a host times out, fall back to masquerading lookup results Changes in version 1.6.1 * -r works correctly in standalone mode. * You can now specify masks for networks in /etc/oidentd.users (See man page) (It used to only accept quad-dot IP notation) * You can now specify a hostname in /etc/oidentd.users Changes in version 1.6.0 * The man page gets installed now * Rewrote "INSTALL" * Fixed (hopefully) the forwarding stuff. Changes in version 1.5.1 * Code and documentation cleanups. * Regenerate autoconf scripts using version 2.13. Changes in version 1.5 * Various small fixes and improvements. * Added support for OpenBSD, FreeBSD. * autoconf'd the package. oidentd-2.5.0/COPYING0000644000175000017500000004325413475700570011140 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. oidentd-2.5.0/README0000644000175000017500000000241013646056621010753 00000000000000oidentd ======= Version 2.5.0 Flexible, RFC 1413 compliant ident daemon with NAT support. oidentd is a flexible ident daemon for Linux, FreeBSD, OpenBSD, NetBSD, and DragonFly BSD. It is highly configurable, allowing the system administator to define custom responses based on host and port pairs. The administrator can also grant capabilities to individual users to allow them to change their ident replies, generate random replies, or hide their connections. oidentd supports lookups for NAT connections and is able to forward queries to other servers. Detailed descriptions of all features are available in the manual pages. The INSTALL file contains instructions for installing oidentd. The HACKING file describes how to work with the source code. Please consult the KERNEL_SUPPORT.md file for information about the supported kernels. oidentd is maintained and developed by Janik Rabe , with contributions from many people who are listed in the AUTHORS file. oidentd was originally written by Ryan McCabe . The most recent version of oidentd is available from . Please mail any feedback, questions, suggestions, patches, or bug reports to Janik Rabe .